@font-face { font-family: "Chakra Petch"; src: url(fonts/ChakraPetch-Light.ttf); font-weight: 300; }
@font-face { font-family: "Chakra Petch"; src: url(fonts/ChakraPetch-Regular.ttf); font-weight: 400; }
@font-face { font-family: "Chakra Petch"; src: url(fonts/ChakraPetch-Medium.ttf); font-weight: 500; }
@font-face { font-family: "Chakra Petch"; src: url(fonts/ChakraPetch-SemiBold.ttf); font-weight: 600; }
@font-face { font-family: "Chakra Petch"; src: url(fonts/ChakraPetch-Bold.ttf); font-weight: 700 800; }
@font-face { font-family: "Baserona"; src: url(fonts/Baserona.otf); }

:root {
  color-scheme: dark;
  --accent: #CBCBCB;   /* Budzy grey: primary buttons, selected states (black text on it) */
  --accent-2: #ffffff; /* highlighted text and numbers */
  --soft: #262626;     /* quiet fills: chips, tracks, pressed states */
  --line: #333333;     /* borders and dividers */
  --field: #111111;    /* text fields */
  --bg: #0e0e0e;
  --ink: #f2f2f2;
  --muted: #858585;
  --card: #1b1b1b;
  --r-lg: 4px;
  --r-md: 4px;
  --shadow: 0 2px 16px rgba(0, 0, 0, .35);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Chakra Petch", -apple-system, system-ui, sans-serif;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:disabled { cursor: default; }
input { font: inherit; }
[hidden] { display: none !important; }

.screen { position: fixed; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; animation: fadeIn .22s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* shared buttons */
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 4px; flex: none; transition: background .15s; }
.icon-btn:active { background: var(--soft); }
.icon-btn.light { color: #fff; }
.icon-btn.light:active { background: rgba(255, 255, 255, .15); }
.ok-btn {
  background: var(--accent); color: #000; font-weight: 700; font-size: 16px;
  padding: 0 20px; height: 44px; border-radius: 4px; flex: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  transition: transform .12s var(--ease), opacity .2s, box-shadow .2s;
}
.ok-btn.small { height: 38px; padding: 0 16px; font-size: 15px; box-shadow: none; }
.ok-btn:active { transform: scale(.96); }
.ok-btn.soft { opacity: .45; box-shadow: none; }
.link-btn { color: var(--accent); font-weight: 500; font-size: 14px; padding: 10px 6px; }
.link-btn.light { color: #fff; }
.link-btn.center { display: block; margin: 14px auto 2px; color: var(--muted); }
.link-btn:active { opacity: .6; }

/* HOME */
#home { overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; padding: calc(var(--safe-t) + 14px) 0 calc(var(--safe-b) + 110px); }
.brand { text-align: center; margin-bottom: 26px; }
.logo { display: inline-block; line-height: 0; }
.logo img { height: 28px; width: auto; display: block; }
.sub { margin: 12px 0 0; color: var(--muted); font-size: 15px; }

.types { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 760px; margin: 0 auto; }
@media (min-width: 700px) { .types { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.type-card {
  background: var(--card); border-radius: var(--r-lg); padding: 8px 8px 14px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; text-align: left;
  transition: transform .15s var(--ease), box-shadow .15s;
}
.type-card:active { transform: scale(.97); box-shadow: 0 1px 8px rgba(0, 0, 0, .08); }
.type-card .thumb { width: 100%; border-radius: 4px; overflow: hidden; background: var(--soft); aspect-ratio: 9 / 16; display: flex; align-items: center; justify-content: center; }
.type-card .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.type-card .name { font-weight: 700; font-size: 16px; margin: 12px 6px 4px; }
.type-card .meta { display: flex; gap: 5px; margin: 0 6px; flex-wrap: wrap; }
.tag { font-size: 11.5px; font-weight: 500; color: var(--accent-2); background: var(--soft); border-radius: 4px; padding: 3px 7px; }

/* EDITOR */
.bar {
  display: flex; align-items: center; gap: 6px;
  padding: calc(var(--safe-t) + 6px) 12px 6px 6px;
}
.bar h1 { font-size: 15px; margin: 0; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; text-align: center; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; padding: 8px 18px; min-height: 0; }
.canvas-wrap { position: relative; line-height: 0; }
#cv { display: block; border-radius: 4px; touch-action: none; box-shadow: 0 10px 34px rgba(0, 0, 0, .18); background: #1b1b1b; }
.hint-pill {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: rgba(0, 0, 0, .62); color: #fff; font-size: 12.5px; line-height: 1.3; font-weight: 500;
  padding: 8px 13px; border-radius: 4px; white-space: nowrap; pointer-events: none;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: opacity .4s;
}
.hint-pill.gone { opacity: 0; }
.add-photo {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: rgba(27, 27, 27, .94); color: var(--ink); font-weight: 700; font-size: 17px;
  padding: 24px 34px 22px; border-radius: 4px; box-shadow: 0 10px 34px rgba(0, 0, 0, .2);
  transition: transform .12s var(--ease);
}
.add-photo:active { transform: scale(.96); }
.add-photo .plus { width: 54px; height: 54px; border-radius: 4px; background: var(--accent); color: #000; display: grid; place-items: center; margin-bottom: 6px; box-shadow: 0 4px 14px rgba(203, 203, 203, .4); }
.add-photo small { font-weight: 400; font-size: 13px; color: var(--muted); }

.dock {
  display: flex; justify-content: center; gap: 4px;
  margin: 4px 14px calc(var(--safe-b) + 12px); padding: 6px;
  background: var(--card); border-radius: 4px; box-shadow: var(--shadow);
  align-self: center; max-width: calc(100% - 28px);
}
.dock-btn {
  position: relative; width: 66px; height: 58px; border-radius: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11.5px; font-weight: 500; color: var(--ink); transition: background .15s;
}
.dock-btn:active { background: var(--soft); }
.dock-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dock-btn span { white-space: nowrap; }
.badge {
  position: absolute; top: 5px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 4px;
  background: var(--accent); color: #000; font-style: normal; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

/* SHEETS */
.sheet {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .32); display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .22s var(--ease); z-index: 10;
}
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet.see-through { background: rgba(0, 0, 0, .06); }
.sheet-card {
  background: var(--bg); width: 100%; max-width: 560px; max-height: 86%;
  border-radius: 4px 4px 0 0; display: flex; flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .16);
  transform: translateY(40px); transition: transform .28s var(--ease);
  -webkit-user-select: text; user-select: text;
}
.sheet.open .sheet-card { transform: none; }
.sheet-head {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  padding: 22px 18px 12px 20px; flex: none;
}
.grab { position: absolute; top: 8px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 2px; background: #444; }
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px 16px calc(var(--safe-b) + 18px); overscroll-behavior: contain; }

/* calendar */
.cal { background: var(--card); border-radius: var(--r-lg); padding: 6px 10px 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
#cal-title { font-weight: 700; font-size: 16px; }
#cal-title::first-letter { text-transform: uppercase; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.cal-dow span { font-size: 12px; color: var(--muted); padding: 4px 0 6px; font-weight: 500; }
.cal-grid button {
  height: 44px; margin: 2px auto; width: 44px; border-radius: 4px; font-size: 16px; font-weight: 500;
  transition: background .12s, color .12s, transform .12s var(--ease);
}
.cal-grid button:active:not(:disabled) { transform: scale(.9); }
.cal-grid button.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-grid button.on { background: var(--accent); color: #000; font-weight: 700; box-shadow: none; }
.cal-grid button.past { color: #444; }
.cal-grid button.blank { visibility: hidden; }
.cal-foot { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 0; font-size: 13px; color: var(--muted); }

.rows { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: var(--r-md); padding: 6px 4px 6px 14px; }
.row .d { font-weight: 700; width: 50px; flex: none; font-variant-numeric: tabular-nums; }
.row input, .input-wrap input {
  flex: 1; min-width: 0; width: 100%; height: 44px; border: 1.5px solid var(--line); border-radius: 4px; padding: 0 12px;
  font-size: 16px; background: var(--field); color: var(--ink); transition: border-color .15s;
}
.row input:focus, .input-wrap input:focus { outline: none; border-color: var(--accent); }
.row .x { width: 40px; height: 40px; border-radius: 4px; color: var(--muted); flex: none; display: grid; place-items: center; }
.row .x:active { background: var(--soft); }
.row .x svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.empty-rows { color: var(--muted); text-align: center; font-size: 14px; margin: 14px 0 4px; }
.quick-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 10px 4px 0; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { background: var(--soft); color: var(--accent-2); font-size: 13.5px; font-weight: 500; height: 34px; padding: 0 13px; border-radius: 4px; }
.quick button:active { background: #333; }

/* text fields */
.fields { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 7px; background: var(--card); border-radius: var(--r-md); padding: 12px 14px 13px; }
.field > span { font-weight: 700; font-size: 14px; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.input-wrap { position: relative; display: flex; }
.input-wrap input { padding-right: 42px; height: 46px; font-size: 17px; }
.input-wrap .clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 4px;
  color: #fff; background: #444; font-size: 18px; line-height: 32px; text-align: center;
}
.input-wrap .clear:active { background: var(--muted); }
.input-wrap input:placeholder-shown + .clear { display: none; }

/* effects */
.fx-list { background: var(--card); border-radius: var(--r-lg); padding: 4px 14px; display: flex; flex-direction: column; }
.fx-row { display: grid; grid-template-columns: 98px 1fr 46px; align-items: center; gap: 10px; min-height: 54px; }
.fx-row + .fx-row { border-top: 1px solid var(--line); }
.fx-list .toggle-row { background: none; border-radius: 0; padding: 12px 0; }
.fx-list > * + .toggle-row, .fx-list .toggle-row + * { border-top: 1px solid var(--line); }
.fx-row > span { font-size: 15px; font-weight: 500; }
.fx-row output { font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; padding: 8px 0; }
.fx-row output.changed { color: var(--accent-2); font-weight: 700; }
.fx-row input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; margin: 0; }
.fx-row input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 2px; background: var(--soft); }
.fx-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 4px; background: #fff; border: 2px solid var(--accent); margin-top: -11px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.fx-row input[type=range]::-moz-range-track { height: 6px; border-radius: 2px; background: var(--soft); }
.fx-row input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 4px; background: #fff; border: 2px solid var(--accent); }
.fx-row.stab { grid-template-columns: 1fr; gap: 8px; padding: 12px 0; }
.chips { display: flex; gap: 6px; }
.chips button { flex: 1; }
.chips button { height: 34px; padding: 0 13px; border-radius: 4px; background: var(--soft); color: var(--accent-2); font-size: 14px; font-weight: 500; }
.chips button.on { background: var(--accent); color: #000; font-weight: 700; }

/* BUSY */
.overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: none; align-items: center; justify-content: center; z-index: 30;
  padding: 20px; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.overlay.open { display: flex; animation: fadeIn .2s var(--ease); }
.busy-card { background: var(--card); border-radius: var(--r-lg); padding: 28px 30px 26px; text-align: center; width: min(320px, 100%); box-shadow: 0 10px 40px rgba(0, 0, 0, .2); }
.spinner { width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 16px; border: 4px solid var(--soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#busy-text { margin: 0 0 14px; font-weight: 500; line-height: 1.35; }
.progress { height: 6px; background: var(--soft); border-radius: 2px; overflow: hidden; }
#busy-bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* RESULT */
.result {
  position: fixed; inset: 0; z-index: 25; background: #000; color: #fff;
  display: none; flex-direction: column;
  padding: calc(var(--safe-t) + 6px) 0 calc(var(--safe-b) + 16px);
}
.result.open { display: flex; animation: fadeIn .25s var(--ease); }
.result-top { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 6px; height: 50px; }
.result-top span { font-weight: 700; font-size: 17px; }
.result-media { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 24px 18px; }
#result-img, #result-vid {
  max-width: 100%; max-height: 100%; border-radius: 4px; box-shadow: 0 14px 50px rgba(0, 0, 0, .5);
  -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; background: #000;
}
.result-actions { padding: 0 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.big-btn {
  background: var(--accent); color: #000; font-weight: 700; font-size: 17px; height: 56px; border-radius: 4px; width: min(360px, 100%);
  box-shadow: 0 6px 20px rgba(203, 203, 203, .45); transition: transform .12s var(--ease);
}
.big-btn:active { transform: scale(.97); }
.result-hint { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .6); text-align: center; }

/* TOAST */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 64px); transform: translate(-50%, -12px);
  background: #f2f2f2; color: #000; font-size: 14px; font-weight: 500; padding: 11px 16px; border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2); opacity: 0; pointer-events: none; z-index: 40;
  transition: opacity .2s, transform .25s var(--ease); max-width: calc(100% - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.rec-canvas { position: fixed; left: 0; top: 0; width: 2px; height: 2px; opacity: .01; pointer-events: none; z-index: -1; }

/* text sheet */
.section-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 16px 4px 8px; }
.sheet-body > .section-label:first-child, #tpl-box .section-label { margin-top: 2px; }
.text-items { display: flex; flex-direction: column; gap: 10px; }
.text-item { background: var(--card); border-radius: var(--r-md); padding: 10px 10px 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.text-item.flash { box-shadow: 0 0 0 2px var(--accent); }
.text-item textarea {
  width: 100%; min-height: 48px; resize: none; border: 1.5px solid var(--line); border-radius: 4px; padding: 10px 12px;
  font: 400 17px/1.4 "Chakra Petch", system-ui, sans-serif; color: var(--ink); background: var(--field);
}
.text-item textarea:focus { outline: none; border-color: var(--accent); }
.text-item .opts { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.seg { display: flex; background: var(--soft); border-radius: 4px; padding: 3px; }
.seg button { height: 32px; padding: 0 10px; border-radius: 4px; font-size: 13.5px; font-weight: 500; color: var(--accent-2); display: grid; place-items: center; }
.seg button.on { background: var(--accent); color: #000; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.seg button svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.text-item .top { display: flex; gap: 6px; align-items: flex-start; }
.text-item .del { flex: none; width: 40px; height: 48px; height: 36px; border-radius: 4px; color: var(--muted); display: grid; place-items: center; }
.text-item .del:active { background: var(--soft); }
.text-item .del svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.add-row {
  margin-top: 10px; width: 100%; height: 50px; border-radius: var(--r-md); border: 1.5px dashed var(--line);
  color: var(--accent-2); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.add-row:active { background: var(--soft); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border-radius: var(--r-md); padding: 12px 14px; }
.toggle-row span { font-weight: 500; font-size: 15px; display: flex; flex-direction: column; gap: 2px; }
.toggle-row small { font-weight: 400; font-size: 12px; color: var(--muted); }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 50px; height: 30px; border-radius: 4px; background: #3a3a3a; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 4px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.toggle-row input:checked + .switch { background: var(--accent); }
.toggle-row input:checked + .switch::after { transform: translateX(20px); }

/* montage entry */
.montage-card {
  display: flex; align-items: center; gap: 14px; width: 100%; max-width: 760px; margin: 0 auto 16px;
  background: var(--card); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--shadow); text-align: left;
  transition: transform .15s var(--ease);
}
.montage-card:active { transform: scale(.98); }
.mc-icon { width: 48px; height: 48px; border-radius: 4px; background: var(--accent); color: #000; display: grid; place-items: center; flex: none; }
.mc-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.mc-text { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.mc-text b { font-size: 16px; }
.mc-text small { color: var(--muted); font-size: 13px; }
.mc-arrow { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* montage screen */
#montage .bar h1 { font-size: 15px; margin: 0; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; text-align: center; flex: 1; }
.m-stage { flex: 1; min-height: 140px; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; padding: 6px 18px; }
#m-cv { touch-action: none; cursor: grab; display: block; max-width: 100%; max-height: 100%; border-radius: 4px; background: #000; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.m-time { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.6); color: #fff; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.m-time:empty { display: none; }
.m-panel { flex: none; max-height: 58%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 14px calc(var(--safe-b) + 14px); display: flex; flex-direction: column; gap: 10px; }
.m-controls { display: flex; flex-direction: column; gap: 8px; }
.m-controls .chips button { flex: 1; }
.m-row2 { display: flex; gap: 8px; }
.m-row2 .chips { flex: 1; }
.m-small { height: 34px; padding: 0 14px; border-radius: 4px; background: var(--card); font-size: 14px; font-weight: 500; box-shadow: 0 1px 6px rgba(0,0,0,.06); flex: none; }
.m-small:active { background: var(--soft); }
.m-small.danger { color: #ff6b5b; }
.m-timeline { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.m-timeline::-webkit-scrollbar { display: none; }
.m-chip { flex: none; position: relative; width: 46px; height: 76px; border-radius: 4px; overflow: hidden; background: #222; box-shadow: inset 0 0 0 2px transparent; }
.m-chip canvas { width: 100%; height: 100%; display: block; object-fit: cover; }
.m-chip span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; font-weight: 700; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); padding: 8px 0 3px; text-align: center; }
.m-chip.on { box-shadow: 0 0 0 3px var(--accent); }
.m-chip.clip-start { margin-left: 6px; }
.m-chip.add { display: grid; place-items: center; background: var(--soft); color: var(--accent-2); font-size: 26px; font-weight: 400; }
.m-cut { background: var(--card); border-radius: var(--r-lg); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.m-cut-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 700; }
.m-len { color: var(--accent-2); font-variant-numeric: tabular-nums; }
.m-coarse { width: 100%; height: 22px; border-radius: 4px; display: block; touch-action: none; }
.m-fine { width: 100%; height: 88px; border-radius: 4px; display: block; touch-action: none; }
.m-help { margin: 0; font-size: 12px; color: var(--muted); }
.m-cut-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.m-cut-actions .m-small { box-shadow: none; background: var(--soft); color: var(--accent-2); }
.m-cut-actions .danger { margin-left: auto; background: #3a1a17; color: #ff6b5b; }

.m-undo { position: absolute; top: 10px; left: 14px; display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px 0 9px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; font-weight: 600; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.m-undo:disabled { opacity: .35; }
.m-undo[hidden] { display: none; }
.m-chip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform .18s ease, box-shadow .15s; }
.m-chip.playing::after { content: ''; position: absolute; top: 4px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 4px; background: #fff; box-shadow: 0 0 0 2px var(--accent); }
.m-chip em { position: absolute; top: 3px; right: 3px; font-style: normal; font-size: 9.5px; font-weight: 800; color: #000; background: var(--accent); border-radius: 4px; padding: 1px 4px; }
.m-chip.zoomed canvas { outline: 2px dashed rgba(255,255,255,.7); outline-offset: -4px; }
.m-chip.hook { box-shadow: inset 0 0 0 2px #fff; margin-right: 6px; }
.m-chip.hook span { background: linear-gradient(transparent, rgba(0,0,0,.9)); }
.m-timeline.reordering { overflow-x: hidden; }
.m-timeline.reordering .m-chip { transition: transform .15s ease; }
.m-chip.lift { transition: none; z-index: 2; box-shadow: 0 0 0 3px var(--accent), 0 10px 22px rgba(0,0,0,.35); }
.m-tl-help { margin-top: -6px; }
.m-speed-row { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.m-speed-row .chips { flex: 1; }
.m-speed-row .chips button { flex: 1; }
.m-panel > * { flex: none; }
.m-stab-row { background: var(--soft); padding: 10px 12px; }
/* montage colour correction: folds open like a toggle row, dot when something is changed */
.m-adj { background: var(--card); border-radius: var(--r-md); }
.m-adj summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; }
.m-adj summary::-webkit-details-marker { display: none; }
.m-adj summary span { font-weight: 500; font-size: 15px; display: flex; flex-direction: column; gap: 2px; }
.m-adj summary small { font-weight: 400; font-size: 12px; color: var(--muted); }
.m-adj summary::after { content: ''; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .15s; }
.m-adj[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.m-adj-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--accent); margin-left: auto; visibility: hidden; }
.m-adj.changed .m-adj-dot { visibility: visible; }
.m-adj-list { background: var(--soft); margin: 0 8px; padding: 0 12px; }
.m-adj .link-btn.center { margin: 4px auto 6px; }
.m-chip.nostab::before { content: 'statyw'; position: absolute; top: 3px; left: 3px; z-index: 1; font-size: 8.5px; font-weight: 700; color: #fff; background: rgba(0,0,0,.65); border-radius: 4px; padding: 1px 3px; }

/* clients */
#clients .bar h1 { font-size: 15px; margin: 0; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; text-align: center; flex: 1; }
#c-add { height: 40px; padding: 0 16px; font-size: 15px; }
.c-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 14px calc(var(--safe-b) + 24px); }
.c-scroll > div { max-width: 980px; margin: 0 auto; }
.c-lock { display: grid; place-items: center; min-height: 60%; }
.c-lock-card { background: var(--card); border-radius: var(--r-lg); padding: 24px 20px; width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); text-align: center; }
.c-lock-card h2 { margin: 0; font-size: 20px; }
.c-lock-card input { height: 52px; border-radius: 4px; border: 1.5px solid var(--line); text-align: center; font-size: 24px; letter-spacing: 8px; font-family: inherit; background: var(--field); color: var(--ink); }
.c-lock-card input:focus { outline: none; border-color: var(--accent); }
.c-lock-card input[hidden], .c-lock-card button[hidden] { display: none; }
.c-muted { color: var(--muted); font-size: 13.5px; margin: 0; line-height: 1.4; }
.c-err { color: #ff6b5b; font-size: 13.5px; margin: 0; min-height: 1em; }
.c-month { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 10px; }
.c-month h2 { margin: 0; font-size: 19px; }
.c-offline { background: #2a2414; color: #e0b860; font-size: 13px; border-radius: 4px; padding: 8px 12px; margin-bottom: 10px; }
.c-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.c-stat { background: var(--card); border-radius: var(--r-md); padding: 11px 13px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.c-stat small { color: var(--muted); font-size: 12px; font-weight: 500; }
.c-stat b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-stat.wide { grid-column: 1 / -1; background: var(--accent); color: #000; }
.c-stat.wide small { color: rgba(0,0,0,.6); }
.c-stat.wide b { font-size: 26px; }
.c-stat.her b { color: var(--accent-2); }
.c-stat.leave { background: var(--soft); }
.c-split { margin: 6px auto 8px; font-size: 13px; }
.c-table { display: flex; flex-direction: column; gap: 8px; }
.c-empty { text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; margin: 30px 0; }
.c-row { display: grid; grid-template-columns: 48px 1fr auto; grid-template-areas: "t w p" "c c c"; gap: 8px 12px; align-items: center; width: 100%; text-align: left;
  background: var(--card); border-radius: var(--r-md); padding: 10px 12px; font-variant-numeric: tabular-nums; }
.c-row:active { background: var(--soft); }
.c-head { display: none; }
.c-thumb { grid-area: t; width: 48px; height: 48px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.c-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-who { grid-area: w; display: flex; flex-direction: column; min-width: 0; }
.c-who b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-who small { color: var(--muted); font-size: 12px; }
.c-price { grid-area: p; font-weight: 700; font-size: 16px; }
.c-chips { grid-area: c; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.c-n { display: flex; flex-direction: column; gap: 1px; font-size: 13px; font-weight: 600; background: var(--bg); border-radius: 4px; padding: 5px 8px; white-space: nowrap; min-width: 0; }
.c-n::before { content: attr(data-l); color: var(--muted); font-size: 10.5px; font-weight: 500; }
.c-her { color: var(--accent-2); }
.c-leave { background: var(--accent); color: #000; }
.c-leave::before { color: rgba(0,0,0,.6); }
.c-sign { display: none; font-style: normal; }
/* iPad: a real table */
@media (min-width: 700px) {
  .c-stats { grid-template-columns: repeat(4, 1fr); }
  .c-stat.wide { grid-column: span 2; }
  .c-table { gap: 0; background: var(--card); border-radius: var(--r-lg); overflow: hidden; }
  .c-row, .c-head { display: grid; grid-template-columns: 44px minmax(120px, 1.4fr) repeat(5, minmax(84px, 1fr)); grid-template-areas: none; border-radius: 0; padding: 9px 16px; gap: 12px; border-bottom: 1px solid var(--line); align-items: center; }
  .c-head { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; background: var(--bg); }
  .c-head span:nth-child(n+3) { text-align: right; }
  .c-thumb { grid-area: auto; width: 40px; height: 40px; }
  .c-who, .c-price { grid-area: auto; }
  .c-price { text-align: right; font-size: 15px; }
  .c-chips { display: contents; }
  .c-n { display: block; text-align: right; font-size: 15px; font-weight: 500; background: none; padding: 0; border-radius: 0; }
  .c-n::before { content: none; }
  .c-her { font-weight: 700; }
  .c-leave { background: none; color: var(--accent-2); font-weight: 700; }
  .c-sign { display: inline; }
}
/* client form */
.cs-photo-row { display: flex; gap: 10px; align-items: stretch; }
.cs-photo { width: 92px; flex: none; border-radius: var(--r-md); background: var(--card); border: 1.5px dashed var(--line); color: var(--accent-2); font-size: 12.5px; font-weight: 600; line-height: 1.3; overflow: hidden; padding: 0; }
.cs-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-photo img[hidden], .cs-photo span[hidden] { display: none; }
.cs-name { flex: 1; min-width: 0; }
.cs-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cs-money input { padding-right: 36px; font-variant-numeric: tabular-nums; }
.cs-money i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 15px; pointer-events: none; }
#cs-date { width: 100%; height: 46px; font-size: 17px; border-radius: 4px; border: 1.5px solid var(--line); padding: 0 12px; font-family: inherit; background: var(--bg); color: var(--ink); -webkit-appearance: none; }
.cs-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cs-sum > span { grid-column: 1 / -1; color: var(--muted); font-size: 13px; text-align: center; padding: 6px; }
.cs-sum div { background: var(--card); border-radius: var(--r-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-variant-numeric: tabular-nums; }
.cs-sum small { color: var(--muted); font-size: 11.5px; }
.cs-sum b { font-size: 16px; }
.cs-sum .hl { background: var(--accent); color: #000; }
.cs-sum .hl small { color: rgba(0,0,0,.6); }
.link-btn.danger { color: #ff6b5b; }

/* home */
#home > * { flex: none; }
.h-top { display: flex; align-items: center; justify-content: space-between; padding: 0 18px 14px; }
.logo.mini img { height: 20px; }
.h-hello { text-align: right; }
.h-hello b { display: block; font-size: 17px; }
.h-hello small { color: var(--muted); font-size: 13px; }
.h-stats { display: block; width: calc(100% - 32px); max-width: 1068px; margin: 0 16px 22px; border-radius: 4px; padding: 16px 18px 14px; color: #000; position: relative; overflow: hidden; text-align: left;
  background: linear-gradient(160deg, #d9d9d9 0%, #CBCBCB 55%, #a8a8a8 100%); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transition: transform .15s var(--ease); }
.h-stats[hidden] { display: none; }
.h-stats:active { transform: scale(.985); }
.h-stats .lbl { font-size: 13px; opacity: .85; display: flex; justify-content: space-between; }
.h-stats .big { font-family: "Baserona", "Chakra Petch", sans-serif; font-size: 34px; font-weight: 400; letter-spacing: -.5px; margin: 2px 0 12px; font-variant-numeric: tabular-nums; }
.h-stats .big small { font-family: "Chakra Petch", sans-serif; font-size: 15px; font-weight: 500; opacity: .85; margin-left: 6px; letter-spacing: 0; }
.h-stats .srow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.h-stats .srow div { background: rgba(0,0,0,.08); border-radius: 4px; padding: 8px 10px; min-width: 0; }
.h-stats .srow small { display: block; font-size: 11px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-stats .srow b { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.h-stats.empty { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.h-stats.empty .lbl { color: var(--muted); opacity: 1; }
.h-stats.empty .big { font-family: inherit; font-weight: 600; font-size: 20px; margin: 4px 0 0; letter-spacing: 0; }
.h-sec { display: flex; align-items: baseline; justify-content: space-between; padding: 0 18px; margin: 4px 0 10px; }
.h-sec h2 { margin: 0; font-family: "Baserona", "Chakra Petch", sans-serif; font-weight: 400; font-size: 22px; text-transform: uppercase; letter-spacing: -.3px; }
.h-sec small { color: var(--muted); font-size: 13px; }
.h-rail { --tw: 168px; --th: calc(var(--tw) * 16 / 9); display: flex; gap: 12px; overflow-x: auto; padding: 2px 18px 18px; scroll-snap-type: x mandatory; scroll-padding: 0 18px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.h-rail::-webkit-scrollbar { display: none; }
.h-rail .type-card { all: unset; flex: none; width: var(--tw); scroll-snap-align: start; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.h-rail .type-card.wide { width: calc(var(--th) * 4 / 5); }
.h-rail .type-card .pv { height: var(--th); border-radius: 4px; overflow: hidden; box-shadow: 0 8px 22px rgba(0, 0, 0, .18); position: relative; background: var(--soft); transition: transform .15s var(--ease); }
.h-rail .type-card:active .pv { transform: scale(.97); }
.h-rail .type-card .pv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.h-rail .fmt { position: absolute; top: 8px; left: 8px; font-size: 10.5px; font-weight: 700; color: #fff; background: rgba(0,0,0,.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); padding: 3px 8px; border-radius: 4px; }
.h-rail .vid { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 4px; background: rgba(0,0,0,.45); display: grid; place-items: center; }
.h-rail .vid svg { width: 10px; height: 10px; fill: #fff; margin-left: 1px; }
.h-rail .type-card b { display: block; font-size: 15px; margin: 9px 2px 0; }
.h-rail .type-card small { display: block; color: var(--muted); font-size: 12px; margin: 1px 2px 0; }
.h-tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 12px); width: min(360px, calc(100% - 32px)); margin: 0; z-index: 8;
  display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px; border-radius: 4px; background: rgba(28,28,28,.86);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.h-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; border-radius: 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.h-tabs button:active { background: var(--soft); }
.h-tabs button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.h-tabs button.on { background: var(--accent); color: #000; }
@media (min-width: 700px) {
  .h-top { padding: 0 28px 18px; }
  .h-stats { width: calc(100% - 56px); margin: 0 28px 28px; display: grid; grid-template-columns: 1.2fr 2fr; align-items: end; gap: 20px; }
  .h-stats .big { margin-bottom: 0; }
  .h-stats.empty { display: block; }
  .h-sec { padding: 0 28px; }
  .h-rail { --tw: 210px; padding: 2px 28px 24px; gap: 16px; scroll-padding: 0 28px; }
}

/* haircut / touch-up */
.cs-kind button, .cs-pay button { flex: 1; height: 40px; font-size: 15px; }
.cs-kind button.on, .cs-pay button.on { background: var(--accent); color: #000; }
.c-tag { font-style: normal; font-size: 11px; font-weight: 700; color: var(--accent-2); background: var(--soft); border-radius: 4px; padding: 1px 6px; margin-left: 4px; }
.c-free { font-size: 11px; font-weight: 500; opacity: .75; }
@media (min-width: 700px) {
    .c-stats { grid-template-columns: repeat(5, 1fr); }
}
.h-stats .srow b.h-num { display: flex; align-items: center; gap: 6px; }
.h-pill { font-size: 11px; font-weight: 400; background: rgba(0,0,0,.1); border-radius: 4px; padding: 2px 7px; white-space: nowrap; }

/* ---------- motion (quick and quiet; off when the phone asks for less motion) ---------- */
@keyframes enterFwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes enterBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes flashRow { 0% { box-shadow: 0 0 0 0 rgba(203,203,203,.0); background: var(--soft); } 30% { box-shadow: 0 0 0 4px rgba(203,203,203,.35); } 100% { box-shadow: 0 0 0 0 rgba(203,203,203,0); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
.screen.active.enter-fwd { animation: enterFwd .32s var(--ease) both; }
.screen.active.enter-back { animation: enterBack .32s var(--ease) both; }
#home.stagger > .h-top, #home.stagger > .h-stats, #home.stagger > .h-sec, #home.stagger > .h-rail { animation: fadeUp .45s var(--ease) both; }
#home.stagger > .h-stats { animation-delay: .05s; }
#home.stagger > .h-stats + .h-sec, #home.stagger > #rail-book { animation-delay: .15s; }
#home.stagger > #rail-book + .h-sec, #home.stagger > #rail-work { animation-delay: .22s; }
#home.stagger > #rail-work + .h-sec, #home.stagger > #rail-video { animation-delay: .26s; }
@keyframes tabsUp { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
body:not([data-screen="home"]) .h-tabs { display: none; }
.h-tabs.in { animation: tabsUp .45s var(--ease) .25s both; }
.c-table.stagger > .c-row[data-id] { animation: fadeUp .4s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.c-row.flash { animation: flashRow 1.4s ease-out both; }
/* press feedback everywhere */
.c-row, .m-chip, .chips button, .ok-btn, .icon-btn, .h-tabs button, .c-stat { transition: transform .15s var(--ease), background .15s, box-shadow .15s; }
.c-row:active { transform: scale(.985); }
.chips button:active, .h-tabs button:active, .icon-btn:active { transform: scale(.94); }
.m-chip:active { transform: scale(.95); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}

/* client contact fields */
.cs-ig i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 17px; pointer-events: none; }
.cs-ig input { padding-left: 30px; padding-right: 92px; }
.cs-ig-open { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 34px; padding: 0 12px; border-radius: 4px; background: var(--soft); color: var(--accent-2); font-weight: 700; font-size: 13.5px; }
.cs-ig-open[hidden] { display: none; }
#cs-time { width: 100%; height: 46px; font-size: 17px; border-radius: 4px; border: 1.5px solid var(--line); padding: 0 12px; font-family: inherit; background: var(--bg); color: var(--ink); -webkit-appearance: none; }
.c-ig { color: var(--accent-2); font-weight: 600; padding: 4px 0; }

/* klienci: views */
.c-view { margin: 0 0 6px; }
.c-view button { height: 36px; font-size: 13.5px; padding: 0 8px; }
.c-month[hidden], .c-stats[hidden], .c-split[hidden], .c-table[hidden], .c-cal[hidden], .c-all[hidden] { display: none !important; }
.c-cal { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; background: var(--card); border-radius: 4px; padding: 12px; }
.cal-wd { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding-bottom: 4px; }
.cal-day { aspect-ratio: 1 / 1; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-variant-numeric: tabular-nums; position: relative; }
.cal-day b { font-size: 15px; font-weight: 500; }
.cal-day.has { background: var(--soft); }
.cal-day.has b { font-weight: 700; color: var(--accent-2); }
.cal-day i { font-style: normal; min-width: 6px; height: 6px; border-radius: 2px; background: var(--accent); font-size: 9.5px; font-weight: 700; color: #000; line-height: 13px; padding: 0 0; }
.cal-day i:not(:empty) { height: 14px; min-width: 14px; border-radius: 4px; padding: 0 3px; }
.cal-day.today b { text-decoration: underline; text-underline-offset: 3px; }
.cal-day.sel { background: var(--accent); }
.cal-day.sel b { color: #000; }
.cal-day.sel i { background: #000; color: #fff; }
.cal-dayhead { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 4px 0; }
.cal-dayhead b { font-size: 17px; }
.cal-dayhead span { color: var(--muted); font-size: 13px; }
.cal-add { background: var(--card); border: 1.5px dashed var(--line); border-radius: 4px; padding: 16px; color: var(--accent-2); font-weight: 600; font-size: 14.5px; }
.cd, .ca { background: var(--card); border-radius: 4px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cd-top, .ca-top { display: flex; gap: 12px; align-items: center; }
.cd-thumb { width: 56px; height: 56px; border-radius: 4px; overflow: hidden; background: var(--soft); flex: none; }
.cd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cd-thumb i { display: grid; place-items: center; width: 100%; height: 100%; font-style: normal; font-weight: 700; font-size: 20px; color: var(--accent-2); }
.cd-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cd-who b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-who small { color: var(--muted); font-size: 12.5px; }
.cd-contact { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: 13px; }
.cd-contact em { font-style: normal; color: var(--muted); }
.cd-contact .cd-none { font-size: 12px; }
.cd-phone { color: var(--ink); font-weight: 600; text-decoration: none; }
.cd-edit { flex: none; align-self: flex-start; background: var(--soft); color: var(--accent-2); font-weight: 700; font-size: 13px; border-radius: 4px; padding: 7px 11px; }
.cd-money { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.cd-money div { background: var(--bg); border-radius: 4px; padding: 6px 7px; min-width: 0; }
.cd-money small { display: block; font-size: 10.5px; color: var(--muted); }
.cd-money b { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cd-money .cd-leave { background: var(--accent); color: #000; }
.cd-money .cd-leave small { color: rgba(0,0,0,.6); }
.c-all { display: flex; flex-direction: column; gap: 10px; }
.c-search input { height: 46px; font-size: 16px; }
#c-all-list { display: flex; flex-direction: column; gap: 8px; }
.c-all-count { margin: 0 4px; color: var(--muted); font-size: 12.5px; }
.ca-sum { text-align: right; flex: none; display: flex; flex-direction: column; }
.ca-sum b { font-size: 16px; font-variant-numeric: tabular-nums; }
.ca-sum small { color: var(--muted); font-size: 12px; }
.ca-visits { display: flex; flex-wrap: wrap; gap: 6px; }
.ca-visit { background: var(--bg); border-radius: 4px; padding: 5px 9px; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink); }
.ca-visit:active { background: var(--soft); }
@media (min-width: 700px) {
  .c-view { max-width: 460px; }
  .c-cal { display: grid; grid-template-columns: minmax(320px, 1fr) 1.2fr; align-items: start; gap: 14px; }
  .c-cal > .cal-grid { grid-row: 1 / span 20; }
  .cal-dayhead { margin-top: 0; }
  #c-all-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .c-all-count { grid-column: 1 / -1; }
}

/* booked-ahead visits */
.c-ahead { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1.5px dashed var(--line); border-radius: 4px; padding: 10px 14px; margin-bottom: 8px; }
.c-ahead[hidden] { display: none; }
.c-ahead b { font-size: 14px; color: var(--accent-2); }
.c-ahead span { font-size: 12px; color: var(--muted); }
.c-plan { background: var(--card); border: 1px dashed var(--accent); }
.c-row.future, .cd.future { background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1.5px var(--line); }
.ca-visit.future { background: var(--card); border: 1px dashed var(--accent); }
/* tap a photo to see it big */
.c-thumb img, .cd-thumb img { cursor: zoom-in; }
#photo-view { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: calc(var(--safe-t) + 50px) 16px calc(var(--safe-b) + 30px); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
#photo-view.open { opacity: 1; pointer-events: auto; }
#photo-view img { max-width: 100%; max-height: 100%; border-radius: 4px; object-fit: contain; transform: scale(.94); transition: transform .25s var(--ease); }
#photo-view.open img { transform: none; }
#photo-view button { position: absolute; top: calc(var(--safe-t) + 10px); right: 14px; width: 40px; height: 40px; border-radius: 4px; background: rgba(255,255,255,.15); color: #fff; font-size: 26px; line-height: 1; }

/* home: upcoming visits */
#h-up-sec[hidden], #h-up[hidden] { display: none; }
.h-up { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 18px; }
.h-up-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 4px; padding: 10px 14px 10px 10px; text-align: left; box-shadow: var(--shadow); transition: transform .15s var(--ease); }
.h-up-row:active { transform: scale(.985); }
.h-up-date { width: 52px; flex: none; display: flex; flex-direction: column; align-items: center; background: var(--soft); border-radius: 4px; padding: 5px 0 6px; line-height: 1.1; }
.h-up-date b { font-size: 20px; color: var(--accent-2); }
.h-up-date small { font-size: 10.5px; color: var(--accent-2); font-weight: 600; }
.h-up-row .cd-thumb { width: 46px; height: 46px; border-radius: 4px; }
.h-up-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.h-up-who b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-up-who small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-up-price { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; flex: none; }
.h-up-empty { margin: 0; background: var(--card); border: 1.5px dashed var(--line); border-radius: 4px; padding: 14px 16px; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
#home.stagger > #h-up-sec, #home.stagger > #h-up { animation: fadeUp .45s var(--ease) .28s both; }
@media (min-width: 700px) {
  .h-up { padding: 0 28px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
}
.field[hidden], .toggle-row[hidden], .dock-btn[hidden] { display: none !important; }


/* template words: two-line headline fields */
.input-wrap textarea { flex: 1; min-width: 0; width: 100%; resize: none; border: 1.5px solid var(--line); border-radius: 4px; padding: 10px 12px;
  font: 400 17px/1.35 "Chakra Petch", system-ui, sans-serif; color: var(--ink); background: var(--field); }
.input-wrap textarea:focus { outline: none; border-color: var(--accent); }
#tpl-box[hidden] { display: none; }
#tpl-box { margin-bottom: 6px; }
.bg-hint { padding: 12px 2px 6px; }
#bg-list .toggle-row { padding: 12px 0; background: none; }
#bg-list .section-label { margin: 14px 0 0; }
/* live-adjust sheets leave the post in view */
.sheet.see-through .sheet-card { max-height: 50%; }
/* touches above a live-adjust sheet reach the post, so panels and the logo can be dragged while it's open */
.sheet.see-through.open { pointer-events: none; }
.sheet.see-through.open .sheet-card { pointer-events: auto; }
/* holding a slider: the sheet fades away, only the slider being dragged stays */
.sheet.peek .sheet-card { background: transparent; box-shadow: none; transition: background .15s; }
.sheet.peek .sheet-card * { visibility: hidden; }
.sheet.peek .fx-row.active, .sheet.peek .fx-row.active * { visibility: visible; }
.sheet.peek .fx-row.active { background: rgba(14, 14, 14, .82); border-radius: 4px; padding: 0 10px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
/* montage: start over, top right of the preview */
.m-clear { left: auto; right: 14px; }
.m-clear[hidden] { display: none; }
