:root {
  --navy: #123b70;
  --navy-dark: #092744;
  --blue: #245aa6;
  --blue-soft: #e9f0fa;
  --silver: #d7dee8;
  --ink: #182432;
  --muted: #627184;
  --surface: #ffffff;
  --background: #edf2f7;
  --success: #18764b;
  --danger: #a72b2b;
  --shadow: 0 14px 35px rgba(9, 39, 68, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, #f4f7fa 0%, var(--background) 100%);
}
.site-header {
  color: white;
  background: linear-gradient(120deg, var(--navy-dark), var(--navy) 65%, #315f9e);
  border-bottom: 5px solid #aeb9c8;
  box-shadow: 0 6px 20px rgba(9, 39, 68, .22);
}
.header-inner {
  width: min(1450px, calc(100% - 36px));
  margin: auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand-logo {
  width: 105px;
  height: 105px;
  object-fit: contain;
  background: white;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.7);
  box-shadow: 0 6px 15px rgba(0,0,0,.22);
}
.eyebrow { margin: 0 0 5px; font-size: .82rem; letter-spacing: .17em; opacity: .86; }
h1 { margin: 0; font-size: clamp(1.55rem, 2.5vw, 2.35rem); }
.subtitle { margin: 7px 0 0; opacity: .86; }

.app-shell {
  width: min(1450px, calc(100% - 36px));
  margin: 28px auto;
  display: grid;
  grid-template-columns: minmax(340px, .88fr) minmax(450px, 1.12fr);
  gap: 24px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--silver);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-heading {
  min-height: 72px;
  padding: 16px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--silver);
  background: #f9fbfd;
}
.panel-heading > div:first-child { display: flex; align-items: center; gap: 11px; }
.panel-heading h2 { margin: 0; font-size: 1.15rem; }
.step {
  width: 31px;
  height: 31px;
  display: inline-grid;
  place-items: center;
  color: white;
  background: var(--navy);
  border-radius: 50%;
  font-weight: 700;
}
textarea {
  display: block;
  width: calc(100% - 36px);
  min-height: 540px;
  margin: 18px;
  padding: 17px;
  resize: vertical;
  border: 1px solid #b8c4d2;
  border-radius: 10px;
  outline: none;
  color: #152235;
  background: #fbfcfe;
  font: 14px/1.48 Consolas, "Courier New", monospace;
  transition: .2s ease;
}
textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36,90,166,.13); }
.helper, .copy-note { margin: -5px 20px 18px; color: var(--muted); font-size: .83rem; }
.status {
  padding: 7px 11px;
  color: var(--muted);
  background: #eef2f6;
  border-radius: 999px;
  font-size: .83rem;
  white-space: nowrap;
}
.status.ok { color: var(--success); background: #e8f7ef; }
.status.warn { color: var(--danger); background: #fdeeee; }
.tabs { display: flex; gap: 8px; padding: 16px 18px 0; }
.tab {
  padding: 10px 17px;
  border: 1px solid #aebccd;
  border-radius: 9px 9px 0 0;
  color: var(--navy);
  background: #f0f4f9;
  font-weight: 700;
  cursor: pointer;
}
.tab.active { color: white; background: var(--navy); border-color: var(--navy); }
.preview-card {
  margin: 0 18px 18px;
  border: 1px solid #afbccb;
  border-top: 5px solid var(--navy);
  border-radius: 0 0 12px 12px;
  overflow: hidden;
  background: white;
}
.preview-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--navy-dark);
  background: linear-gradient(90deg, #eef3f9, white);
  border-bottom: 1px solid var(--silver);
}
.preview-brand img { width: 48px; height: 48px; object-fit: contain; }
.preview-brand strong, .preview-brand span { display: block; }
.preview-brand span { margin-top: 3px; color: var(--muted); font-size: .82rem; }
pre {
  min-height: 450px;
  margin: 0;
  padding: 22px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: #111b27;
  font: 15px/1.55 "Segoe UI", Arial, sans-serif;
}
.actions { display: flex; flex-wrap: wrap; gap: 9px; padding: 0 18px 14px; }
.button {
  appearance: none;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: 700 .9rem "Segoe UI", Arial, sans-serif;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.button:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { color: white; background: var(--navy); }
.button-secondary { color: white; background: var(--blue); }
.button-light { color: var(--navy); background: white; border-color: #aebccd; }
footer { padding: 8px 20px 24px; color: var(--muted); text-align: center; font-size: .84rem; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  padding: 12px 17px;
  color: white;
  background: var(--success);
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: toast-in .18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  textarea { min-height: 340px; }
  .brand-logo { width: 82px; height: 82px; }
}
@media (max-width: 560px) {
  .header-inner { align-items: flex-start; }
  .brand-logo { width: 66px; height: 66px; }
  .eyebrow { font-size: .67rem; }
  .output-heading { align-items: flex-start; flex-direction: column; }
}
@media print {
  body { background: white; }
  .site-header, .input-panel, .panel-heading, .tabs, .actions, .copy-note, footer { display: none !important; }
  .app-shell { display: block; width: 100%; margin: 0; }
  .panel, .preview-card { border: 0; box-shadow: none; margin: 0; }
  .preview-brand { display: none; }
  pre { min-height: 0; padding: 0; font-size: 12pt; }
}
