:root {
  --bg: #05070f;
  --surface: #0a0f1c;
  --card: rgba(16, 22, 40, 0.72);
  --text: #f5f7ff;
  --muted: #c5d0e0;
  --accent: #22d3ee;
  --accent-ink: #04222a;
  --violet: #a78bfa;
  --gold: #f5c542;
  --line: rgba(197, 208, 224, 0.16);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --warn: rgba(245, 197, 66, 0.12);
  --warn-line: rgba(245, 197, 66, 0.45);
  --font-display: "Syne", "Segoe UI", system-ui, sans-serif;
  --font-body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --r-input: 12px;
  --r-card: 18px;
  --r-hero: 24px;
  --space: 8px;
  color-scheme: dark;
}

html.theme-light {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --card: #ffffff;
  --text: #0b1220;
  --muted: #3d4f66;
  --accent: #0e7490;
  --accent-ink: #f5f7ff;
  --line: rgba(61, 79, 102, 0.16);
  --shadow: 0 14px 32px rgba(11, 18, 32, 0.08);
  --warn: #fff7df;
  --warn-line: rgba(161, 110, 16, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(34, 211, 238, 0.08), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(167, 139, 250, 0.07), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 1rem;
}
img, svg, input, select, textarea, button, a { max-width: 100%; }
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.03em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); margin: 0 0 12px; font-weight: 700; }
h2 { font-size: 1.45rem; margin: 0 0 16px; }
h3 { font-size: 1.15rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: 12px;
  z-index: 40;
}
.skip:focus { top: 12px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.topbar, main, .foot { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  min-height: 44px;
}
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.desk-nav, .desk-tools { display: flex; align-items: center; gap: 4px; }
.desk-nav { flex: 1; justify-content: center; gap: 2px; }
.desk-nav a, .drawer a {
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
}
.desk-nav a:hover, .drawer a:hover { color: var(--text); background: rgba(34, 211, 238, 0.08); }
.world-link {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex: 0 0 auto;
  max-width: none;
  font-size: 0.92rem;
}
.icon-btn, .menu-btn, .theme {
  min-width: 44px;
  min-height: 44px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
}
.theme {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  padding: 0 8px;
  font: inherit;
}
.mobile-tools { display: none; margin-left: auto; gap: 4px; }
.drawer {
  position: sticky;
  top: 64px;
  z-index: 25;
  width: min(1180px, calc(100% - 32px));
  margin: 8px auto 0;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.drawer nav { display: grid; }
.drawer[hidden] { display: none; }

main { padding: 28px 0 48px; }
.tool-intro, .work, .schedule-block { width: min(1120px, 100%); margin-left: auto; margin-right: auto; }
.crumbs { margin-bottom: 18px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: 0.92rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.kicker, .eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.lede, .action { color: var(--muted); max-width: 42rem; }
.action { color: var(--text); font-size: 1.05rem; margin-bottom: 8px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 48px 32px 32px;
  border-radius: var(--r-hero);
  border: 1px solid var(--line);
  background:
    radial-gradient(520px 180px at 12% 0%, rgba(34, 211, 238, 0.16), transparent 70%),
    radial-gradient(420px 200px at 92% 18%, rgba(167, 139, 250, 0.14), transparent 68%),
    linear-gradient(180deg, rgba(245, 197, 66, 0.05), transparent 28%),
    var(--surface);
  box-shadow: var(--shadow);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 247, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 247, 255, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 20% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}
html.theme-light .hero::before { opacity: 0.45; }
.hero > * { position: relative; }
@media (prefers-reduced-motion: no-preference) {
  .hero { animation: settle 900ms ease both; }
}
@keyframes settle { from { opacity: 0.72; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-hero);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.search-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.22); }
.search-bar input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
}
.search-bar input:focus { outline: none; }
.search-bar button, .btn, button, .preset {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.preset { flex: 0 0 auto; white-space: nowrap; }
.preset, .reset, .actions a.reset {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.chips a:hover { color: var(--text); border-color: rgba(34, 211, 238, 0.5); }

section { margin-top: 40px; }
.quick, .bento { display: grid; gap: 16px; }
.qcard, .bento-card, .panel, .result-card, .schedule-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.qcard {
  display: flex;
  gap: 12px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  min-height: 96px;
  transition: transform 180ms ease, border-color 180ms ease;
}
.qcard:hover { transform: translateY(-2px); border-color: rgba(34, 211, 238, 0.55); }
.qicon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid var(--line);
  flex: none;
}
.qcopy { display: grid; gap: 2px; }
.qcopy strong { font-family: var(--font-display); font-size: 1.05rem; }
.qcopy span, .qcat { color: var(--muted); }
.qcat { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.bento-card { padding: 18px 18px 14px; }
.bento-card p { color: var(--muted); }
.bento-card h3 a { color: var(--text); text-decoration: none; }
.bento-links { display: flex; flex-wrap: wrap; gap: 8px; }
.bento-links a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.bento-card[data-accent="violet"] { box-shadow: inset 3px 0 0 var(--violet), var(--shadow); }
.bento-card[data-accent="blue"] { box-shadow: inset 3px 0 0 #7dd3fc, var(--shadow); }
.bento-card[data-accent="gold"] { box-shadow: inset 3px 0 0 var(--gold), var(--shadow); }
.bento-card[data-accent="indigo"] { box-shadow: inset 3px 0 0 #818cf8, var(--shadow); }
.bento-card[data-accent="cyan"], .bento-card[data-accent="life"] { box-shadow: inset 3px 0 0 rgba(34, 211, 238, 0.7), var(--shadow); }
.soon {
  display: inline-flex;
  margin: 0 0 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 0.8rem;
}

.work { display: grid; gap: 16px; align-items: start; }
.panel { padding: 18px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .tool label { font-weight: 600; }
.field small, .meta, .trust-note { color: var(--muted); }
input, select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--r-input);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--text);
  font: inherit;
}
textarea { min-height: 120px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.presets { margin-bottom: 16px; }
.presets p { color: var(--muted); font-size: 0.92rem; }

.result-card { padding: 8px 4px 0; }
.panel .result-card { box-shadow: none; border: 0; background: transparent; padding: 0; }
.metric-label { margin: 0; color: var(--muted); font-size: 0.92rem; }
.metric-value {
  margin: 4px 0 16px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.metrics { display: grid; gap: 10px; margin: 0; }
.metrics div { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.metrics dt { color: var(--muted); }
.metrics dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.share { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: rgba(167, 139, 250, 0.35); margin: 4px 0 6px; }
.share span { display: block; background: var(--accent); }
.share-key { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.8rem; }
.quiet p:last-child { color: var(--muted); }
.bridge { margin-top: 16px; }
.qr svg { width: min(220px, 100%); height: auto; }

.schedule-block { margin-top: 24px; padding: 18px; }
.schedule-wrap { overflow-x: auto; max-height: 28rem; border: 1px solid var(--line); border-radius: 12px; }
table.schedule { width: 100%; border-collapse: collapse; min-width: 36rem; font-variant-numeric: tabular-nums; }
table.schedule th, table.schedule td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); }
table.schedule th:first-child, table.schedule td:first-child { text-align: left; }
table.schedule th { position: sticky; top: 0; background: var(--surface); font-weight: 600; }
details summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; margin-top: 12px; }

.banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-input);
  background: var(--warn);
  border: 1px solid var(--warn-line);
  color: var(--text);
}
.banner .ico { flex: none; color: var(--gold); margin-top: 2px; }
.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 20px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.trust span { color: var(--text); font-weight: 600; margin-right: 6px; }
.trust-note { flex-basis: 100%; }
.links { list-style: none; padding: 0; margin: 0; }
.catalog li, .links li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.meta {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}
.tool-row.off a { color: var(--muted); }

.foot {
  display: grid;
  gap: 20px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.foot-col { display: grid; gap: 6px; align-content: start; }
.foot-col h2 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text); }
.foot a { color: var(--muted); text-decoration: none; min-height: 32px; }
.legal { grid-column: 1 / -1; margin: 0; color: var(--text); }

@media (min-width: 768px) {
  .quick { grid-template-columns: 1fr 1fr; }
  .bento { grid-template-columns: 1fr 1fr; }
  .foot { grid-template-columns: 1.4fr repeat(4, 1fr); }
}
@media (min-width: 1024px) {
  .work { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .bento { grid-template-columns: 1.15fr 1fr 1fr; }
  .bento-card:first-child { grid-row: span 2; }
}
@media (max-width: 860px) {
  .desk-nav, .desk-tools { display: none; }
  .mobile-tools { display: flex; }
  .hero { padding: 28px 16px 20px; }
  .search-bar { padding-right: 6px; }
  .search-bar button { flex: 0 0 auto; max-width: none; }
  .actions .btn, .actions .reset { flex: 1; }
  .topbar, main, .foot, .drawer { width: min(100% - 24px, 1180px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
