:root {
  --ink: #111315;
  --ink-2: #1b1e21;
  --ink-3: #25292d;
  --paper: #f5f1e9;
  --paper-2: #fffdf8;
  --white: #ffffff;
  --orange: #ff5a2a;
  --orange-dark: #e84417;
  --muted: #6d706f;
  --muted-light: #a8aaa8;
  --line: rgba(17, 19, 21, 0.12);
  --line-dark: rgba(255, 255, 255, 0.1);
  --green: #648560;
  --red: #b8453a;
  --amber: #a56b13;
  --shadow: 0 18px 55px rgba(22, 20, 16, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 260px;
  --topbar: 76px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }

h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, .serif { font-family: "DM Serif Display", Georgia, serif; font-weight: 400; }
h1 { font-size: clamp(2.4rem, 6vw, 5.2rem); line-height: .98; letter-spacing: -.035em; }
h2 { font-size: clamp(1.85rem, 3vw, 2.7rem); line-height: 1.08; letter-spacing: -.02em; }
h3 { line-height: 1.25; }
small { font-size: 12px; }

.loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-content: center; grid-template-columns: auto auto; align-items: center; gap: 14px;
  background: var(--ink); color: white;
}
.loading-screen .brand-mark { animation: pulse 1.4s ease-in-out infinite; }
.loading-screen div:last-child { display: grid; }
.loading-screen span { color: var(--muted-light); font-size: 12px; margin-top: 3px; }
@keyframes pulse { 50% { transform: scale(.94); opacity: .72; } }

.brand-mark {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--orange); color: white; display: grid; place-items: center;
  font-weight: 800; letter-spacing: -.04em; flex: 0 0 auto;
}
.brand-lockup { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-lockup > span:last-child { display: grid; line-height: 1.15; }
.brand-lockup strong { font-size: 17px; }
.brand-lockup small { margin-top: 4px; color: var(--muted-light); }
.brand-lockup.compact .brand-mark { width: 38px; height: 38px; }

.auth-view { min-height: 100vh; display: grid; grid-template-columns: 1.25fr .75fr; }
.auth-brand-panel {
  min-height: 100vh; padding: 52px;
  color: white; background:
    radial-gradient(circle at 72% 18%, rgba(255,90,42,.25), transparent 26%),
    radial-gradient(circle at 20% 78%, rgba(255,255,255,.08), transparent 28%),
    var(--ink);
  position: relative; overflow: hidden;
}
.auth-brand-panel::after {
  content: ""; position: absolute; width: 480px; height: 480px; right: -130px; bottom: -220px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.02);
}
.auth-brand-content { max-width: 850px; margin: auto; min-height: calc(100vh - 104px); display: flex; flex-direction: column; position: relative; z-index: 1; }
.auth-copy { margin: auto 0 54px; max-width: 760px; }
.auth-copy h1 { margin: 18px 0 24px; }
.auth-copy p { color: #c8c9c7; max-width: 620px; font-size: 17px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .15em; font-size: 11px; font-weight: 800; color: #ff9c7e; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
.auth-preview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-dark); border: 1px solid var(--line-dark); }
.auth-preview-grid article { background: rgba(17,19,21,.82); padding: 22px 18px; min-height: 135px; display: flex; flex-direction: column; }
.auth-preview-grid span { color: var(--orange); font-weight: 800; font-size: 11px; }
.auth-preview-grid b { margin-top: auto; }
.auth-preview-grid small { color: var(--muted-light); margin-top: 6px; line-height: 1.45; }
.auth-form-panel { display: grid; place-items: center; padding: 42px; background: var(--paper); }
.auth-card { width: min(100%, 430px); }
.auth-mobile-brand { display: none; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 5px; background: rgba(17,19,21,.06); border-radius: 12px; margin-bottom: 30px; }
.auth-tab { border: 0; background: transparent; padding: 11px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.auth-tab.active { background: white; color: var(--ink); box-shadow: 0 3px 10px rgba(0,0,0,.07); }
.auth-form header { margin-bottom: 26px; }
.auth-form h2 { margin-bottom: 8px; }
.auth-form header p { color: var(--muted); }
.auth-form .field { margin-bottom: 15px; }
.form-message { min-height: 22px; margin: 12px 0 0; font-size: 13px; color: var(--red); }
.align-right { margin-left: auto; display: block; margin-top: -3px; margin-bottom: 16px; }

.field { display: grid; gap: 7px; }
.field > span, .field-label { font-weight: 700; font-size: 13px; }
.field small, .helper { color: var(--muted); font-size: 12px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink);
  border-radius: var(--radius-sm); padding: 12px 13px; outline: none; transition: .18s border, .18s box-shadow, .18s background;
}
input:focus, select:focus, textarea:focus { border-color: rgba(255,90,42,.75); box-shadow: 0 0 0 4px rgba(255,90,42,.1); background: white; }
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--orange); }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-prefix input { padding-left: 40px; }

.btn {
  border: 0; border-radius: 11px; padding: 12px 17px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .18s, background .18s, color .18s, opacity .18s, box-shadow .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.btn-primary { color: white; background: var(--orange); box-shadow: 0 10px 25px rgba(255,90,42,.2); }
.btn-primary:hover { background: var(--orange-dark); }
.btn-dark { background: var(--ink); color: white; }
.btn-light { background: white; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: #fff2ef; color: var(--red); border: 1px solid #f0cbc5; }
.btn-small { padding: 9px 12px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }
.link-button { border: 0; background: transparent; color: var(--orange-dark); padding: 0; font-size: 13px; font-weight: 700; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); background: white; border-radius: 10px; }
.icon-text-button { width: 100%; border: 0; background: transparent; color: #ddd; text-align: left; padding: 10px 0; display: flex; gap: 9px; align-items: center; }

.app-view { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 50; background: var(--ink); color: white;
  display: flex; flex-direction: column; padding: 24px 18px;
}
.sidebar-head { padding: 0 8px 25px; border-bottom: 1px solid var(--line-dark); }
.desktop-nav { padding: 22px 0; display: grid; gap: 6px; }
.nav-item {
  border: 0; background: transparent; color: #bfc1bf; display: flex; align-items: center; gap: 12px; padding: 12px 13px;
  border-radius: 11px; text-align: left; font-weight: 650;
}
.nav-item .nav-icon { width: 22px; display: grid; place-items: center; opacity: .9; }
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: var(--orange); color: white; }
.sidebar-foot { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--line-dark); }
.user-mini { display: flex; gap: 10px; align-items: center; min-width: 0; margin-bottom: 11px; }
.user-mini > div { display: grid; min-width: 0; }
.user-mini small { color: #8e9290; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-avatar { width: 38px; height: 38px; border: 0; border-radius: 50%; display: grid; place-items: center; background: #f6d4c9; color: var(--orange-dark); font-weight: 800; flex: 0 0 auto; }
.top-avatar { width: 36px; height: 36px; }
.app-main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar); display: flex; align-items: center; justify-content: space-between; gap: 15px;
  padding: 0 28px; background: rgba(245,241,233,.9); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px);
}
.topbar > div:first-of-type { display: grid; }
.topbar small { color: var(--muted); }
.topbar strong { font-size: 17px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.page-content { padding: 30px; max-width: 1540px; margin: 0 auto; outline: none; }
.mobile-nav, .mobile-drawer { display: none; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-header h1 { font-size: clamp(2rem, 4vw, 3.4rem); margin-bottom: 8px; }
.page-header p { margin: 0; color: var(--muted); max-width: 720px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

.hero-dashboard {
  border-radius: 26px; min-height: 300px; padding: clamp(28px, 5vw, 58px); color: white; overflow: hidden; position: relative;
  background: radial-gradient(circle at 78% 25%, rgba(255,90,42,.38), transparent 26%), var(--ink);
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
}
.hero-dashboard::before { content: ""; position: absolute; right: 8%; bottom: -155px; width: 350px; height: 350px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.02); }
.hero-dashboard > * { position: relative; z-index: 1; }
.hero-dashboard h1 { font-size: clamp(2.2rem, 4.7vw, 4.4rem); margin: 15px 0 18px; max-width: 780px; }
.hero-dashboard p { color: #c8cac8; max-width: 650px; }
.hero-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-card { min-height: 110px; padding: 16px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.055); color: white; border-radius: 14px; text-align: left; display: flex; flex-direction: column; }
.quick-card:hover { background: rgba(255,255,255,.1); }
.quick-card span { color: #ff9f82; font-size: 20px; }
.quick-card b { margin-top: auto; }
.quick-card small { color: #aeb1af; margin-top: 4px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0; }
.stat-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-height: 132px; display: flex; flex-direction: column; }
.stat-card .stat-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #fff0eb; color: var(--orange-dark); }
.stat-card strong { font-size: 28px; margin-top: auto; letter-spacing: -.04em; }
.stat-card small { color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
.panel { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel-dark { background: var(--ink-2); color: white; border-color: transparent; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.panel-title h3 { margin: 0; }
.panel-title p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.panel-dark .panel-title p { color: var(--muted-light); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar-left, .toolbar-right { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.search-box { min-width: min(330px, 100%); position: relative; }
.search-box input { padding-left: 40px; background: white; }
.search-box span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.segmented { display: inline-flex; gap: 3px; padding: 4px; background: rgba(17,19,21,.06); border-radius: 11px; }
.segmented button { border: 0; background: transparent; padding: 8px 11px; border-radius: 8px; color: var(--muted); font-weight: 700; font-size: 12px; }
.segmented button.active { color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(0,0,0,.06); }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.menu-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-height: 330px; }
.menu-image { height: 150px; background: #dfd8cc; overflow: hidden; position: relative; display: grid; place-items: center; color: var(--muted); }
.menu-image img { width: 100%; height: 100%; object-fit: cover; }
.menu-image .status-pill { position: absolute; top: 11px; right: 11px; }
.menu-card-body { padding: 18px; display: flex; flex-direction: column; flex: 1; }
.menu-card h3 { margin-bottom: 7px; }
.menu-card p { color: var(--muted); font-size: 13px; margin-bottom: 15px; }
.menu-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.menu-card-actions { margin-top: auto; display: grid; grid-template-columns: 1fr auto; gap: 8px; }

.badge, .status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; background: rgba(17,19,21,.06); color: var(--muted); }
.badge-orange { background: #fff0eb; color: var(--orange-dark); }
.badge-green { background: #edf5eb; color: var(--green); }
.badge-red { background: #fff0ee; color: var(--red); }
.badge-dark { background: rgba(255,255,255,.1); color: white; }

.empty-state { text-align: center; padding: 55px 25px; border: 1px dashed rgba(17,19,21,.22); border-radius: var(--radius); background: rgba(255,255,255,.35); }
.empty-state .empty-icon { width: 58px; height: 58px; border-radius: 17px; margin: 0 auto 16px; display: grid; place-items: center; background: #fff0eb; color: var(--orange); font-size: 24px; }
.empty-state h3 { margin-bottom: 7px; }
.empty-state p { color: var(--muted); max-width: 530px; margin: 0 auto 18px; }

.workspace { display: grid; grid-template-columns: minmax(0, .82fr) minmax(400px, 1.18fr); gap: 20px; align-items: start; }
.form-panel { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: calc(var(--topbar) + 18px); }
.result-panel { min-height: 500px; background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.check-card { border: 1px solid var(--line); border-radius: 11px; padding: 11px; display: flex; align-items: flex-start; gap: 9px; background: white; }
.check-card:has(input:checked) { border-color: var(--orange); background: #fff7f4; }
.form-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }

.result-empty { min-height: 440px; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 30px; }
.result-empty .orb { width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: radial-gradient(circle at 35% 28%, #ffbca7, var(--orange)); color: white; font-size: 26px; box-shadow: 0 18px 35px rgba(255,90,42,.22); }
.result-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.result-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin: 18px 0; }
.result-tab { border: 1px solid var(--line); background: white; color: var(--muted); border-radius: 999px; padding: 8px 12px; font-weight: 700; font-size: 12px; }
.result-tab.active { background: var(--ink); color: white; border-color: var(--ink); }
.result-section { margin-bottom: 18px; }
.result-section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; }
.result-section-title h4 { margin: 0; }
.editable-output { border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-height: 76px; white-space: pre-wrap; background: var(--paper-2); }
.hook-list { display: grid; gap: 9px; }
.hook-item { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.hook-item span:first-child { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: #fff0eb; color: var(--orange-dark); font-size: 11px; font-weight: 800; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f8f5ef; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
td input, td select { min-width: 100px; padding: 9px; background: white; }
.table-actions { display: flex; gap: 5px; }
.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.summary-item { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.summary-item span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.summary-item strong { font-size: 19px; }
.summary-item.highlight { background: var(--ink); color: white; border-color: var(--ink); }
.summary-item.highlight span { color: #aaa; }
.warning { border-left: 3px solid var(--amber); background: #fff8e8; padding: 12px 14px; border-radius: 0 10px 10px 0; color: #765016; font-size: 13px; margin-top: 12px; }
.error-box { border-left-color: var(--red); background: #fff1ef; color: #853d35; }
.success-box { border-left-color: var(--green); background: #eff6ed; color: #476344; }

.list { display: grid; gap: 10px; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); background: white; border-radius: 13px; padding: 14px; }
.list-item-main { min-width: 0; }
.list-item-main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-main small { color: var(--muted); }
.list-item-actions { display: flex; gap: 6px; flex: 0 0 auto; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(6,7,8,.64); display: grid; place-items: center; padding: 18px; backdrop-filter: blur(5px); }
.modal { width: min(720px, 100%); max-height: min(90vh, 900px); overflow: auto; background: var(--paper); border-radius: 22px; box-shadow: 0 35px 100px rgba(0,0,0,.35); }
.modal.wide { width: min(960px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; background: rgba(245,241,233,.94); backdrop-filter: blur(10px); padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 22px; }
.modal-foot { position: sticky; bottom: 0; background: rgba(245,241,233,.94); backdrop-filter: blur(10px); padding: 15px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; }
.close-button { border: 0; background: white; width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }

.onboarding { width: min(920px, 100%); }
.onboarding-progress { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; padding: 0 22px; margin-top: 18px; }
.onboarding-progress span { height: 4px; background: #ddd6ca; border-radius: 20px; }
.onboarding-progress span.active { background: var(--orange); }
.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.option-card { border: 1px solid var(--line); background: white; border-radius: 12px; padding: 13px; display: grid; gap: 4px; }
.option-card:has(input:checked) { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,90,42,.08); }

.toast-root { position: fixed; z-index: 500; right: 18px; bottom: 18px; display: grid; gap: 9px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 280px; max-width: 420px; background: var(--ink); color: white; padding: 13px 15px; border-radius: 12px; box-shadow: var(--shadow); display: flex; align-items: flex-start; gap: 10px; animation: toastIn .22s ease; }
.toast.success { border-left: 4px solid #8fb78b; }
.toast.error { border-left: 4px solid #e37467; }
.toast small { color: #b9bcba; display: block; margin-top: 2px; }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } }

.skeleton { position: relative; overflow: hidden; background: #e9e4da; border-radius: 8px; min-height: 18px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.loading-result { display: grid; gap: 13px; padding: 25px 0; }
.loading-result .skeleton:nth-child(1) { width: 35%; height: 28px; }
.loading-result .skeleton:nth-child(2) { width: 100%; height: 80px; }
.loading-result .skeleton:nth-child(3) { width: 88%; height: 16px; }
.loading-result .skeleton:nth-child(4) { width: 96%; height: 16px; }

.history-grid { display: grid; gap: 12px; }
.history-card { background: white; border: 1px solid var(--line); border-radius: 15px; padding: 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; }
.history-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #fff0eb; color: var(--orange-dark); }
.history-card p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.settings-grid { display: grid; grid-template-columns: .7fr 1.3fr; gap: 20px; }
.settings-nav { display: grid; gap: 6px; align-content: start; }
.settings-nav button { border: 0; background: transparent; text-align: left; padding: 11px 12px; border-radius: 10px; font-weight: 700; color: var(--muted); }
.settings-nav button.active { background: var(--ink); color: white; }
.danger-zone { border: 1px solid #efc4bd; background: #fff4f2; border-radius: 14px; padding: 18px; }

.photo-preview { height: 190px; border-radius: 13px; border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; background: #eee8dd; color: var(--muted); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 1180px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .workspace { grid-template-columns: 1fr; }
  .form-panel { position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --topbar: 66px; }
  .mobile-only { display: grid !important; }
  .auth-view { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { min-height: 100vh; padding: 25px; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
  .sidebar { display: none; }
  .app-main { margin-left: 0; padding-bottom: 78px; }
  .topbar { padding: 0 16px; }
  .topbar > div:first-of-type { margin-right: auto; }
  .topbar-actions .btn { display: none; }
  .page-content { padding: 20px 16px; }
  .mobile-nav { position: fixed; z-index: 60; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); height: 64px; display: grid; grid-template-columns: repeat(5,1fr); background: rgba(17,19,21,.96); color: white; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; padding: 6px; box-shadow: 0 18px 55px rgba(0,0,0,.3); backdrop-filter: blur(16px); }
  .mobile-nav button { border: 0; background: transparent; color: #aeb1af; border-radius: 12px; display: grid; place-items: center; gap: 2px; font-size: 10px; }
  .mobile-nav button span { font-size: 18px; line-height: 1; }
  .mobile-nav button.active { color: white; background: var(--orange); }
  .mobile-drawer { position: fixed; z-index: 80; inset: 0; display: none; background: rgba(0,0,0,.5); }
  .mobile-drawer.open { display: block; }
  .mobile-drawer-panel { width: min(330px, 88vw); height: 100%; background: var(--ink); color: white; padding: 22px; animation: drawerIn .2s ease; }
  @keyframes drawerIn { from { transform: translateX(-100%); } }
  .mobile-drawer .desktop-nav { display: grid; }
  .hero-dashboard { grid-template-columns: 1fr; }
  .hero-dashboard h1 { font-size: clamp(2.1rem, 9vw, 3.6rem); }
  .dashboard-grid, .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  body { font-size: 14px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .btn { flex: 1; }
  .hero-dashboard { min-height: auto; padding: 28px 20px; }
  .hero-quick { grid-template-columns: 1fr 1fr; }
  .quick-card { min-height: 96px; padding: 13px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { min-height: 115px; padding: 15px; }
  .stat-card strong { font-size: 23px; }
  .card-grid { grid-template-columns: 1fr; }
  .form-grid, .summary-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .check-grid, .option-grid { grid-template-columns: 1fr; }
  .workspace { display: block; }
  .result-panel { margin-top: 15px; padding: 16px; min-height: 420px; }
  .form-panel { padding: 16px; }
  .toolbar { align-items: stretch; }
  .toolbar-left, .toolbar-right, .search-box { width: 100%; }
  .toolbar-right .btn { flex: 1; }
  .history-card { grid-template-columns: auto 1fr; }
  .history-card .list-item-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { border-radius: 22px 22px 0 0; max-height: 94vh; }
  .modal-body { padding: 18px; }
  .toast-root { left: 12px; right: 12px; bottom: 86px; }
  .toast { min-width: 0; width: 100%; }
}

@media print {
  .sidebar, .topbar, .mobile-nav, .page-header, .form-panel, .no-print, .toast-root { display: none !important; }
  .app-main { margin: 0; }
  .page-content { max-width: none; padding: 0; }
  .result-panel { border: 0; padding: 0; }
  body { background: white; }
}
