@font-face { font-family: "Geist"; src: url(fonts/Geist-Regular.woff2) format("woff2"); font-weight: 400; }
@font-face { font-family: "Geist"; src: url(fonts/Geist-Medium.woff2) format("woff2"); font-weight: 500; }
@font-face { font-family: "Geist"; src: url(fonts/Geist-Bold.woff2) format("woff2"); font-weight: 700; }
@font-face { font-family: "Botanical"; src: url(fonts/Botanical.otf); }
@font-face { font-family: "Baliglad"; src: url(fonts/Baliglad.ttf); }

:root {
  --pink: #C466A2;
  --pink-dark: #a94f88;
  --pink-soft: #f4e2ec;
  --pink-line: #ecdbe4;
  --bg: #f8f0f4;
  --ink: #2a1f26;
  --muted: #8f7b87;
  --card: #ffffff;
  --r-lg: 22px;
  --r-md: 14px;
  --shadow: 0 2px 16px rgba(120, 50, 95, .10);
  --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: "Geist", -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: 50%; flex: none; transition: background .15s; }
.icon-btn:active { background: var(--pink-soft); }
.icon-btn.light { color: #fff; }
.icon-btn.light:active { background: rgba(255, 255, 255, .15); }
.ok-btn {
  background: var(--pink); color: #fff; font-weight: 700; font-size: 16px;
  padding: 0 20px; height: 44px; border-radius: 22px; flex: none;
  box-shadow: 0 4px 14px rgba(196, 102, 162, .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(--pink); 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; -webkit-overflow-scrolling: touch; padding: calc(var(--safe-t) + 14px) 0 calc(var(--safe-b) + 110px); }
.brand { text-align: center; margin-bottom: 26px; }
.logo { display: inline-block; color: var(--pink); line-height: 1; }
.logo .hh { font-family: "Botanical"; font-size: 52px; display: block; letter-spacing: -.5px; }
.logo .tt { font-family: "Baliglad"; font-size: 52px; display: block; margin-top: -24px; margin-left: -8px; }
.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(120, 50, 95, .08); }
.type-card .thumb { width: 100%; border-radius: 15px; overflow: hidden; background: var(--pink-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(--pink-dark); background: var(--pink-soft); border-radius: 8px; 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: 17px; margin: 0; font-weight: 700; 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: 16px; touch-action: none; box-shadow: 0 10px 34px rgba(60, 20, 45, .18); background: #e9dfe5; }
.hint-pill {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: rgba(30, 14, 24, .62); color: #fff; font-size: 12.5px; line-height: 1.3; font-weight: 500;
  padding: 8px 13px; border-radius: 16px; 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(255, 255, 255, .94); color: var(--ink); font-weight: 700; font-size: 17px;
  padding: 24px 34px 22px; border-radius: 24px; box-shadow: 0 10px 34px rgba(60, 20, 45, .2);
  transition: transform .12s var(--ease);
}
.add-photo:active { transform: scale(.96); }
.add-photo .plus { width: 54px; height: 54px; border-radius: 50%; background: var(--pink); color: #fff; display: grid; place-items: center; margin-bottom: 6px; box-shadow: 0 4px 14px rgba(196, 102, 162, .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: 24px; box-shadow: var(--shadow);
  align-self: center; max-width: calc(100% - 28px);
}
.dock-btn {
  position: relative; width: 66px; height: 58px; border-radius: 18px;
  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(--pink-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: 9px;
  background: var(--pink); color: #fff; font-style: normal; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

/* SHEETS */
.sheet {
  position: fixed; inset: 0; background: rgba(30, 10, 20, .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(30, 10, 20, .06); }
.sheet-card {
  background: var(--bg); width: 100%; max-width: 560px; max-height: 86%;
  border-radius: 26px 26px 0 0; display: flex; flex-direction: column;
  box-shadow: 0 -8px 40px rgba(60, 20, 45, .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: 3px; background: #dccbd4; }
.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: 50%; 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(--pink); }
.cal-grid button.on { background: var(--pink); color: #fff; font-weight: 700; box-shadow: none; }
.cal-grid button.past { color: #d2c4cc; }
.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(--pink-line); border-radius: 12px; padding: 0 12px;
  font-size: 16px; background: #fff; color: var(--ink); transition: border-color .15s;
}
.row input:focus, .input-wrap input:focus { outline: none; border-color: var(--pink); }
.row .x { width: 40px; height: 40px; border-radius: 50%; color: var(--muted); flex: none; display: grid; place-items: center; }
.row .x:active { background: var(--pink-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(--pink-soft); color: var(--pink-dark); font-size: 13.5px; font-weight: 500; height: 34px; padding: 0 13px; border-radius: 17px; }
.quick button:active { background: #ecd0e0; }

/* 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: 50%;
  color: #fff; background: #cdbcc6; 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 #f3e8ee; }
.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(--pink-dark); 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: 3px; background: var(--pink-soft); }
.fx-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--pink); margin-top: -11px; box-shadow: 0 2px 8px rgba(120, 50, 95, .25); }
.fx-row input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--pink-soft); }
.fx-row input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid var(--pink); }
.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: 17px; background: var(--pink-soft); color: var(--pink-dark); font-size: 14px; font-weight: 500; }
.chips button.on { background: var(--pink); color: #fff; font-weight: 700; }

/* BUSY */
.overlay {
  position: fixed; inset: 0; background: rgba(30, 10, 20, .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(--pink-soft); border-top-color: var(--pink); 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(--pink-soft); border-radius: 3px; overflow: hidden; }
#busy-bar { height: 100%; width: 0; background: var(--pink); transition: width .2s; }

/* RESULT */
.result {
  position: fixed; inset: 0; z-index: 25; background: #1f1219; 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: 16px; 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(--pink); color: #fff; font-weight: 700; font-size: 17px; height: 56px; border-radius: 28px; width: min(360px, 100%);
  box-shadow: 0 6px 20px rgba(196, 102, 162, .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: var(--ink); color: #fff; font-size: 14px; font-weight: 500; padding: 11px 16px; border-radius: 14px;
  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, #header-fields .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(--pink); }
.text-item textarea {
  width: 100%; min-height: 48px; resize: none; border: 1.5px solid var(--pink-line); border-radius: 12px; padding: 10px 12px;
  font: 300 17px/1.4 "Geist", system-ui, sans-serif; color: var(--ink); background: #fff;
}
.text-item textarea:focus { outline: none; border-color: var(--pink); }
.text-item .opts { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.seg { display: flex; background: var(--pink-soft); border-radius: 12px; padding: 3px; }
.seg button { height: 32px; padding: 0 10px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: var(--pink-dark); display: grid; place-items: center; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(120, 50, 95, .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: 50%; color: var(--muted); display: grid; place-items: center; }
.text-item .del:active { background: var(--pink-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 #dfc6d4;
  color: var(--pink-dark); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.add-row:active { background: var(--pink-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: 15px; background: #e2d3db; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.toggle-row input:checked + .switch { background: var(--pink); }
.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: 14px; background: var(--pink); color: #fff; 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: 17px; margin: 0; font-weight: 700; 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: 14px; background: #1f1219; box-shadow: 0 8px 28px rgba(60, 20, 45, .18); }
.m-time { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); background: rgba(30,14,24,.6); color: #fff; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 10px; 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: 17px; 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(--pink-soft); }
.m-small.danger { color: #c0392b; }
.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: 10px; overflow: hidden; background: #2a1f26; 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(--pink); }
.m-chip.clip-start { margin-left: 6px; }
.m-chip.add { display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-dark); 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(--pink-dark); font-variant-numeric: tabular-nums; }
.m-coarse { width: 100%; height: 22px; border-radius: 6px; display: block; touch-action: none; }
.m-fine { width: 100%; height: 88px; border-radius: 10px; 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(--pink-soft); color: var(--pink-dark); }
.m-cut-actions .danger { margin-left: auto; background: #fbe9e7; color: #c0392b; }
.look-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.look-list button { background: var(--card); border-radius: var(--r-md); padding: 8px; display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; text-align: left; }
.look-list img { width: 100%; border-radius: 10px; aspect-ratio: 9/16; object-fit: contain; background: var(--pink-soft); }

.m-undo { position: absolute; top: 10px; left: 14px; display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px 0 9px; border-radius: 17px; background: rgba(30,14,24,.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: 50%; background: #fff; box-shadow: 0 0 0 2px var(--pink); }
.m-chip em { position: absolute; top: 3px; right: 3px; font-style: normal; font-size: 9.5px; font-weight: 800; color: #fff; background: var(--pink); border-radius: 6px; 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(196,102,162,.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(--pink), 0 10px 22px rgba(60,20,45,.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(--pink-soft); padding: 10px 12px; }
.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(30,14,24,.65); border-radius: 5px; padding: 1px 3px; }

/* clients */
#clients .bar h1 { font-size: 17px; margin: 0; font-weight: 700; 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: 14px; border: 1.5px solid var(--pink-line); text-align: center; font-size: 24px; letter-spacing: 8px; font-family: inherit; background: var(--bg); }
.c-lock-card input:focus { outline: none; border-color: var(--pink); }
.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: #c0392b; 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: #fff4e5; color: #8a5a12; font-size: 13px; border-radius: 12px; 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(--pink); color: #fff; }
.c-stat.wide small { color: rgba(255,255,255,.85); }
.c-stat.wide b { font-size: 26px; }
.c-stat.her b { color: var(--pink-dark); }
.c-stat.leave { background: var(--pink-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(--pink-soft); }
.c-head { display: none; }
.c-thumb { grid-area: t; width: 48px; height: 48px; border-radius: 10px; background: var(--pink-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: 9px; 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(--pink-dark); }
.c-leave { background: var(--pink); color: #fff; }
.c-leave::before { color: rgba(255,255,255,.85); }
.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(--pink-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(--pink-dark); 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(--pink-line); color: var(--pink-dark); 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: 12px; border: 1.5px solid var(--pink-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(--pink); color: #fff; }
.cs-sum .hl small { color: rgba(255,255,255,.85); }
.link-btn.danger { color: #c0392b; }

/* home */
#home > * { flex: none; }
.h-top { display: flex; align-items: center; justify-content: space-between; padding: 0 18px 14px; }
.logo.mini .hh { font-size: 32px; }
.logo.mini .tt { font-size: 32px; margin-top: -15px; margin-left: -5px; }
.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: 24px; padding: 16px 18px 14px; color: #fff; position: relative; overflow: hidden; text-align: left;
  background: radial-gradient(120% 140% at 100% 0%, #e59acb 0%, #c466a2 45%, #8d3f73 100%); box-shadow: 0 10px 30px rgba(140, 50, 105, .28); 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-size: 40px; font-weight: 700; letter-spacing: -.5px; margin: 2px 0 12px; font-variant-numeric: tabular-nums; }
.h-stats .big small { 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(255,255,255,.16); border-radius: 14px; 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-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-size: 20px; }
.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: 18px; overflow: hidden; box-shadow: 0 8px 22px rgba(80, 30, 60, .18); position: relative; background: var(--pink-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(30,14,24,.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); padding: 3px 8px; border-radius: 9px; }
.h-rail .vid { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: rgba(30,14,24,.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)) !important; margin: 0 !important; z-index: 5;
  display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px; border-radius: 26px; background: rgba(255,255,255,.82);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: 0 10px 30px rgba(80, 30, 60, .18); }
.h-tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; border-radius: 20px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.h-tabs button:active { background: var(--pink-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(--pink); color: #fff; }
@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; }
}

/* booking text + touch-ups */
.h-copy { display: flex; gap: 8px; margin: -8px 16px 22px; width: calc(100% - 32px) !important; }
.h-copy-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 20px; padding: 12px 12px 12px 14px; box-shadow: var(--shadow); text-align: left; transition: transform .15s var(--ease); }
.h-copy-main:active { transform: scale(.985); }
.hb-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--pink-soft); color: var(--pink-dark); display: grid; place-items: center; flex: none; }
.hb-icon svg, .hb-edit svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hb-text b { font-size: 15px; }
.hb-text small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-pill { flex: none; background: var(--pink); color: #fff; font-weight: 700; font-size: 14px; border-radius: 14px; padding: 9px 14px; transition: background .2s; }
.hb-pill.done { background: #3f9a6b; }
.hb-edit { flex: none; width: 52px; border-radius: 20px; background: var(--card); color: var(--muted); display: grid; place-items: center; box-shadow: var(--shadow); }
.hb-edit:active { background: var(--pink-soft); }
#bk-text { width: 100%; min-height: 220px; border: 1.5px solid var(--pink-line); border-radius: 12px; padding: 12px; font: inherit; font-size: 16px; line-height: 1.45; color: var(--ink); background: #fff; resize: vertical; }
#bk-text:focus { outline: none; border-color: var(--pink); }
.cs-kind button { flex: 1; height: 40px; font-size: 15px; }
.cs-kind button.on { background: var(--pink); color: #fff; }
.c-tag { font-style: normal; font-size: 11px; font-weight: 700; color: var(--pink-dark); background: var(--pink-soft); border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.c-free { font-size: 11px; font-weight: 500; opacity: .75; }
@media (min-width: 700px) {
  .h-copy { margin: -12px 28px 28px; width: calc(100% - 56px) !important; }
  .c-stats { grid-template-columns: repeat(5, 1fr); }
}
.hb-edit[hidden] { display: none; }
.h-stats .srow b.h-num { display: flex; align-items: center; gap: 6px; }
.h-pill { font-size: 11px; font-weight: 400; background: rgba(255,255,255,.22); border-radius: 8px; 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(196,102,162,.0); background: var(--pink-soft); } 30% { box-shadow: 0 0 0 4px rgba(196,102,162,.35); } 100% { box-shadow: 0 0 0 0 rgba(196,102,162,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-copy, #home.stagger > .h-sec, #home.stagger > .h-rail { animation: fadeUp .45s var(--ease) both; }
#home.stagger > .h-stats { animation-delay: .05s; }
#home.stagger > .h-copy { animation-delay: .1s; }
#home.stagger > .h-copy + .h-sec, #home.stagger > #rail-book { animation-delay: .15s; }
#home.stagger > #rail-book + .h-sec, #home.stagger > #rail-work { animation-delay: .22s; }
@keyframes tabsUp { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
#home.stagger > .h-tabs { 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; }
.hb-pill.done { animation: pop .35s var(--ease); }
/* press feedback everywhere */
.c-row, .m-chip, .chips button, .ok-btn, .icon-btn, .h-tabs button, .hb-edit, .c-stat, .look-list button { transition: transform .15s var(--ease), background .15s, box-shadow .15s; }
.c-row:active, .look-list button:active { transform: scale(.985); }
.chips button:active, .h-tabs button:active, .hb-edit: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; }
}
