:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --primary: #0284c7;
  --primary-dark: #0369a1;
  --primary-soft: #f0f9ff;
  --teal: #0d9488;
  --teal-soft: #f0fdfa;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 28px -14px rgba(15, 23, 42, 0.14);
}
[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-soft: #1e293b;
  --border: #1f2937;
  --border-strong: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --primary: #38bdf8;
  --primary-dark: #7dd3fc;
  --primary-soft: rgba(56, 189, 248, 0.14);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, 0.14);
  --shadow: 0 14px 32px -14px rgba(0, 0, 0, 0.55);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 62px; padding: 8px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #0284c7, #0d9488);
  color: #fff; font-weight: 800; font-size: 0.95rem;
}
.header-right { display: flex; align-items: center; gap: 14px; }
.header-nav { display: flex; align-items: center; gap: 16px; font-size: 0.9rem; font-weight: 600; }
.header-nav a { color: var(--text-muted); }
.header-nav a:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  border: 1px solid var(--border); background: var(--surface-soft); color: var(--text);
  border-radius: 999px; padding: 6px 12px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}

.hero { padding: 34px 0 18px; }
.hero-eyebrow {
  display: inline-flex; padding: 5px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 0.8rem; font-weight: 700; margin-bottom: 12px;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(1.7rem, 3.6vw, 2.45rem); line-height: 1.18; letter-spacing: -0.025em; }
.accent {
  background: linear-gradient(135deg, #0284c7, #0d9488);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin: 0; max-width: 780px; color: var(--text-muted); font-size: 1rem; }
.pill-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill-nav a {
  padding: 7px 13px; border-radius: 999px; font-size: 0.83rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
}
.pill-nav a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pill-nav a.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.toolbar-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.preset-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-soft); color: var(--text-muted); font-size: 0.79rem; font-weight: 700; cursor: pointer;
}
.chip:hover { border-color: var(--primary); color: var(--primary-dark); }

.meta-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); }
input[type="text"], input[type="number"], input[type="time"], select {
  width: 100%; height: 39px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 0.9rem; font-weight: 600; font-family: inherit;
}

.tc-wrap { overflow-x: auto; }
table.timecard { width: 100%; border-collapse: collapse; min-width: 660px; }
table.timecard th, table.timecard td { padding: 9px 8px; border-bottom: 1px solid var(--border); text-align: left; }
table.timecard th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-light); background: var(--surface-soft); }
table.timecard td.day-name { font-weight: 800; width: 92px; }
table.timecard td.num-out { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.overnight-badge {
  display: inline-block; margin-left: 4px; padding: 2px 6px; border-radius: 6px;
  background: var(--primary-soft); color: var(--primary-dark); font-size: 0.68rem; font-weight: 700;
}
.clear-row-btn {
  border: 1px solid var(--border); background: transparent; color: var(--text-light);
  border-radius: 8px; padding: 4px 8px; cursor: pointer; font-size: 0.78rem;
}
.clear-row-btn:hover { border-color: #ef4444; color: #ef4444; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.kpi { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 13px; padding: 14px 15px; }
.kpi.primary { background: linear-gradient(135deg, var(--primary-soft), var(--teal-soft)); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.kpi-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-light); }
.kpi-val { font-size: 1.48rem; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.kpi.primary .kpi-val { color: var(--primary-dark); }
.kpi-sub { font-size: 0.77rem; color: var(--text-muted); }

.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface-soft); color: var(--text);
  font-size: 0.85rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn:hover { border-color: var(--primary); color: var(--primary-dark); }
.btn-primary { background: linear-gradient(135deg, #0284c7, #0d9488); border-color: transparent; color: #fff; }
.btn-primary:hover { color: #fff; filter: brightness(1.06); }
.toast { margin-top: 10px; padding: 9px 13px; border-radius: var(--radius-sm); background: var(--teal-soft); color: var(--teal); font-size: 0.84rem; font-weight: 700; }
.hidden { display: none !important; }

/* Converter Panels */
.conv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.big-result {
  margin-top: 14px; padding: 16px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-soft), var(--teal-soft));
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  font-size: 1.5rem; font-weight: 800; color: var(--primary-dark); font-variant-numeric: tabular-nums;
}
.ref-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.ref-item {
  display: flex; justify-content: space-between; padding: 8px 11px; border-radius: 9px;
  background: var(--surface-soft); border: 1px solid var(--border); font-size: 0.84rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.seo-section { margin-bottom: 20px; }
.prose-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.prose-card h2 { margin: 0 0 10px; font-size: 1.22rem; }
.prose-card p { color: var(--text-muted); margin: 0 0 10px; font-size: 0.94rem; }
.print-sign { display: none; margin-top: 22px; padding-top: 14px; border-top: 1px solid #cbd5e1; font-size: 0.86rem; }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0 36px; margin-top: 24px; color: var(--text-light); font-size: 0.84rem; text-align: center; }
.site-footer p { margin: 4px 0; }

@media (max-width: 820px) {
  .meta-grid, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conv-grid { grid-template-columns: 1fr; }
  .ref-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .container { padding: 0 14px; }
  .header-nav { display: none; }
  .kpi-val { font-size: 1.22rem; }
  .actions-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .site-header, .pill-nav, .toolbar-row, .actions-row, .seo-section, .site-footer, .clear-row-btn { display: none !important; }
  .print-sign { display: flex; justify-content: space-between; }
  body { background: #fff !important; color: #000 !important; }
  .card { box-shadow: none !important; border: 1px solid #cbd5e1; }
}
