/* Massage planner — the v5 look «Индиго» (DESIGN.md "v5 LOOK «Индиго»",
   approved by Slava 2026-10-10; it replaces the v4 Goldie-like look).
   Reference: design/sketch/V5A_Week.dc.html and V5A_Visit.dc.html.
   Dark is the main mode, light is the same shapes.
   Phone first: the screen column is 390 px wide and centred on a laptop.

   The shape rule of v5: buttons, chips and icon buttons are SOFT SQUARES
   (radius 12), the main "+" is 60 px radius 18, cards are radius 18 with a
   hairline. No pills, no circles — only an avatar may stay round. */

/* ---- Manrope, self-hosted: no run-time request leaves this origin ---- */
/* Variable font, one file per subset, the whole 400–800 range in each.
   Licence: planner/static/fonts/OFL.txt (SIL Open Font License 1.1). */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/static/fonts/manrope-cyrillic-ext.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/static/fonts/manrope-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/static/fonts/manrope-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/static/fonts/manrope-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- the v5 tokens, in this one place ---- */

:root {
  /* page, cards, and the two quieter grid fills */
  --bg: #0E0C20; --surf: #1B1934; --dim: #25233F; --past: #2B2947;
  /* the hairline of a card and the heavier line of a button or a divider */
  --hair: rgba(255, 255, 255, 0.07); --line: #34315A;
  /* text */
  --text: #F4F2FF; --muted: #A7A3C9;
  /* indigo: links, primary button, selected chip */
  --acc: #9AA0FF; --acc-ink: #0E0C20;
  /* money states: paid green, debt amber, cancelled red */
  --ok: #7FD48A; --ok-ink: #0B2410; --ok-fill: #2C5A37;
  --warn: #F2A65A; --warn-fill: #4A3320;
  --bad: #FF8A7A; --bad-ink: #1A0A08; --bad-fill: #5A2A2E;
  /* a waiting visit, and a personal block */
  --wait-fill: #3A3B78; --wait-ink: #E3E4FF; --pers-fill: #3A3852;
  /* icon button and chip surfaces */
  --icon: #24223F; --chip: #26244A;
  /* The discount badge — v5 names no colour for it, so v4's warm one stays,
     one step darker: at #C2620F white-on-orange was 4.16 : 1 and WCAG AA
     asks 4.5 for 12 px text (P-S11d measured it in the browser). */
  --disc: #B85C0C; --disc-ink: #FFFFFF;
  /* The same discount written as TEXT on a card needs the opposite treatment:
     #B85C0C is a fill for white ink and reads 3.70 : 1 on --surf, which the
     browser caught on the visit screen (P-S11f). This one is 6.37. */
  --disc-text: #E08A3C;
  /* the small discount note inside a waiting week block — its own token, so
     its contrast is checked against the fill it actually sits on */
  --note: #BFC3FF;
  /* shapes: soft squares everywhere */
  --r-card: 18px; --r-btn: 12px; --r-small: 8px; --r-plus: 18px;
  --sh: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --sh-plus: 0 6px 16px rgba(0, 0, 0, 0.45);
}

/* Light keeps the v4 light values and takes the v5 shapes (DESIGN.md). */
:root[data-theme="light"] {
  --bg: #F4F3F9; --surf: #FFFFFF; --dim: #ECEAF4; --past: #E4E2EE;
  --hair: #E2E0EC; --line: #CFCCE0;
  /* --muted one step darker than v4's: at #6A677E the «›» of a cancelled
     row was 4.49 : 1 on --bad-fill, just under AA (P-S11d). */
  --text: #151228; --muted: #5E5B73;
  --acc: #4A4FC2; --acc-ink: #FFFFFF;
  --ok: #2E7D32; --ok-ink: #FFFFFF; --ok-fill: #DCEEDA;
  --warn: #B4530A; --warn-fill: #FBEBDD;
  --bad: #B3261E; --bad-ink: #FFFFFF; --bad-fill: #FBE4E1;
  --wait-fill: #E4E5FB; --wait-ink: #3A3FA8; --pers-fill: #ECEAF4;
  --icon: #FFFFFF; --chip: #FFFFFF;
  --disc: #B4530A; --disc-ink: #FFFFFF; --disc-text: #B4530A;   /* 5.02 on white */
  --note: #2F3490;
  --sh: 0 1px 3px rgba(21, 18, 40, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --sh-plus: 0 6px 16px rgba(21, 18, 40, 0.22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* Manrope, self-hosted above; system-ui only until it arrives (swap) */
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

.screen {
  width: 100%;
  max-width: 390px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.spacer { flex-grow: 1; }

/* ---- header: soft-square buttons, title, date line ---- */

.head { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 20px 16px 8px; }
.head__titles { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
h1 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.head__when {
  font-size: 14px; color: var(--muted); max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.head__btn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--r-btn);
  border: 1px solid var(--line); background: var(--icon); color: var(--text);
  box-shadow: var(--sh);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-family: inherit; cursor: pointer; padding: 0;
}
.head__btn--wide { width: auto; padding: 0 18px; font-size: 16px; font-weight: 600; }
.head__form { display: flex; flex-shrink: 0; }

/* the "Оплачено $X" button of the visit header */
.head__pay {
  height: 44px; flex-shrink: 0; padding: 0 18px; border: 0; border-radius: var(--r-btn);
  background: var(--acc); color: var(--acc-ink); box-shadow: var(--sh);
  font-family: inherit; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
/* already paid: a status label, not a button (V5A_Visit draws it radius 8) */
/* Filled, not tinted: --ok on --ok-fill is 4.45 : 1 dark and 4.22 light, and
   this label is 13 px. The "$" marker's pairing clears AA in both (P-S11d). */
.head__pay--done {
  height: 30px; padding: 0 12px; border-radius: var(--r-small); box-shadow: none;
  background: var(--ok); color: var(--ok-ink); font-size: 13px; cursor: default;
}

/* ---- the stats box ---- */

.stats {
  margin: 10px 16px 14px; background: var(--surf); border: 1px solid var(--hair);
  border-radius: var(--r-card);
  padding: 14px 16px; display: grid; grid-template-columns: repeat(var(--cells, 3), minmax(0, 1fr));
}
.stat { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; border-right: 1px solid var(--hair); min-width: 0; }
.stat:first-child { padding-left: 0; }
.stat:last-child { padding-right: 0; border-right: 0; }
.stat__label { font-size: 13px; color: var(--muted); line-height: 1.25; }
.stat__sum { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.stat__sum--ok { color: var(--ok); }
.stat__sum--warn { color: var(--warn); }
.stat__sum--bad { color: var(--bad); }
.stats--six { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
.stats--six .stat__sum { font-size: 20px; }
.stats--six .stat:nth-child(3n) { border-right: 0; padding-right: 0; }
.stats--six .stat:nth-child(3n + 1) { padding-left: 0; }

/* ---- section label, with an action link on the same line ---- */

.sect { padding: 16px 20px 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sect--tight { padding-top: 0; }
.sect__label { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
/* «Изменить», «Перенести», «Записать снова», «Карточка ›»: 21 px of text that
   has to be a 44 px target. They keep their size and grow the target around
   themselves, the way `.ent__who` already does (P-S11d). */
.sect__link { font-size: 15px; font-weight: 600; color: var(--acc); text-decoration: none; background: 0; border: 0; font-family: inherit; padding: 0; cursor: pointer; position: relative; }
.sect__link::after { content: ""; position: absolute; inset: -12px -8px; }
.sect__note { font-size: 14px; color: var(--muted); }
/* two links on the right of one section heading (P-S11c): «Изменить» next to
   «Перенести», «Записать снова» next to «Карточка ›» */
.sect__links { display: flex; align-items: baseline; gap: 16px; }

/* ---- the day list ---- */

.list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }

.ent {
  position: relative;
  background: var(--surf); border: 1px solid var(--hair); border-radius: var(--r-card);
  padding: 12px 16px; display: flex; align-items: center; gap: 14px;
  color: var(--text); text-decoration: none;
}
.ent--personal { background: var(--pers-fill); border: 1px dashed var(--line); color: var(--muted); }
.ent--bad { background: var(--bad-fill); border-color: transparent; }
/* the next visit still waiting: the indigo card of the v5 sketch */
.ent--next { background: var(--wait-fill); border-color: transparent; color: var(--wait-ink); }

/* one stretched link opens the row; the name is its own link on top, so the
   two targets never nest (P-S05). */
.ent__hit { position: absolute; inset: 0; border-radius: inherit; }
/* They sit ON TOP of `.ent__hit` — positioned, and later in the markup — so
   without this a tap on the row's own words landed on nothing at all and the
   row simply did not open (P-S11d, found in the browser). */
.ent__mark, .ent__body, .ent__tail, .ent__paid { position: relative; pointer-events: none; }

.ent__mark {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--r-small);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px;
}
.ent__mark--ok { background: var(--ok); color: var(--ok-ink); }
.ent__mark--acc { background: var(--acc); color: var(--acc-ink); }
.ent__mark--personal { background: var(--icon); color: var(--muted); }
.ent__mark--bad { background: var(--bad); color: var(--acc-ink); }

.ent__body { flex-grow: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ent__name { font-size: 18px; font-weight: 600; }
.ent--next .ent__name { font-weight: 700; }
.ent__who { color: inherit; text-decoration: none; position: relative; pointer-events: auto; }
.ent__who::after { content: ""; position: absolute; inset: -11px -8px; }
.ent__sub { font-size: 14px; color: var(--muted); }
.ent--next .ent__sub { color: var(--wait-ink); opacity: 0.8; }
.ent--personal .ent__sub { color: var(--muted); }
.ent--bad .ent__sub { color: var(--bad); }
.ent__badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ent__tail { font-size: 15px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.ent--next .ent__tail { color: var(--wait-ink); }
.ent__paid { font-size: 17px; font-weight: 700; flex-shrink: 0; }
.ent__empty { padding: 26px 4px; color: var(--muted); font-size: 15px; }

.badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-small); align-self: flex-start; }
.badge--warn { color: var(--disc-ink); background: var(--disc); }
.badge--acc { color: var(--acc-ink); background: var(--acc); }
/* a cancelled row reads as a red line, as the sketch draws it */
.badge--bad { color: var(--bad); background: transparent; padding: 0; font-weight: 600; }

/* ---- bottom bar: a soft square on the left, the big "+" on the right ---- */

.bar { padding: 12px 16px 26px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.round {
  width: 60px; height: 60px; flex-shrink: 0; border-radius: var(--r-plus); border: 0;
  background: var(--acc); color: var(--acc-ink); box-shadow: var(--sh-plus);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-family: inherit; cursor: pointer;
}

/* ---- buttons ---- */

.foot { padding: 14px 16px 26px; display: flex; flex-direction: column; gap: 10px; }
.foot--tight { padding-top: 0; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px; border: 0; border-radius: var(--r-btn);
  background: var(--acc); color: var(--acc-ink); box-shadow: var(--sh);
  font-family: inherit; font-size: 17px; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.btn--out { background: var(--icon); border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.btn--warn { background: transparent; border: 1px solid var(--line); color: var(--warn); font-weight: 600; }
.btn--mid { height: 48px; font-size: 16px; }
.btn:disabled, .btn--dead { background: var(--dim); border: 1px solid var(--line); color: var(--muted); box-shadow: none; cursor: default; }
.btn__stack { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.btn__sub { font-size: 14px; font-weight: 400; }

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

/* the three outline buttons at the bottom of the visit screen */
.trio { padding: 6px 16px 24px; display: grid; grid-template-columns: repeat(var(--cells, 3), minmax(0, 1fr)); gap: 8px; }
.trio form { display: flex; }
.trio__pill {
  width: 100%; height: 48px; border-radius: var(--r-btn); border: 1px solid var(--line);
  background: transparent; color: var(--text); box-shadow: var(--sh);
  font-family: inherit; font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer;
}
.trio__pill--warn { color: var(--warn); }
.trio__pill--bad { color: var(--bad); }

/* ---- cards ---- */

.card {
  margin: 0 16px; background: var(--surf); border: 1px solid var(--hair);
  border-radius: var(--r-card); padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
}
/* the one round shape v5 allows */
.card__ava {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 999px;
  background: var(--wait-fill); color: var(--wait-ink);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card__name { font-size: 19px; font-weight: 700; }
.card__sub { font-size: 14px; color: var(--muted); }

/* date | time, one card split by a hairline */
.split {
  margin: 0 16px; background: var(--surf); border: 1px solid var(--hair);
  border-radius: var(--r-card); display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: hidden;
}
.split__left { padding: 16px; display: flex; align-items: center; gap: 12px; border-right: 1px solid var(--hair); }
.split__left svg { fill: var(--acc); flex-shrink: 0; }
.split__right { padding: 16px; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.split span { font-size: 17px; font-weight: 600; }

/* the price card of the visit screen (v5: a surface card, not a lavender one) */
.lav {
  margin: 0 16px; background: var(--surf); color: var(--text);
  border: 1px solid var(--hair); border-radius: var(--r-card); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.lav__line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lav__name { display: flex; flex-direction: column; min-width: 0; }
.lav__name > span:first-child { font-size: 17px; font-weight: 600; }
.lav__note { font-size: 13px; color: var(--muted); }
.lav__chip { font-size: 17px; font-weight: 700; background: var(--chip); border: 1px solid var(--line); padding: 6px 14px; border-radius: var(--r-small); white-space: nowrap; }
.lav__line--cut .lav__name > span:first-child, .lav__line--cut .lav__sum { color: var(--disc-text); font-weight: 700; }
.lav__sum { font-size: 17px; font-weight: 600; white-space: nowrap; }

/* the "Итого" line above the bottom buttons */
.total { margin: 0 20px; border-top: 1px solid var(--hair); padding: 12px 0 6px; display: flex; flex-direction: column; gap: 4px; }
.total__tip { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; color: var(--muted); }
.total__line { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.total__word { font-size: 15px; color: var(--muted); }
.total__sum { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }

.note { margin: 12px 16px 0; padding: 12px 16px; border-radius: var(--r-card); background: var(--bad-fill); border: 1px solid var(--hair); color: var(--bad); font-size: 15px; font-weight: 600; }
.warncard { margin: 0 16px 12px; border-radius: var(--r-card); padding: 14px 16px; background: var(--bad-fill); border: 1px solid var(--hair); display: flex; gap: 12px; align-items: flex-start; }
.warncard > svg { stroke: var(--bad); flex-shrink: 0; margin-top: 1px; }
.warncard__title { font-size: 17px; font-weight: 700; color: var(--bad); }
.warncard__text { font-size: 15px; color: var(--text); }

/* a plain list of label → value lines inside one card */
.rows { margin: 0 16px; background: var(--surf); border: 1px solid var(--hair); border-radius: var(--r-card); padding: 2px 16px; display: flex; flex-direction: column; }
.rows__line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--hair); font-size: 16px; }
.rows__line:last-child { border-bottom: 0; }
.rows__label { color: var(--muted); }
.rows__value { text-align: right; min-width: 0; }

/* ---- groups, chips, fields ---- */

.group { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.group__hint { font-size: 14px; color: var(--muted); padding: 0 4px; }
.group__hint--warn { color: var(--warn); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
/* The payment and tip chips. «Наличные» needs 75 px of ink at 15 px Manrope
   600. Five across a 390 px phone leave 53, and the `auto-fit` row P-S11d put
   here wrapped to four and left the word 66 px of content box: it hung into
   its own padding and at 360 px stopped half a pixel short of the border.
   Three columns give it 94 px at 360 and 104 at 390, the row reads 3 + 2, and
   a longer word in another language cannot clip either (P-14, P-S11f). */
.grid-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
/* P-S11e: one wide chip above the five money ones — the certificate. */
.grid-1 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }

/* A row rendered `hidden` (the certificate's tip methods, the header pill a
   certificate visit does not use) is a grid or a flex box, and a class beats
   the browser's own `[hidden]` rule. This one does not. */
[hidden] { display: none !important; }

/* «Разделить» — the split-payment line, a plain <details> so it needs no JS.
   Closed, it is one quiet link under the method chips (P-S11c, step 2). */
.more { margin-top: 2px; }
.more__sum { list-style: none; font-size: 15px; font-weight: 600; color: var(--acc); cursor: pointer; padding: 2px 4px; display: inline-flex; align-items: center; min-height: 44px; }
.more__sum::-webkit-details-marker { display: none; }
.more__panel { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }

/* Radio chips: the input itself is hidden, its label is the soft square. */
.opt { position: relative; }
.opt input { position: absolute; inset: 0; margin: 0; opacity: 0; width: 100%; height: 100%; }
.opt span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  height: 46px; padding: 0 4px; border-radius: var(--r-btn); border: 1px solid var(--line);
  background: var(--chip); color: var(--text); box-shadow: var(--sh);
  font-size: 15px; font-weight: 600; line-height: 1.1;
}
.opt input:checked + span { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.opt input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 44px; padding: 0 16px; border-radius: var(--r-btn);
  border: 1px solid var(--line); background: var(--chip); color: var(--text);
  box-shadow: var(--sh);
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none;
}
.chip--on { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); font-weight: 700; }
.chip--new { background: transparent; border: 1px dashed var(--acc); color: var(--acc); box-shadow: none; }

.field { display: flex; gap: 8px; align-items: center; }
.field input[type="text"], .field input[type="search"], .field input[type="tel"],
.field input[type="password"],
.field input[type="date"], .field input[type="time"] {
  flex-grow: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: var(--r-btn);
  border: 1px solid var(--line); background: var(--surf); color: var(--text);
  font-family: inherit; font-size: 16px;
}
.field input::placeholder { color: var(--muted); }
.field label { font-size: 15px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.field__fix { width: 62px; flex-shrink: 0; font-size: 15px; color: var(--muted); }
/* «Первым способом» — the labelled first row of an open «Разделить» (P-S11f,
   step 3). 130 px holds it and still leaves 190 to type in at 360 px. */
.field__fix--wide { width: 130px; }

.check { display: flex; align-items: center; gap: 12px; min-height: 46px; font-size: 16px; padding: 0 4px; }
.check input { width: 22px; height: 22px; accent-color: var(--acc); }

/* ---- Записать: the day strip and the free-time squares ---- */

.strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cell {
  height: 58px; border-radius: var(--r-btn); border: 1px solid var(--line);
  background: var(--chip); color: var(--text); box-shadow: var(--sh);
  font-family: inherit; font-size: 11px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer;
}
.cell__num { font-size: 17px; font-weight: 700; }
.cell--on { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.cell:disabled { background: var(--dim); border: 1px solid var(--hair); color: var(--muted); box-shadow: none; cursor: default; }

.slot {
  height: 46px; border-radius: var(--r-btn); border: 1px solid var(--line);
  background: var(--chip); color: var(--text); box-shadow: var(--sh);
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
}
.slot--tall { height: 54px; }
.slot__price { font-size: 12px; font-weight: 400; color: var(--muted); }
.slot--on { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); }
.slot--on .slot__price { color: inherit; }

.block { margin: 14px 16px 0; border-radius: var(--r-card); background: var(--surf); border: 1px solid var(--hair); }
.block > summary { min-height: 52px; padding: 15px 18px; font-size: 16px; font-weight: 600; color: var(--acc); cursor: pointer; }
.block .group { padding: 0 14px 16px; }

/* ---- Карточка клиента: the history lines ---- */

.hist { margin: 0 16px; background: var(--surf); border: 1px solid var(--hair); border-radius: var(--r-card); padding: 4px 16px; display: flex; flex-direction: column; }
.hist__line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; font-size: 16px; min-height: 34px; border-bottom: 1px solid var(--hair); }
.hist__line:last-child { border-bottom: 0; }
.hist__end { font-weight: 600; white-space: nowrap; }
.hist__end--ok { color: var(--ok); }
.hist__end--warn { color: var(--warn); }
.hist__end--bad { color: var(--bad); }
.hist__end--muted { color: var(--muted); }
.hist--plain { background: 0; border: 0; padding: 0 4px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em; background: var(--dim); border: 1px solid var(--hair);
  border-radius: 6px; padding: 1px 6px; white-space: nowrap;
}

/* P-S12c: one cost of the month — what it was, and under it the day, how it
   was paid and what it was for. The whole row is the tap target. */
.exp { display: flex; flex-direction: column; justify-content: center; gap: 2px;
       min-width: 0; min-height: 44px; }
.exp .ent__sub { display: block; }

.link { color: var(--acc); text-decoration: none; }
.link--plain { color: inherit; text-decoration: none; }

/* ---- Неделя ---- */

/* ---- the start screen: the week grid (P-S11b) ----------------------------
   One row is half an hour (Slava 2026-10-10: no 15-minute times). The grid is
   drawn over the WHOLE scrollable day (07:00–23:00, `--rows`) while the
   scroller is only as tall as the working hours (`--shown`), so the screen
   opens on the working day and reaches the rest by scrolling.
   Reference: design/sketch/V5A_Week.dc.html. */

.wk { display: grid; grid-template-columns: 34px repeat(7, minmax(0, 1fr)); gap: 3px; padding: 0 12px 0 8px; }
.wk--head { text-align: center; }
.wk--grid { --row: 28px; }

.head--week { gap: 8px; padding-bottom: 4px; }
/* 44 px even here: the week header is the screen Slava taps most. */
.head--week .head__btn { width: 44px; }

.wk__day { display: flex; flex-direction: column; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); border-radius: var(--r-btn); padding: 3px 0; text-decoration: none; }
.wk__num { font-size: 17px; font-weight: 700; color: var(--text); }
.wk__day--off .wk__num { color: var(--muted); font-weight: 500; }
.wk__day--now { background: var(--acc); color: var(--acc-ink); }
.wk__day--now .wk__num { color: var(--acc-ink); }

/* The window the screen opens on IS the working hours. The scrollbar is hidden
   so the seven columns stay under their seven day headers on a laptop too. */
.wk__scroll {
  --row: 28px;
  height: calc(var(--row) * var(--shown)); overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.wk__scroll::-webkit-scrollbar { display: none; }

.wk__hours { display: flex; flex-direction: column; font-size: 10px; color: var(--muted); margin-top: -6px; }
.wk__hour { height: calc(var(--row) * 2); }

.wk__col { position: relative; height: calc(var(--row) * var(--rows)); border-radius: 10px; overflow: hidden; }

/* One half hour. Working hours are the card fill, hours nobody works are the
   lighter `--dim`, and everything already behind is the lighter `--past`
   (DESIGN.md "Week grid rules"). A whole hour gets the solid hairline, the half
   hour inside it the dashed one. */
.wk__cell { display: block; height: var(--row); border-top: 1px solid var(--hair); }
.wk__cell:nth-child(even) { border-top-style: dashed; }
.wk__cell--free { background: var(--surf); }
.wk__cell--dim { background: var(--dim); }
.wk__cell--past { background: var(--past); }

.wk__block {
  position: absolute; left: 2px; right: 2px;
  top: calc(var(--row) * var(--top) + 1px);
  height: calc(var(--row) * var(--span) - 3px);
  border-radius: var(--r-small); font-size: 10px; line-height: 1.15; padding: 3px 4px;
  overflow: hidden; text-decoration: none;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  /* Slava 2026-10-10: a client name in a week block is never bold */
  font-weight: 400;
}
.wk__block--ok { background: var(--ok-fill); color: var(--text); }
.wk__block--acc { background: var(--wait-fill); color: var(--wait-ink); }
/* v5 puts "over but not paid" on the same red as "cancelled": the "$" marker
   and the strike-through are what tell the two apart (DESIGN.md token list). */
.wk__block--warn { background: var(--bad-fill); color: var(--text); }
.wk__block--bad { background: var(--bad-fill); color: var(--text); }
.wk__block--personal { background: var(--pers-fill); color: var(--muted); border: 1px dashed var(--line); }
.wk__block--struck { opacity: 0.55; }
.wk__block--struck .wk__who { text-decoration: line-through; }

.wk__who { line-height: 1.15; }
.wk__at { font-size: 9px; opacity: 0.75; }
.wk__note { font-size: 10px; font-weight: 700; color: var(--note); }

/* "$": green when the money is in, red when the visit is over and it is not. */
.wk__mark { width: 14px; height: 14px; border-radius: 4px; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.wk__mark--ok { background: var(--ok); color: var(--ok-ink); }
.wk__mark--bad { background: var(--bad); color: var(--bad-ink); }

/* the line across today's column, and its square head */
.wk__now { position: absolute; left: 0; right: 0; top: calc(var(--row) * var(--at)); height: 2px; background: var(--acc); }
.wk__now::before { content: ""; position: absolute; left: 0; top: -3px; width: 8px; height: 8px; border-radius: 2px; background: var(--acc); }

.wk__hint { padding: 6px 16px 0; text-align: center; font-size: 12px; color: var(--muted); }

/* The week's own two numbers, one quiet line under the header (P-S11c, step 7):
   it must not compete with the grid, so it is the muted 12 px of the hint. */
.wk__sums { padding: 0 20px 6px; font-size: 12px; color: var(--muted); }

/* ---- the month picker behind the header (plain <details>, no JS) ---- */

.mp { flex-grow: 1; min-width: 0; position: relative; }
.mp__sum { list-style: none; display: flex; align-items: center; gap: 6px; min-height: 44px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; cursor: pointer; }
.mp__sum::-webkit-details-marker { display: none; }
.mp__panel {
  /* 7 x 44 px + 6 x 4 px gaps + 2 x 12 px padding + the 1 px border on
     each side = 358 px, so a day cell really measures 44 (P-S11d). */
  position: absolute; z-index: 5; top: 44px; left: -68px; width: 358px;
  background: var(--surf); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.mp__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mp__title { font-size: 16px; font-weight: 700; }
.mp__week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; }
.mp__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mp__day { min-height: 44px; border-radius: var(--r-btn); background: var(--dim); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 14px; font-weight: 600; text-decoration: none; }
.mp__day--out { background: transparent; color: var(--muted); }
.mp__day--on { background: var(--chip); box-shadow: inset 0 0 0 1px var(--acc); }
.mp__day--now { background: var(--acc); color: var(--acc-ink); }
.mp__dot { width: 4px; height: 4px; border-radius: 2px; background: var(--acc); }
.mp__day--now .mp__dot { background: var(--acc-ink); }

/* ---- the "+" sheet of the bottom bar (plain <details>, no JS) ---- */

.bar__left { display: flex; align-items: center; gap: 8px; }
.sheet { position: relative; }
.sheet > summary { list-style: none; }
.sheet > summary::-webkit-details-marker { display: none; }
.sheet__panel {
  position: absolute; right: 0; bottom: 70px; z-index: 5; width: 216px;
  background: var(--surf); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.sheet__form { display: flex; flex-direction: column; gap: 6px; }
.sheet__date {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: var(--r-btn); background: var(--chip); color: var(--text);
  font-family: inherit; font-size: 15px;
}
.sheet__item {
  width: 100%; height: 48px; padding: 0 14px; border: 0; border-radius: var(--r-btn);
  background: var(--icon); color: var(--text); box-shadow: var(--sh);
  display: flex; align-items: center; font-family: inherit; font-size: 16px;
  font-weight: 600; text-decoration: none; cursor: pointer;
}

.legend { padding: 14px 20px 0; display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__dot { width: 10px; height: 10px; border-radius: 3px; }
.legend__dot--ok { background: var(--ok); }
.legend__dot--acc { background: var(--acc); }
.legend__dot--warn { background: var(--bad); }
.legend__dot--bad { background: var(--bad); opacity: 0.45; }
.legend__dot--personal { background: var(--pers-fill); border: 1px dashed var(--line); }

/* ---- Деньги ---- */

.switch { margin: 0 16px; background: var(--surf); border: 1px solid var(--hair); border-radius: var(--r-card); padding: 4px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.switch__tab { min-height: 44px; border-radius: var(--r-btn); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none; }
.switch__tab--on { background: var(--acc); color: var(--acc-ink); box-shadow: var(--sh); }

.hero { padding: 18px 16px 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hero__body { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.hero__when { font-size: 14px; color: var(--muted); }
.hero__sum { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.hero__tips { font-size: 14px; color: var(--muted); }

.chart { margin: 6px 16px 0; background: var(--surf); border: 1px solid var(--hair); border-radius: var(--r-card); padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 6px; }
.chart__label { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.chart__plot { height: 118px; display: grid; grid-template-columns: repeat(var(--bars), minmax(0, 1fr)); gap: 6px; align-items: end; border-bottom: 1px solid var(--hair); }
.chart__slot { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; }
.chart__value { font-size: 12px; font-weight: 700; text-align: center; }
.chart__bar { background: var(--acc); border-radius: 5px 5px 0 0; min-height: 0; }
.chart__bar--dim { opacity: 0.5; }
.chart__axis { display: grid; grid-template-columns: repeat(var(--bars), minmax(0, 1fr)); gap: 6px; font-size: 12px; color: var(--muted); text-align: center; }

.shares { margin: 12px 16px 0; background: var(--surf); border: 1px solid var(--hair); border-radius: var(--r-card); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.share { display: flex; flex-direction: column; gap: 6px; }
.share__line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 16px; }
.share__sum { font-weight: 700; white-space: nowrap; }
.share__track { height: 8px; background: var(--dim); border-radius: 4px; }
.share__fill { height: 8px; background: var(--acc); border-radius: 4px; }

/* the "Неделя" / "Деньги" button of the bottom bar */
.bar__pill {
  height: 44px; padding: 0 18px; border-radius: var(--r-btn);
  border: 1px solid var(--line); background: var(--icon); color: var(--text);
  box-shadow: var(--sh);
  display: inline-flex; align-items: center; font-size: 15px; font-weight: 600;
  text-decoration: none; font-family: inherit; cursor: pointer;
}

/* The client card's header line is longer than a date and may wrap. */
.head__sub { font-size: 14px; color: var(--muted); line-height: 1.3; }
.head__sub .link { color: var(--acc); }

/* ---- Расчёт со студией (P-S12b) ---- */

/* The settlement text, ready to copy: as tall as the message, never wider than
   the screen, and in the same monospace-free face as everything else. */
.sms {
  width: 100%; box-sizing: border-box; padding: 12px 14px; resize: vertical;
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--chip); color: var(--text);
  font-family: inherit; font-size: 15px; line-height: 1.45;
}
/* The strip over the week after a studio day — a link, not a warning. */
.banner {
  margin: 0 16px 10px; padding: 12px 16px; border-radius: var(--r-card);
  background: var(--surf); border: 1px solid var(--line); color: var(--text);
  box-shadow: var(--sh); display: flex; align-items: center; min-height: 44px;
  font-size: 15px; font-weight: 600; text-decoration: none;
}
