:root {
  --navy: #00133a;
  --blue: #00658d;
  --sky: #2dbcfe;
  --ink: #172b4d;
  --muted: #65758b;
  --line: #dfe1e6;
  --surface: #f7fafd;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--surface);
}

button, input { font: inherit; }
button, label, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid #8ccfff;
  outline-offset: 2px;
}

.plate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 11px clamp(16px, 4vw, 54px);
  color: #fff;
  background: var(--navy);
}

.plate-brand, .home-link {
  color: inherit;
  text-decoration: none;
}

.plate-brand { display: flex; align-items: center; gap: 12px; }
.plate-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}
.plate-brand span { display: grid; gap: 2px; }
.plate-brand strong { font-size: 16px; }
.plate-brand small { color: #b9cae0; font-size: 10px; }
.home-link { padding: 10px 12px; font-size: 12px; font-weight: 800; }

.plate-main {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 52px;
}

.plate-intro { max-width: 720px; margin-bottom: 25px; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.plate-intro h1 { margin: 0; color: var(--navy); font-size: clamp(28px, 4vw, 32px); line-height: 40px; letter-spacing: -.02em; }
.plate-intro > p:last-child { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }

.plate-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.plate-controls, .plate-preview-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
}

.plate-controls { display: grid; gap: 22px; padding: 22px; }
.control-heading, .plate-preview-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.control-heading h2, .plate-preview-card h2 { margin: 0; color: var(--navy); font-size: 19px; }
.text-button {
  min-height: 40px;
  padding: 7px 9px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.plate-controls > label, .colour-grid label {
  display: grid;
  gap: 7px;
  color: #34455b;
  font-size: 12px;
  font-weight: 800;
}
.plate-controls label > small { color: #7a899c; font-size: 10px; font-weight: 600; }

.input-shell { position: relative; display: block; }
#plateText {
  width: 100%;
  min-height: 54px;
  padding: 10px 64px 10px 14px;
  color: var(--navy);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: #f8fafc;
  border: 1.5px solid #b9c9db;
  border-radius: 4px;
}
#plateCharacterCount {
  position: absolute;
  top: 50%;
  right: 13px;
  color: #718197;
  font-size: 10px;
  transform: translateY(-50%);
}

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 9px; color: #34455b; font-size: 12px; font-weight: 800; }
.style-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.style-option {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 11px;
  cursor: pointer;
  border: 1.5px solid var(--line);
  border-radius: 6px;
}
.style-option:has(input:checked) {
  background: #edf6fb;
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.style-option input { position: absolute; opacity: 0; }
.style-option > span:last-child { display: grid; gap: 2px; }
.style-option strong { font-size: 11px; }
.style-option small { color: var(--muted); font-size: 9px; }
.style-swatch {
  display: grid;
  height: 42px;
  place-items: center;
  color: #111;
  border: 3px double #111;
  border-radius: 5px;
}
.style-swatch i { font-size: 12px; font-style: normal; font-weight: 900; letter-spacing: .06em; }
.style-swatch.yellow { background: #f7c900; }
.style-swatch.white { background: linear-gradient(145deg, #fff, #dfe3e7); }

.colour-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.colour-control {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 6px 9px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.colour-control input { width: 31px; height: 31px; padding: 0; border: 0; background: transparent; }
.colour-control output { font-size: 10px; font-weight: 700; }

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 10px 16px;
  color: #fff;
  font-weight: 850;
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 4px;
  cursor: pointer;
}
.download-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.plate-preview-card { position: sticky; top: 18px; padding: 22px; }
.plate-preview-card > header { margin-bottom: 20px; }
#plateStyleBadge {
  padding: 7px 10px;
  color: #675600;
  font-size: 10px;
  font-weight: 850;
  background: #fff5b8;
  border-radius: 999px;
}
.canvas-stage {
  display: grid;
  min-height: 430px;
  padding: clamp(18px, 5vw, 46px);
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #ffffff, #e6ebf1 68%);
  border: 1px solid var(--line);
  border-radius: 8px;
}
#plateCanvas {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 18px rgba(0,0,0,.22));
}
.plate-preview-card > p {
  margin: 13px 0 0;
  color: #7b899b;
  font-size: 10px;
  text-align: center;
}

.plate-toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 11px 15px;
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  background: var(--navy);
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: .18s ease;
}
.plate-toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .plate-workspace { grid-template-columns: 1fr; }
  .plate-preview-card { position: static; }
}

@media (max-width: 560px) {
  .plate-header { min-height: 68px; padding: 9px 13px; }
  .plate-brand img { width: 44px; height: 44px; }
  .home-link { width: 44px; overflow: hidden; font-size: 0; white-space: nowrap; }
  .home-link span { font-size: 18px; }
  .plate-main { width: min(100% - 22px, 1200px); padding-top: 28px; }
  .plate-controls, .plate-preview-card { padding: 16px; }
  .colour-grid { grid-template-columns: 1fr; }
  .canvas-stage { min-height: 250px; padding: 14px; }
}
