.ac-stage { --ac-bg: #0c0d10; --ac-ink: #f2f3f5; --ac-sub: #a9adb8; --ac-hi: #ffc83d;
  background: var(--ac-bg); color: var(--ac-ink); cursor: zoom-in; }
.ac-stage.is-full { cursor: default; }
.ac-stage:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.ac-box { position: absolute; inset: 0; container-type: size; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 12px; text-align: center; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.ac-digital { font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; letter-spacing: -0.01em; font-size: 20cqh; }
.ac-s { opacity: .55; font-size: .5em; margin-left: .04em; }
.ac-ap { font-size: .28em; margin-left: .25em; font-weight: 600; letter-spacing: .04em; color: var(--ac-sub); vertical-align: .2em; }
.ac-s[hidden], .ac-ap[hidden] { display: none; }
.ac-date { margin: 0; color: var(--ac-sub); font-weight: 500; font-size: max(13px, 5.5cqh); line-height: 1.2; }
.ac-next { margin: 0; font-size: max(13px, 5cqh); line-height: 1.25; color: var(--ac-sub); padding: .35em 1em; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22); max-width: 94%; font-variant-numeric: tabular-nums; }
.ac-next.on { color: var(--ac-hi); border-color: rgba(255, 200, 61, .5); }
@media (max-width: 420px) { .ac-stage .fs-btn span { display: none; } }

/* ringing screen: fixed over the page (and inside the stage, so it also shows in real full screen) */
.ac-ring { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px; overflow: auto;
  background: #101218; color: #fff; cursor: default; user-select: none; -webkit-user-select: none; }
.ac-ring[hidden] { display: none; }
.ac-ring.flash { animation: ac-pulse 1s ease-in-out infinite alternate; }
@keyframes ac-pulse { from { background: #101218; } to { background: #8a1010; } }
.ac-ring-in { display: grid; gap: 14px; justify-items: center; text-align: center; width: 100%; max-width: 560px; }
.ac-bell { width: clamp(44px, 10vmin, 72px); height: clamp(44px, 10vmin, 72px); color: #ffc83d; transform-origin: 50% 12%;
  animation: ac-shake 1.2s ease-in-out infinite; }
@keyframes ac-shake { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-14deg); } }
.ac-ring-now { margin: 0; font-size: clamp(3rem, 17vmin, 8.5rem); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.ac-ring-h { margin: 0; font-size: clamp(1.5rem, 6vmin, 2.6rem); line-height: 1.15; overflow-wrap: anywhere; }
.ac-ring-d { margin: 0; font-size: clamp(1rem, 3.4vmin, 1.3rem); color: #d4d7de; }
.ac-ring-tap { margin: 0; padding: 8px 14px; border-radius: 12px; background: #ffc83d; color: #1a1400; font-weight: 700; }
.ac-ring-tap[hidden] { display: none; }
.ac-stop { font: inherit; width: min(100%, 380px); min-height: 92px; font-size: clamp(1.8rem, 6vmin, 2.4rem); font-weight: 800; border-radius: 999px;
  border: 0; background: #fff; color: #111317; cursor: pointer; margin-top: 6px; }
.ac-snz { display: flex; gap: 10px; width: min(100%, 380px); }
.ac-snz button { flex: 1; font: inherit; font-size: 1.1rem; font-weight: 700; min-height: 60px; border-radius: 999px; cursor: pointer;
  background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, .65); }
.ac-stop:hover { background: #e9ebef; }
.ac-snz button:hover { background: rgba(255, 255, 255, .1); }
.ac-ring button:focus-visible { outline: 3px solid #8fb0ff; outline-offset: 3px; }
.ac-ring-keys { margin: 0; font-size: .9rem; color: #a9adb8; }
@media (hover: none) { .ac-ring-keys { display: none; } }

/* setter */
.ac-set { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: grid; gap: 14px; }
.ac-set-h { margin: 0; font-size: 1.25rem; }
.ac-picker { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ac-unit { display: grid; gap: 6px; justify-items: stretch; }
.ac-unit input { width: 2.2ch; box-sizing: content-box; font: inherit; font-size: clamp(2.6rem, 11vw, 4rem); font-weight: 700; line-height: 1.1;
  text-align: center; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--field); border: 1px solid var(--field-border);
  border-radius: 14px; padding: 4px 10px; }
.ac-unit input[aria-invalid="true"] { border-color: #d33; box-shadow: 0 0 0 1px #d33; }
.ac-step { display: grid; place-items: center; min-height: 44px; border-radius: 12px; border: 1px solid var(--field-border); background: var(--field);
  color: var(--ink); cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.ac-step svg { width: 24px; height: 24px; }
.ac-step:hover, .ac-chips button:hover { border-color: var(--muted); }
.ac-colon { font-size: clamp(2.6rem, 11vw, 4rem); font-weight: 700; line-height: 1; padding-bottom: .1em; }
.ac-ampm { display: grid; gap: 6px; margin-left: 4px; }
.ac-ampm[hidden] { display: none; }
.ac-ampm button { font: inherit; font-size: 1.05rem; font-weight: 700; min-width: 64px; min-height: 48px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--field-border); background: var(--field); color: var(--ink); }
.ac-ampm button[aria-pressed="true"] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.ac-when { margin: 0; text-align: center; font-weight: 600; min-height: 1.5em; }
.ac-set .ctl input[type="text"] { width: 100%; box-sizing: border-box; }
.ac-set .ctl label { margin-bottom: 6px; }
.ac-set .btn-row .btn { flex: 1 1 auto; }
.ac-set [hidden] { display: none !important; }
.ac-sub { font-weight: 500; color: var(--muted); font-size: .88em; }
.ac-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-chips button { font: inherit; font-size: .92rem; font-weight: 600; border: 1px solid var(--field-border); background: var(--field); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; min-height: 40px; cursor: pointer; font-variant-numeric: tabular-nums; }
.ac-note { margin: 0; font-weight: 600; color: var(--ink); }
.ac-note:empty { display: none; }

/* list */
.ac-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ac-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px; background: var(--field); }
.ac-item.editing { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.ac-item-t { min-width: 0; }
.ac-item-t strong { display: block; font-size: 1.35rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ac-lab { display: block; font-weight: 600; overflow-wrap: anywhere; }
.ac-item-t small { display: block; color: var(--muted); font-size: .84rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
.ac-item.off .ac-item-t strong, .ac-item.off .ac-lab { color: var(--muted); }
.ac-tog { position: relative; width: 50px; height: 30px; border-radius: 999px; border: 1px solid var(--field-border); background: var(--line);
  cursor: pointer; padding: 0; flex-shrink: 0; }
.ac-tog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.ac-tog[aria-checked="true"] { background: var(--primary); border-color: var(--primary); }
.ac-tog[aria-checked="true"]::after { transform: translateX(20px); }
.ac-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--field-border);
  background: var(--surface); color: var(--ink); cursor: pointer; padding: 0; }
.ac-ic svg { width: 18px; height: 18px; }
.ac-undo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; font-size: .92rem; }
.ac-undo[hidden], .panel [hidden] { display: none !important; }

/* sounds */
.ac-tones { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ac-tn { display: grid; text-align: start; gap: 1px; font: inherit; border: 1px solid var(--field-border); background: var(--field); color: var(--ink);
  border-radius: 12px; padding: 7px 10px; min-height: 48px; cursor: pointer; }
.ac-tn span { font-weight: 600; font-size: .92rem; }
.ac-tn small { font-size: .78rem; color: var(--muted); }
.ac-tn[aria-pressed="true"] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.ac-sws { display: grid; gap: 10px; }
.ac-warn { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 10px 14px; font-size: .92rem; }
.ac-warn p { margin: 0; }
.ac-warn .hint { margin-top: 6px; }
.ac-warn .hint:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .ac-bell { animation: none; }
  .ac-tog::after { transition: none; }
}
