/* =========================================================
   YourReporto — "Ink & Paper" theme
   Warm paper backgrounds, midnight ink text, tangerine accent.
   ========================================================= */

:root {
  --bg: #FBF7F0;
  --bg-alt: #F4EEE3;
  --surface: #FFFFFF;
  --text: #1B1F3B;
  --muted: #5D6280;
  --line: #E7DFD1;
  --ink: #1B1F3B;
  --accent: #FF6B35;
  --accent-text: #C2410C;
  --accent-soft: #FFE8DC;
  --teal: #0F9F8F;
  --teal-soft: #D4F4EF;
  --shadow-sm: 0 1px 2px rgba(27, 31, 59, .06);
  --shadow: 0 1px 2px rgba(27, 31, 59, .05), 0 16px 40px -16px rgba(27, 31, 59, .22);
  --radius: 18px;
  --radius-sm: 12px;
  --font-head: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --header-h: 72px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0E1124;
  --bg-alt: #141833;
  --surface: #1A1F3F;
  --text: #ECE9F6;
  --muted: #A6AAC8;
  --line: #2B3160;
  --accent-text: #FF8F63;
  --accent-soft: #3A2622;
  --teal: #3DD6C4;
  --teal-soft: #123B3A;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 44px -18px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.container.narrow { width: min(820px, 100% - 40px); }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s, border-color .2s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--accent); color: #1B1F3B; box-shadow: 0 8px 20px -8px rgba(255, 107, 53, .7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -8px rgba(255, 107, 53, .8); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--text); }
.btn-lg { padding: 15px 26px; font-size: 16px; }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--accent-text); font-weight: 600; font-size: 14px; cursor: pointer; padding: 4px 0; }
.link-btn:hover { text-decoration: underline; }

.icon-btn {
  width: 42px; height: 42px; display: inline-grid; place-items: center;
  border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.icon-btn:hover { border-color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 22px; font-weight: 500; }
.brand b { font-weight: 700; color: var(--accent-text); }
.logo-mark { width: 34px; height: 34px; flex: none; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav ul a { display: block; padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: 15px; color: var(--muted); transition: color .2s, background-color .2s; }
.main-nav ul a:hover { color: var(--text); background: var(--bg-alt); }
.main-nav ul a.active { color: var(--text); background: var(--accent-soft); }
.main-nav .nav-mobile-cta { display: none; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }

.menu-toggle { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.menu-toggle span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .3s, opacity .3s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Generic sections ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); }
.section-head p { color: var(--muted); font-size: 17px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-text); background: var(--accent-soft);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(255, 107, 53, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 107, 53, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 107, 53, 0); } }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 96px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 20%, transparent 70%);
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(38px, 5.6vw, 64px); font-weight: 700; margin-bottom: 22px; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--accent-text); }
.marker { background: linear-gradient(transparent 62%, var(--teal-soft) 62%, var(--teal-soft) 92%, transparent 92%); padding: 0 4px; }
.lead { font-size: 18px; color: var(--muted); max-width: 560px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 26px; }
.hero-points { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 0; margin: 0; font-size: 14px; color: var(--muted); }
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--teal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F9F8F' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 10px no-repeat; }

.hero-visual { position: relative; height: 440px; }
.paper { position: absolute; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.paper-back { inset: 40px 10px 10px 50px; transform: rotate(5deg); background: var(--accent-soft); border-color: transparent; }
.report-mock { inset: 20px 40px 30px 10px; padding: 26px; transform: rotate(-2deg); display: flex; flex-direction: column; gap: 20px; animation: floatY 6s ease-in-out infinite; }
@keyframes floatY { 50% { transform: rotate(-2deg) translateY(-8px); } }
.rm-head { display: flex; justify-content: space-between; align-items: flex-start; }
.rm-head small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rm-head strong { font-family: var(--font-head); font-size: 24px; }
.rm-badge { font-size: 12px; font-weight: 600; color: var(--teal); background: var(--teal-soft); padding: 4px 10px; border-radius: 999px; }
.rm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rm-stats div { background: var(--bg-alt); border-radius: 12px; padding: 12px; }
.rm-stats b { display: block; font-family: var(--font-head); font-size: 22px; }
.rm-stats span { font-size: 12px; color: var(--muted); }
.rm-chart { flex: 1; display: flex; align-items: flex-end; gap: 6px; min-height: 90px; }
.rm-chart i { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent), #FFA27D); transform-origin: bottom; animation: grow 1s cubic-bezier(.2, .8, .2, 1) both; }
.rm-chart i:nth-child(3n) { background: linear-gradient(180deg, var(--teal), #7FE3D6); }
.rm-chart i:nth-child(2) { animation-delay: .05s; } .rm-chart i:nth-child(3) { animation-delay: .1s; } .rm-chart i:nth-child(4) { animation-delay: .15s; }
.rm-chart i:nth-child(5) { animation-delay: .2s; } .rm-chart i:nth-child(6) { animation-delay: .25s; } .rm-chart i:nth-child(7) { animation-delay: .3s; }
.rm-chart i:nth-child(8) { animation-delay: .35s; } .rm-chart i:nth-child(9) { animation-delay: .4s; } .rm-chart i:nth-child(10) { animation-delay: .45s; }
.rm-chart i:nth-child(11) { animation-delay: .5s; } .rm-chart i:nth-child(12) { animation-delay: .55s; }
@keyframes grow { from { transform: scaleY(0); } }
.rm-lines { display: grid; gap: 8px; }
.rm-lines span { height: 8px; border-radius: 4px; background: var(--line); }
.rm-lines .short { width: 60%; }

.float-chip {
  position: absolute; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px;
  animation: floatY2 5s ease-in-out infinite;
}
.float-chip b { color: var(--teal); }
.chip-a { top: 0; right: 0; }
.chip-b { bottom: 0; left: -10px; animation-delay: -2.5s; }
.flame { width: 10px; height: 10px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); }
@keyframes floatY2 { 50% { transform: translateY(-10px); } }

/* ---------- Before / after ---------- */
.ba-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.ba-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.ba-before, .ba-after { padding: 20px 24px; }
.ba-before { border-bottom: 1px dashed var(--line); }
.ba-before p { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(194, 65, 12, .45); }
.ba-after p { font-weight: 500; }
.ba-card p { margin: 6px 0 0; }
.ba-tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ba-after .ba-tag { color: var(--teal); }

/* ---------- Features ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.feature-card h3 { font-size: 20px; margin: 18px 0 8px; }
.feature-card p { color: var(--muted); font-size: 15px; margin: 0; }
.f-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.feature-card:nth-child(even) .f-icon { background: var(--teal-soft); color: var(--teal); }
.f-icon svg { width: 24px; height: 24px; }

/* ---------- Steps (dark band) ---------- */
.section-ink { background: #1B1F3B; color: #ECE9F6; }
[data-theme="dark"] .section-ink { background: #080A18; }
.section-ink .eyebrow { background: rgba(255, 107, 53, .16); color: #FF9A70; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: s; }
.steps li { position: relative; padding: 32px 28px; border-radius: var(--radius); background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .1); }
.steps h3 { font-size: 24px; }
.steps p { color: #B6B9D3; margin: 0; }
.step-no { display: block; font-family: var(--font-head); font-size: 48px; font-weight: 700; line-height: 1; margin-bottom: 18px; color: transparent; -webkit-text-stroke: 1.5px #FF8F63; }

/* ---------- Live tool ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 20px; }
.tile span { display: block; font-size: 13px; color: var(--muted); }
.tile b { font-family: var(--font-head); font-size: 28px; }
.tile-accent { background: var(--accent-soft); border-color: transparent; }

.tool-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; }
.panel-head h3 { font-size: 22px; margin: 0; display: flex; align-items: center; gap: 10px; }
.num { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--ink); color: #fff; font-family: var(--font-body); font-size: 14px; }
[data-theme="dark"] .num { background: var(--accent); color: #1B1F3B; }

.panel label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.panel .opt { font-weight: 400; }
.panel input:not([type="radio"]), .panel select, .panel textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 15px; font-weight: 400;
  transition: border-color .2s, box-shadow .2s;
}
.panel textarea { resize: vertical; }
.panel input:focus, .panel select:focus, .panel textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.panel input[aria-invalid="true"] { border-color: #DC2626; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }

.seg { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.seg legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; padding: 0; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; transition: all .2s; }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
[data-theme="dark"] .seg input:checked + span { background: var(--accent); border-color: var(--accent); color: #1B1F3B; }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.wc-box { margin-bottom: 14px; border: 1.5px dashed var(--line); border-radius: 10px; padding: 10px 13px; }
.wc-box summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent-text); }
.wc-box textarea { margin-top: 10px; }
.wc-box small { display: block; margin-top: 6px; color: var(--muted); }

.entries-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 26px 0 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.entries-head h4 { margin: 0; font-size: 18px; }
.entries-head input { max-width: 200px; margin: 0 !important; padding: 8px 12px !important; }
.entry-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; }
.entry-list li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); animation: slideIn .35s ease both; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } }
.entry-date { flex: none; width: 46px; text-align: center; background: var(--bg-alt); border-radius: 10px; padding: 4px 0; line-height: 1.2; }
.entry-date b { display: block; font-family: var(--font-head); font-size: 18px; }
.entry-date span { font-size: 11px; text-transform: uppercase; color: var(--muted); }
.entry-body { flex: 1; min-width: 0; }
.entry-body strong { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-body small { color: var(--muted); font-size: 13px; }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); margin-left: 4px; }
.pill.warn { background: var(--accent-soft); color: var(--accent-text); }
.del-btn { flex: none; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; }
.del-btn:hover { color: #DC2626; background: rgba(220, 38, 38, .08); }
.del-btn svg { width: 16px; height: 16px; }
.empty { color: var(--muted); font-size: 14px; padding: 18px 4px; text-align: center; }

.period-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.period-tabs button { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s; }
.period-tabs button:hover { border-color: var(--text); }
.period-tabs button.active { background: var(--accent); border-color: var(--accent); color: #1B1F3B; font-weight: 600; }
.custom-range[hidden] { display: none; }

.tool-tip { display: flex; gap: 10px; margin-top: 18px; padding: 14px; border-radius: 12px; background: var(--teal-soft); font-size: 14px; }
.tool-tip svg { width: 20px; height: 20px; flex: none; color: var(--teal); margin-top: 2px; }
.tool-tip p { margin: 0; }

/* ---------- Generated report (always "paper" style) ---------- */
.report-area { margin-top: 32px; }
.report-area[hidden] { display: none; }
.report-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-bottom: 14px; }
.report {
  --r-ink: #1B1F3B; --r-muted: #5D6280; --r-line: #E7DFD1; --r-soft: #F7F2EA;
  background: #fff; color: var(--r-ink); border-radius: 20px; box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 48px); max-width: 900px; margin: 0 auto; animation: slideIn .45s ease both;
}
.r-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 22px; border-bottom: 3px solid var(--r-ink); }
.r-kicker { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #C2410C; }
.r-head h3 { font-size: clamp(24px, 3.4vw, 34px); margin: 6px 0; }
.r-head p { margin: 0; color: var(--r-muted); font-size: 14px; }
.r-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 700; font-size: 16px; white-space: nowrap; }
.r-brand .logo-mark { width: 26px; height: 26px; }
.r-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 26px 0; }
.r-stat { background: var(--r-soft); border-radius: 14px; padding: 14px 16px; }
.r-stat b { display: block; font-family: var(--font-head); font-size: 26px; line-height: 1.2; }
.r-stat span { font-size: 12px; color: var(--r-muted); text-transform: uppercase; letter-spacing: .06em; }
.report h4 { font-size: 18px; margin: 0 0 12px; }
.r-section { margin-bottom: 28px; break-inside: avoid; }
.r-summary p { font-size: 16px; line-height: 1.75; margin: 0; }
.r-summary { border-left: 4px solid #FF6B35; padding-left: 18px; }
.r-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 1.1fr) 2fr auto; gap: 10px; align-items: center; font-size: 14px; margin-bottom: 9px; }
.bar-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--r-soft); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: #FF6B35; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.r-cols section:last-child .bar-fill { background: #0F9F8F; }
.bar-val { font-variant-numeric: tabular-nums; color: var(--r-muted); font-size: 13px; }
.r-chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding: 10px 0 0; border-bottom: 1px solid var(--r-line); }
.r-chart i { flex: 1; min-height: 2px; background: #FF6B35; border-radius: 3px 3px 0 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.r-chart i.zero { background: var(--r-line); }
.r-chart-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--r-muted); margin-top: 6px; }
.r-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.r-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--r-muted); padding: 8px 10px; border-bottom: 2px solid var(--r-ink); }
.r-table td { padding: 9px 10px; border-bottom: 1px solid var(--r-line); vertical-align: top; }
.r-table td:first-child { white-space: nowrap; }
.r-table td.n, .r-table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.r-table tr { break-inside: avoid; }
.table-scroll { overflow-x: auto; }
.r-status { display: flex; flex-wrap: wrap; gap: 10px; }
.r-status span { background: var(--r-soft); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.r-foot { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--r-line); font-size: 12px; color: var(--r-muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.r-empty { text-align: center; padding: 30px 10px; color: var(--r-muted); }

/* ---------- Periods / audience ---------- */
.period-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.period-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; overflow: hidden; transition: transform .25s, box-shadow .25s; }
.period-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.period-idx { position: absolute; right: 18px; top: 8px; font-family: var(--font-head); font-size: 56px; font-weight: 700; color: var(--accent-soft); line-height: 1; }
.period-card h3 { font-size: 22px; position: relative; }
.period-card p { color: var(--muted); margin: 0; position: relative; }

.audience-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.aud-card { padding: 26px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(160deg, var(--surface), var(--bg-alt)); }
.aud-card h3 { font-size: 20px; }
.aud-card p { color: var(--muted); margin: 0; font-size: 15px; }

/* ---------- FAQ ---------- */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; padding: 0 22px; transition: box-shadow .2s; }
.faq details[open] { box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 30px 18px 0; font-weight: 600; font-size: 17px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--accent-text); transition: transform .25s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--muted); margin: 0 0 18px; }

/* ---------- CTA band ---------- */
.cta-band { padding: 0 0 96px; background: var(--bg-alt); }
.cta-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
  padding: 48px; border-radius: 28px; background: #1B1F3B; color: #fff; position: relative; overflow: hidden;
}
.cta-inner::after { content: ""; position: absolute; width: 320px; height: 320px; right: -80px; top: -120px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 107, 53, .45), transparent 70%); pointer-events: none; }
.cta-inner h2 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 6px; position: relative; }
.cta-inner p { margin: 0; color: #B6B9D3; position: relative; }
.cta-inner .btn { position: relative; z-index: 1; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 64px 0 28px; }
.footer-top { display: grid; grid-template-columns: 1.2fr 2fr; gap: 48px; }
.footer-brand p { color: var(--muted); font-size: 15px; margin: 16px 0 20px; max-width: 340px; }
.social-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.social-list a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1.5px solid var(--line); color: var(--muted); transition: all .2s; }
.social-list a:hover { color: #1B1F3B; background: var(--accent); border-color: var(--accent); transform: translateY(-3px); }
.social-list svg { width: 18px; height: 18px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-cols h4 { font-family: var(--font-body); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 14px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-cols a { font-size: 15px; transition: color .2s; word-break: break-word; }
.footer-cols a:hover { color: var(--accent-text); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.footer-bottom p { margin: 0; }

/* ---------- Floating UI ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 40;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .3s, transform .3s;
}
[data-theme="dark"] .to-top { background: var(--accent); color: #1B1F3B; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); z-index: 60;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; max-width: calc(100% - 40px);
}
[data-theme="dark"] .toast { background: #ECE9F6; color: #1B1F3B; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scroll reveal (only when JS is on) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .feature-grid, .audience-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .menu-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 16px 20px 24px; box-shadow: var(--shadow);
    transform: translateY(-12px); opacity: 0; visibility: hidden; transition: all .25s ease;
  }
  .main-nav.open { transform: none; opacity: 1; visibility: visible; }
  .main-nav ul { flex-direction: column; gap: 2px; }
  .main-nav ul a { padding: 12px 14px; font-size: 17px; border-radius: 12px; }
  .main-nav .nav-mobile-cta { display: flex; margin-top: 14px; }
  .hero { padding: 40px 0 72px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { height: 380px; max-width: 520px; width: 100%; margin: 0 auto; }
  .steps, .period-grid { grid-template-columns: 1fr; }
  .ba-grid { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr; gap: 36px; }
  .section { padding: 72px 0; }
  .r-stats { grid-template-columns: repeat(2, 1fr); }
  .r-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .container, .container.narrow { width: calc(100% - 28px); }
  .feature-grid, .audience-grid { grid-template-columns: 1fr; }
  .row-2, .row-3 { grid-template-columns: 1fr; gap: 0; }
  .panel { padding: 20px; }
  .hero-ctas .btn { width: 100%; }
  .hero-visual { height: 330px; }
  .report-mock { inset: 20px 16px 30px 6px; padding: 20px; }
  .chip-b { left: 0; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .cta-inner { padding: 32px 24px; }
  .cta-inner .btn { width: 100%; }
  .entries-head { flex-direction: column; align-items: stretch; }
  .entries-head input { max-width: none; }
  .r-head { flex-direction: column-reverse; }
  .report-actions { justify-content: stretch; }
  .report-actions .btn { flex: 1; }
  .brand { font-size: 20px; }
}


/* =========================================================
   v2 — editing, filters, exports, richer reports
   ========================================================= */
.goal-bar { height: 6px; border-radius: 4px; background: var(--line); margin-top: 8px; overflow: hidden; }
.goal-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width .5s ease; }
.goal-bar i.done { background: var(--teal); }

.panel.is-editing { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-sm); }
.edit-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 14px; }
.edit-banner[hidden] { display: none; }
.edit-banner svg { width: 18px; height: 18px; flex: none; color: var(--accent-text); margin-top: 2px; }
.form-actions { display: flex; gap: 10px; }
.form-actions .btn-primary { flex: 1; }
.form-actions [hidden] { display: none; }

.entries-head h4 small { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--muted); }
.entry-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.entry-filters select { margin: 0 !important; padding: 8px 10px !important; font-size: 14px !important; }
.entry-list li.editing { background: var(--accent-soft); border-radius: 12px; }
.entry-body small { display: block; }
.org-tag { font-weight: 600; color: var(--text); }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.entry-meta .pill { margin-left: 0; }
.entry-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--accent-text); }
.entry-link svg { width: 13px; height: 13px; }
.edited { font-size: 11px; color: var(--muted); font-style: italic; }
.entry-actions { display: flex; flex: none; gap: 2px; }
.entry-actions button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 7px; border-radius: 8px; transition: color .2s, background-color .2s; }
.entry-actions button:hover { color: var(--text); background: var(--bg-alt); }
.entry-actions button.del:hover { color: #DC2626; background: rgba(220, 38, 38, .08); }
.entry-actions svg { width: 16px; height: 16px; }
#showMore { margin-top: 10px; }
#showMore[hidden] { display: none; }

.data-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.chip-btn { padding: 7px 13px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--bg); font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color .2s, color .2s; }
.chip-btn:hover { border-color: var(--text); }
.chip-btn.danger:hover { border-color: #DC2626; color: #DC2626; }

.checks { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.checks legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; padding: 0; }
.checks label { margin: 0 !important; }
.checks input { position: absolute; opacity: 0; pointer-events: none; }
.checks span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: all .2s; }
.checks span::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid currentColor; }
.checks input:checked + span { color: var(--text); border-color: var(--teal); background: var(--teal-soft); }
.checks input:checked + span::before { background: var(--teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 10px no-repeat; border-color: var(--teal); }
.checks input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Export toolbar */
.export-bar { max-width: 900px; margin: 0 auto 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.export-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.export-head h3 { margin: 0; font-size: 20px; }
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.export-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); cursor: pointer; text-align: left; transition: transform .15s, border-color .2s, background-color .2s; }
.export-grid button:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.export-grid button b { font-size: 14px; }
.export-grid button span { font-size: 12px; color: var(--muted); }
.export-grid button[hidden] { display: none; }

/* Report additions */
.r-summary-body { outline: none; border-radius: 8px; transition: background-color .2s, box-shadow .2s; }
.r-summary-body:hover { background: #FFFBF6; }
.r-summary-body:focus { background: #FFF8F1; box-shadow: 0 0 0 3px #FFE8DC; }
.r-summary-body p { font-size: 16px; line-height: 1.75; margin: 0 0 12px; }
.r-summary-body p:last-child { margin-bottom: 0; }
.r-edit-hint { display: block; margin-top: 8px; font-size: 12px; color: var(--r-muted); }
.r-highlights { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.r-highlights li { position: relative; padding-left: 18px; font-size: 14.5px; }
.r-highlights li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: #FF6B35; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.r-table a { color: #C2410C; word-break: break-all; }
.r-table tr.r-total td { border-top: 2px solid var(--r-ink); border-bottom: 0; }
.r-next ul { margin: 0; padding-left: 18px; }
.r-next li { margin-bottom: 8px; font-size: 14.5px; }
.r-next .pill { margin-left: 6px; background: #FFE8DC; color: #C2410C; }
.r-next small { color: var(--r-muted); }

.toast { display: flex; align-items: center; gap: 14px; }
.toast.show { pointer-events: auto; }
.toast button { background: var(--accent); color: #1B1F3B; border: 0; border-radius: 8px; padding: 5px 12px; font-weight: 700; cursor: pointer; }

@media (max-width: 560px) {
  .entry-filters { grid-template-columns: 1fr; }
  .entry-list li { flex-wrap: wrap; }
  .entry-body { flex-basis: calc(100% - 60px); }
  .entry-actions { width: 100%; justify-content: flex-end; margin-top: -6px; }
  .export-grid { grid-template-columns: repeat(2, 1fr); }
  .r-highlights { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; }
  .checks span { font-size: 12.5px; }
}
@media print {
  .r-edit-hint, .export-bar { display: none !important; }
  .r-summary-body { background: none !important; box-shadow: none !important; }
}

/* ---------- Print: only the report ---------- */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; }
  body * { visibility: hidden; }
  #report, #report * { visibility: visible; }
  #report { position: absolute; left: 0; top: 0; width: 100%; max-width: none; box-shadow: none; padding: 0; border-radius: 0; animation: none; }
  .site-header, .to-top, .toast { display: none !important; }
}

/* Prevent form controls from overflowing narrow screens */
.row-2, .row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-3 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
.panel, .panel label, .tool-grid > * { min-width: 0; }
.panel input, .panel select, .panel textarea { min-width: 0; max-width: 100%; }
@media (max-width: 560px) {
  .row-2, .row-3 { grid-template-columns: minmax(0, 1fr); }
}
.checks input[type="checkbox"] { width: 1px !important; height: 1px !important; margin: 0 !important; padding: 0 !important; }
.checks label { position: relative; }

/* Always respect the hidden attribute */
[hidden] { display: none !important; }