:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #f4f8f5;
  --surface-blue: #eef8f2;
  --text: #17221c;
  --muted: #647069;
  --border: #d9e2dc;
  --border-strong: #bdcbc2;
  --accent: #0b6b3a;
  --accent-hover: #08582f;
  --accent-soft: #e3f3e9;
  --accent-bright: #18a05e;
  --success: #0b7b45;
  --warning: #a65d00;
  --warning-bg: #fff7e8;
  --danger: #c43a3a;
  --shadow: 0 20px 50px rgba(17, 55, 35, .12);
  --shadow-soft: 0 10px 28px rgba(23, 58, 39, .08);
  --radius: 14px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; color: var(--text); background: var(--bg); font-family: var(--font); }
body { overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button:focus-visible, .icon-button:focus-visible, .command-button:focus-visible, .brand:focus-visible, select:focus-visible, input:focus-visible, .sheet-tab:focus-visible, .add-sheet-button:focus-visible {
  outline: 3px solid rgba(24, 160, 94, .32);
  outline-offset: 2px;
}
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.startup-warning {
  position: fixed; z-index: 220; top: 18px; left: 50%; width: min(720px, calc(100% - 28px));
  transform: translateX(-50%); display: grid; gap: 7px; padding: 16px 18px;
  border: 1px solid #e4a43a; border-radius: 12px; background: #fff8e8;
  box-shadow: 0 14px 42px rgba(57, 39, 8, .2); text-align: left;
}
.startup-warning strong { font-size: 15px; }
.startup-warning span { color: #5f4619; font-size: 13px; line-height: 1.55; }
.startup-warning small { color: #7c6845; line-height: 1.45; }
.startup-warning code { padding: 2px 5px; border-radius: 5px; background: rgba(255,255,255,.72); }
.global-drop-overlay {
  position: fixed; z-index: 150; inset: 12px; pointer-events: none; display: grid; place-items: center;
  border: 3px dashed var(--accent); border-radius: 20px; background: rgba(235, 248, 240, .96);
  box-shadow: inset 0 0 0 5px rgba(255,255,255,.7), 0 20px 80px rgba(11, 107, 58, .2);
}
.global-drop-overlay > div { display: grid; justify-items: center; gap: 10px; padding: 32px; text-align: center; }
.global-drop-overlay svg { width: 48px; height: 48px; color: var(--accent); }
.global-drop-overlay strong { font-size: clamp(22px, 3vw, 34px); letter-spacing: -.03em; }
.global-drop-overlay span { color: var(--muted); font-size: 15px; }
body.file-drag-active { user-select: none; }

.site-header { height: 68px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(11,107,58,.12); background: rgba(255,255,255,.92); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; border: 0; background: transparent; padding: 0; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg, #0d7a43, #07562e); color: #fff; box-shadow: 0 8px 20px rgba(11, 107, 58, .22); }
.brand-mark svg { width: 22px; height: 22px; }
.brand strong { display: block; font-size: 18px; letter-spacing: -.025em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 650; }
.brand.compact .brand-mark { width: 32px; height: 32px; border-radius: 8px; box-shadow: none; }
.brand.compact strong { font-size: 16px; }
.site-nav { display: flex; align-items: center; gap: 14px; }
.privacy-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font-size: 12px; font-weight: 700; }
.language-select, .format-select { height: 36px; padding: 0 30px 0 11px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }

.home-view { min-height: calc(100vh - 68px); background: radial-gradient(circle at 86% 10%, rgba(150, 226, 178, .28), transparent 30%), linear-gradient(180deg, #f6faf7 0, #eef5f1 100%); }
.hero-section { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: clamp(50px, 8vh, 86px) 0 34px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.03fr) minmax(420px, .97fr); align-items: center; gap: clamp(44px, 7vw, 86px); }
.hero-copy { max-width: 620px; margin: 0; text-align: left; }
.hero-section > .hero-copy { max-width: 790px; margin: 0 auto 34px; text-align: center; }
.hero-section > .hero-copy h1 { margin-inline: auto; }
.hero-section > .hero-copy p { margin-inline: auto; }
.hero-section > .drop-zone { max-width: 820px; margin-inline: auto; }
.hero-eyebrow { width: fit-content; display: inline-flex; align-items: center; gap: 9px; margin-bottom: 22px; color: var(--accent); font-size: 13px; font-weight: 780; letter-spacing: -.01em; }
.eyebrow-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--accent-bright); box-shadow: 0 0 0 5px rgba(24,160,94,.11); transform: rotate(45deg); }
.hero-copy h1 { max-width: 610px; margin: 0; font-size: clamp(40px, 4.4vw, 62px); line-height: 1.09; letter-spacing: -.05em; font-weight: 790; word-break: keep-all; }
.hero-copy p { max-width: 560px; margin: 23px 0 0; color: var(--muted); font-size: clamp(16px, 1.45vw, 19px); line-height: 1.68; word-break: keep-all; }
.quick-steps { margin: 34px 0 0; padding: 0; display: flex; gap: 14px; list-style: none; }
.quick-steps li { min-width: 0; display: flex; align-items: center; gap: 9px; color: #405047; font-size: 12px; }
.quick-steps li:not(:last-child)::after { content: ''; width: 24px; height: 1px; margin-left: 5px; background: #bdd0c4; }
.quick-steps span { width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #b6d4c1; border-radius: 50%; background: #fff; color: var(--accent); font-size: 11px; font-weight: 800; }
.quick-steps strong { white-space: nowrap; font-weight: 700; }
.drop-panel { position: relative; }
.drop-panel::before { content: ''; position: absolute; inset: -18px 24px 24px -18px; border-radius: 28px; background: rgba(42, 139, 85, .08); transform: rotate(-2deg); }
.drop-zone { position: relative; min-height: 438px; margin: 0; padding: 34px 34px 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed #8fbca0; border-radius: 24px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease; outline: none; text-align: center; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: #fbfefc; transform: translateY(-3px); box-shadow: 0 26px 64px rgba(17, 75, 43, .15); }
.drop-kicker { position: absolute; top: 18px; left: 20px; display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-size: 11px; font-weight: 760; }
.drop-kicker svg { width: 14px; height: 14px; }
.drop-icon { width: 76px; height: 76px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #159255, #086335); border-radius: 20px; box-shadow: 0 14px 30px rgba(11,107,58,.22); }
.drop-icon svg { width: 38px; height: 38px; stroke-width: 1.55; }
.drop-zone h2 { max-width: 340px; margin: 27px 0 9px; font-size: clamp(23px, 2.4vw, 29px); line-height: 1.25; letter-spacing: -.035em; word-break: keep-all; }
.drop-zone > p { margin: 0; color: var(--muted); line-height: 1.55; word-break: keep-all; }
.drop-actions { width: min(360px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 27px 0 20px; }
.supported-formats { font-size: 11px; font-weight: 650; letter-spacing: .01em; }
.trust-strip { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 30px; color: var(--muted); font-size: 12px; }
.trust-strip span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--success); font-weight: 650; }
.trust-strip a:hover { color: var(--accent); }
.seo-content { border-top: 1px solid var(--border); background: #fff; }
.seo-content-inner { width: min(900px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 76px; }
.seo-content h2 { margin: 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.18; letter-spacing: -.035em; }
.seo-content-lead { max-width: 760px; margin: 18px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.seo-feature-list { margin: 32px 0 44px; padding: 0; display: grid; gap: 13px; list-style: none; }
.seo-feature-list li { position: relative; padding-left: 28px; line-height: 1.55; }
.seo-feature-list li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--success); font-weight: 800; }
.seo-faq { border-top: 1px solid var(--border); }
.seo-faq details { border-bottom: 1px solid var(--border); padding: 18px 0; }
.seo-faq summary { cursor: pointer; font-weight: 720; }
.seo-faq p { max-width: 760px; margin: 12px 0 0; color: var(--muted); line-height: 1.65; }

.button { min-height: 42px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; border: 1px solid transparent; font-weight: 740; font-size: 13px; transition: background .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.button.primary { background: var(--accent); color: #fff; box-shadow: 0 7px 18px rgba(11,107,58,.2); }
.button.primary:hover { background: var(--accent-hover); }
.button.primary:active, .button.secondary:active { transform: translateY(1px); }
.button.secondary { background: #fff; border-color: var(--border-strong); color: #33423a; }
.button.secondary:hover { background: var(--surface-soft); }
.button.full { width: 100%; margin-top: 18px; }
.compact-button { min-height: 34px; padding: 0 13px; }

.editor-view { position: fixed; inset: 0; display: grid; grid-template-rows: 54px 46px auto 40px minmax(0,1fr) 40px; background: #fff; overflow: hidden; }
.app-header { grid-row: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 0 12px; border-bottom: 1px solid #07552e; background: linear-gradient(100deg, #0b6537, #0d7440); color: #fff; }
.file-title-wrap { min-width: 100px; flex: 1 1 auto; display: flex; align-items: center; gap: 8px; }
.file-name-input { width: min(320px, 100%); min-width: 90px; height: 34px; border: 1px solid transparent; border-radius: 8px; padding: 0 9px; color: #fff; font-weight: 700; background: transparent; }
.file-name-input:hover, .file-name-input:focus { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.1); outline: none; }
.modified-dot { width: 7px; height: 7px; border-radius: 50%; background: #8ee1ad; box-shadow: 0 0 0 3px rgba(255,255,255,.14); }
.header-actions { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.icon-button, .command-button { border: 0; background: transparent; border-radius: 7px; display: inline-grid; place-items: center; color: #4d5a70; }
.icon-button { width: 36px; height: 36px; }
.icon-button:hover, .command-button:hover { background: var(--surface-soft); color: var(--text); }
.icon-button.text-button { width: auto; grid-auto-flow: column; gap: 7px; padding: 0 9px; font-size: 12px; font-weight: 650; }
.toolbar-divider { width: 1px; height: 22px; background: var(--border); margin: 0 5px; }
.app-header .brand { color: #fff; }
.app-header .brand-mark { background: rgba(255,255,255,.14); box-shadow: none; }
.app-header .icon-button { color: rgba(255,255,255,.88); }
.app-header .icon-button:hover { color: #fff; background: rgba(255,255,255,.12); }
.app-header .toolbar-divider { background: rgba(255,255,255,.22); }
.app-header .language-select { border-color: rgba(255,255,255,.25); color: #fff; background: rgba(255,255,255,.1); }
.app-header .language-select option { color: var(--text); background: #fff; }
.app-header #saveButton { color: var(--accent); background: #fff; box-shadow: 0 5px 14px rgba(3,43,22,.24); }
.app-header #saveButton:hover { background: #eef9f2; }
.compact-select { height: 32px; padding-left: 8px; }
.menu-wrap { position: relative; }
.popover-menu { position: absolute; z-index: 40; right: 0; top: calc(100% + 7px); width: 230px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.popover-menu button { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.popover-menu button:hover { background: var(--surface-soft); }
.popover-menu small { color: var(--muted); }

.command-bar { grid-row: 2; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-bottom: 1px solid #cfddd3; background: linear-gradient(180deg, #fbfdfb, #f3f8f5); overflow-x: auto; overflow-y: hidden; scrollbar-color: #adc5b5 transparent; scrollbar-width: thin; }
.command-group { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.command-button { min-width: 32px; height: 32px; padding: 0 8px; }
.command-button svg { width: 17px; height: 17px; }
.command-button.labeled { display: inline-flex; gap: 6px; font-size: 11px; font-weight: 650; }
.command-button.active { color: var(--accent); background: #dcefe3; box-shadow: inset 0 0 0 1px rgba(11,107,58,.08); }
.decimal-button { min-width: 38px; padding: 0 5px; font-size: 10px; font-weight: 750; letter-spacing: -.04em; }
.strong-letter { font-weight: 850; font-family: Georgia, serif; }
.align-icon { font-weight: 800; letter-spacing: -2px; justify-items: start; }
.align-icon.center { justify-items: center; }
.align-icon.right { justify-items: end; }
.font-size-control input { width: 52px; height: 30px; border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; background: #fff; }
.color-control { position: relative; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; overflow: hidden; }
.color-control:hover { background: var(--surface-soft); }
.color-control input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.color-swatch { width: 17px; height: 17px; border-radius: 4px; border: 1px solid var(--border-strong); background: #fff; }
.text-color-symbol { font-weight: 800; border-bottom: 3px solid #172033; line-height: 18px; }
.format-select { height: 31px; font-size: 11px; }
.warning-bar { grid-row: 3; min-height: 34px; padding: 7px 42px 7px 14px; position: relative; display: flex; align-items: center; gap: 8px; background: var(--warning-bg); color: #744200; border-bottom: 1px solid #f0dba9; font-size: 12px; }
.warning-bar button { position: absolute; right: 8px; width: 26px; height: 26px; border: 0; background: transparent; color: inherit; }
.formula-bar { grid-row: 4; display: grid; grid-template-columns: 76px 40px minmax(0,1fr); align-items: center; border-bottom: 1px solid var(--border); background: #fff; box-shadow: 0 1px 0 rgba(23,55,36,.02); }
.cell-address { height: 100%; display: grid; place-items: center; border-right: 1px solid #cfe0d5; color: var(--accent); background: #eff7f2; font-size: 12px; font-weight: 780; }
.formula-symbol { color: var(--accent); font-family: Georgia, serif; font-style: italic; font-weight: 700; text-align: center; }
.formula-bar input { height: 100%; min-width: 0; border: 0; border-left: 1px solid var(--border); padding: 0 10px; outline: none; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.work-area { grid-row: 5; min-height: 0; position: relative; background: #fff; }
.grid-host { position: absolute; inset: 0; overflow: auto; outline: none; background: #fff; overscroll-behavior: contain; }

.grid-spacer { position: absolute; top: 0; left: 0; pointer-events: none; }
.grid-cells-layer, .grid-headers-layer { position: absolute; inset: 0; pointer-events: none; }
.grid-cell, .grid-row-header, .grid-col-header, .grid-corner { position: absolute; border-right: 1px solid #e1e8e3; border-bottom: 1px solid #e1e8e3; }
.grid-cell { padding: 5px 7px; background: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; line-height: 18px; pointer-events: auto; user-select: none; }
.grid-cell.wrap { white-space: normal; }
.grid-cell.frozen-row { z-index: 4; box-shadow: 0 2px 0 rgba(51, 65, 85, .12); }
.grid-cell.cell-warning::after { content: ''; position: absolute; right: 0; top: 0; width: 0; height: 0; border-top: 7px solid #d97706; border-left: 7px solid transparent; }
.grid-row-header, .grid-col-header, .grid-corner { z-index: 5; display: flex; align-items: center; justify-content: center; background: #f1f6f3; color: #53635a; font-size: 11px; font-weight: 680; pointer-events: auto; user-select: none; }
.grid-col-header { border-top: 1px solid var(--border); }
.grid-row-header { border-left: 1px solid var(--border); }
.grid-row-header.frozen-row { z-index: 6; box-shadow: 0 2px 0 rgba(51, 65, 85, .12); }
.grid-corner { z-index: 8; border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
.col-resizer { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; }
.col-resizer:hover { background: rgba(11,107,58,.22); }
.row-resizer { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; height: 8px; cursor: row-resize; }
.row-resizer:hover { background: rgba(11,107,58,.22); }
.grid-selection { position: absolute; z-index: 7; border: 2px solid var(--accent); background: rgba(11,107,58,.035); pointer-events: none; }
.grid-selection::after { content: ''; position: absolute; right: -4px; bottom: -4px; width: 6px; height: 6px; border: 1px solid #fff; background: var(--accent); }
.grid-editor { position: absolute; z-index: 12; padding: 4px 6px; resize: both; border: 2px solid var(--accent); border-radius: 0; background: #fff; box-shadow: 0 7px 20px rgba(27,42,70,.18); outline: none; font-size: 12px; line-height: 18px; }
.grid-editor.formula-entry { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.grid-context-menu { position: absolute; z-index: 20; width: 190px; padding: 5px; border: 1px solid var(--border); border-radius: 9px; background: #fff; box-shadow: var(--shadow); }
.grid-context-menu button { width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; text-align: left; font-size: 12px; }
.grid-context-menu button:hover { background: var(--surface-soft); }
.column-resize-guide { position: absolute; z-index: 11; top: 0; bottom: 0; width: 1px; background: var(--accent); pointer-events: none; }
.row-resize-guide { position: absolute; z-index: 11; height: 1px; background: var(--accent); pointer-events: none; }

.editor-footer { grid-row: 6; min-width: 0; display: flex; align-items: center; border-top: 1px solid #cedbd2; background: #f4f8f5; overflow: hidden; }
.sheet-tabs { min-width: 0; display: flex; height: 100%; overflow-x: auto; }
.sheet-tab { min-width: 86px; max-width: 180px; height: 100%; padding: 0 15px; border: 0; border-right: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 11px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-tab.active { color: var(--accent); background: #fff; box-shadow: inset 0 3px 0 var(--accent); font-weight: 780; }
.add-sheet-button { flex: 0 0 auto; width: 36px; height: 100%; border: 0; border-right: 1px solid var(--border); background: transparent; color: var(--muted); }
.footer-spacer { flex: 1; min-width: 8px; }
.footer-ad { flex: 0 1 310px; height: 27px; margin: 0 10px; padding: 0 9px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); background: #fff; font-size: 9px; overflow: hidden; white-space: nowrap; }
.footer-ad span { font-weight: 750; color: #7b8698; }
.footer-ad small { overflow: hidden; text-overflow: ellipsis; }
.status-area { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding-right: 12px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.local-status { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 999px; color: var(--success); background: #e7f4eb; font-weight: 750; }
.local-status svg { width: 13px; height: 13px; }

.modal-backdrop, .loading-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(18, 27, 43, .38); backdrop-filter: blur(3px); }
.modal-card, .loading-card { position: relative; width: min(480px, 100%); padding: 26px; border: 1px solid rgba(255,255,255,.5); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.small-modal { width: min(400px, 100%); }
.modal-card h2 { margin: 0 40px 18px 0; font-size: 21px; letter-spacing: -.02em; }
.modal-card > p { color: var(--muted); line-height: 1.55; }
.modal-card label { display: grid; gap: 7px; margin: 13px 0; font-size: 12px; font-weight: 680; }
.modal-card input, .modal-card select, .modal-card textarea { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 10px; background: #fff; outline: none; }
.modal-card input:focus, .modal-card select:focus, .modal-card textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.checkbox-label { grid-template-columns: auto 1fr !important; align-items: center; }
.checkbox-label input { width: auto; }
.modal-close { position: absolute; right: 16px; top: 16px; width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent; }
.modal-close:hover { background: var(--surface-soft); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.wrap-actions { flex-wrap: wrap; }
.compatibility-list { margin: 0; padding-left: 20px; color: #6a4a18; line-height: 1.5; }
.sponsor-card { text-align: center; }
.sponsor-panel { min-height: 120px; margin: -10px -10px 22px; padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #b8c5da; border-radius: 12px; background: var(--surface-soft); color: var(--muted); }
.sponsor-panel > span { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.sponsor-panel strong { margin-top: 8px; color: var(--text); }
.sponsor-panel p { margin: 6px 0 0; font-size: 11px; }
.countdown { min-width: 23px; height: 23px; display: inline-grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); }
.loading-card { width: min(320px, 100%); display: grid; justify-items: center; gap: 10px; text-align: center; }
.loading-card small { color: var(--muted); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; z-index: 120; right: 18px; bottom: 54px; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 9px; background: #fff; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .18s ease-out; }
.toast.error { border-color: #efb9b9; color: #8f2323; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.legal-page { width: min(800px, calc(100% - 40px)); margin: 50px auto; line-height: 1.7; }
.legal-page h1 { font-size: 34px; }
.legal-page h2 { margin-top: 34px; }
.legal-page p, .legal-page li { color: #4d5a70; }

@media (max-width: 900px) {
  .hero-section { width: min(760px, calc(100% - 40px)); padding-top: 50px; }
  .hero-grid { grid-template-columns: 1fr; gap: 42px; }
  .hero-copy { max-width: 680px; }
  .hero-copy h1 { max-width: 660px; }
  .drop-panel { width: min(620px, 100%); }
  .drop-zone { min-height: 400px; }
  .privacy-chip span { display: none; }
  .icon-button.text-button span, .data-actions span { display: none; }
  .icon-button.text-button { width: 34px; padding: 0; }
  .command-button.labeled { width: 32px; padding: 0; }
  .footer-ad { display: none; }
  .editor-view { grid-template-rows: 52px 46px auto 40px minmax(0,1fr) 38px; }
}

@media (max-width: 620px) {
  .site-header { height: 62px; padding: 0 16px; }
  .brand small { display: none; }
  .privacy-chip { display: none; }
  .home-view { min-height: calc(100vh - 62px); }
  .hero-section { width: min(100% - 28px, 1000px); padding: 38px 0 24px; }
  .hero-grid { gap: 34px; }
  .hero-eyebrow { margin-bottom: 17px; font-size: 12px; }
  .hero-copy h1 { font-size: clamp(34px, 10.5vw, 43px); line-height: 1.13; }
  .hero-copy p { margin-top: 18px; font-size: 15px; line-height: 1.62; }
  .quick-steps { margin-top: 25px; display: grid; gap: 9px; }
  .quick-steps li { font-size: 12px; }
  .quick-steps li:not(:last-child)::after { display: none; }
  .drop-panel::before { inset: -10px 14px 16px -8px; border-radius: 22px; }
  .drop-zone { min-height: 390px; padding: 52px 18px 25px; border-radius: 20px; }
  .drop-kicker { top: 16px; left: 17px; }
  .drop-icon { width: 68px; height: 68px; border-radius: 18px; }
  .drop-zone h2 { margin-top: 23px; font-size: 24px; }
  .drop-actions { width: 100%; grid-template-columns: 1fr; margin: 24px 0 18px; }
  .drop-actions .button { width: 100%; }
  .trust-strip { margin-top: 25px; gap: 8px; line-height: 1.5; }
  .trust-strip > span:first-child { flex-basis: 100%; justify-content: center; }
  .editor-view { grid-template-rows: 50px 46px auto 40px minmax(0,1fr) 38px; }
  .app-header { gap: 7px; padding: 0 6px; }
  .brand.compact strong { display: none; }
  .file-name-input { width: 100%; font-size: 12px; }
  .header-actions .toolbar-divider, #newButton, #redoButton, #findButton, #feedbackButton, .compact-select { display: none; }
  .command-bar { padding-left: 6px; }
  .formula-bar { grid-template-columns: 58px 32px minmax(0,1fr); }
  .sheet-tab { min-width: 72px; }
  .status-area .local-status, #dimensionsText { display: none; }
  .status-area { padding-right: 6px; }
  .modal-card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Public-beta utility controls */
.install-button { white-space: nowrap; }
.text-link-button { padding: 0; border: 0; background: transparent; color: inherit; text-decoration: underline; font-size: inherit; }
.text-link-button:hover { color: var(--accent); }
.footer-utility-button { flex: 0 0 auto; height: 28px; margin-right: 8px; padding: 0 8px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 9px; }
.footer-utility-button:hover { border-color: var(--border); background: #fff; color: var(--text); }
.footer-utility-button svg { width: 12px; height: 12px; }

@media (max-width: 700px) {
  .install-button { width: 36px; min-width: 36px; padding: 0; }
  .install-button span { display: none; }
  .footer-utility-button span { display: none; }
  .footer-utility-button { width: 28px; padding: 0; justify-content: center; }
}
