/* Mūsu Laiks — analog workbook styling.
   Palette and type are lifted from the printed worksheets: cream paper,
   navy ink, five marker colours. Muted tones are all >= 4.5:1 on paper. */

:root {
  --paper: #FBF7EC;
  --paper-deep: #F2EBD9;
  --card: #FFFDF6;
  --ink: #16255C;
  --ink-body: #4A5578;
  --ink-muted: #6E6244;
  --ink-soft: #6B6347;
  --ink-off: #6F6750;
  --rule: #E4DAC0;
  --rule-strong: #DCD3BC;

  --marker-yellow: #F2C900;
  --marker-blue: #1E6FB4;
  --marker-green: #4E9E3E;
  --marker-purple: #9E5A9C;
  --marker-red: #D63A2C;
  --orange: #F0A21C;
  --alert: #C42032;

  --band-yellow: #F7DE55;
  --band-blue: #8FC2E6;
  --band-green: #A5D79A;
  --band-purple: #D9AED7;
  --band-red: #F0A79E;

  --display: 'Fira Sans Condensed', 'Segoe UI Condensed', 'Segoe UI', system-ui, sans-serif;
  --body: 'PT Serif', Georgia, 'Times New Roman', serif;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  --shadow: 3px 4px 0 rgba(22, 37, 92, 0.07);
  --shadow-lift: 5px 6px 0 rgba(22, 37, 92, 0.14);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper-deep);
  color: var(--ink);
  font-family: var(--display);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-weight: 700;
}
.skip:focus { left: 8px; top: 8px; }

#app {
  min-height: 100svh;
  background-color: var(--paper);
  background-image: var(--grain);
  max-width: 560px;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px calc(26px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.boot { display: flex; justify-content: center; padding: 80px 0; }
@media (prefers-reduced-motion: no-preference) {
  .boot svg { animation: tick 1.6s steps(8, end) infinite; transform-origin: 50% 50%; }
  @keyframes tick { to { transform: rotate(360deg); } }
}

/* ---------- shared chrome ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 44px;
}
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.partner-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 13px;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  transition: background 120ms ease, color 120ms ease;
}
.partner-chip .dot { flex: none; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--ink); }
.partner-chip:hover { background: var(--ink); color: var(--card); }
.partner-chip:hover .dot { border-color: var(--card); }

.partner-list { display: flex; flex-direction: column; gap: 12px; margin-top: 2px; }
.partner-row {
  display: flex;
  align-items: stretch;
  background: var(--card);
  border: 1.5px solid var(--rule);
  box-shadow: var(--shadow);
}
.partner-row.on { border-color: var(--ink); }
.partner-row .pick {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 14px;
}
.partner-row .pick:hover .label { color: var(--alert); }
.partner-row .face {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1.5px solid var(--ink);
  color: var(--card);
}
.partner-row .names { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.partner-row .label {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.partner-row .status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-off);
}
.partner-row .status.locked { color: var(--marker-green); }
.partner-row .mark { flex: none; display: flex; align-items: center; }
.partner-row .manage {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  border-left: 1.5px solid var(--rule);
  color: var(--ink-soft);
}
.partner-row .manage:hover { background: var(--ink); color: var(--card); }
.lock-now { width: 100%; }

/* ---------- PIN screens ---------- */

.lock-who { display: flex; align-items: center; gap: 12px; }
.lock-who .face {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--ink);
  color: var(--card);
}
.lock-who .label { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }

.pin-form { display: flex; flex-direction: column; gap: 12px; }
.pin-field { display: flex; flex-direction: column; gap: 5px; }
.pin-field span { font-size: 12px; font-weight: 700; letter-spacing: 0.09em; color: var(--ink-muted); }
.pin-field input {
  width: 100%;
  height: 52px;
  padding: 0 12px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--ink);
}
.pin-error { margin: 0; font-size: 13px; font-weight: 700; color: var(--alert); }

.warn-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid var(--orange);
  background: rgba(240, 162, 28, 0.1);
  color: var(--ink);
}
.warn-box svg { flex: none; color: #8A6E04; margin-top: 1px; }
.warn-box p { margin: 0; font-family: var(--body); font-size: 12.5px; line-height: 1.4; text-wrap: pretty; }

.danger-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid var(--alert);
  background: rgba(196, 32, 50, 0.06);
}
.danger-box p { margin: 0; font-family: var(--body); font-size: 12.5px; line-height: 1.4; text-wrap: pretty; }

.link-btn {
  align-self: flex-start;
  min-height: 44px;
  padding: 0 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--alert);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: #8F1522; }

.brand { display: flex; flex-direction: column; gap: 2px; }
.brand h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1;
}
.brand p {
  margin: 0;
  font-family: var(--body);
  font-size: 12px;
  font-style: italic;
  color: var(--ink-body);
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

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

.back {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}
.back svg { stroke: var(--ink); }
.back:hover { color: var(--ink); }

.lang-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: background 120ms ease, color 120ms ease;
}
.lang-chip:hover { background: var(--ink); color: var(--card); }

h2.screen-title {
  margin: 0;
  font-size: clamp(25px, 7.4vw, 30px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

p.intro {
  margin: 0;
  font-family: var(--body);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-body);
  text-wrap: pretty;
}

p.hint {
  margin: 0;
  font-family: var(--body);
  font-size: 11.5px;
  font-style: italic;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.sheet {
  background: var(--card);
  border: 1.5px solid var(--rule);
  box-shadow: var(--shadow);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  background: var(--ink);
}
.sheet-head .label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--card);
}
.sheet-head .value { font-size: 13px; font-weight: 700; color: var(--marker-yellow); }

/* ---------- home ---------- */

.badge-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}
.badge-stamp { position: relative; flex: none; width: 96px; height: 96px; }
.badge-stamp svg { display: block; width: 100%; height: 100%; }
.badge-stamp .readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  pointer-events: none;
}
.badge-stamp .readout b { font-size: 27px; font-weight: 800; line-height: 1; }
.badge-stamp .readout span { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }

.badge-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  color: var(--ink-muted);
}
.badge-copy h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  text-wrap: pretty;
}
.badge-copy p {
  margin: 0;
  font-family: var(--body);
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink-body);
  text-wrap: pretty;
}

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

.exercise {
  display: flex;
  align-items: stretch;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--rule);
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.exercise:hover, .exercise:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-lift);
}
@media (prefers-reduced-motion: reduce) {
  .exercise, .exercise:hover { transition: none; transform: none; }
}
.exercise .spine { flex: none; width: 7px; }
.exercise .glyph {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
}
.exercise .body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 13px 12px;
}
.exercise .card-top { display: flex; align-items: flex-start; gap: 8px; }
.exercise h3 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}
.exercise .tag {
  flex: none;
  padding: 2px 7px;
  border: 1px solid #C0B69B;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.exercise .tag.shared { border-color: var(--alert); color: var(--alert); background: rgba(196, 32, 50, 0.07); }
.exercise .sub {
  font-family: var(--body);
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--ink-body);
}
.exercise .meter { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.exercise .track { flex: 1 1 auto; height: 5px; background: rgba(22, 37, 92, 0.1); }
.exercise .fill { height: 5px; }
.exercise .count { flex: none; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.exercise .open {
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--alert);
}

/* ---------- schedule ---------- */

.brushes { display: flex; flex-wrap: wrap; gap: 6px; }
.brush {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px 0 8px;
  border: 1.5px solid var(--rule);
  background: var(--card);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-body);
  max-width: 100%;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.brush span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brush:hover { border-color: var(--ink); color: var(--ink); }
/* Selection is an outline, not a fill: a filled chip would swallow the swatch
   of any activity whose colour is close to the chip's own. */
.brush.on {
  background: rgba(22, 37, 92, 0.08);
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
  color: var(--ink);
  font-weight: 700;
}
.brush .sw {
  flex: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--ink);
  background: var(--card);
}
.brush .sw.busy { background: repeating-linear-gradient(45deg, #2B3A6B 0 2px, #3A4A80 2px 4px); }
.brush .sw.free { background: var(--band-yellow); }
.brush .sw.none { background: var(--card); border-style: dashed; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-body); }
.legend i { width: 16px; height: 16px; border: 1px solid var(--ink); }
.legend i.busy { background: repeating-linear-gradient(45deg, #2B3A6B 0 2px, #3A4A80 2px 4px); }
.legend i.free { background: var(--band-yellow); }
.legend i.none { background: var(--card); border-color: #C8BFA6; }

.grid { border: 1.5px solid var(--ink); background: var(--card); }
.grid .head { display: flex; background: var(--ink); }
.grid .head .corner { flex: none; width: 40px; }
.grid .head b {
  flex: 1 1 0;
  min-width: 0;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid rgba(251, 247, 236, 0.28);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--card);
}
.grid .line { display: flex; border-top: 1px solid var(--rule-strong); }
.grid .line .hour {
  flex: none;
  width: 40px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  background: #F4EEDC;
}
.grid .cell {
  flex: 1 1 0;
  min-width: 0;
  height: 26px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--rule-strong);
  background: transparent;
}
.grid .cell.busy { background: repeating-linear-gradient(45deg, #2B3A6B 0 2px, #3A4A80 2px 4px); }
.grid .cell.free { background: var(--band-yellow); }
.grid .cell:hover { box-shadow: inset 0 0 0 2px var(--alert); }

.summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; }
.summary .badge-stamp { width: 70px; height: 70px; }
.summary .badge-stamp .readout b { font-size: 22px; }
.summary .badge-stamp .readout span { font-size: 10px; }
.summary .copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.summary h2 { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.1; text-wrap: pretty; }
.summary .marked { font-family: var(--body); font-size: 12px; color: var(--ink-body); }

/* ---------- pie ---------- */

.banner { display: flex; align-items: stretch; background: var(--marker-yellow); border: 1.5px solid var(--ink); box-shadow: 4px 5px 0 rgba(22, 37, 92, 0.12); }
.banner .clock {
  flex: none;
  width: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--orange);
  border-right: 1.5px solid var(--ink);
}
.banner h2 { margin: 0; padding: 14px; font-size: clamp(21px, 6.2vw, 26px); font-weight: 800; line-height: 1; letter-spacing: -0.02em; text-wrap: pretty; }

.chart { display: flex; justify-content: center; padding: 2px 0; }
.chart svg { display: block; max-width: 100%; height: auto; }

/* No free hours in the table means an empty ring, which explains itself badly.
   This says where the hours are supposed to come from instead. */
.no-free {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1.5px dashed var(--ink-off);
  background: rgba(179, 168, 140, 0.1);
  text-align: center;
}
.no-free p { margin: 0; font-family: var(--body); font-size: 13px; line-height: 1.4; text-wrap: pretty; }
.no-free .btn { text-decoration: none; }

.activities { display: flex; flex-direction: column; }
.activity {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 52px;
  padding: 5px 10px 5px 8px;
  border-top: 1px solid var(--rule);
}
.activity .tick {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}
.activity .box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.activity .name {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 44px;
  text-align: left;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 2px;
  border-bottom: 1px dashed transparent;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}
.activity .name:hover { border-bottom-color: var(--alert); color: var(--alert); }
.activity.off .name { color: var(--ink-off); }

.stepper {
  flex: none;
  display: flex;
  align-items: center;
  border: 1.5px solid var(--ink);
  background: var(--card);
}
.stepper .step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 44px;
  color: var(--ink);
}
.stepper .step:hover:not(:disabled) { background: var(--ink); color: var(--card); }
.stepper .step:disabled { color: #C0B69B; cursor: not-allowed; }
.stepper .val {
  min-width: 48px;
  padding: 0 2px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-left: 1.5px solid var(--ink);
  border-right: 1.5px solid var(--ink);
  line-height: 44px;
}
.activity.off .stepper { border-color: #C0B69B; }
.activity.off .stepper .val { color: var(--ink-off); border-color: #C0B69B; }

.activity.spare .name { color: var(--ink-off); font-style: italic; }
.activity.spare .tick { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
.activity.spare .box { border-color: #B3A88C; }
.spare-hours {
  flex: none;
  min-width: 128px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-off);
}

.activity-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--rule);
  background: rgba(196, 32, 50, 0.05);
  box-shadow: inset 3px 0 0 var(--alert);
}
.activity-edit input[type="text"] {
  width: 100%;
  height: 46px;
  padding: 0 10px;
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--ink);
}
.activity-edit input::placeholder { color: var(--ink-off); font-style: italic; }
.hours-field { display: flex; align-items: center; gap: 10px; }
.hours-field span { font-size: 13px; font-weight: 600; color: var(--ink-body); }
.hours-field input {
  width: 96px;
  height: 44px;
  padding: 0 8px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--ink);
}
.edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn.outline { background: transparent; color: var(--ink); }
.btn.outline:hover { background: var(--ink); color: var(--card); }
.btn.danger { background: transparent; color: var(--alert); border-color: var(--alert); margin-left: auto; }
.btn.danger:hover { background: var(--alert); color: var(--card); }
/* Scoped so it beats .btn.ghost's width, which is declared later in this file.
   width:auto lets the column flex container stretch it to the card minus the
   margins, instead of pinning it to 100% and overhanging by the margins. */
.activities .btn.add-activity { width: auto; margin: 12px; }

.remember { display: flex; align-items: stretch; border: 1.5px solid var(--alert); background: rgba(196, 32, 50, 0.06); }
.remember .key { flex: none; width: 46px; display: flex; align-items: center; justify-content: center; background: var(--alert); }
.remember .copy { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; min-width: 0; }
.remember .copy b { font-size: 11.5px; font-weight: 700; letter-spacing: 0.11em; color: var(--alert); }
.remember .copy p { margin: 0; font-family: var(--body); font-size: 12.5px; font-weight: 700; line-height: 1.32; text-wrap: pretty; }

.reflect { display: flex; flex-direction: column; gap: 10px; }
.reflect p { margin: 0; font-family: var(--body); font-size: 12.5px; line-height: 1.4; text-wrap: pretty; }
.reflect textarea {
  font-family: var(--body);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  padding: 6px 2px;
  min-height: 64px;
  resize: vertical;
  width: 100%;
}
.reflect textarea::placeholder { color: var(--ink-off); font-style: italic; }

/* ---------- ideas ---------- */

.matrix { border: 1.5px solid var(--ink); background: var(--card); }
.matrix .head { display: flex; background: var(--ink); }
.matrix .head .corner { flex: none; width: 104px; }
.matrix .head b {
  flex: 1 1 0;
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-left: 1px solid rgba(251, 247, 236, 0.28);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--card);
  text-align: center;
}
.matrix .line { display: flex; border-top: 1.5px solid var(--ink); }
.matrix .line .dur {
  flex: none;
  width: 104px;
  display: flex;
  align-items: center;
  padding: 6px 9px;
  min-height: 58px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.14;
  text-wrap: pretty;
}
.matrix .box {
  flex: 1 1 0;
  min-width: 0;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px;
  border: 0;
  border-left: 1px solid var(--rule-strong);
  background: transparent;
}
.matrix .box b { font-size: 21px; font-weight: 800; line-height: 1; }
.matrix .box.on { box-shadow: inset 0 0 0 2.5px var(--alert); background: rgba(196, 32, 50, 0.07); }
.matrix .box:hover:not(.on) { background: rgba(22, 37, 92, 0.05); }

.share { display: flex; flex-direction: column; gap: 10px; }
.share .share-open { width: 100%; }
.share .share-open:disabled {
  border-color: #C0B69B;
  color: var(--ink-off);
  cursor: not-allowed;
  background: transparent;
}
.share-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: var(--card);
  border: 1.5px solid var(--rule);
  box-shadow: var(--shadow);
}
.share-panel .btn { flex: 1 1 auto; text-decoration: none; }
.share-panel .btn.done { background: var(--marker-green); border-color: var(--marker-green); }
.share-panel .btn.done:hover { background: var(--marker-green); border-color: var(--marker-green); }

.share-manual { display: flex; flex-direction: column; gap: 6px; }
.share-text {
  width: 100%;
  min-height: 150px;
  padding: 10px;
  font-family: var(--body);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--ink);
  resize: vertical;
}

.idea-list { display: flex; flex-direction: column; padding: 2px 12px 12px; }
.idea {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 0 9px;
  border-bottom: 1px solid var(--rule);
}
.idea .dot { flex: none; width: 9px; height: 9px; margin-top: 5px; }
.idea .text { flex: 1 1 auto; min-width: 0; font-family: var(--body); font-size: 13px; line-height: 1.34; text-wrap: pretty; overflow-wrap: anywhere; }
.idea .remove {
  flex: none;
  width: 34px;
  height: 34px;
  margin: -6px -6px -6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-off);
}
.idea .remove:hover { color: var(--alert); }
.empty-note { padding: 16px 0 14px; font-family: var(--body); font-size: 13px; font-style: italic; color: var(--ink-off); }

.composer { display: flex; gap: 8px; margin-top: 12px; }
.composer input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  padding: 0 10px;
  height: 46px;
}
.composer input::placeholder { color: var(--ink-off); font-style: italic; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 0 16px;
  border: 1.5px solid var(--ink);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--ink);
  color: var(--card);
  transition: background 120ms ease, color 120ms ease;
}
.btn:hover { background: var(--alert); border-color: var(--alert); }
.btn.ghost { background: transparent; color: var(--ink); border-style: dashed; width: 100%; margin-top: 12px; }
.btn.ghost:hover { background: var(--ink); color: var(--card); border-style: solid; }

/* ---------- bingo ---------- */

.bingo-title { display: flex; flex-direction: column; }
.bingo-title .word { display: flex; align-items: baseline; gap: 1px; }
.bingo-title .word span { font-size: clamp(36px, 11vw, 46px); font-weight: 800; line-height: 0.92; letter-spacing: -0.01em; }
.bingo-title .rest { font-size: clamp(20px, 6.4vw, 26px); font-weight: 800; line-height: 1; letter-spacing: -0.015em; text-wrap: pretty; }

.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.square {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5px 3px;
  border: 4px solid;
  background: var(--card);
  font-size: clamp(9px, 2.6vw, 11px);
  font-weight: 600;
  line-height: 1.16;
  overflow: hidden;
  overflow-wrap: anywhere;
  transition: transform 110ms ease;
}
.square:hover { transform: scale(1.04); z-index: 1; }
@media (prefers-reduced-motion: reduce) { .square, .square:hover { transition: none; transform: none; } }
.square .tick { position: absolute; top: 3px; right: 3px; }
.square.star { border-color: var(--ink); cursor: default; }
.square.star:hover { transform: none; }
.square.star .free { font-size: 8.5px; font-weight: 700; letter-spacing: 0.06em; margin-top: 2px; }
.square.blank { border-style: dashed; color: var(--ink-off); }

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

.callout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  background: var(--marker-red);
  border: 1.5px solid var(--ink);
  box-shadow: 4px 5px 0 rgba(22, 37, 92, 0.14);
}
.callout b { font-size: 28px; font-weight: 800; letter-spacing: 0.02em; color: var(--card); }

.progress-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.progress-card .num { flex: none; font-size: 24px; font-weight: 800; line-height: 1; color: var(--marker-purple); }
.progress-card .copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.progress-card .copy span { font-size: 12px; font-weight: 600; color: var(--ink-body); }
.progress-card .track { height: 6px; background: rgba(22, 37, 92, 0.1); }
.progress-card .fill { height: 6px; background: var(--marker-purple); }

/* ---------- language ---------- */

.lang-list { display: flex; flex-direction: column; gap: 12px; }
.lang-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--rule);
  box-shadow: var(--shadow);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.lang-row:hover, .lang-row:focus-visible { transform: translate(-1px, -1px); box-shadow: var(--shadow-lift); }
.lang-row[aria-checked="true"] { border-color: var(--ink); }
.lang-row .code {
  flex: none;
  width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: rgba(22, 37, 92, 0.07);
  color: var(--ink-muted);
}
.lang-row[aria-checked="true"] .code { color: var(--card); }
.lang-row .names { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 16px 12px; }
.lang-row .names b { font-size: 18px; font-weight: 800; line-height: 1.05; }
.lang-row .names em { font-family: var(--body); font-size: 12px; color: var(--ink-body); }
.lang-row .mark { flex: none; display: flex; align-items: center; padding-right: 14px; }

.file-note {
  margin-top: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-top: 1.5px solid var(--rule);
  padding-top: 14px;
  font-family: var(--body);
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* ---------- install prompt ---------- */

.install {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--ink);
  color: var(--card);
  box-shadow: 0 -4px 14px rgba(22, 37, 92, 0.18);
}
.install .copy { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.install .copy b { font-size: 13.5px; font-weight: 700; }
.install .copy span { font-family: var(--body); font-size: 11.5px; line-height: 1.35; opacity: 0.85; text-wrap: pretty; }
.install .btn { background: var(--marker-yellow); color: var(--ink); border-color: var(--marker-yellow); min-height: 44px; }
.install .btn:hover { background: var(--card); border-color: var(--card); }
.install .dismiss { min-height: 44px; padding: 0 8px; font-size: 12px; font-weight: 600; color: var(--card); opacity: 0.8; }
.install .dismiss:hover { opacity: 1; }

@media (min-width: 480px) {
  .grid .cell, .grid .line .hour, .grid .head b { height: 30px; }
}
