:root {
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --border: #cbd5e1;
  --border-light: #e2e8f0;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #ecfdf5;
  --accent-border: #99f6e4;
  --danger: #b91c1c;
  --danger-border: #fecaca;
  --max-width: 1060px;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header, main, footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:hover { text-decoration: none; color: var(--accent); }

.brand::before {
  content: "";
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background-color: var(--accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15.5 14'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpolyline points='12 7 12 12 15.5 14'/%3E%3C/svg%3E") center / contain no-repeat;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.32rem 0.62rem;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
}

nav a:hover {
  color: var(--accent);
  background: var(--surface-alt);
  text-decoration: none;
}

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

h1 {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-size: 1.65rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.subtitle {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 0.96rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 0.9rem 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

main > .card:first-child {
  border-top: 4px solid var(--accent);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

.hero-card {
  background: linear-gradient(135deg, #ffffff 0%, var(--accent-soft) 100%);
  border-top: 4px solid var(--accent);
}

.pill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: #ffffff;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 680px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-card.featured {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
}

.tool-card {
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-border);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.tool-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.tool-card:hover h2 a {
  color: var(--accent);
}

.tool-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.86rem;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 0.75rem 0.9rem;
  margin-bottom: 0.85rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
input[type="time"],
input[type="date"],
select {
  width: 100%;
  height: 39px;
  padding: 0.42rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
}

input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.55rem 0;
  font-size: 0.92rem;
}

.inline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.35rem;
  align-items: center;
  margin: 0.35rem 0 0.75rem;
}

.btn-row, .btn-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
  align-items: center;
}

.btn-bar {
  justify-content: space-between;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  border-radius: 7px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s, border-color 0.14s;
}

button:hover, .btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

button.secondary:hover {
  background: var(--surface-alt);
}

button.danger-outline {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger-border);
}

button.danger-outline:hover {
  background: #fef2f2;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0.65rem 0;
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.42rem 0.48rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

th {
  background: var(--surface-alt);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.table-wrap input[data-field="label"] {
  min-width: 8.2rem;
}

.table-wrap input[type="time"] {
  min-width: 6.9rem;
  height: 34px;
  padding: 0.25rem 0.35rem;
  font-size: 0.88rem;
}

.table-wrap input[type="number"] {
  min-width: 4.3rem;
  height: 34px;
  padding: 0.25rem 0.42rem;
  font-size: 0.88rem;
}

.table-wrap .secondary {
  padding: 0.32rem 0.6rem;
  font-size: 0.8rem;
}

.cell-hhmm, .cell-dec {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.85rem 0 0.6rem;
}

@media (min-width: 700px) {
  .summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  }
}

.stat-box {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 9px;
  padding: 0.72rem 0.85rem;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.stat-value {
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 0.15rem;
  line-height: 1.2;
}

.stat-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.mix-bar-wrap {
  margin: 0.45rem 0 0.75rem;
}

.mix-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
}

.mix-reg { background: #0f766e; transition: width 0.2s; }
.mix-ot { background: #d97706; transition: width 0.2s; }
.mix-dt { background: #dc2626; transition: width 0.2s; }

.mix-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.mix-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.3rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.14rem 0.52rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-weight: 700;
}

.alert-banner {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  font-size: 0.92rem;
  color: #78350f;
}

.faq-item {
  border-top: 1px solid var(--border-light);
  padding: 0.75rem 0;
}

.faq-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
}

footer {
  border-top: 1px solid var(--border-light);
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 1.75rem;
  padding-bottom: 1.75rem;
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--accent);
}

.print-only {
  display: none;
}

/* Reserve fixed height when AdSense renders to prevent CLS layout shifts */
.ad-slot {
  min-height: 100px;
  margin: 1rem 0;
  border-radius: 8px;
}
.ad-slot:empty {
  display: none;
  min-height: 0;
  margin: 0;
}

@media print {
  header, nav, .btn-row, .btn-bar, .no-print, footer {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .print-header-box {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
  }
  .signature-line {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    font-size: 0.85rem;
    color: #334155;
  }
  .signature-line div {
    border-top: 1px solid #64748b;
    padding-top: 0.35rem;
  }
  body { background: #ffffff; }
  .card, main > .card:first-child {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}
