/* =========================================
   DESIGN TOKENS
   ========================================= */
:root {
  color-scheme: light;

  /* Core palette — light */
  --bg:              #f5f6f4;
  --bg-soft:         #edf0ed;
  --surface:         #ffffff;
  --surface-raised:  #fafbfa;
  --surface-strong:  #f0f2f0;

  /* Text */
  --text:            #161a18;
  --text-secondary:  #434d49;
  --muted:           #6b7874;

  /* Brand */
  --primary:         #0a6b63;
  --primary-hover:   #085c55;
  --primary-soft:    #e0f0ee;
  --primary-xsoft:   #f0f8f7;

  /* Semantic */
  --result:          #0d7a56;
  --result-soft:     #e4f5ec;
  --notice:          #7a5c14;
  --notice-soft:     #fef9e7;
  --danger:          #b03a34;
  --danger-soft:     #fdf0ef;

  /* Borders */
  --border:          #e0e5e3;
  --border-mid:      #cdd5d1;
  --border-strong:   #b3bfbb;

  /* Shadow */
  --shadow-xs:       0 1px 3px rgba(14, 30, 26, 0.06), 0 1px 2px rgba(14, 30, 26, 0.04);
  --shadow-sm:       0 2px 8px rgba(14, 30, 26, 0.07), 0 1px 3px rgba(14, 30, 26, 0.05);
  --shadow:          0 4px 20px rgba(14, 30, 26, 0.08), 0 2px 8px rgba(14, 30, 26, 0.05);
  --shadow-lg:       0 8px 32px rgba(14, 30, 26, 0.10), 0 2px 10px rgba(14, 30, 26, 0.06);

  /* Shape */
  --radius:          10px;
  --radius-sm:       7px;
  --radius-xs:       5px;
  --radius-pill:     999px;

  /* Layout */
  --max:             1180px;
  --header-h:        58px;
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg:              #131917;
  --bg-soft:         #1a2120;
  --surface:         #1e2826;
  --surface-raised:  #222d2b;
  --surface-strong:  #283330;

  --text:            #eaf2f0;
  --text-secondary:  #b8c9c5;
  --muted:           #8fa39e;

  --primary:         #4ec8bb;
  --primary-hover:   #72d8cd;
  --primary-soft:    #122e2c;
  --primary-xsoft:   #0d2322;

  --result:          #5dd49a;
  --result-soft:     #102b1e;
  --notice:          #f2d06b;
  --notice-soft:     #2d2610;
  --danger:          #ff8a82;
  --danger-soft:     #2c1210;

  --border:          #2e3c39;
  --border-mid:      #3a4d49;
  --border-strong:   #4d6460;

  --shadow-xs:       0 1px 3px rgba(0,0,0, 0.22), 0 1px 2px rgba(0,0,0, 0.18);
  --shadow-sm:       0 2px 8px rgba(0,0,0, 0.26), 0 1px 3px rgba(0,0,0, 0.20);
  --shadow:          0 4px 20px rgba(0,0,0, 0.32), 0 2px 8px rgba(0,0,0, 0.22);
  --shadow-lg:       0 8px 32px rgba(0,0,0, 0.40), 0 2px 10px rgba(0,0,0, 0.28);
}

/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-width: 320px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--primary);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
  transition: color 0.14s ease, opacity 0.14s ease;
}

html[data-theme="dark"] a {
  color: var(--primary);
}

a:hover {
  opacity: 0.8;
  text-decoration-thickness: 0.14em;
}

button, input, select {
  font: inherit;
}

/* =========================================
   SKIP LINK
   ========================================= */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  padding: 0.55rem 0.9rem;
  font-weight: 650;
  transition: top 0.16s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* =========================================
   HEADER
   ========================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  height: 100%;
  padding: 0 1.25rem;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-size: 0.93rem;
  font-weight: 760;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  background: var(--primary);
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 38%, transparent);
}

html[data-theme="dark"] .brand-mark {
  color: #0a1a18;
}

.brand-mark svg {
  width: 1rem;
  height: 1rem;
}

/* Nav */
.site-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.15rem;
}

.site-nav a {
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--surface-strong);
  color: var(--text);
  opacity: 1;
}

.site-nav a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary);
}

html[data-theme="dark"] .site-nav a[aria-current="page"] {
  color: var(--primary);
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, var(--primary) 8%);
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  margin-left: 0.35rem;
}

.theme-toggle:hover {
  background: var(--primary-xsoft);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 16%, transparent);
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

html[data-theme="light"] .theme-toggle .lucide-moon,
html[data-theme="dark"] .theme-toggle .lucide-sun {
  display: none;
}

/* Focus styles */
.input:focus-visible,
.select:focus-visible,
.tool-button:focus-visible,
.theme-toggle:focus-visible,
a:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
}

/* =========================================
   LAYOUT
   ========================================= */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.main {
  padding-bottom: 4rem;
}

/* =========================================
   HERO
   ========================================= */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.56fr);
  gap: 2rem;
  align-items: center;
  padding: 2.25rem 0 1.5rem;
}

.hero-copy {
  align-self: center;
}

/* Eyebrow */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: var(--radius-pill);
  background: var(--primary-xsoft);
  color: var(--primary);
  padding: 0.28rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 720;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* Headings */
h1, h2, h3 {
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h1 {
  max-width: 800px;
  margin: 0;
  font-size: clamp(1.6rem, 2.65vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.022em;
}

h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  font-weight: 780;
}

h3 {
  margin: 1.4rem 0 0.45rem;
  font-size: 1rem;
  font-weight: 740;
}

.lead {
  max-width: 680px;
  margin: 0.85rem 0 0;
  color: var(--text-secondary);
  font-size: clamp(0.98rem, 1.4vw, 1.12rem);
  line-height: 1.65;
}

.updated-note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Hero visual */
.hero-visual {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  padding: 1.1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
}

.hero-visual-link {
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.hero-visual-link:hover {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--border));
  box-shadow: var(--shadow-lg);
  opacity: 1;
  transform: translateY(-1px);
}

.hero-visual-link:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent), var(--shadow);
  outline: none;
}

.workweek-visual {
  width: 100%;
  min-height: 240px;
}

.workweek-visual text {
  fill: var(--muted);
  font-size: 11.5px;
  font-weight: 620;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.workweek-visual .bar-regular {
  fill: var(--primary);
}

.workweek-visual .bar-overtime {
  fill: var(--result);
}

.workweek-visual .bar-muted {
  fill: var(--border-strong);
}

.workweek-visual .chart-eyebrow {
  fill: var(--muted);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.845rem;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb span {
  line-height: 1;
}

/* =========================================
   CALCULATOR CARD
   ========================================= */
.calculator-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(272px, 0.78fr);
  gap: 0;
  margin: 1.25rem 0 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.calculator-form {
  display: grid;
  gap: 1.1rem;
  padding: 1.4rem;
  border-right: 1px solid var(--border);
}

.calculator-form > div:first-child h2 {
  margin-bottom: 0.25rem;
}

.calculator-form > div:first-child p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.calculator-mode-shell {
  display: grid;
  gap: 0.8rem;
  margin: 1.25rem 0 2rem;
}

.calculator-mode-shell .calculator-card {
  margin: 0;
}

.calculator-mode-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
}

.calculator-mode-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.calculator-mode-tabs {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 0.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.22rem;
  box-shadow: var(--shadow-xs);
}

.calculator-mode-tab {
  min-width: 128px;
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  padding: 0.45rem 0.78rem;
  font-size: 0.875rem;
  font-weight: 720;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.calculator-mode-tab:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.calculator-mode-tab[aria-selected="true"] {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 28%, transparent);
}

html[data-theme="dark"] .calculator-mode-tab[aria-selected="true"] {
  color: #071514;
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.form-field {
  display: grid;
  gap: 0.32rem;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.835rem;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.field-help {
  color: var(--muted);
  font-size: 0.795rem;
  line-height: 1.45;
}

/* Inputs */
.input,
.select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  padding: 0.55rem 0.72rem;
  font-size: 0.915rem;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  appearance: none;
  -webkit-appearance: none;
}

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7874' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2rem;
}

.input:hover,
.select:hover {
  border-color: var(--border-strong);
}

.input:focus,
.select:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
  outline: none;
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.form-message {
  min-height: 1.25rem;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 620;
}

/* Action buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tool-button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 38px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0.46rem 0.85rem;
  font-size: 0.855rem;
  font-weight: 660;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.tool-button:hover,
.download-link:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.tool-button.primary,
.download-link.primary {
  border-color: transparent;
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 32%, transparent);
}

html[data-theme="dark"] .tool-button.primary,
html[data-theme="dark"] .download-link.primary {
  color: #071514;
  font-weight: 720;
}

.tool-button.primary:hover,
.download-link.primary:hover {
  background: var(--primary-hover);
  border-color: transparent;
  box-shadow: 0 3px 12px color-mix(in srgb, var(--primary) 42%, transparent);
}

.tool-button svg,
.download-link svg {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
}

/* =========================================
   RESULTS PANEL
   ========================================= */
.results-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-soft);
  padding: 1.1rem;
}

.results-panel-label {
  font-size: 0.76rem;
  font-weight: 720;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.results-panel [data-results] {
  display: grid;
  gap: 0.6rem;
}

.result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.8rem 0.95rem;
  transition: box-shadow 0.14s ease, border-color 0.14s ease;
}

.result-card:hover {
  box-shadow: var(--shadow-xs);
}

.result-card.highlight {
  border-color: color-mix(in srgb, var(--result) 40%, var(--border));
  background: var(--result-soft);
}

.result-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.result-value {
  margin-top: 0.28rem;
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 740;
  letter-spacing: -0.018em;
  word-break: break-word;
  line-height: 1.22;
}

/* Daily hours list — smaller, line-height for readability */
.result-value.result-value--list {
  font-size: 0.875rem;
  font-weight: 520;
  letter-spacing: 0;
  color: var(--text-secondary);
  line-height: 1.75;
}

.result-card.highlight .result-value {
  color: var(--result);
  font-weight: 780;
}

.result-note {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.result-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.result-table th,
.result-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0.75rem;
  vertical-align: top;
}

.result-table thead th {
  color: var(--muted);
  background: var(--bg-soft);
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.result-table tr:last-child th,
.result-table tr:last-child td {
  border-bottom: none;
}

.result-row.highlight th,
.result-row.highlight td {
  background: var(--result-soft);
}

.result-table .result-label {
  width: 42%;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  text-align: left;
  text-transform: none;
}

.result-table .result-value {
  margin-top: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 740;
  letter-spacing: 0;
  line-height: 1.35;
  word-break: break-word;
}

.result-row.highlight .result-value {
  color: var(--result);
  font-weight: 780;
}

.result-table .result-note {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

/* =========================================
   TIMESHEET
   ========================================= */
.timesheet-card-shell {
  display: grid;
  gap: 0.7rem;
  grid-column: 1 / -1;
}

.timesheet-meta {
  display: grid;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  padding: 0.65rem;
}

.timesheet-meta label {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
}

.timesheet-meta .input,
.timesheet-card-title .input {
  min-height: 34px;
  padding: 0.4rem 0.55rem;
}

.timesheet-time-card,
.timesheet-options {
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  overflow: hidden;
}

.timesheet-card-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--primary);
  color: #ffffff;
  padding: 0.45rem 0.55rem;
}

html[data-theme="dark"] .timesheet-card-title {
  color: #071514;
}

.timesheet-card-title strong {
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
}

.timesheet-card-title .input {
  max-width: 240px;
  border-color: color-mix(in srgb, var(--primary) 35%, #ffffff);
  background: #ffffff;
  color: #1f2933;
}

.timesheet-entry-wrap,
.timesheet-result-table-wrap {
  overflow-x: auto;
}

.timesheet-result-table-wrap {
  border-bottom: 1px solid var(--border-mid);
}

.timesheet-entry-hint {
  margin: 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding: 0.55rem 0.65rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.timesheet-entry-table,
.timesheet-result-table,
.timesheet-weekly-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.timesheet-entry-table th,
.timesheet-entry-table td,
.timesheet-result-table th,
.timesheet-result-table td,
.timesheet-weekly-table th,
.timesheet-weekly-table td {
  border: 1px solid var(--border-mid);
  padding: 0.38rem 0.45rem;
}

.timesheet-entry-table th {
  color: var(--text);
  background: var(--bg-soft);
  font-size: 0.86rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: none;
  text-align: center;
}

.timesheet-entry-table tbody th {
  width: 64px;
  text-align: left;
  white-space: nowrap;
}

.timesheet-entry-table td {
  vertical-align: middle;
}

.timesheet-time-input {
  min-width: 74px;
  min-height: 34px;
  padding: 0.34rem 0.45rem;
  text-align: center;
}

.timesheet-break-input {
  min-width: 70px;
  min-height: 34px;
  padding: 0.34rem 0.45rem;
  text-align: center;
}

.timesheet-period-select {
  min-width: 68px;
  min-height: 34px;
  padding: 0.34rem 1.45rem 0.34rem 0.45rem;
  background-position: right 0.42rem center;
}

.timesheet-options {
  display: grid;
  gap: 0.5rem;
  padding: 0.65rem;
}

.timesheet-options-title {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 780;
}

.timesheet-options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.timesheet-option-field {
  display: grid;
  gap: 0.3rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 680;
}

.timesheet-money-input,
.timesheet-unit-input {
  display: grid;
  grid-template-columns: auto minmax(70px, 1fr) auto;
  align-items: center;
  gap: 0.25rem;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 620;
}

.timesheet-money-input .input,
.timesheet-unit-input .input,
.timesheet-option-field .select {
  min-height: 36px;
  padding-top: 0.42rem;
  padding-bottom: 0.42rem;
}

.timesheet-result {
  display: grid;
  gap: 0.7rem;
}

.timesheet-report-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: var(--radius-xs);
  background: var(--text-secondary);
  color: var(--bg);
  padding: 0.25rem 0.45rem;
}

.timesheet-report-title {
  font-size: 0.95rem;
  font-weight: 780;
}

.timesheet-report-note {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-size: 0.84rem;
  font-weight: 650;
}

.timesheet-result-meta {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  padding: 0.55rem 0.65rem;
}

.timesheet-meta-result-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 0.5rem;
  align-items: baseline;
}

.timesheet-meta-result-row dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 740;
  text-transform: uppercase;
}

.timesheet-meta-result-row dd {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.timesheet-weekly-title {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 780;
}

.timesheet-result-table th,
.timesheet-weekly-table th {
  color: var(--text);
  background: var(--bg-soft);
  font-size: 0.82rem;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: none;
}

.timesheet-result-table td,
.timesheet-weekly-table td {
  color: var(--text-secondary);
  font-size: 0.86rem;
  text-align: right;
  white-space: nowrap;
}

.timesheet-result-table tbody th,
.timesheet-weekly-table tbody th {
  text-align: left;
  white-space: nowrap;
}

.timesheet-total-row th,
.timesheet-total-row td,
.timesheet-weekly-table tbody tr:last-child th,
.timesheet-weekly-table tbody tr:last-child td {
  color: var(--text);
  background: var(--result-soft);
  font-weight: 760;
}

/* =========================================
   CONTENT STACK
   ========================================= */
.content-stack {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.calculator-card,
.content-section,
.sources-box,
.related-box,
.disclaimer-box,
.download-panel,
.faq-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.content-section,
.sources-box,
.related-box,
.disclaimer-box,
.download-panel,
.faq-block {
  padding: clamp(1.1rem, 2.2vw, 1.5rem);
}

/* Content paragraphs */
.content-section p,
.sources-box p,
.related-box p,
.disclaimer-box p,
.faq-block p,
.download-panel p {
  margin: 0.75rem 0 0;
  color: var(--text-secondary);
  font-size: 0.945rem;
  line-height: 1.7;
}

.content-section p:first-of-type,
.sources-box p:first-of-type,
.related-box p:first-of-type,
.disclaimer-box p:first-of-type {
  margin-top: 0;
}

/* Lists in content */
.content-section ul,
.related-list,
.sources-list,
.faq-list {
  margin: 0.85rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-secondary);
  font-size: 0.945rem;
}

.content-section li,
.related-list li,
.sources-list li,
.faq-list li {
  margin: 0.4rem 0;
  line-height: 1.6;
}

/* Calculator hub */
.calculator-hub {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}

.section-heading {
  max-width: 760px;
}

.section-heading p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.945rem;
  line-height: 1.65;
}

.calculator-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.calculator-hub-card {
  display: grid;
  gap: 0.55rem;
  min-height: 196px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 1rem;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.calculator-hub-card:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: var(--shadow);
  opacity: 1;
  transform: translateY(-1px);
}

.calculator-hub-label {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 730;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.calculator-hub-title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.25;
}

.calculator-hub-copy {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
}

.calculator-hub-action {
  align-self: end;
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 710;
}

/* Formula block */
.formula-block,
.example-block,
.rate-table-wrap {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  padding: 1rem;
}

.formula-block {
  position: relative;
}

.formula-block pre {
  overflow-x: auto;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-wrap;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", ui-monospace, monospace;
}

.copy-formula {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  min-height: 28px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--muted);
  padding: 0.22rem 0.55rem;
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease;
}

.copy-formula:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.example-block {
  border-left: 3px solid var(--primary);
  background: var(--primary-xsoft);
  color: var(--text-secondary);
  font-size: 0.93rem;
}

.example-block strong {
  color: var(--text);
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg-soft);
}

td {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

tr:last-child td {
  border-bottom: none;
}

/* Download panel */
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

/* Notice / disclaimer */
.notice {
  border-left: 3px solid color-mix(in srgb, var(--notice) 70%, transparent);
  background: var(--notice-soft);
}

.notice h2,
.notice p {
  color: var(--notice);
}

html[data-theme="dark"] .notice h2,
html[data-theme="dark"] .notice p {
  color: var(--notice);
}

/* =========================================
   RELATED BOX
   ========================================= */
.related-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem 1.2rem;
  padding-left: 0;
  list-style: none;
  margin-top: 0.9rem;
}

.related-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 0.13s ease;
}

.related-list a:hover {
  color: var(--primary);
  opacity: 1;
}

.related-list a::before {
  content: "";
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
  transition: background 0.13s ease;
}

.related-list a:hover::before {
  background: var(--primary);
}

/* =========================================
   SOURCES BOX
   ========================================= */
.sources-list {
  padding-left: 0;
  list-style: none;
  margin-top: 0.9rem;
}

.sources-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.sources-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sources-list a {
  font-weight: 650;
}

/* =========================================
   FAQ
   ========================================= */
.faq-list {
  display: grid;
  gap: 0;
  padding-left: 0;
  list-style: none;
  margin-top: 0.9rem;
}

.faq-list li {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

.faq-list li:last-child {
  border-bottom: 1px solid var(--border);
}

.faq-list h3 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.faq-list p {
  margin-top: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.905rem;
}

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 1rem;
}

.footer-inner {
  display: grid;
  gap: 1.1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.6rem 1.25rem;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  column-gap: 0;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.15rem 0.65rem 0.15rem 0;
  transition: color 0.13s ease;
}

.footer-links a:hover {
  color: var(--text);
  opacity: 1;
}

.footer-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-note {
  color: var(--muted);
  font-size: 0.845rem;
  line-height: 1.55;
  max-width: 640px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.footer-brand-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.9rem;
}

.footer-legal-links a {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.13s ease;
}

.footer-legal-links a:hover {
  color: var(--text);
  opacity: 1;
}

html[data-theme="dark"] .footer-brand-mark {
  color: #071514;
}

.footer-brand-mark svg {
  width: 0.75rem;
  height: 0.75rem;
}

.print-calculator-root {
  display: none;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 960px) {
  .header-inner {
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    height: auto;
  }

  .site-header {
    height: auto;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 0.15rem;
  }

  .hero,
  .calculator-card {
    grid-template-columns: 1fr;
  }

  .calculator-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calculator-form {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .hero-visual {
    order: -1;
    max-width: 420px;
  }

  .timesheet-options-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-inner,
  .container,
  .footer-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .site-nav a,
  .theme-toggle {
    justify-content: center;
    min-height: 40px;
    text-align: center;
  }

  .theme-toggle {
    justify-self: center;
    margin-left: 0;
  }

  .hero {
    padding-top: 1.25rem;
  }

  .calculator-mode-bar {
    align-items: center;
  }

  .calculator-mode-tabs {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .calculator-mode-tab {
    min-width: 0;
    width: 100%;
  }

  .hero-visual {
    display: none;
  }

  .form-grid,
  .calculator-hub-grid,
  .related-list {
    grid-template-columns: 1fr;
  }

  .result-value {
    font-size: 1.2rem;
  }

  .result-table .result-value {
    font-size: 0.95rem;
  }

  .timesheet-meta label {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .timesheet-card-title {
    align-items: stretch;
    flex-direction: column;
  }

  .footer-top {
    flex-direction: column;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* =========================================
   PRINT
   ========================================= */
@media print {
  body.printing-calculator > :not(.print-calculator-root) {
    display: none !important;
  }

  body.printing-calculator .print-calculator-root {
    display: block;
  }

  body.printing-calculator .print-calculator-root .calculator-card {
    margin: 0;
    overflow: visible;
  }

  body.printing-calculator .print-calculator-root .actions {
    display: none;
  }

  .site-header,
  .site-footer,
  .actions,
  .copy-formula,
  .breadcrumb {
    display: none;
  }

  body {
    background: #fff;
    color: #111;
  }

  .calculator-card,
  .content-section,
  .sources-box,
  .related-box,
  .disclaimer-box,
  .download-panel,
  .faq-block {
    box-shadow: none;
    border-color: #ddd;
  }
}
