body { width: 340px; padding: 16px 18px 18px; }

/* The logo's rounded face (Fredoka, SIL Open Font License), bundled so it works offline. */
@font-face {
  font-family: 'Fredoka';
  font-weight: 700;
  src: url('../assets/fonts/fredoka-700-latin.woff2') format('woff2');
}

header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 20px; height: 28px; flex: none; fill: var(--brand); }
h1 { font-family: 'Fredoka', ui-rounded, system-ui, sans-serif; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.version { font-size: 11px; color: var(--muted); align-self: flex-end; margin-bottom: 2px; }

/* Progress ring around the pause button, countdown underneath */
.clock { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.timer {
  position: relative; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%;
  background: var(--card); color: var(--ink); cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 1px 3px rgba(20, 30, 45, .12);
}
.timer .ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 4.5; }
.timer .track { stroke: color-mix(in srgb, var(--muted) 22%, transparent); }
.timer .arc { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset .6s linear; }
.timer[data-tone="rest"] .arc { stroke: color-mix(in srgb, var(--brand) 45%, var(--card)); }
.timer[data-tone="paused"] .arc { stroke: transparent; }
.count { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; color: var(--muted); }
.glyph { position: relative; width: 18px; height: 18px; fill: var(--ink); }
.timer:hover .glyph { fill: var(--brand); }
.timer:focus-visible { outline: 3px solid #e9a93a; outline-offset: 2px; }

/* Interrupter picker, full width under the header */
.effect { display: block; margin-bottom: 18px; }
.effect select {
  -webkit-appearance: none; appearance: none;
  width: 100%; font: inherit; font-weight: 600; padding: 10px 40px 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background-color: var(--card); color: var(--ink); cursor: pointer;
  /* Our own chevron, inset from the edge */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235a6a7e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
.effect select:focus-visible { outline: 3px solid #e9a93a; outline-offset: 1px; }

.field { margin-bottom: 16px; }
.row { display: flex; align-items: baseline; justify-content: space-between; }
.row .label { margin-bottom: 4px; }
output { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Sliders with tick labels */
/* --p (0-100%) is set by the settings binding: orange up to the handle, light after it. */
.slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 12px 0 8px; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand) var(--p, 0%), color-mix(in srgb, var(--muted) 22%, transparent) var(--p, 0%));
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand); box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.slider:focus-visible { outline: none; }
.slider:focus-visible::-webkit-slider-thumb { outline: 3px solid #e9a93a; outline-offset: 2px; }
.ticks { position: relative; height: 16px; margin: 0 8px; font-size: 11px; color: var(--muted); }
.ticks span { position: absolute; top: 0; transform: translateX(-50%); }

.seg span { padding: 8px 4px; font-size: 13px; }
@media (prefers-color-scheme: dark) { .seg { background: #0f1620; } }
form[data-mode="day"] .break-field { display: none; }

/* On/off switch with a tooltip */
/* Label and "?" on the left, the switch on the right. */
.toggle { display: flex; align-items: center; gap: 8px; }
.toggle-label { font-weight: 600; cursor: pointer; }
.switch { display: flex; margin-left: auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.knob {
  position: relative; width: 38px; height: 22px; flex: none; border-radius: 11px;
  background: color-mix(in srgb, var(--muted) 35%, transparent); transition: background .2s;
}
.knob::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s;
}
.switch input:checked + .knob { background: var(--brand); }
.switch input:checked + .knob::after { transform: translateX(16px); }
.switch input:focus-visible + .knob { outline: 3px solid #e9a93a; outline-offset: 2px; }

.tip { position: relative; }
.tip-btn {
  width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
  color: var(--muted); font: 700 12px/1 inherit; cursor: help;
}
.tip-btn:focus-visible { outline: 3px solid #e9a93a; outline-offset: 2px; }
.tooltip {
  position: absolute; left: -150px; bottom: calc(100% + 8px); width: 230px; padding: 10px 12px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-size: 12px; line-height: 1.4;
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s;
  box-shadow: 0 8px 24px rgba(10, 20, 30, .25); z-index: 1;
}
.tip:hover .tooltip, .tip-btn:focus-visible + .tooltip { opacity: 1; visibility: visible; transform: none; }


/* Sign-in screen and the account line */
.gate { text-align: center; padding: 6px 4px 4px; }
.gate h2 { font-size: 17px; margin-bottom: 16px; }
.gate p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.gate .btn { width: 100%; background: var(--brand); color: #fff; }
.gate .fine { margin: 12px 0 0; font-size: 12px; }
.gate .fine a { color: var(--muted); }
body.locked .clock { visibility: hidden; }
.account { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { all: unset; color: var(--muted); text-decoration: underline; cursor: pointer; }
.link:hover { color: var(--brand); }
.link:focus-visible { outline: 3px solid #e9a93a; outline-offset: 2px; }
