:root {
  --tz-primary: #0284c7;
  --tz-primary-hover: #0369a1;
  --tz-bg-card: #ffffff;
  --tz-border: #e2e8f0;
  --tz-text-main: #0f172a;
  --tz-text-muted: #64748b;
  --tz-pill-bg: #f1f5f9;
  --tz-pill-hover: #e2e8f0;
  --tz-result-bg: #f8fafc;
  --tz-hl-bg: #e0f2fe;
  --tz-hl-border: #bae6fd;
  --tz-hl-text: #0369a1;
  --tz-work-bg: #dcfce7;
  --tz-work-text: #166534;
  --tz-ext-bg: #fef9c3;
  --tz-ext-text: #854d0e;
  --tz-sleep-bg: #f1f5f9;
  --tz-sleep-text: #94a3b8;
}

.tz-tool-container {
  max-width: 960px;
  margin: 0 auto 3rem auto;
  font-family: inherit;
  color: var(--tz-text-main);
}

.tz-editor-card {
  background: var(--tz-bg-card);
  border: 1px solid var(--tz-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tz-presets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--tz-border);
}

.tz-presets-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--tz-text-muted);
}

.tz-pill-btn {
  background: var(--tz-pill-bg);
  border: 1px solid var(--tz-border);
  color: var(--tz-text-main);
  border-radius: 9999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.tz-pill-btn:hover {
  background: var(--tz-pill-hover);
  border-color: var(--tz-primary);
}

.tz-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
  .tz-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

.tz-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--tz-text-main);
}

.tz-field select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--tz-border);
  border-radius: 8px;
  background: var(--tz-bg-card);
  color: var(--tz-text-main);
  font-size: 0.85rem;
  box-sizing: border-box;
}

.tz-field select:focus {
  outline: none;
  border-color: var(--tz-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.tz-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.tz-legend-tag {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tz-tag-work { color: #16a34a; }
.tz-tag-ext { color: #ca8a04; }
.tz-tag-sleep { color: #94a3b8; }

/* 24-Hour Matrix Table */
.tz-matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--tz-border);
  border-radius: 8px;
  background: var(--tz-bg-card);
}

.tz-matrix-table {
  min-width: 760px;
  display: flex;
  flex-direction: column;
}

.tz-matrix-row {
  display: flex;
  border-bottom: 1px solid var(--tz-border);
}

.tz-matrix-row:last-child {
  border-bottom: none;
}

.tz-city-label-col {
  width: 140px;
  min-width: 140px;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--tz-pill-bg);
  border-right: 1px solid var(--tz-border);
  display: flex;
  align-items: center;
  color: var(--tz-text-main);
}

.tz-hours-col {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(24, 1fr);
}

.tz-hour-cell {
  padding: 0.45rem 0;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  border-right: 1px solid var(--tz-border);
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease;
}

.tz-hour-cell:last-child {
  border-right: none;
}

.tz-hour-cell:hover {
  filter: brightness(0.95);
  transform: scaleY(1.05);
}

.tz-cell-work {
  background: var(--tz-work-bg);
  color: var(--tz-work-text);
}

.tz-cell-ext {
  background: var(--tz-ext-bg);
  color: var(--tz-ext-text);
}

.tz-cell-sleep {
  background: var(--tz-sleep-bg);
  color: var(--tz-sleep-text);
}

.tz-cell-selected {
  outline: 2px solid var(--tz-primary);
  outline-offset: -2px;
  font-weight: 900;
}

.tz-results-card {
  background: var(--tz-result-bg);
  border: 1px solid var(--tz-border);
  border-radius: 12px;
  padding: 1.75rem;
}

.tz-highlight-box {
  background: var(--tz-hl-bg);
  border: 1px solid var(--tz-hl-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.tz-hl-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--tz-hl-text);
  margin-bottom: 0.25rem;
  display: block;
}

.tz-hl-val {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--tz-hl-text);
  margin-bottom: 0.25rem;
}

.tz-hl-sub {
  font-size: 0.95rem;
  color: var(--tz-hl-text);
}

.tz-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .tz-specs-grid {
    grid-template-columns: 1fr;
  }
}

.tz-spec-item {
  background: var(--tz-bg-card);
  border: 1px solid var(--tz-border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tz-spec-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tz-text-muted);
}

.tz-spec-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--tz-text-main);
}

.tz-spec-sub {
  font-size: 0.75rem;
  color: var(--tz-text-muted);
}

.tz-table-card {
  background: var(--tz-bg-card);
  border: 1px solid var(--tz-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.tz-sub-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: var(--tz-text-main);
}

.tz-table-wrap {
  overflow-x: auto;
}

.tz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.tz-table th,
.tz-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--tz-border);
}

.tz-table th {
  background: var(--tz-pill-bg);
  font-weight: 700;
  color: var(--tz-text-muted);
}

.tz-tip-box {
  background: var(--tz-bg-card);
  border: 1px solid var(--tz-border);
  border-radius: 8px;
  padding: 1.25rem;
}

.tz-tip-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--tz-primary);
}

.tz-tip-box p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--tz-text-muted);
  line-height: 1.5;
}

/* Status mapping tokens */
.work,
.ext {
  display: contents;
}

.tz-ad {
  overflow: hidden;
  min-height: 280px;
  margin: 32px 0;
  text-align: center;
}
/* tf:dark-palette — generated by migrate_chrome.py */
/* Neutrals inherit the shared chrome tokens so all tools share one
   ground; brand hues are kept and lightened, never inverted. */
[data-theme="dark"] {
  --tz-primary: #81bcda;
  --tz-primary-hover: #69aed4;
  --tz-bg-card: var(--tf-surface);
  --tz-border: var(--tf-surface);
  --tz-text-main: var(--tf-ink);
  --tz-text-muted: var(--tf-ink-faint);
  --tz-pill-bg: var(--tf-surface);
  --tz-pill-hover: var(--tf-surface);
  --tz-result-bg: var(--tf-surface);
  --tz-hl-bg: var(--tf-surface);
  --tz-hl-border: #81bbda;
  --tz-hl-text: #69aed4;
  --tz-work-bg: var(--tf-surface);
  --tz-work-text: #59cf86;
  --tz-ext-bg: var(--tf-surface);
  --tz-ext-text: #d0995c;
  --tz-sleep-bg: var(--tf-surface);
  --tz-sleep-text: var(--tf-ink-faint);
}
