/* NextChurch — azulejaria modular (Brasília). Um só arquivo, sem build.
   Chão branco-azulejo, rejunte frio, cobalto como única cor de marca e de ação. */


:root {
  --ground: #f3f5f8;
  --tile: #ffffff;
  --grout: #d8dee8;
  --grout-strong: #b9c2d1;
  --ink: #0d1830;
  --ink-2: #3c4864;
  --ink-3: #5f6a85;
  --cobalt: #1b3ea8;
  --cobalt-700: #142f84;
  --cobalt-050: #eef2fc;
  --cobalt-100: #dbe3f8;
  --ochre: #8f5a07;
  --ochre-100: #fbefd6;
  --ochre-line: #e3b25a;
  --green: #17683f;
  --green-100: #e2f3e9;
  --red: #a8261b;
  --red-100: #fbe6e3;

  --font: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 2px;
  --gap: 3px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --shadow-1: 0 1px 2px rgb(13 24 48 / 0.06), 0 2px 8px rgb(13 24 48 / 0.05);
  --shadow-pop: 0 10px 22px -8px rgb(13 24 48 / 0.28), 0 2px 6px rgb(13 24 48 / 0.08);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--cobalt); color: #fff; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: var(--r); }
a { color: var(--cobalt); text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--grout-strong) transparent; }

/* ── Botões ───────────────────────────────────────────────────────────── */
.btn {
  --bg: var(--tile); --fg: var(--ink); --bd: var(--grout-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--bd); border-radius: var(--r);
  background: var(--bg); color: var(--fg);
  font-weight: 600; font-size: 0.95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
  user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { --bg: var(--cobalt); --fg: #fff; --bd: var(--cobalt); }
.btn-ghost { --bg: transparent; --bd: transparent; --fg: var(--ink-2); }
.btn-danger { --bg: var(--tile); --fg: var(--red); --bd: #e9b8b2; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }
.btn-lg { min-height: 56px; padding: 0 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { --bd: var(--ink-3); }
  .btn-primary:hover:not(:disabled) { --bg: var(--cobalt-700); --bd: var(--cobalt-700); }
  .btn-ghost:hover:not(:disabled) { --bg: var(--cobalt-050); --bd: transparent; --fg: var(--ink); }
  .btn-danger:hover:not(:disabled) { --bg: var(--red-100); --bd: var(--red); }
}
.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"] .btn-label { filter: blur(1.5px); opacity: 0.6; transition: filter 200ms ease, opacity 200ms ease; }

/* ── Campos ───────────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; }
.label { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 0.8125rem; color: var(--ink-3); }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--tile); border: 1px solid var(--grout-strong); border-radius: var(--r);
  font-size: 1rem; caret-color: var(--cobalt);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.input::placeholder { color: #7f88a0; }
.input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-100); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%233c4864' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 0.95rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--cobalt); }

.msg { padding: 10px 14px; border-radius: var(--r); font-size: 0.9rem; border: 1px solid; }
.msg-error { background: var(--red-100); color: var(--red); border-color: #efc2bc; }
.msg-ok { background: var(--green-100); color: var(--green); border-color: #b5dcc6; }
.msg-warn { background: var(--ochre-100); color: var(--ochre); border-color: var(--ochre-line); }

/* ── Azulejos (motivos de Athos Bulcão desenhados por ui.js) ─────────────── */
.panel-tiles { display: block; width: 100%; height: 100%; color: var(--cobalt); }
.panel-tiles rect.bg { fill: var(--tile); }
.panel-tiles .grout { stroke: var(--grout); stroke-width: 1; fill: none; }

/* mural: grade de azulejos com rejunte real (gap) */
.mural {
  display: grid; gap: var(--gap); padding: var(--gap);
  background: var(--grout); border: 1px solid var(--grout);
  grid-template-columns: repeat(auto-fill, minmax(var(--tile-min, 132px), 1fr));
}
.tile {
  position: relative; display: grid; align-content: space-between; gap: 10px;
  min-height: var(--tile-h, 132px); padding: 12px;
  background: var(--tile); color: var(--ink); text-align: left;
  border: 0; border-radius: 0; overflow: hidden;
}
button.tile { cursor: pointer; transition: transform 160ms var(--ease-out); }
button.tile:active { transform: scale(0.98); }
.tile { --motif: clamp(34px, 34%, 64px); }
.tile .motif { position: absolute; right: 0; top: 0; width: var(--motif); aspect-ratio: 1; color: var(--cobalt); pointer-events: none; }
.tile-name { position: relative; font-size: 0.875rem; font-weight: 600; line-height: 1.25; max-width: calc(100% - var(--motif) - 2px); overflow-wrap: anywhere; hyphens: auto; }
.tile-meta { position: relative; font-size: 0.8125rem; color: var(--ink-3); }
.tile-num { position: relative; font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile-num small { font-size: 0.8125rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
/* pendente: azulejo ainda não assentado */
.tile.is-pending { background: var(--ground); }
.tile.is-pending .motif { color: var(--grout-strong); }
.tile.is-pending::after { content: ""; position: absolute; inset: 5px; border: 1.5px dashed var(--grout-strong); pointer-events: none; }
.tile.is-pending .tile-num { color: var(--ink-3); font-size: 1rem; font-weight: 600; }
/* inativo */
.tile.is-off { background: var(--ground); opacity: 0.6; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; font-size: 0.75rem; font-weight: 600; border-radius: var(--r); border: 1px solid; white-space: nowrap; }
.tag-ok { color: var(--green); background: var(--green-100); border-color: #b5dcc6; }
.tag-warn { color: var(--ochre); background: var(--ochre-100); border-color: var(--ochre-line); }
.tag-off { color: var(--ink-3); background: var(--ground); border-color: var(--grout); }
.tag-blue { color: var(--cobalt); background: var(--cobalt-050); border-color: var(--cobalt-100); }
.tag-down { color: var(--red); background: var(--red-100); border-color: #efc2bc; }

/* barra de lotação: mesma escala sempre (0–100%+), linha fixa nos 80% */
.occ { position: relative; height: 8px; background: var(--ground); border: 1px solid var(--grout); }
.occ > i { position: absolute; inset: 0 auto 0 0; background: var(--cobalt); transform-origin: left; }
.occ.is-full > i { background: var(--ochre); }
.occ::after { content: ""; position: absolute; top: -4px; bottom: -4px; left: 80%; width: 2px; background: var(--ink); }

/* ── Skeleton: azulejos brancos com rejunte, brilho lento ─────────────────── */
.sk {
  position: relative; overflow: hidden; background: #e9edf3; border-radius: var(--r);
}
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgb(255 255 255 / 0.65) 50%, transparent 100%);
  transform: translateX(-100%); animation: sk-shine 1.4s var(--ease-in-out) infinite;
}
.sk-line { height: 12px; }
.sk-tile { min-height: var(--tile-h, 132px); border-radius: 0; background: #edf0f5; }
@keyframes sk-shine { to { transform: translateX(100%); } }

/* ── Entradas (uma vez, ao carregar) ──────────────────────────────────── */
.enter > * { animation: enter 260ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 28ms); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.fade-in { animation: fade 200ms var(--ease-out) both; }
@keyframes fade { from { opacity: 0; } }

/* assentar: o azulejo do relatório gira e encaixa */
.seat { animation: seat 420ms var(--ease-out) both; }
@keyframes seat { from { opacity: 0; transform: rotate(-90deg) scale(0.9); } }

/* ── Diálogos ─────────────────────────────────────────────────────────── */
dialog.sheet {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0;
  border: 0; border-radius: var(--r); background: var(--tile); color: var(--ink);
  box-shadow: var(--shadow-pop);
  opacity: 1; transform: none;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), overlay 200ms allow-discrete, display 200ms allow-discrete;
}
dialog.sheet:not([open]) { opacity: 0; transform: translateY(8px) scale(0.98); transition-duration: 140ms; }
@starting-style { dialog.sheet[open] { opacity: 0; transform: translateY(8px) scale(0.98); } }
dialog.sheet::backdrop { background: rgb(13 24 48 / 0.38); transition: opacity 200ms ease, overlay 200ms allow-discrete, display 200ms allow-discrete; }
@starting-style { dialog.sheet[open]::backdrop { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--grout); }
.sheet-head h2 { font-size: 1.125rem; }
dialog.sheet > form { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.sheet-body { display: grid; gap: 16px; padding: 20px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid var(--grout); background: var(--ground); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Avisos (toast) ───────────────────────────────────────────────────── */
.toasts { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 80; display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); transform: translateX(-50%); pointer-events: none; }
.toast {
  pointer-events: auto; padding: 12px 16px; background: var(--ink); color: #fff; border-radius: var(--r);
  box-shadow: var(--shadow-pop); font-size: 0.9375rem;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
@starting-style { .toast { opacity: 0; transform: translateY(12px); } }
.toast.is-leaving { opacity: 0; transform: translateY(12px); transition-duration: 160ms; }
.toast.is-error { background: var(--red); }

/* ── Tabelas ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--grout); background: var(--tile); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
table.data th { text-align: left; font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); padding: 10px 14px; border-bottom: 1px solid var(--grout); background: var(--ground); white-space: nowrap; }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--grout); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr { transition: background-color 120ms ease; }
@media (hover: hover) { table.data tbody tr:hover { background: var(--cobalt-050); } }

/* ── Estrutura de app (painéis) ───────────────────────────────────────── */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
.rail {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  background: var(--ink); color: #d7def0;
}
.rail-brand { display: flex; align-items: center; gap: 12px; padding: 20px; }
.rail-brand .mark { width: 36px; height: 36px; flex: none; }
.rail-brand strong { display: block; color: #fff; font-size: 1rem; letter-spacing: -0.01em; }
.rail-brand span { display: block; font-size: 0.8125rem; color: #a9b4cf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.rail nav { display: grid; gap: 2px; padding: 8px 10px; }
.rail a, .rail button.rail-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  color: #c3cce2; text-decoration: none; border: 0; background: none; border-radius: var(--r); cursor: pointer; text-align: left; font-size: 0.95rem;
  transition: background-color 140ms ease, color 140ms ease;
}
.rail a svg, .rail button.rail-link svg { width: 18px; height: 18px; flex: none; opacity: 0.9; }
.rail a[aria-current="page"] { background: rgb(255 255 255 / 0.08); color: #fff; box-shadow: inset 2px 0 0 #8fa8ff; }
@media (hover: hover) { .rail a:hover, .rail button.rail-link:hover { background: rgb(255 255 255 / 0.06); color: #fff; } }
.rail-foot { margin-top: auto; padding: 14px 10px 18px; border-top: 1px solid rgb(255 255 255 / 0.08); }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 12px 10px; }
.who .avatar { width: 32px; height: 32px; display: grid; place-items: center; background: var(--cobalt); color: #fff; font-weight: 700; font-size: 0.875rem; flex: none; }
.who b { display: block; color: #fff; font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.who small { color: #a9b4cf; font-size: 0.75rem; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px clamp(16px, 3vw, 32px); background: rgb(243 245 248 / 0.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--grout); }
.topbar h1 { font-size: 1.25rem; }
.topbar p { font-size: 0.875rem; color: var(--ink-3); }
.topbar .spacer { flex: 1; }
.menu-btn { display: none; }
.content { padding: clamp(16px, 3vw, 32px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-content: start; max-width: 1360px; width: 100%; }
.block { display: grid; gap: 14px; }
.block-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.block-head h2 { font-size: 1.125rem; }
.block-head p { font-size: 0.875rem; color: var(--ink-3); margin-top: 4px; }
.surface { background: var(--tile); border: 1px solid var(--grout); padding: 18px; }
.chart-box { position: relative; height: 260px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }

.week-nav { display: inline-flex; align-items: center; gap: 4px; }
.week-nav span { min-width: 168px; text-align: center; font-weight: 600; font-size: 0.95rem; font-variant-numeric: tabular-nums; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--tile); }
.rows { display: grid; gap: 1px; background: var(--grout); border: 1px solid var(--grout); }
.row-main { min-width: 0; }
.row-main b { display: block; font-weight: 600; font-size: 0.95rem; overflow-wrap: anywhere; }
.row-main small { display: block; color: var(--ink-3); font-size: 0.8125rem; margin-top: 2px; }
.row-actions { display: flex; gap: 6px; flex: none; }

.empty { padding: 28px 20px; text-align: center; color: var(--ink-3); font-size: 0.95rem; background: var(--tile); border: 1px dashed var(--grout-strong); }

.alert-band { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; background: var(--ochre-100); border: 1px solid var(--ochre-line); color: #5c3a05; }
.alert-band svg { width: 22px; height: 22px; flex: none; margin-top: 1px; color: var(--ochre); }
.alert-band b { display: block; color: #4a2f04; }

/* abas: azulejos lado a lado no rejunte; a ativa é o azulejo cobalto */
.tabs { display: flex; gap: var(--gap); padding: var(--gap); background: var(--grout); width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs > * { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; background: var(--tile); color: var(--ink-2); border: 0; border-radius: 0; font-weight: 600; font-size: 0.9rem; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color 140ms ease, color 140ms ease; }
.tabs > * .num { font-weight: 500; color: var(--ink-3); }
.tabs > [aria-current="page"], .tabs > [aria-pressed="true"] { background: var(--cobalt); color: #fff; }
.tabs > [aria-current="page"] .num, .tabs > [aria-pressed="true"] .num { color: #dbe3f8; }
@media (hover: hover) { .tabs > :not([aria-current="page"]):not([aria-pressed="true"]):hover { background: var(--cobalt-050); color: var(--ink); } }
.tabs svg { width: 16px; height: 16px; }

.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search .input { padding-left: 42px; }

/* troca de seção (View Transitions quando houver) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: var(--ease-out); }

.rail-scrim { display: none; }
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .rail-scrim { display: block; }
  .rail { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 60; transform: translateX(-100%); transition: transform 260ms var(--ease-out); box-shadow: var(--shadow-pop); }
  .rail[data-open="true"] { transform: none; }
  .rail-scrim { position: fixed; inset: 0; z-index: 55; background: rgb(13 24 48 / 0.38); opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
  .rail[data-open="true"] + .rail-scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-flex; }
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
  .mural { --tile-min: 112px; --tile-h: 118px; }
  .tile-num { font-size: 1.625rem; }
  .week-nav span { min-width: 0; }
  .topbar p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .sk::after { display: none; }
}

/* ── Relatório no celular ─────────────────────────────────────────────── */
.r-app { min-height: 100dvh; display: flex; flex-direction: column; }
.r-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--tile); border-bottom: 1px solid var(--grout); }
.r-top .who-mini { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 0.875rem; color: var(--ink-3); }
.r-top .who-mini b { color: var(--ink); font-weight: 600; }
.r-body { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 20px 16px 132px; display: grid; gap: 22px; align-content: start; }
.r-steps { display: flex; gap: 3px; padding: 3px; background: var(--grout); width: max-content; }
.r-steps i { width: 22px; height: 22px; background: var(--tile); display: block; transition: background-color 220ms var(--ease-out); }
.r-steps i.done { background: var(--cobalt); }
.r-steps i.now { background: var(--cobalt-100); }
.r-title h1 { font-size: 1.625rem; letter-spacing: -0.03em; }
.r-title p { color: var(--ink-2); margin-top: 6px; }
.step { display: none; gap: 18px; }
.step.active { display: grid; animation: fade 200ms var(--ease-out) both; }

.choices { --tile-min: 150px; --tile-h: 104px; }
.choices .tile[aria-pressed="true"] { background: var(--cobalt); color: #fff; }
.choices .tile[aria-pressed="true"] .motif { color: rgb(255 255 255 / 0.28); }
.choices .tile[aria-pressed="true"] .tile-meta { color: #dbe3f8; }

.counter { display: grid; gap: 10px; padding: 16px; background: var(--tile); border: 1px solid var(--grout); }
.counter label { font-weight: 600; color: var(--ink-2); }
.counter .row-c { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; align-items: stretch; }
.counter button { min-height: 64px; border: 1px solid var(--grout-strong); background: var(--ground); border-radius: var(--r); display: grid; place-items: center; cursor: pointer; color: var(--ink); transition: transform 120ms var(--ease-out), background-color 120ms ease; touch-action: manipulation; }
.counter button:active { transform: scale(0.95); background: var(--cobalt-050); }
.counter button svg { width: 24px; height: 24px; }
.counter input { width: 100%; min-height: 64px; text-align: center; font-size: 2.25rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; border: 1px solid var(--grout-strong); border-radius: var(--r); background: var(--tile); caret-color: var(--cobalt); -moz-appearance: textfield; }
.counter input::-webkit-outer-spin-button, .counter input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.counter input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-100); }
.counter.is-main { border-color: var(--cobalt); }
.counter.is-main input { font-size: 3rem; min-height: 80px; }
.counter.is-main button { min-height: 80px; }
.counter .occ-line { display: flex; justify-content: space-between; font-size: 0.875rem; color: var(--ink-3); }

.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--grout); border: 1px solid var(--grout); }
.summary div { background: var(--tile); padding: 14px 16px; }
.summary dt { font-size: 0.8125rem; color: var(--ink-3); }
.summary dd { margin: 4px 0 0; font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary .wide { grid-column: 1 / -1; }
.summary .wide dd { font-size: 1.0625rem; font-weight: 600; }

.r-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgb(255 255 255 / 0.96); border-top: 1px solid var(--grout); backdrop-filter: blur(6px); }
.r-bar .btn { flex: 1; min-height: 56px; font-size: 1.05rem; }
.r-bar .btn-ghost { flex: 0 0 auto; }
@media (min-width: 600px) { .r-bar { position: sticky; max-width: 560px; margin: 0 auto 24px; border: 1px solid var(--grout); } .r-body { padding-bottom: 24px; } }

.done-view { display: grid; gap: 18px; justify-items: start; }
.done-tile { width: 132px; height: 132px; display: grid; place-items: center; background: var(--cobalt); color: #fff; position: relative; overflow: hidden; }
.done-tile svg.check { width: 56px; height: 56px; position: relative; color: #fff; }
.done-tile .motif { position: absolute; inset: 0; width: 100%; color: rgb(255 255 255 / 0.2); }
