:root {
  --navy-950: #061638;
  --navy-900: #071b46;
  --navy-800: #0b2860;
  --blue-700: #1f56ae;
  --ice-100: #edf5ff;
  --ink: #102953;
  --muted: #6d81a5;
  --gold: #d5ad67;
  --line: #d5e2f3;
  --shadow: 0 22px 50px rgba(20, 57, 113, 0.15);
}
@font-face { font-family: "Open Sans Local"; src: url("../fonts/open-sans-regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sans Local"; src: url("../fonts/open-sans-semibold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--ice-100); color: var(--ink); font-family: "Open Sans Local", "Open Sans", "Helvetica Neue", Arial, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; background: linear-gradient(145deg, #edf5ff 0%, #f8fbff 52%, #e4effd 100%); }
.topbar { height: 66px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; color: #f7fbff; background: var(--navy-950); border-bottom: 1px solid rgba(197, 222, 255, 0.18); }
.brand-lockup, .brand-lockup > div, .topbar-meta, .toolbar-actions, .preview-status, .section-label-row, .sidebar-heading { display: flex; align-items: center; }
.brand-lockup { gap: 11px; }
.brand-lockup > div { flex-direction: column; align-items: flex-start; gap: 1px; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(245, 215, 137, 0.78); color: var(--gold); font-weight: 600; font-size: 17px; }
.brand-lockup strong { letter-spacing: .16em; font-size: 15px; }
.brand-lockup span:not(.brand-mark) { color: #a8bfde; font-size: 11px; }
.topbar-meta { gap: 10px; color: #9db5d8; font-size: 11px; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: #6fe0a2; box-shadow: 0 0 0 4px rgba(111, 224, 162, .15); }
.topbar-divider { width: 1px; height: 13px; background: rgba(189, 214, 245, .28); }
.workspace { width: min(1540px, calc(100% - 36px)); min-height: calc(100vh - 90px); margin: 12px auto 18px; display: grid; grid-template-columns: 248px minmax(480px, 1fr) 310px; gap: 12px; }
.sidebar, .preview-area { border: 1px solid var(--line); background: rgba(255,255,255,.86); box-shadow: var(--shadow); }
.sidebar { padding: 18px 16px; display: flex; flex-direction: column; min-height: 0; }
.left-sidebar { border-top: 3px solid var(--blue-700); }
.inspector-sidebar { border-top: 3px solid var(--gold); }
.sidebar-heading { justify-content: space-between; gap: 12px; }
.sidebar-heading h1, .sidebar-heading h2 { margin: 5px 0 0; color: var(--navy-900); font-size: 23px; letter-spacing: -.03em; }
.sidebar-heading h2 { font-size: 19px; }
.eyebrow { display: block; color: var(--blue-700); font-size: 10px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.count-badge, .live-chip { display: inline-grid; place-items: center; min-width: 27px; height: 23px; padding: 0 7px; border: 1px solid #bed2ed; color: var(--blue-700); font-size: 11px; font-weight: 600; }
.live-chip { border-color: #e4cf9d; color: #9e762b; }
.sidebar-section { margin-top: 20px; }
.section-label-row { justify-content: space-between; gap: 10px; color: var(--navy-800); font-size: 12px; font-weight: 600; }
.section-label-row small { color: var(--muted); font-size: 10px; font-weight: 400; }
.language-list { margin-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.language-section { border: 1px solid var(--line); background: #f8fbff; }
.language-section.is-open { border-color: #91b4e3; background: #eef5ff; }
.language-trigger { width: 100%; padding: 10px 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; background: transparent; color: var(--ink); text-align: left; }
.language-trigger:disabled { cursor: default; opacity: .58; }
.language-identity { display: flex; align-items: center; gap: 9px; }
.flag { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid #cbdcf1; background: #fff; font-size: 14px; }
.language-text { display: flex; flex-direction: column; gap: 2px; }
.language-text strong { font-size: 12px; font-weight: 600; }
.language-text small { color: var(--muted); font-size: 10px; }
.language-actions { display: flex; align-items: center; gap: 7px; }
.usage-badge { color: var(--blue-700); font-size: 10px; }
.language-arrow { color: var(--blue-700); transition: transform 160ms ease; }
.language-section.is-open .language-arrow { transform: rotate(180deg); }
.vip-grid { padding: 0 10px 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.vip-btn { min-height: 31px; border: 1px solid #cbdcf1; background: #fff; color: var(--navy-800); font-size: 10px; transition: border-color 140ms ease, background 140ms ease, color 140ms ease; }
.vip-btn:hover, .vip-btn.active { border-color: var(--blue-700); background: var(--blue-700); color: #fff; }
.language-empty { padding: 0 11px 11px; color: var(--muted); font-size: 10px; }
.cache-section { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.cache-track { height: 6px; margin-top: 9px; overflow: hidden; background: #dbe8f7; }
.cache-track span { display: block; width: 0; height: 100%; background: var(--blue-700); transition: width 180ms ease; }
.cache-section p { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.preview-area { min-width: 0; padding: 14px; display: flex; flex-direction: column; }
.preview-toolbar { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-toolbar strong { display: block; margin-top: 4px; color: var(--navy-900); font-size: 15px; }
.toolbar-actions { gap: 7px; }
.ghost-button, .primary-button, .export-button, .upload-button, .icon-button { border: 1px solid #cbdcf1; background: #fff; color: var(--navy-800); transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease; }
.ghost-button, .primary-button { min-height: 34px; padding: 0 13px; font-size: 11px; }
.primary-button { border-color: var(--blue-700); background: var(--blue-700); color: #fff; }
.ghost-button:hover, .primary-button:hover, .export-button:hover, .upload-button:hover, .icon-button:hover { border-color: var(--blue-700); transform: translateY(-1px); box-shadow: 0 8px 15px rgba(31, 86, 174, .12); }
.canvas-stage { position: relative; flex: 1; min-height: 0; margin-top: 12px; display: flex; align-items: center; justify-content: center; padding: 31px 28px 20px; overflow: hidden; border: 1px solid #cfdff1; background: #eaf3fd; }
#certificateCanvas { display: block; width: min(100%, 520px); max-height: calc(100vh - 164px); height: auto; background: #fff; box-shadow: 0 18px 42px rgba(15, 48, 101, .22); cursor: grab; }
#certificateCanvas.is-dragging { cursor: grabbing; }
.canvas-ruler { position: absolute; color: #8ea6c4; font-size: 9px; pointer-events: none; }
.ruler-top { top: 10px; left: 28px; right: 28px; display: flex; justify-content: space-between; }
.ruler-side { top: 31px; bottom: 20px; left: 8px; display: flex; flex-direction: column; justify-content: space-between; }
.state-overlay { position: absolute; inset: 28px; display: grid; place-items: center; background: rgba(237, 245, 255, .84); }
.hidden { display: none; }
.state-card { min-width: 190px; padding: 20px; border: 1px solid #cbdcf1; background: #fff; text-align: center; box-shadow: 0 14px 26px rgba(20,57,113,.12); }
.state-card p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.state-error strong { display: block; color: #9d3d3d; }
.state-error .ghost-button { margin-top: 12px; }
.spinner { width: 23px; height: 23px; display: block; margin: 0 auto; border: 2px solid #cbdcf1; border-top-color: var(--blue-700); border-radius: 50%; animation: spin 800ms linear infinite; }
.preview-status { justify-content: space-between; gap: 10px; padding: 10px 2px 0; color: var(--blue-700); font-size: 10px; }
.preview-status span:last-child { color: var(--muted); }
.inspector-heading { margin-bottom: 4px; }
.inspector-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.upload-button { width: 100%; min-height: 35px; margin-top: 9px; display: flex; align-items: center; justify-content: space-between; padding: 0 11px; font-size: 11px; }
.upload-button span { color: var(--muted); font-size: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.text-input { width: 100%; height: 37px; margin-top: 9px; padding: 0 11px; border: 1px solid #6f9ed2; outline: none; color: var(--navy-900); background: #edf5ff; font-size: 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.68); }
.text-input::placeholder { color: #6d82a4; }
.text-input:focus, .field-grid input:focus { border-color: var(--gold); background: #fffdf7; box-shadow: 0 0 0 3px rgba(213,173,103,.2), inset 0 0 0 1px rgba(255,255,255,.9); }
.field-grid { margin-top: 8px; display: grid; gap: 6px; }
.field-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid label { color: var(--muted); font-size: 9px; }
.field-grid input { width: 100%; height: 29px; margin-top: 4px; padding: 0 5px; border: 1px solid #8eafd4; outline: none; color: var(--navy-800); background: #f3f8ff; font-size: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.72); }
.control-row { margin-top: 8px; display: grid; grid-template-columns: repeat(4, 1fr) 1fr 1fr; gap: 5px; }
.icon-button { height: 29px; display: grid; place-items: center; padding: 0; color: var(--blue-700); font-size: 14px; line-height: 1; }
.icon-button.wide { font-size: 16px; }
.export-section { margin-top: auto; }
.export-button { width: 100%; min-height: 39px; margin-top: 9px; border-color: var(--blue-700); background: #f1f6fd; color: var(--blue-700); font-size: 11px; font-weight: 600; }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.coords { margin: 14px 0 0; padding: 10px; border: 1px solid var(--line); background: #f5f9fe; color: var(--muted); font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 1180px) { .workspace { grid-template-columns: 220px minmax(420px, 1fr) 282px; width: min(1100px, calc(100% - 24px)); } .sidebar { padding: 15px 12px; } }
@media (max-width: 940px) { .workspace { grid-template-columns: 1fr; width: min(680px, calc(100% - 20px)); } .left-sidebar, .inspector-sidebar { min-height: auto; } .cache-section, .export-section { margin-top: 18px; } #certificateCanvas { max-height: none; width: min(100%, 520px); } .canvas-stage { min-height: 680px; } }
@media (max-width: 560px) { .topbar { height: 58px; padding: 0 16px; } .topbar-meta span:not(.connection-dot):not(.topbar-divider):last-child { display: none; } .workspace { margin-top: 8px; } .preview-area { padding: 10px; } .preview-toolbar { align-items: flex-start; flex-direction: column; } .toolbar-actions { width: 100%; } .toolbar-actions button { flex: 1; } .canvas-stage { min-height: 600px; padding-left: 22px; padding-right: 22px; } .ruler-top { left: 22px; right: 22px; } }
