/* İkimiz — mobile-first, one-handed. System fonts only; no inline styles (CSP). */

:root {
  color-scheme: light dark;

  --bg: #fbf6f0;
  --surface: #ffffff;
  --text: #2b211c;
  --muted: #74655b;
  --border: #e8dccf;
  --input-border: #9c8b7e; /* >= 3:1 against --surface (WCAG 1.4.11) */
  --accent: #b64a33;
  --accent-hover: #a2402b;
  --on-accent: #ffffff;
  --accent-soft: #f7e3da;
  --on-accent-soft: #8a3422;
  --error: #b3261e;
  --success: #2c6e45;
  --success-soft: #e2f1e6;
  --inset: #f6efe7; /* panels inside a card */
  --shadow: 0 1px 2px rgb(43 33 28 / 0.05), 0 6px 20px rgb(43 33 28 / 0.06);
  /* Banners are inverted against the page so they read as system messages. */
  --toast-bg: #2b211c;
  --toast-text: #fbf6f0;
  --toast-action: #f3b39f;
  --on-toast-action: #2a130c;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Roboto Mono", monospace;
  --radius: 16px;
  --tap: 48px;
  --gutter: 20px;

  /* What covers the bottom of the screen: the home indicator (or the tab
     bar, which sits over it) and the banners above that. The screen keeps
     clear of both, and the banners stack on top of the tab bar. */
  /* In rem, so the bar (and the room kept for it) grows with the text size. */
  --tabbar-h: 4rem;
  --bottom-bar: env(safe-area-inset-bottom, 0px);
  --banner-room: 0px;
}

html[data-tabbar] {
  --bottom-bar: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

html[data-banners="1"] {
  --banner-room: 72px;
}

html[data-banners="2"] {
  --banner-room: 136px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1512;
    --surface: #251e1a;
    --text: #f5ede6;
    --muted: #b8a89d;
    --border: #3a302a;
    --input-border: #7d6d62;
    --accent: #e8876b;
    --accent-hover: #f09a80;
    --on-accent: #2a130c;
    --accent-soft: #3b2620;
    --on-accent-soft: #f3b39f;
    --error: #ff8a80;
    --success: #8fd4a6;
    --success-soft: #1f3327;
    --inset: #1e1815;
    --shadow: none;
    --toast-bg: #f5ede6;
    --toast-text: #1a1512;
    --toast-action: #b64a33;
    --on-toast-action: #ffffff;
  }
}

/* Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Focusing a control never leaves it behind the tab bar or a banner. */
  scroll-padding-bottom: calc(var(--bottom-bar) + var(--banner-room) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4,
p,
ol,
dl,
dd {
  margin: 0;
}

/* Layout classes set display; hidden must still win. */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

img,
svg {
  display: block;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Headings get programmatic focus on route change; no ring for that. */
[tabindex="-1"]:focus {
  outline: none;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.noscript {
  padding: 24px var(--gutter);
  text-align: center;
}

/* Layout */

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: 30rem;
  margin-inline: auto;
  padding-top: calc(env(safe-area-inset-top, 0px) + 32px);
  padding-right: calc(env(safe-area-inset-right, 0px) + var(--gutter));
  padding-bottom: calc(var(--bottom-bar) + var(--banner-room) + 24px);
  padding-left: calc(env(safe-area-inset-left, 0px) + var(--gutter));
  animation: screen-enter 200ms ease-out;
}

.screen--center {
  justify-content: center;
}

/* Pins actions to the bottom, within thumb reach. */
.screen-footer {
  margin-top: auto;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stack--sm {
  gap: 4px;
}

.stack--lg {
  gap: 28px;
}

.intro {
  gap: 10px;
}

.brand-mark {
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

/* Type */

.title {
  font-size: 1.75rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lead {
  color: var(--muted);
  text-wrap: pretty;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.note {
  font-size: 0.9375rem;
}

/* Card */

.card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.score {
  font-size: 3rem;
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* Buttons */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition:
    background-color 150ms ease,
    opacity 150ms ease,
    transform 100ms ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.85;
}

/* Focusable but inert, e.g. "Başka fotoğraf seç" during an upload. */
.btn[aria-disabled="true"]:not([aria-busy="true"]) {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn[aria-busy="true"]::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

@media (hover: hover) {
  .btn--primary:hover:not(:disabled) {
    background: var(--accent-hover);
  }

  .btn--secondary:hover:not(:disabled) {
    background: var(--surface);
  }
}

/* Form */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.input {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 16px;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--input-border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1.125rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input:focus {
  /* Transparent outline keeps a visible ring in forced-colors mode. */
  outline: 2px solid transparent;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.input[aria-invalid="true"] {
  border-color: var(--error);
}

.input--code {
  min-height: 64px;
  padding-inline: 12px;
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  /* Balances the trailing letter-spacing so the code sits centered. */
  text-indent: 0.18em;
  text-align: center;
}

.input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.input--code::placeholder {
  color: var(--muted);
  opacity: 0.45;
}

.error {
  min-height: 1.5em;
  color: var(--error);
  font-size: 0.9375rem;
  font-weight: 500;
}

/* Today */

.today-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.clocks {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.35em;
  min-height: 1.5em;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.clock-time {
  color: var(--text);
  font-weight: 600;
}

.score-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 8px;
}

.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--on-accent-soft);
}

.score-label {
  font-weight: 600;
}

.score-total {
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.score-week {
  color: var(--muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.notice {
  margin-top: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--on-accent-soft);
  font-size: 0.9375rem;
  font-weight: 600;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 700;
}

.loading {
  padding: 8px 0;
}

.link-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 12px 16px;
  background: none;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  font: inherit;
  font-size: 0.9375rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:disabled,
.link-btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.6;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  min-height: var(--tap);
  margin-left: -10px;
  padding: 0 14px 0 6px;
  border-radius: 12px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* Round card */

.round {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.round--attention {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}

.round--muted {
  background: transparent;
  box-shadow: none;
}

.round--muted .round-question {
  color: var(--muted);
}

.round-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.round-status {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.round--attention .round-status {
  color: var(--accent);
}

.round-meta {
  color: var(--muted);
  font-size: 0.875rem;
}

.round-question {
  font-size: 1.375rem;
  line-height: 1.25;
  font-weight: 700;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.round-body {
  gap: 16px;
}

/* Kept in the accessibility tree while empty so it can announce. */
.round-error {
  color: var(--error);
  font-size: 0.9375rem;
  font-weight: 500;
}

.round-error:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.hint {
  color: var(--muted);
  font-size: 0.875rem;
}

.dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.dot--pulse {
  background: var(--muted);
  animation: pulse 1.6s ease-in-out infinite;
}

.nudge,
.waiting-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.nudge {
  color: var(--on-accent-soft);
}

/* Answer form */

.round-form {
  gap: 20px;
}

.options-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.options-group > legend {
  padding: 0;
  margin-bottom: 10px;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.option {
  position: relative;
  display: flex;
}

/* An odd last option spans the row. */
.option:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.option-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.option-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  background: var(--surface);
  border: 2px solid var(--input-border);
  border-radius: 14px;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.option-label::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--input-border);
  border-radius: 50%;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

.option-input:checked + .option-label {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--on-accent-soft);
  font-weight: 600;
}

.option-input:checked + .option-label::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--accent-soft);
}

.option-input:focus-visible + .option-label {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.option-input[aria-invalid="true"] + .option-label,
.textarea[aria-invalid="true"] {
  border-color: var(--error);
}

@media (hover: hover) {
  .option-label:hover {
    border-color: var(--accent);
  }
}

.textarea {
  display: block;
  min-height: 0;
  resize: vertical;
  font-size: 1.0625rem;
  line-height: 1.4;
}

.form-actions {
  gap: 10px;
}

.btn--quiet {
  min-height: var(--tap);
  background: transparent;
  color: var(--muted);
}

.btn--toggle {
  background: var(--surface);
  color: var(--text);
  border-color: var(--input-border);
}

.btn--toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* Waiting */

.answer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--inset);
  border-radius: 14px;
}

.answer-list dt,
.side-list dt {
  color: var(--muted);
  font-size: 0.8125rem;
}

.answer-list dd,
.side-list dd {
  white-space: pre-line; /* keep the line breaks of free answers and notes */
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Revealed */

.badge {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.875rem;
  font-weight: 700;
}

.reveal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reveal-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  background: var(--inset);
  border-radius: 14px;
}

.side-name {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.side-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-note dd {
  font-weight: 400;
  font-style: italic;
}

.verdict {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  font-style: normal;
  white-space: nowrap;
}

.verdict--hit {
  background: var(--success-soft);
  color: var(--success);
}

.verdict--miss {
  background: var(--border);
  color: var(--text);
}

.verdict--pending {
  border: 1px dashed var(--input-border);
  color: var(--muted);
  font-weight: 600;
}

.verdict-line {
  font-weight: 600;
}

.points {
  color: var(--accent);
  font-size: 1.125rem;
  font-weight: 800;
}

.judge {
  gap: 12px;
  padding: 16px;
  background: var(--accent-soft);
  border-radius: 14px;
}

.judge-q {
  white-space: pre-line;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.judge-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Reveal moment: the card flips in and the points float off it. */

.round--reveal {
  transform-origin: 50% 50%;
  animation: card-flip 720ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.reveal-burst {
  position: absolute;
  top: -14px;
  right: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.18);
  pointer-events: none;
  animation: burst 2800ms ease-out 400ms both;
}

/* Photo task */

.btn--photo {
  min-height: 64px;
  font-size: 1.125rem;
}

.btn[aria-invalid="true"] {
  border-color: var(--error);
  box-shadow: 0 0 0 1px var(--error);
}

.photo-preview,
.photo-mine {
  margin: 0;
}

.photo-img {
  width: 100%;
  background: var(--inset);
  border-radius: 12px;
  object-fit: cover;
}

/* One photo on its own (preview, my photo while waiting): whole, never cropped. */
.photo-img--single {
  height: auto;
  min-height: 120px;
  max-height: min(60vh, 440px);
  object-fit: contain;
  border-radius: 14px;
}

.photo-open {
  appearance: none;
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 12px;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
  touch-action: manipulation;
}

.photo-open .photo-img--single {
  border-radius: 14px;
}

.photo-missing {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 12px;
  background: var(--inset);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}

.photo-caption {
  white-space: pre-line;
  font-size: 0.9375rem;
  font-style: italic;
  overflow-wrap: anywhere;
}

.photo-none {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  background: var(--surface);
  border-radius: 12px;
  font-size: 0.875rem;
}

.side--photo {
  gap: 10px;
  padding: 10px 10px 12px;
}

.side-head {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-inline: 2px;
}

.side-head .side-name {
  color: var(--text);
}

.round--muted .side-head .side-name {
  color: var(--muted);
}

.side-who {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* Side by side: equal frames, cropped; tap for the whole photo. */
.reveal-grid--photos .photo-img,
.reveal-grid--photos .photo-missing {
  aspect-ratio: 3 / 4;
  min-height: 0;
}

.reveal-grid--photos.reveal-grid--single .photo-img {
  aspect-ratio: 4 / 3;
}

/* Full-size photo */

html:has(.viewer[open]) {
  overflow: hidden;
}

.viewer {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  background: rgb(12 9 8 / 0.94);
  border: 0;
  color: #f5ede6;
}

.viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  animation: fade-in 160ms ease-out;
}

.viewer::backdrop {
  background: rgb(12 9 8 / 0.6);
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
  padding-right: calc(env(safe-area-inset-right, 0px) + 8px);
  padding-left: calc(env(safe-area-inset-left, 0px) + var(--gutter));
}

.viewer-title {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.viewer-close {
  appearance: none;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  background: rgb(255 255 255 / 0.14);
  border: 0;
  border-radius: 50%;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.viewer-close:focus-visible {
  outline-color: #f5ede6;
}

.viewer-frame {
  display: grid;
  /* Definite tracks, so max-height: 100% on the image resolves and tall or
     landscape photos fit the screen. */
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 0;
  padding: 12px;
}

.viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.viewer-caption {
  max-height: 30vh;
  overflow-y: auto;
  padding: 4px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 20px);
  white-space: pre-line;
  font-style: italic;
  text-align: center;
  overflow-wrap: anywhere;
}

/* Reactions */

.reactions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
}

.reaction-set {
  display: flex;
  gap: 6px;
}

.reaction {
  appearance: none;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  font: inherit;
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 100ms ease;
}

.reaction:active {
  transform: scale(0.92);
}

.reaction[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.reaction-set[aria-busy="true"] .reaction {
  cursor: progress;
}

.reaction-partner {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 600;
}

.reaction-emoji {
  font-size: 1.375rem;
  line-height: 1;
}

@media (hover: hover) {
  .reaction:hover {
    border-color: var(--accent);
  }
}

@media (forced-colors: active) {
  .option-input:checked + .option-label {
    outline: 3px solid Highlight;
  }

  .btn--toggle[aria-pressed="true"],
  .reaction[aria-pressed="true"] {
    outline: 3px solid Highlight;
  }

  .banner {
    border: 1px solid CanvasText;
  }

  .tab[aria-current="page"] .tab-pill,
  .segment-input:checked + .segment-label {
    outline: 3px solid Highlight;
  }

  .switch-track {
    border: 1px solid CanvasText;
  }

  .switch-input:checked + .switch-track::after {
    background: Highlight;
  }
}

/* Settings */

.settings-section {
  gap: 14px;
}

.push-body {
  gap: 12px;
}

.push-on {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.dot--on {
  background: var(--success);
}

.push-note {
  font-weight: 600;
  text-wrap: pretty;
}

.push-result {
  color: var(--success);
  font-size: 0.9375rem;
  font-weight: 600;
}

.push-result--error {
  color: var(--error);
}

.push-off {
  align-self: center;
}

.settings-foot {
  gap: 8px;
  text-align: center;
}

/* Profile */

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 20px;
  width: 9px;
  height: 9px;
  margin-top: -7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
  font-size: 1.0625rem;
  text-overflow: ellipsis;
  cursor: pointer;
}

.select:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* The morning notification, below this device's notification controls. */
.morning {
  gap: 10px;
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--tap);
  cursor: pointer;
  touch-action: manipulation;
}

.switch-text {
  font-weight: 600;
}

/* The checkbox itself is invisible; the track after it shows its state. */
.switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.switch-track {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: var(--input-border);
  transition: background-color 150ms ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 150ms ease;
}

.switch-input:checked + .switch-track {
  background: var(--accent);
}

.switch-input:checked + .switch-track::after {
  transform: translateX(20px);
}

.switch-input:focus-visible + .switch-track {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.hour-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.select-wrap--hour {
  flex: 0 1 10rem;
}

.profile-form .form-actions {
  margin-top: 8px;
}

/* Kept in the accessibility tree while empty so they can announce, without
   taking a row (and its gap) in the stack. */
.settings .error:empty,
.field-error:empty,
.push-result:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* A field's own error line (forms of Soru yaz and Ayarlar). */
.field-error {
  color: var(--error);
  font-size: 0.9375rem;
  font-weight: 500;
}

/* Archive */

.archive-days {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.archive-day {
  gap: 12px;
}

.day-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 10px;
  padding-inline: 4px;
  font-size: 1.125rem;
  line-height: 1.3;
  font-weight: 700;
}

.day-date {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.archive-end {
  color: var(--muted);
  font-size: 0.9375rem;
  text-align: center;
}

.empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 32px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  text-wrap: balance;
}

.empty-title {
  font-weight: 700;
}

/* Soru yaz */

.fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.fieldset > legend {
  padding: 0;
  margin-bottom: 8px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.segment {
  position: relative;
  display: flex;
}

.segment-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.segment-label {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: var(--tap);
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 150ms ease, color 150ms ease;
}

.segment-input:checked + .segment-label {
  background: var(--accent);
  color: var(--on-accent);
}

.segment-input:focus-visible + .segment-label {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.segment-input:disabled + .segment-label {
  cursor: not-allowed;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.counter {
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.counter--near {
  color: var(--accent);
  font-weight: 600;
}

.counter--over {
  color: var(--error);
  font-weight: 700;
}

.options-fieldset {
  gap: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

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

.chip {
  appearance: none;
  min-height: 44px;
  padding: 8px 18px;
  background: var(--accent-soft);
  color: var(--on-accent-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 100ms ease;
}

.chip:active {
  transform: scale(0.95);
}

.option-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-row .input {
  flex: 1;
  min-width: 0;
}

.icon-btn {
  appearance: none;
  flex: none;
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}

@media (hover: hover) {
  .icon-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  .chip:hover {
    border-color: var(--accent);
  }
}

.btn--add {
  min-height: var(--tap);
}

.rule {
  padding: 12px 14px;
  background: var(--inset);
  border-radius: 12px;
  text-wrap: pretty;
}

.author-note {
  color: var(--muted);
  font-size: 0.9375rem;
  text-wrap: pretty;
}

.success {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 600;
}

.success:empty {
  display: none;
}

/* Banners: offline and "Yeni sürüm hazır" (§10) */

.banners {
  position: fixed;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-right: calc(env(safe-area-inset-right, 0px) + 12px);
  padding-bottom: calc(var(--bottom-bar) + 12px);
  padding-left: calc(env(safe-area-inset-left, 0px) + 12px);
  /* The empty strip never blocks taps on the screen (or tab bar) under it. */
  pointer-events: none;
}

.banner-slot {
  width: 100%;
  max-width: 30rem;
}

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 8px 8px 16px;
  background: var(--toast-bg);
  color: var(--toast-text);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.24);
  pointer-events: auto;
  animation: banner-in 220ms ease-out;
}

.banner-icon {
  flex: none;
}

.banner-text {
  flex: 1;
  min-width: 0;
  padding-block: 6px;
  padding-right: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.banner-action {
  appearance: none;
  flex: none;
  min-height: 44px;
  padding: 0 20px;
  background: var(--toast-action);
  color: var(--on-toast-action);
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.banner-action:focus-visible {
  outline-color: var(--toast-action);
}

.banner-action[aria-busy="true"] {
  cursor: progress;
  opacity: 0.7;
}

/* Tab bar: Bugün, Arşiv, Soru yaz, Ayarlar */

.tabbar {
  position: fixed;
  z-index: 9;
  right: 0;
  bottom: 0;
  left: 0;
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgb(43 33 28 / 0.04);
}

.tabbar-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 30rem;
  margin: 0 auto;
  padding: 0 4px;
  list-style: none;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--tabbar-h);
  padding: 6px 2px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.tab:focus-visible {
  outline-offset: -3px;
}

.tab-pill {
  display: grid;
  place-items: center;
  width: 56px;
  height: 30px;
  border-radius: 999px;
  transition: background-color 150ms ease, color 150ms ease;
}

.tab[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

.tab[aria-current="page"] .tab-pill {
  background: var(--accent-soft);
  color: var(--on-accent-soft);
}

.tab-label {
  flex: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) {
  .tab:hover:not([aria-current="page"]) .tab-pill {
    background: var(--inset);
  }
}

/* Install guide */

.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  counter-increment: step;
}

.step::before {
  content: counter(step);
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--on-accent-soft);
  font-weight: 700;
}

.step-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-text {
  font-weight: 600;
}

.step-hint {
  font-size: 0.9375rem;
}

.step-icon {
  flex: none;
  color: var(--accent);
}

/* Motion */

@keyframes screen-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.3;
  }
}

@keyframes card-flip {
  from {
    transform: perspective(1200px) rotateY(-88deg);
    opacity: 0;
  }
  45% {
    opacity: 1;
  }
  75% {
    transform: perspective(1200px) rotateY(6deg);
  }
  to {
    transform: perspective(1200px) rotateY(0);
  }
}

@keyframes burst {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.6);
  }
  12% {
    opacity: 1;
    transform: translateY(0) scale(1.12);
  }
  20% {
    transform: scale(1);
  }
  80% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-12px);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes banner-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes fade-in-out {
  0%,
  100% {
    opacity: 0;
  }
  12%,
  80% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* The reveal still happens, as a fade instead of a flip. These beat the
     reset above on specificity. */
  .round--reveal {
    animation: fade-in 500ms ease-out both !important;
  }

  .reveal-burst {
    animation: fade-in-out 2800ms ease 200ms both !important;
  }
}
