/* ZeroFee Tools family theme - Stopwatch */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #1d4ed8; --purple: #7c3aed; --ink: #1e293b; --muted: #64748b;
  --line: #e2e8f0; --bg: #f8fafc; --card: #ffffff; --ok: #16a34a;
  --warn: #d97706; --bad: #dc2626;
}
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }

/* header */
#siteHeader { background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; padding: 26px 0 0; }
.header-inner { display: flex; align-items: center; }
.brand { display: flex; gap: 14px; align-items: center; }
.hub-link { color: #fff; text-decoration: none; font-size: .85rem; opacity: .85; display: block; margin-bottom: 2px; }
.hub-link:hover { opacity: 1; text-decoration: underline; }
.brand-name { font-size: 1.7rem; line-height: 1.1; }
.brand-tag { opacity: .9; font-size: .9rem; }
.free-banner { text-align: center; font-size: .82rem; padding: 10px 16px 14px; opacity: .95; }

/* layout */
#main { padding: 30px 0 10px; }

/* mode tabs */
.sw-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.sw-tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 18px; font-size: .95rem; cursor: pointer; color: var(--ink); }
.sw-tab.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }

/* stopwatch card */
.sw-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px 24px; box-shadow: 0 6px 28px rgba(15,23,42,.08); margin-bottom: 22px; }
.sw-display { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; font-size: clamp(2.6rem, 8vw, 4.4rem); text-align: center; letter-spacing: .02em; color: var(--ink); }
.sw-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 20px 0 12px; }
.btn { border: none; border-radius: 10px; padding: 11px 26px; font-size: .95rem; font-weight: 700; cursor: pointer; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; min-width: 110px; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: #eef2ff; color: var(--blue); }
.btn-ghost:hover { background: #e0e7ff; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.center-row { justify-content: center; }

/* fullscreen display */
.sw-card:fullscreen { background: #0f172a; display: flex; flex-direction: column; justify-content: center; border-radius: 0; }
.sw-card:fullscreen .sw-display { color: #fff; font-size: 15vw; }
.sw-card:fullscreen .sw-controls, .sw-card:fullscreen .center, .sw-card:fullscreen .tm-inputs, .sw-card:fullscreen .tm-presets { display: none; }

/* laps */
.lap-wrap { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 8px; }
.lap-wrap h3 { margin-bottom: 8px; }
.lap-list { list-style: none; max-height: 320px; overflow-y: auto; }
.lap-row { display: flex; gap: 12px; align-items: baseline; padding: 9px 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lap-row:last-child { border-bottom: none; }
.lap-n { font-weight: 700; min-width: 90px; }
.lap-split { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--blue); font-weight: 600; }
.lap-total { margin-left: auto; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.lap-row.fastest .lap-split { color: var(--ok); }
.lap-row.slowest .lap-split { color: var(--bad); }
.lap-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; border-radius: 999px; padding: 2px 9px; margin-left: 8px; vertical-align: 2px; }
.tag-fast { background: #dcfce7; color: #166534; }
.tag-slow { background: #fee2e2; color: #991b1b; }
.lap-legend { margin-top: 10px; }

/* timer inputs */
.tm-inputs { display: flex; gap: 14px; justify-content: center; margin: 18px 0 6px; flex-wrap: wrap; }
.tm-inputs label { font-size: .85rem; font-weight: 600; color: var(--muted); text-align: center; }
.tm-inputs input { display: block; width: 92px; margin-top: 6px; padding: 10px 8px; font-size: 1.35rem; text-align: center; border: 1px solid var(--line); border-radius: 10px; font-variant-numeric: tabular-nums; }
.tm-inputs input:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
.tm-presets { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0 4px; }
.tm-presets button { border: 1px solid var(--line); background: #f8fafc; border-radius: 999px; padding: 6px 14px; font-size: .85rem; cursor: pointer; color: var(--ink); font-variant-numeric: tabular-nums; }
.tm-presets button:hover { border-color: var(--blue); color: var(--blue); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: .92rem; margin: 12px 0 4px; }
.check-row input { width: auto; margin: 0; }

/* faq */
.faq-sec { margin: 34px 0 40px; }
.faq-sec h2 { margin-bottom: 14px; font-size: 1.3rem; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.faq summary { padding: 14px 18px; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+ "; color: var(--blue); font-weight: 700; }
.faq[open] summary::before { content: "− "; }
.faq p { padding: 0 18px 16px; color: #475569; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: #1e293b; color: #fff; padding: 12px 20px; border-radius: 12px; font-size: .9rem; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 520px) {
  .sw-display { font-size: clamp(2.1rem, 11vw, 3rem); }
  .tm-inputs input { width: 76px; font-size: 1.15rem; }
}
