:root {
  color-scheme: light;
  --ink: #192c39;
  --muted: #69818d;
  --line: #e5eff0;
  --cyan: #00bde9;
  --mint: #ebfbfa;
  --body: #f6fafb;
  --round: "Trebuchet MS", "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;
  --font: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; background: var(--body); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .brand:focus-visible { outline: 3px solid #00a8db; outline-offset: 3px; }
svg { display: block; }
.app-shell { min-height: 100vh; }
.topbar { min-height: 78px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; box-shadow: 0 1px 0 #e7eef0; position: relative; z-index: 9; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; flex: 0 0 auto; }
.brand-mark { width: 49px; height: 49px; display: block; transform: rotate(-8deg); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; line-height: 1.05; }
.brand-copy strong { font: 900 26px/1 var(--round); letter-spacing: -.95px; }
.brand-copy small { color: #78909c; font-size: 10px; font-weight: 800; letter-spacing: 1.95px; text-transform: uppercase; }
.topbar-center { display: flex; align-items: center; gap: 8px; color: #78909b; font-size: 12px; font-weight: 600; white-space: nowrap; }
.privacy-dot { background: #66c1a0; height: 7px; width: 7px; border-radius: 50%; box-shadow: 0 0 0 4px #e0f5ee; margin-right: 5px; }
.bullet-sep { color: #b7c8ce; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.btn { border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 13px; padding: 11px 17px; font-weight: 800; font-size: 13px; line-height: 1.2; text-decoration: none; transition: background .18s, transform .18s, border-color .18s; white-space: nowrap; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.9; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: #00bde9; color: #063748; box-shadow: 0 4px 12px rgba(0,189,233,.15); }
.btn-primary:hover { background: #00c8f6; }
.btn-ghost { background: #fff; color: #314959; border-color: #e2eaed; }
.btn-ghost:hover { background: #f7fbfb; border-color: #bacbd1; }
.btn-outline { background: #fff; border-color: #dce9ed; color: #3c5b69; }
.btn-outline:hover { background: #f7fcff; border-color: #98cbdc; }
.btn-small { padding: 9px 12px; font-size: 12px; }
.btn-small svg { width: 16px; height: 16px; }
.workspace { display: grid; grid-template-columns: 396px minmax(0, 1fr); min-height: calc(100vh - 78px); }
.editor-panel { background: #fff; border-right: 1px solid #e5eded; min-width: 0; height: calc(100vh - 78px); display: flex; flex-direction: column; }
.editor-intro { padding: 23px 28px 16px; flex: 0 0 auto; }
.editor-eyebrow { font-size: 10px; font-weight: 900; color: #008eb9; letter-spacing: 2px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.mini-spark { color: #00bde9; font-size: 21px; }
.editor-intro h1 { font: 900 32px/1.07 var(--round); margin: 0 0 9px; letter-spacing: -1.4px; }
.editor-intro h1 em { color: #04aacf; font-style: normal; }
.editor-intro p { color: #708794; font-size: 12.5px; line-height: 1.55; margin: 0; }
/* Color selection is the first customization step, always visible above the editor tabs. */
.theme-start { margin: 0 27px 15px; padding: 13px 13px 11px; border: 1px solid #d9edf1; background: linear-gradient(135deg,#f3fcfe,#f7fafc); border-radius: 16px; flex: 0 0 auto; }
.theme-start-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.theme-step { font-size: 9px; color: #5995a7; font-weight: 900; letter-spacing: 1px; margin-bottom: 4px; }
.theme-start h2 { margin: 0; font: 900 17px/1.1 var(--round); color: #243d4b; letter-spacing: -.4px; }
.theme-start h2 span { color: #00bde9; margin-left: 2px; }
.theme-customize { border: 1px solid #c7e4e9; background: #fff; color: #167e98; white-space: nowrap; padding: 7px 9px; font-size: 10px; font-weight: 850; border-radius: 9px; }
.theme-customize:hover { background: #e5f9fd; border-color: #83cede; }
.quick-palettes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.quick-palette { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; min-width: 0; padding: 8px 1px 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: #66818d; }
.quick-palette:hover { border-color: #c5e2e8; background: #fff9; }
.quick-palette.is-active { border-color: #88cfe0; background: white; box-shadow: 0 2px 6px #2443510c; color: #187f99; }
.quick-swatch { width: 31px; height: 31px; flex: 0 0 auto; border: 2px solid white; border-radius: 50%; background: conic-gradient(var(--palette-accent) 0 135deg,var(--palette-surface) 135deg 225deg,var(--palette-paper) 225deg 315deg,var(--palette-ink) 315deg 360deg); box-shadow: 0 0 0 1px #c5dce3,0 2px 5px #112b3c0b; }
.quick-palette.is-active .quick-swatch { box-shadow: 0 0 0 2px #55bbd3,0 2px 5px #112b3c0c; }
.quick-palette-label { font-size: 9px; line-height: 1; font-weight: 800; white-space: nowrap; }
.theme-start-foot { margin: 7px 2px 0; text-align: center; color: #79939e; font-size: 10px; line-height: 1.25; }
.theme-start-foot strong { color: #35768b; }
.template-line { margin: 0 27px 15px; padding: 11px; border-radius: 16px; display: flex; align-items: center; background: #f2f9fa; gap: 8px; flex-wrap: wrap; }
.template-label { font-size: 9px; font-weight: 900; color: #7996a2; letter-spacing: 1px; width: 100%; }
.template-line select { flex: 1; min-width: 0; border: 0; border-radius: 10px; background: #fff; color: #2a4a56; font-size: 12px; font-weight: 750; height: 36px; padding: 0 10px; appearance: auto; }
.btn-icon { border: 1px solid #d5e8ed; color: #1b7f9a; background: #fff; border-radius: 10px; height: 36px; width: 36px; flex: 0 0 auto; display: grid; place-items: center; }
.btn-icon:hover { background: #e8f9ff; }
.btn-icon svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.editor-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; border-bottom: 1px solid #e8eef1; padding: 0 21px; flex: 0 0 auto; }
.tab { color: #8297a1; background: transparent; border: none; border-bottom: 3px solid transparent; font-size: 12px; padding: 12px 1px 13px; display: flex; align-items: center; gap: 5px; justify-content: center; font-weight: 800; border-radius: 8px 8px 0 0; }
.tab:hover { background: #f4fbfd; color: #2b7187; }
.tab.is-active { color: #009bbd; border-bottom-color: #00bde9; }
.tab-emoji { font-size: 14px; }
.editor-content { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 23px 26px 35px; scrollbar-color: #dbe9ed transparent; scrollbar-width: thin; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0 0 18px; }
.panel-heading h2 { font: 850 20px/1.2 var(--round); margin: 0 0 4px; letter-spacing: -.6px; }
.panel-heading p { color: #748c97; font-size: 12px; line-height: 1.5; margin: 0; max-width: 290px; }
.editor-section { border-top: 1px solid #edf2f3; padding: 21px 0 0; margin: 21px 0 0; }
.editor-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 13px; }
.section-heading h3 { font: 900 12px/1.2 var(--round); color: #294451; margin: 0; text-transform: uppercase; letter-spacing: .8px; }
.section-heading .helper { font-size: 10px; color: #879da7; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.field label { color: #546b77; font-size: 11px; font-weight: 800; letter-spacing: .15px; }
.field input, .field textarea, .field select { background: #fff; color: #183641; border: 1.5px solid #dce8eb; border-radius: 10px; padding: 10px 12px; outline: none; width: 100%; min-width: 0; font-size: 13px; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #33b8d6; box-shadow: 0 0 0 3px #bbedf5; }
.field textarea { resize: vertical; min-height: 86px; line-height: 1.55; }
.field small { color: #92a4ae; font-size: 10px; line-height: 1.4; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.item-row { display: grid; grid-template-columns: 41px minmax(0, 1fr) minmax(0, 1.1fr) 29px; gap: 7px; margin-bottom: 8px; align-items: center; }
.item-row input { min-width: 0; background: white; border: 1px solid #e1ebed; border-radius: 9px; padding: 9px 7px; font-size: 11.5px; }
.item-row input.icon-input { text-align: center; font-size: 17px; padding: 6px 4px; }
.item-row button { width: 29px; height: 31px; border: 0; background: #f5f8fa; border-radius: 8px; color: #8fa2a9; font-size: 16px; }
.item-row button:hover { color: #a53232; background: #fff1f1; }
.add-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: #008fb8; border: 1.5px dashed #abdce7; background: #f0fbfd; border-radius: 10px; padding: 9px 14px; font-weight: 800; font-size: 12px; width: 100%; }
.add-button:hover { background: #def7ff; border-color: #68bdd1; }
.callout { padding: 13px 14px; background: #fffaf0; border: 1px solid #f4e7c7; border-radius: 13px; color: #876f3d; font-size: 11.5px; line-height: 1.55; display: flex; gap: 9px; }
.callout span:first-child { font-size: 17px; flex: 0 0 auto; }
.callout-blue { background: #f0faff; border-color: #d9edf4; color: #416d7f; }
.meal-list { display: flex; flex-direction: column; gap: 11px; }
.meal-editor { border: 1px solid #e3ecee; border-radius: 15px; overflow: hidden; background: #fff; }
.meal-editor[open] { box-shadow: 0 5px 20px #17384a0b; border-color: #b9e2e9; }
.meal-editor summary { display: flex; align-items: center; gap: 9px; list-style: none; padding: 12px 12px; cursor: pointer; }
.meal-editor summary::-webkit-details-marker { display: none; }
.meal-editor summary::after { content: '⌄'; color: #8ca6b0; font-size: 20px; margin-left: auto; transition: transform .15s; }
.meal-editor[open] summary::after { transform: rotate(180deg); }
.meal-circle { height: 35px; width: 35px; flex: 0 0 auto; display: grid; place-items: center; font-size: 20px; border-radius: 10px; background: #e9faff; }
.meal-summary-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.meal-summary-copy strong { color: #2f4a57; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meal-summary-copy small { color: #95a9b2; font-size: 10px; }
.meal-number { font-size: 11px; background: #dff6fa; color: #0a9bbb; font-weight: 900; border-radius: 50%; height: 25px; width: 25px; display: grid; place-items: center; }
.meal-form { padding: 15px 14px 14px; border-top: 1px solid #edf2f4; background: #fcfefe; }
.meal-actions { display: flex; justify-content: space-between; align-items: center; gap: 5px; flex-wrap: wrap; padding-top: 9px; }
.meal-actions-left { display: flex; gap: 4px; }
.micro-button { border: 1px solid #e0eaed; color: #577581; background: #fff; border-radius: 8px; font-size: 11px; font-weight: 750; padding: 7px 9px; }
.micro-button:hover { background: #eefaFD; }
.micro-button.danger { color: #ad5252; }
.micro-button.danger:hover { background: #fff0f0; }
.file-pick { display: flex; align-items: center; gap: 8px; }
.file-pick label { display: inline-flex; align-items: center; gap: 5px; border-radius: 9px; padding: 8px 10px; color: #23778a; font-size: 11px; font-weight: 800; border: 1px dashed #b2dce5; cursor: pointer; background: white; }
.file-pick label:hover { background: #edfaff; }
.file-pick input { display: none; }
.uploaded-thumb { max-width: 51px; max-height: 42px; object-fit: cover; border-radius: 7px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 750; color: #546d79; margin-top: 4px; }
.checkbox-line input { accent-color: #00bce7; height: 16px; width: 16px; }
.color-field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; margin-bottom: 11px; }
.color-field label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; font-weight: 800; color: #425a65; }
.color-field label small { font-size: 10px; font-weight: 500; color: #8aa0aa; }
.color-control { display: flex; align-items: center; gap: 7px; }
.color-control input[type=color] { width: 40px; height: 35px; border: 1px solid #dce7eb; padding: 3px; background: white; border-radius: 9px; cursor: pointer; }
.color-control code { font-size: 10.5px; color: #79919b; font-family: ui-monospace, monospace; width: 65px; }
.style-guide { padding: 13px; background: #f5fafb; border: 1px solid #e2eff1; border-radius: 12px; font-size: 11.5px; color: #66818f; line-height: 1.6; }
.style-guide strong { color: #284656; }
.editor-bottom { flex: 0 0 auto; padding: 13px 26px; border-top: 1px solid #e7eef0; background: #fff; display: flex; align-items: center; justify-content: space-between; }
.save-indicator { display: flex; gap: 7px; align-items: center; color: #84a1a2; font-size: 10.5px; font-weight: 750; }
.save-led { height: 7px; width: 7px; background: #5abf9a; border-radius: 50%; }
.link-button { border: 0; background: transparent; color: #189ab9; font-weight: 800; font-size: 11px; padding: 4px; }
.link-button:hover { text-decoration: underline; }
.preview-panel { display: flex; flex-direction: column; min-width: 0; height: calc(100vh - 78px); overflow: hidden; background: #f7fafb; }
.preview-bar { padding: 28px 34px 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex: 0 0 auto; }
.preview-eyebrow { font-size: 10px; font-weight: 900; color: #39a5bc; letter-spacing: 2px; margin-bottom: 7px; }
.preview-spark { display: inline-block; margin-left: 5px; font-size: 14px; }
.preview-bar h2 { font: 900 25px/1.1 var(--round); margin: 0 0 4px; letter-spacing: -.8px; }
.preview-bar p { color: #8aa0aa; margin: 0; font-size: 12px; }
.preview-tools { flex: 0 0 auto; display: flex; align-items: center; background: #fff; border: 1px solid #e0ecee; border-radius: 12px; padding: 3px; box-shadow: 0 2px 9px #14272f09; }
.zoom-button { background: transparent; border: 0; font-weight: 600; font-size: 21px; color: #728b95; width: 32px; height: 32px; }
.zoom-button:hover { background: #edf8fb; border-radius: 8px; }
#zoom-indicator { text-align: center; min-width: 34px; color: #64818d; font-size: 11px; font-weight: 800; }
.zoom-fit { border: 0; background: #e9f8fb; color: #168aa7; padding: 8px 10px; font-weight: 850; font-size: 10px; border-radius: 8px; margin-left: 3px; }
.zoom-fit:hover { background: #d2f4fb; }
.canvas-scroll { overflow: auto; flex: 1 1 auto; min-height: 0; scrollbar-color: #c4dbe0 transparent; scrollbar-width: thin; background-image: radial-gradient(#dce7e9 1px, transparent 1px); background-size: 25px 25px; background-position: 11px 12px; border-top: 1px solid #ecf0f1; }
.canvas-board { display: block; min-width: 100%; min-height: 100%; padding: 28px 30px 65px; }
.poster-outer { width: min(100%, 780px); margin-inline: auto; transform-origin: top center; transition: width .12s; }
.poster { width: 100%; background: #fff; border-radius: 5px; box-shadow: 0 18px 48px #25455326, 0 2px 6px #0000000b; overflow: hidden; }
.poster svg { width: 100%; height: auto; display: block; }
.preview-bottom { flex: 0 0 auto; background: #f8fbfc; border-top: 1px solid #e4edef; padding: 11px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.preview-bottom > span { color: #9aacb4; font-size: 11px; font-weight: 600; }
.secondary-actions { display: flex; align-items: center; gap: 8px; }
.mobile-mode-switch { display: none; }
.toast { position: fixed; bottom: 26px; right: 28px; z-index: 40; background: #193f4d; color: #fff; border-radius: 13px; font-size: 12px; font-weight: 700; box-shadow: 0 15px 38px #11323a38; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; padding: 12px 17px; max-width: min(90vw, 390px); }
.toast.show { opacity: 1; transform: translateY(0); }
.confirm-dialog { width: min(90vw, 410px); padding: 29px; border: 1px solid #e8eff1; border-radius: 22px; box-shadow: 0 25px 90px #071e2b33; }
.confirm-dialog::backdrop { background: #12333f77; backdrop-filter: blur(3px); }
.dialog-badge { height: 45px; width: 45px; background: #e0faff; display: grid; place-items: center; color: #00b6db; border-radius: 14px; font-size: 27px; margin-bottom: 17px; }
.confirm-dialog h2 { font: 900 23px/1.2 var(--round); margin: 0 0 9px; }
.confirm-dialog p { color: #6f8590; font-size: 13px; line-height: 1.6; margin: 0 0 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 1160px) {
  .topbar-center { display: none; }
  .workspace { grid-template-columns: 360px minmax(0, 1fr); }
  .editor-intro { padding-left: 23px; padding-right: 23px; }
  .editor-content { padding-left: 20px; padding-right: 20px; }
  .template-line, .theme-start { margin-left: 20px; margin-right: 20px; }
  .preview-bar { padding-left: 20px; padding-right: 20px; }
  .preview-bottom { padding-left: 20px; padding-right: 20px; }
  .canvas-board { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 810px) {
  .topbar { padding: 0 17px; min-height: 72px; }
  .brand-mark { width: 43px; height: 43px; }
  .brand-copy strong { font-size: 23px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions .btn { padding: 11px 12px; }
  .top-save span { display: none; }
  .workspace { display: block; min-height: calc(100vh - 121px); }
  .mobile-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px; background: #fff; border-bottom: 1px solid #e4edf0; }
  .mobile-mode-switch button { padding: 11px 5px; border: 0; border-radius: 9px; background: #fff; color: #68838e; font-size: 12px; font-weight: 850; }
  .mobile-mode-switch button.is-active { background: #e9f9fc; color: #069ec3; }
  .editor-panel, .preview-panel { height: calc(100dvh - 122px); }
  .editor-panel { border-right: 0; overflow-y: auto; overscroll-behavior: contain; }
  .editor-content { flex: 0 0 auto; overflow: visible; }
  .editor-tabs { position: sticky; top: 0; z-index: 3; background: white; }
  .editor-bottom { position: sticky; bottom: 0; z-index: 4; }
  .workspace:not(.preview-active) .preview-panel { display: none; }
  .workspace.preview-active .editor-panel { display: none; }
  .preview-bar { padding: 16px 18px 13px; }
  .preview-bar h2 { font-size: 20px; }
  .preview-bar p { font-size: 10.5px; }
  .preview-tools { align-self: flex-start; }
  .preview-bottom { flex-wrap: wrap; padding: 11px 15px; }
  .preview-bottom > span { display: none; }
  .secondary-actions { width: 100%; }
  .secondary-actions button { flex: 1; }
  .canvas-board { padding: 20px 12px 65px; }
  .poster-outer { width: min(100%, 780px); }
}
@media (max-width: 435px) {
  .brand-copy small { letter-spacing: 1.1px; font-size: 8px; }
  .brand-copy strong { font-size: 22px; }
  .brand-mark { height: 40px; width: 40px; }
  .topbar .btn-primary { padding: 12px; font-size: 11px; }
  .topbar .btn-primary svg { width: 15px; height: 15px; }
  .zoom-button { width: 26px; }
  .preview-bar h2 { font-size: 17px; }
  .preview-bar p { max-width: 200px; }
  .preview-bar { gap: 7px; }
  .preview-tools { gap: 0; }
  .zoom-fit { padding: 7px; }
  .editor-intro { padding-top: 17px; }
  .theme-start { padding: 11px 10px; }
  .quick-palettes { gap: 2px; }
  .quick-palette { gap: 5px; padding: 7px 1px 6px; }
  .quick-swatch { width: 28px; height: 28px; }
  .editor-intro h1 { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 435px) { .topbar { padding-inline: 16px; } }
@media (max-width: 360px) { .topbar #export-png span { display: none; } .topbar #export-png { min-width: 42px; padding: 11px; } .brand-copy strong { font-size: 20px; } .brand-mark { width: 36px; height: 36px; } .brand { gap: 8px; } }

/* v3 UX polish: color guidance, compact controls, and readable zoom. */
.contrast-guidance {
  margin-top: 17px;
  padding: 12px 13px;
  border: 1px solid #d8ede6;
  background: #f0faf6;
  border-radius: 12px;
  color: #366b55;
  font-size: 11px;
  line-height: 1.5;
}
.contrast-guidance.needs-adjustment {
  background: #fff9ed;
  border-color: #f1dfb7;
  color: #76613c;
}
.contrast-guidance strong { display: block; font-size: 11.5px; margin-bottom: 3px; }
.contrast-guidance p { margin: 0; }
#zoom-indicator { min-width: 45px; font-variant-numeric: tabular-nums; }
.editor-tabs .tab { white-space: nowrap; }
@media (max-width: 420px) {
  .editor-tabs { padding-inline: 12px; gap: 1px; }
  .editor-tabs .tab { font-size: 10.5px; gap: 3px; }
  .editor-tabs .tab-emoji { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .poster-outer { transition: none; }
}
