:root {
  --sw-primary: #0284c7;
  --sw-primary-hover: #0369a1;
  --sw-bg-card: #ffffff;
  --sw-border: #e2e8f0;
  --sw-text-main: #0f172a;
  --sw-text-muted: #64748b;
  --sw-pill-bg: #f1f5f9;
  --sw-pill-hover: #e2e8f0;
  --sw-result-bg: #f8fafc;
  --sw-hl-bg: #e0f2fe;
  --sw-hl-border: #bae6fd;
  --sw-hl-text: #0369a1;
}

.sw-tool-container {
  max-width: 880px;
  margin: 0 auto 3rem auto;
  font-family: inherit;
  color: var(--sw-text-main);
}

.sw-editor-card {
  background: var(--sw-bg-card);
  border: 1px solid var(--sw-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.sw-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(--sw-border);
}

.sw-presets-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--sw-text-muted);
}

.sw-pill-btn {
  background: var(--sw-pill-bg);
  border: 1px solid var(--sw-border);
  color: var(--sw-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;
}

.sw-pill-btn:hover {
  background: var(--sw-pill-hover);
  border-color: var(--sw-primary);
}

.sw-tabs-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.sw-tab-btn {
  flex: 1;
  background: var(--sw-pill-bg);
  border: 1px solid var(--sw-border);
  color: var(--sw-text-main);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.sw-tab-active {
  background: var(--sw-primary);
  color: #ffffff;
  border-color: var(--sw-primary);
}

.sw-display-box {
  background: var(--sw-result-bg);
  border: 2px solid var(--sw-border);
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.sw-time-digits {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 4.8rem;
  font-weight: 900;
  color: var(--sw-primary);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

@media (max-width: 550px) {
  .sw-time-digits {
    font-size: 3.2rem;
  }
}

.sw-time-sub {
  font-size: 1rem;
  font-weight: 600;
  color: var(--sw-text-muted);
}

.sw-controls-row,
.sw-action-row {
  display: flex;
  gap: 0.75rem;
}

.sw-primary-btn {
  flex: 2;
  background: var(--sw-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sw-primary-btn:hover {
  background: var(--sw-primary-hover);
}

.sw-secondary-btn {
  background: var(--sw-pill-bg);
  color: var(--sw-text-main);
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.sw-secondary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sw-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 600px) {
  .sw-grid-2 {
    grid-template-columns: 1fr;
  }
}

.sw-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--sw-text-main);
}

.sw-field input,
.sw-field select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  background: var(--sw-bg-card);
  color: var(--sw-text-main);
  font-size: 0.95rem;
  box-sizing: border-box;
}

.sw-results-card {
  background: var(--sw-result-bg);
  border: 1px solid var(--sw-border);
  border-radius: 12px;
  padding: 1.75rem;
}

.sw-table-card {
  background: var(--sw-bg-card);
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.sw-lap-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.sw-sub-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  color: var(--sw-text-main);
}

.sw-table-wrap {
  overflow-x: auto;
}

.sw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.sw-table th,
.sw-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--sw-border);
}

.sw-table th {
  background: var(--sw-pill-bg);
  font-weight: 700;
  color: var(--sw-text-muted);
}

.sw-specs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .sw-specs-grid {
    grid-template-columns: 1fr;
  }
}

.sw-spec-item {
  background: var(--sw-bg-card);
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sw-spec-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sw-text-muted);
}

.sw-spec-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--sw-text-main);
}

.sw-spec-sub {
  font-size: 0.75rem;
  color: var(--sw-text-muted);
}

.sw-tip-box {
  background: var(--sw-bg-card);
  border: 1px solid var(--sw-border);
  border-radius: 8px;
  padding: 1.25rem;
}

.sw-tip-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: var(--sw-primary);
}

.sw-tip-box p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--sw-text-muted);
  line-height: 1.5;
}

.sw-alarm-row {
  display: block;
}

.sw-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"] {
  --sw-primary: #81bcda;
  --sw-primary-hover: #69aed4;
  --sw-bg-card: var(--tf-surface);
  --sw-border: var(--tf-surface);
  --sw-text-main: var(--tf-ink);
  --sw-text-muted: var(--tf-ink-faint);
  --sw-pill-bg: var(--tf-surface);
  --sw-pill-hover: var(--tf-surface);
  --sw-result-bg: var(--tf-surface);
  --sw-hl-bg: var(--tf-surface);
  --sw-hl-border: #81bbda;
  --sw-hl-text: #69aed4;
}
