/* The Martini — dark, high-contrast phone UI. */
:root {
  --bg: #0f1419; --bg-elev: #1a2332; --bg-panel: #15202b; --bg-hover: #243044;
  --border: #3d4f63; --border-soft: #2a3a4d;
  --text: #f5f8fc; --text-muted: #c5d0dc; --text-dim: #9aabbc;
  --accent: #4da3ff; --accent-soft: rgba(77, 163, 255, 0.16);
  --warn: #f0b429; --danger: #ff6b7a;
  --seg-track: rgba(255, 255, 255, 0.06); --seg-border: #3d516a; --seg-on-bg: var(--accent); --seg-on-text: #04111f;
  /* the four statuses */
  --st-needs: #9aabbc; --st-being: #f0b429; --st-done: #3dd68c; --st-left: #ff8043;
  --st-tint: 16%; --st-ink: 80%; --st-ink-to: #ffffff;
  --radius: 12px; --radius-pill: 999px;
  --font: "Inter", "SF Pro Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
#app { max-width: 560px; margin: 0 auto; padding: 0 12px calc(76px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; }
.quiet { color: var(--text-dim); }
.small { font-size: 0.8rem; }
h1, h2 { margin: 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; min-height: 40px; padding: 0 1rem; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--bg-hover); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--seg-on-text); }
.btn-primary:hover { background: #6eb0ff; }
.btn-warn { background: var(--warn); border-color: var(--warn); color: #1c1c1e; }
.btn-sm { min-height: 32px; padding: 0 0.85rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.75rem 0 0.25rem; }
/* centred × (two strokes, not a font glyph) */
.x-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-dim); font-size: 0; cursor: pointer; flex: none; }
.x-btn::before, .x-btn::after { content: ""; grid-area: 1 / 1; width: 12px; height: 1.75px; border-radius: 1px; background: currentColor; transform: rotate(45deg); }
.x-btn::after { transform: rotate(-45deg); }
.x-btn:hover { background: var(--bg-hover); color: var(--text); }

/* top */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: calc(10px + env(safe-area-inset-top)) 2px 6px; background: rgba(15, 20, 25, 0.94); backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand-ic { width: 26px; height: 26px; border-radius: 7px; }
.who { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 34px; padding: 0 0.75rem 0 0.35rem; border-radius: var(--radius-pill); border: 1px solid var(--seg-border); background: var(--seg-track); cursor: pointer; max-width: 60%; }
.who-role { font-size: 0.7rem; font-weight: 800; padding: 0.1rem 0.45rem; border-radius: var(--radius-pill); }
.who.is-pa .who-role { background: var(--bg-hover); color: var(--text-muted); }
.who.is-ad .who-role { background: var(--accent); color: var(--seg-on-text); }
.who-name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subtop { font-size: 0.78rem; padding: 0 2px 6px; }

/* banners */
.banners { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; margin-bottom: 6px; }
.banners:empty { display: none; }
.banner { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.5rem 0.5rem 0.75rem; border-radius: var(--radius); border: 1px solid; }
.banner.is-stale { border-color: color-mix(in srgb, var(--warn) 60%, transparent); background: color-mix(in srgb, var(--warn) 13%, var(--bg)); }
.banner-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 25%, transparent); flex: none; }
.banner-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.banner-txt b { font-size: 0.92rem; }
.banner-txt .quiet { font-size: 0.76rem; }
.note-line { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0.2rem 0.2rem 0.7rem; border-radius: var(--radius); border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--bg-elev)); font-size: 0.82rem; }
.note-line.is-over { border-left-color: var(--st-left); background: color-mix(in srgb, var(--st-left) 9%, var(--bg-elev)); }
.note-ic { color: var(--text-dim); }
.note-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* day card */
.day-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); padding: 6px 6px 10px; margin-bottom: 12px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.day-nav { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; }
.day-step { height: 44px; border: 0; background: none; color: var(--text-muted); font-size: 1.6rem; line-height: 1; border-radius: 10px; cursor: pointer; }
.day-step:hover:not(:disabled) { background: var(--bg-hover); color: var(--text); }
.day-step:disabled { opacity: 0.25; cursor: default; }
.day-title { text-align: center; min-width: 0; }
.day-l1 { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.01em; }
.day-sep { color: var(--text-dim); font-weight: 500; }
.day-l2 { font-size: 0.78rem; }
.badge-today { display: inline-block; vertical-align: 2px; font-size: 0.64rem; font-weight: 800; padding: 0.05rem 0.45rem; border-radius: var(--radius-pill); background: var(--accent); color: var(--seg-on-text); letter-spacing: 0.02em; }
.day-dots { display: flex; justify-content: center; gap: 5px; margin: 4px 0 8px; }
.day-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.day-dots i.is-today { box-shadow: 0 0 0 1.5px var(--accent); }
.day-dots i.is-on { background: var(--text); }
.day-meta { display: flex; align-items: center; justify-content: center; gap: 0.45rem; font-size: 0.78rem; }
.tag { display: inline-flex; align-items: center; font-size: 0.68rem; font-weight: 750; padding: 0.06rem 0.5rem; border-radius: var(--radius-pill); border: 1px solid var(--tag-c, var(--border)); background: color-mix(in srgb, var(--tag-c, var(--border)) var(--st-tint), transparent); color: color-mix(in srgb, var(--tag-c, var(--text)) var(--st-ink), var(--st-ink-to)); white-space: nowrap; }
.tag.is-official { --tag-c: var(--accent); }
.tag.is-mine { --tag-c: #b39ddb; }
.tag.is-wrap { --tag-c: var(--st-left); }

/* scenes */
.scn-head { display: flex; align-items: baseline; gap: 0.6rem; margin: 2px 2px 6px; min-width: 0; }
.scn-head h2 { font-size: 1.05rem; font-weight: 800; }
.scn-sum { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scn-sum b { color: var(--text); }
.scn-sum .is-being, .scn-sum .is-being b { color: var(--st-being); }
.scn-sum .is-left, .scn-sum .is-left b { color: var(--st-left); }
.scn-bar { height: 6px; border-radius: var(--radius-pill); background: var(--bg-elev); overflow: hidden; display: flex; margin: 0 2px 10px; }
.scn-bar i { display: block; height: 100%; transition: width .25s ease; }
.scn-bar .is-done { background: var(--st-done); }
.scn-bar .is-being { background: var(--st-being); }
.scn-bar .is-left { background: var(--st-left); }
/* word-flip row: each pill shows its current word; tap flips it */
.scn-flips { display: grid; grid-template-columns: repeat(2, minmax(0, 8.5rem)) 2.25rem; gap: 6px; align-items: center; margin: 0 2px 8px; }
.seg-pill { display: flex; border: 1px solid var(--seg-border); border-radius: var(--radius-pill); padding: 2px; background: var(--seg-track); }
.seg-pill-opt { display: flex; align-items: center; justify-content: center; width: 100%; height: 30px; padding: 0 6px; border: 0; border-radius: var(--radius-pill); background: var(--seg-on-bg); color: var(--seg-on-text); font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer; white-space: nowrap; }
.scn-more { height: 36px; border: 1px solid var(--border-soft); border-radius: var(--radius-pill); background: var(--bg-elev); color: var(--text-muted); font-size: 16px; letter-spacing: 1px; cursor: pointer; padding: 0 0 2px; }
.scn-scope { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; font-size: 0.78rem; margin: 0 2px 10px; }

.scn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.scn-row { position: relative; border-radius: 14px; overflow: hidden; background: var(--bg-elev); }
.scn-card { position: relative; z-index: 2; display: flex; gap: 0.5rem; padding: 0.65rem 0.8rem 0.7rem; background: var(--bg-elev); border: 1px solid var(--border-soft); border-left: 4px solid var(--st-c, transparent); border-radius: 14px; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: pointer; }
.scn-row.is-ro .scn-card { cursor: default; }
.scn-main { min-width: 0; flex: 1; }
.cdo-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.55rem; align-items: baseline; font-size: 0.92rem; }
.cdo-sc { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 1.8rem; }
.cdo-set { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdo-set .ie { font-size: 0.68rem; font-weight: 750; color: var(--text-dim); border: 1px solid var(--border-soft); border-radius: 5px; padding: 0 0.3rem; vertical-align: 1px; }
.cdo-dn { color: var(--text-dim); font-size: 0.78rem; white-space: nowrap; }
.cdo-desc { margin-top: 0.2rem; font-size: 0.85rem; line-height: 1.35; color: var(--text-muted); }
.cdo-cast { margin-top: 0.3rem; font-size: 0.72rem; display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.cast { display: inline-block; min-width: 1.4rem; text-align: center; padding: 0.02rem 0.4rem; border: 1px solid var(--border-soft); border-radius: var(--radius-pill); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.scn-foot { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; margin-top: 0.45rem; }
/* status pills: outlined + soft tint + coloured text */
.scn-st { --st-c: var(--st-needs); display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.74rem; font-weight: 700; padding: 0.16rem 0.6rem; border-radius: var(--radius-pill); border: 1px solid var(--st-c); background: color-mix(in srgb, var(--st-c) var(--st-tint), transparent); color: color-mix(in srgb, var(--st-c) var(--st-ink), var(--st-ink-to)); cursor: pointer; }
span.scn-st { cursor: default; }
.scn-st .ic { font-size: 0.8rem; line-height: 1; }
.scn-st.is-needs { background: transparent; color: var(--text-muted); border-color: var(--border); }
.scn-st.is-being { --st-c: var(--st-being); }
.scn-st.is-done { --st-c: var(--st-done); }
.scn-st.is-left { --st-c: var(--st-left); }
.mine-tag { font-size: 0.68rem; font-weight: 650; color: #cbbcf0; border: 1px dashed #8a78c0; border-radius: var(--radius-pill); padding: 0.06rem 0.45rem; }
.scn-row.st-being .scn-card { --st-c: var(--st-being); border-color: color-mix(in srgb, var(--st-being) 60%, transparent); border-left-color: var(--st-being); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st-being) 28%, transparent); }
.scn-row.st-left .scn-card { --st-c: var(--st-left); border-left-color: var(--st-left); }
.scn-row.st-done .scn-card { border-color: color-mix(in srgb, var(--st-done) 40%, var(--border-soft)); border-left-color: color-mix(in srgb, var(--st-done) 60%, transparent); }
.scn-row.st-done .scn-main > :not(.scn-foot) { opacity: 0.5; }
.scn-row.st-done .cdo-sc { text-decoration: line-through; }
.scn-row.is-rowstyle .scn-card { padding: 0.45rem 0.7rem; }
.scn-row.is-rowstyle .scn-foot { margin-top: 0.25rem; }
.scn-row.is-expanded .scn-card { box-shadow: 0 0 0 1.5px var(--accent); }
.scn-row.is-bucket .scn-card { cursor: default; }
.bk-was { font-size: 0.74rem; }
/* AD reorder */
.scn-move { display: flex; flex-direction: column; justify-content: center; gap: 4px; margin: -0.2rem 0; }
.scn-move .mv { width: 34px; height: 30px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--bg-panel); color: var(--text-muted); font-size: 0.7rem; cursor: pointer; }
.scn-move .mv:hover { color: var(--accent); border-color: var(--accent); }
/* swipe actions under the card */
.scn-acts { position: absolute; top: 0; bottom: 0; display: none; z-index: 1; }
.scn-acts-r { right: 0; }
.scn-acts-l { left: 0; width: 100%; background: var(--bg-hover); }
.scn-row.show-r .scn-acts-r, .scn-row.show-l .scn-acts-l { display: flex; }
.scn-act { width: 64px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; border: 0; font-size: 0.72rem; font-weight: 750; color: #fff; cursor: pointer; }
.scn-act .ic { font-size: 1.1rem; line-height: 1; }
.scn-act.is-needs { background: #636366; }
.scn-act.is-being { background: var(--st-being); color: #1c1c1e; }
.scn-act.is-done { background: var(--st-done); color: #04231a; }
.scn-act.is-left { background: var(--st-left); color: #2a1206; }
.scn-acts-l .scn-act { width: 96px; }
.scn-row.show-l .scn-acts-l:has(.is-being) { background: var(--st-being); }
.scn-row.show-l .scn-acts-l:has(.is-done) { background: var(--st-done); }
.scn-row.is-full-r .scn-acts-r { left: 0; }
.scn-row.is-full-r .scn-acts-r .scn-act:not(.is-done) { width: 0; overflow: hidden; padding: 0; }
.scn-row.is-full-r .scn-acts-r .scn-act.is-done { width: auto; flex: 1; align-items: flex-end; padding-right: 1.2rem; }
.wrap-card { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; width: 100%; margin-top: 10px; padding: 0.7rem 0.85rem; text-align: left; border: 1px dashed color-mix(in srgb, var(--st-left) 60%, transparent); border-radius: var(--radius); background: color-mix(in srgb, var(--st-left) 8%, transparent); cursor: pointer; font-size: 0.85rem; }

/* bucket */
.bucket-intro { font-size: 0.8rem; margin: 0 2px 12px; }
.bk-group { margin-bottom: 14px; }
.bk-head { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 700; color: var(--text-muted); margin: 0 2px 6px; text-transform: uppercase; letter-spacing: 0.03em; }

/* import */
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-panel); padding: 0.4rem 0.9rem 0.6rem; font-size: 0.88rem; }
.card p { margin: 0.55rem 0; }
.sheet-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; background: var(--bg-panel); border: 1px solid var(--border); border-bottom: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5); }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; padding: 14px 10px 8px 16px; border-bottom: 1px solid var(--border-soft); }
.sheet-head h2 { font-size: 1.05rem; }
.sheet-body { overflow: auto; padding: 10px 16px; }
.sheet-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border-soft); }
.rv-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.rv-sum > div { display: flex; flex-direction: column; align-items: center; padding: 0.45rem 0; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--border-soft); }
.rv-sum b { font-size: 1.05rem; }
.rv-sum span { font-size: 0.7rem; color: var(--text-dim); }
.rv-sec { margin-bottom: 12px; }
.rv-label { font-size: 0.72rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); margin-bottom: 5px; }
.rv-cols { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.rv-col { font-size: 0.74rem; padding: 0.1rem 0.5rem; border-radius: var(--radius-pill); border: 1px solid color-mix(in srgb, var(--st-done) 55%, transparent); background: color-mix(in srgb, var(--st-done) 12%, transparent); color: #c8f5df; }
.rv-col b { color: var(--text); }
.rv-warn { margin: 0 0 12px; padding: 0.45rem 0.7rem 0.45rem 1.6rem; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); font-size: 0.8rem; }
.rv-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rv-day { padding: 0.45rem 0.6rem; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--border-soft); }
.rv-day-h { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.85rem; }
.rv-day-h .quiet { font-size: 0.76rem; white-space: nowrap; }
.rv-scenes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.rv-sc { font-size: 0.74rem; font-weight: 700; min-width: 1.9rem; text-align: center; padding: 0.06rem 0.4rem; border-radius: 6px; border: 1px solid var(--border-soft); background: var(--bg-panel); font-variant-numeric: tabular-nums; }
.rv-sc.is-un { border-color: color-mix(in srgb, var(--st-left) 60%, transparent); color: #ffc5a8; }
.rv-fine { margin: 4px 0 0; }

/* menu + toast + tabs */
.menu-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.35); display: flex; align-items: flex-end; justify-content: center; }
.menu { width: 100%; max-width: 560px; padding: 8px 10px calc(14px + env(safe-area-inset-bottom)); background: var(--bg-panel); border-radius: 18px 18px 0 0; border: 1px solid var(--border); display: grid; gap: 4px; }
.menu button { text-align: left; min-height: 48px; padding: 0 0.9rem; border: 0; border-radius: 10px; background: transparent; font-size: 0.95rem; cursor: pointer; }
.menu button:hover { background: var(--bg-hover); }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 120; max-width: min(92vw, 520px); padding: 0.55rem 0.9rem; border-radius: 12px; background: #2b3a4f; border: 1px solid var(--border); font-size: 0.85rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.toast.is-err { border-color: var(--danger); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 4px; padding: 6px 10px calc(8px + env(safe-area-inset-bottom)); background: rgba(12, 17, 24, 0.96); border-top: 1px solid var(--border-soft); backdrop-filter: blur(10px); }
.tab { flex: 1; max-width: 180px; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--text-dim); font-weight: 650; font-size: 0.86rem; cursor: pointer; }
.tab.is-on { color: var(--text); background: var(--bg-elev); }
.tab-n { display: inline-block; min-width: 1.2rem; padding: 0 0.3rem; border-radius: var(--radius-pill); background: var(--st-left); color: #2a1206; font-size: 0.7rem; font-weight: 800; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 4px; }
.login-card { width: 100%; max-width: 400px; text-align: center; }
.login-ic { width: 72px; height: 72px; border-radius: 18px; }
.login h1 { font-size: 1.7rem; margin-top: 10px; }
.login .quiet { margin: 4px 0 18px; }
.fld { display: grid; gap: 6px; text-align: left; margin-bottom: 14px; }
.fld > span { font-size: 0.78rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.fld input { min-height: 46px; padding: 0 0.9rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font: inherit; }
.fld textarea { padding: 0.6rem 0.9rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); font: inherit; line-height: 1.4; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.role-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0.7rem 0.8rem; text-align: left; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-elev); cursor: pointer; }
.role-opt small { color: var(--text-dim); font-size: 0.74rem; line-height: 1.3; }
.role-opt.is-on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.mock-note { font-size: 0.75rem; color: var(--text-dim); margin-top: 14px; }
.empty { text-align: center; padding: 2rem 1rem; }
.empty h2 { margin-bottom: 0.4rem; }

/* —— v1: productions, account, admin requests —— */
.prod-switch { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 38px; max-width: 74%; padding: 0 0.7rem 0 0.4rem; border-radius: var(--radius-pill); border: 1px solid var(--seg-border); background: var(--seg-track); cursor: pointer; font-weight: 700; }
.prod-switch-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.95rem; }
.prod-switch .caret { color: var(--text-dim); font-size: 0.75rem; }
.prod-switch .who-role { font-size: 0.68rem; font-weight: 800; padding: 0.1rem 0.45rem; border-radius: var(--radius-pill); flex: none; }
.who-role.is-ad { background: var(--accent); color: var(--seg-on-text); }
.who-role.is-pa { background: var(--bg-hover); color: var(--text-muted); }
.who-role.is-ro { background: var(--bg-hover); color: var(--text-dim); }
.avatar { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem; letter-spacing: 0.02em; background: var(--accent-soft); color: var(--text); border: 1px solid var(--seg-border); cursor: pointer; }
.avatar.sm { width: 30px; height: 30px; font-size: 0.72rem; cursor: default; }
.avatar.is-ghost { background: transparent; color: var(--text-dim); border-style: dashed; }
.badge-n { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e5534b; color: #fff; font-size: 0.68rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }
.badge-n.is-inline { position: static; border: 0; margin-left: 0.4rem; }
.tag.is-owner { background: rgba(240, 180, 41, 0.16); color: #f0b429; border-color: rgba(240, 180, 41, 0.45); }
.tag.is-adv { background: rgba(163, 113, 247, 0.16); color: #c4a5ff; border-color: rgba(163, 113, 247, 0.45); font-size: 0.66rem; vertical-align: middle; }
.alert-line { width: 100%; display: flex; align-items: center; gap: 0.55rem; min-height: 46px; margin: 4px 0 12px; padding: 0 0.9rem; border-radius: 12px; border: 1px solid rgba(240, 180, 41, 0.45); background: rgba(240, 180, 41, 0.1); color: var(--text); cursor: pointer; text-align: left; font-size: 0.92rem; }
.alert-line b { flex: 1; }
.prods .scn-head { margin-top: 6px; }
.prod-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.prod-card { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 14px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-elev); text-align: left; cursor: pointer; color: var(--text); }
.prod-card.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.prod-t { font-weight: 800; font-size: 1.02rem; }
.prod-tags { display: inline-flex; gap: 4px; align-items: center; }
.prod-d { grid-column: 1 / -1; font-size: 0.8rem; }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; background: #fff; color: #1f1f1f; border-color: #dadce0; font-weight: 700; min-height: 48px; }
.btn-link { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--accent); font-weight: 700; font-size: 0.92rem; cursor: pointer; padding: 6px; }
.login-err { color: #ff8b84; font-size: 0.85rem; margin-top: 10px; }
.login textarea, .fld input[type=date] { width: 100%; }
.wait-card { text-align: left; margin: 14px 0; display: grid; gap: 3px; }
.wait-note, .req-note { font-style: italic; color: var(--text-muted); margin-top: 4px; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu-who { display: flex; gap: 10px; align-items: center; padding: 8px 6px 12px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; }
.menu-who > span:last-child { display: grid; gap: 2px; }
.menu-who .avatar { cursor: default; }
.crew-list { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 6px; }
.crew-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--bg-elev); }
.crew-who { flex: 1; min-width: 0; display: grid; }
.crew-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.invite-row input { flex: 1; min-width: 0; }
.btn-danger { background: rgba(229, 83, 75, 0.14); color: #ff8b84; border-color: rgba(229, 83, 75, 0.5); }
.sheet-wrap.is-full .sheet { max-height: 100vh; height: 100%; border-radius: 0; max-width: none; }
.sheet-wrap.is-center { align-items: center; padding: 16px; }
.sheet.confirm { border-radius: 16px; border-bottom: 1px solid var(--border); max-width: 420px; }
.req-flip { display: flex; align-items: center; gap: 10px; padding: 8px 16px 0; }
.req-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.req-card { border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elev); padding: 12px; display: grid; gap: 10px; }
.req-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.req-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.req-acts .btn:only-child { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .sheet-wrap.is-full { align-items: center; }
  .sheet-wrap.is-full .sheet { height: auto; max-height: 86vh; max-width: 720px; border-radius: 18px; border-bottom: 1px solid var(--border); }
  .req-card { grid-template-columns: 1fr auto; align-items: center; }
  .req-acts { grid-template-columns: auto auto; }
  .req-acts .btn { min-width: 110px; }
}
.tab { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; position: relative; }
.tab-ic { font-size: 1rem; line-height: 1; }
.tab-l { font-size: 0.74rem; }
.tab .tab-n { position: absolute; top: 3px; right: calc(50% - 30px); }
.tab-n.is-req { background: #e5534b; color: #fff; }
.req-sec { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.approvals .req-list { margin-top: 8px; }
.bk-head.is-bucket { color: var(--st-left); }
.bk-sec { border: 1px solid var(--border-soft); border-radius: 14px; padding: 4px 10px 10px; margin: 8px 0 14px; background: rgba(255, 140, 66, 0.05); }
.bk-empty { margin: 4px 0; }
.ol-day { margin-bottom: 12px; }
.ol-day.is-today .bk-head { color: var(--accent); }
.ol-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.ol-row { display: grid; grid-template-columns: 22px 3.6rem 1fr auto; align-items: center; gap: 6px; min-height: 36px; padding: 4px 6px; border-radius: 8px; border-bottom: 1px solid var(--border-soft); font-size: 0.86rem; }
.ol-row.is-open { grid-template-columns: 3.6rem 1fr auto; grid-template-areas: "sc set btn" "sc dn btn" "sc from btn"; }
.ol-row.is-open .ol-sc { grid-area: sc; } .ol-row.is-open .ol-set { grid-area: set; } .ol-row.is-open .ol-dn { grid-area: dn; } .ol-row.is-open .ol-from { grid-area: from; } .ol-row.is-open .btn { grid-area: btn; }
.ol-row.is-done .ol-sc, .ol-row.is-done .ol-set { text-decoration: line-through; color: var(--text-dim); }
.ol-check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 800; }
.ol-row.is-done .ol-check { background: var(--st-done); border-color: var(--st-done); color: #04210f; }
.ol-row.st-being .ol-check { color: var(--st-being); border-color: var(--st-being); }
.ol-row.st-left .ol-check { color: var(--st-left); border-color: var(--st-left); }
.ol-sc { font-weight: 800; }
.ol-set { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-dn { font-size: 0.76rem; white-space: nowrap; }
.move-days { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.move-day { display: grid; gap: 2px; padding: 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); text-align: left; cursor: pointer; }
.move-day.is-on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* iPad (768–1199) and desktop (≥1200): left rail instead of the bottom tabs. Split View / Slide Over (<768) = phone. */
@media (min-width: 768px) {
  html.has-rail #app { max-width: 820px; padding-left: 196px; padding-bottom: 24px; }
  html.has-rail .tabs { top: 0; bottom: 0; right: auto; width: 176px; flex-direction: column; justify-content: flex-start; gap: 4px; padding: calc(72px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)) calc(10px + env(safe-area-inset-left)); border-top: 0; border-right: 1px solid var(--border-soft); }
  html.has-rail .tab { flex: none; max-width: none; min-height: 48px; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 0 12px; }
  html.has-rail .tab-l { font-size: 0.92rem; }
  html.has-rail .tab .tab-n { position: static; margin-left: auto; }
  html.has-rail .toast { bottom: 24px; }
  .cal-cell { min-height: 84px; }
}
@media (min-width: 1200px) {
  html.has-rail #app { max-width: 1040px; padding-left: 230px; }
  html.has-rail .tabs { width: 200px; left: max(0px, calc(50% - 520px)); }
  html.has-rail .approvals { max-width: 720px; }
  .cal-cell { min-height: 96px; }
}
/* touch: comfortable targets; mouse: hover states */
@media (pointer: coarse) { .tab, .btn, .seg-pill-opt, .x-btn, .cal-cell, .rv-sc { min-height: 44px; } .x-btn { min-width: 44px; } }
@media (hover: hover) and (pointer: fine) {
  .scn-st[data-cycle]:hover, .cal-cell:hover, .prod-card:hover, .tab:hover { filter: brightness(1.18); }
  .scn-st[data-cycle] { cursor: pointer; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}
.top { padding-left: max(2px, env(safe-area-inset-left)); padding-right: max(2px, env(safe-area-inset-right)); }

/* calendar */
.cal-bar-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.cal-bar-top .spacer { flex: 1; }
.cal-label { min-width: 8.5rem; text-align: center; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-head span { text-align: center; font-size: 0.7rem; color: var(--text-dim); font-weight: 700; padding: 4px 0; }
.cal-cell { position: relative; min-height: 62px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 4px 5px; border-radius: 8px; border: 1px solid var(--border-soft); background: var(--bg-elev); color: var(--text); text-align: left; cursor: pointer; overflow: hidden; }
.cal-cell.is-out { opacity: 0.4; }
.cal-cell.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-cell.is-today .cal-num { background: var(--accent); color: var(--seg-on-text); border-radius: 9px; padding: 0 5px; }
.cal-cell.is-selected { background: var(--accent-soft); }
.cal-cell.has-day { border-color: rgba(77, 163, 255, 0.35); }
.cal-cell.is-wrapped { background: rgba(63, 185, 80, 0.07); }
.cal-cell.is-adv .cal-sd { color: #c4a5ff; border-color: rgba(163, 113, 247, 0.45); border-style: dashed; }
.cal-cell.is-target.has-day, .cal-cell.is-target:not(.is-out) { outline: 1px dashed var(--st-left); }
.cal-num { font-size: 0.78rem; font-weight: 800; }
.cal-sd { font-size: 0.64rem; font-weight: 800; padding: 0 4px; border-radius: 6px; border: 1px solid rgba(77, 163, 255, 0.45); color: var(--accent); white-space: nowrap; }
.cal-n { font-size: 0.7rem; color: var(--text-muted); }
.cal-bar { width: 100%; height: 3px; border-radius: 2px; background: var(--bg-hover); margin-top: auto; }
.cal-bar i { display: block; height: 100%; border-radius: 2px; background: var(--st-done); }
.cal-wrap { position: absolute; top: 3px; right: 5px; font-size: 0.7rem; color: var(--st-done); font-weight: 800; }
.cal-grid.is-week .cal-cell { min-height: 96px; }
.cal-tray { margin-bottom: 10px; padding: 6px 10px 8px; border-radius: 12px; border: 1px solid var(--border-soft); background: rgba(255, 140, 66, 0.06); }
.cal-tray .rv-sc { cursor: pointer; }
.rv-sc.is-on { outline: 2px solid var(--st-left); }
.cal-detail { margin-top: 12px; }
.rv-plan { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(77, 163, 255, 0.4); background: var(--accent-soft); font-size: 0.9rem; }
.rv-plan.is-callsheet { border-color: rgba(163, 113, 247, 0.45); background: rgba(163, 113, 247, 0.1); }

/* feedback */
.fb-sheet textarea { width: 100%; resize: vertical; min-height: 7.5rem; }
.fb-count { text-align: right; margin-top: -6px; }
.fb-ctx { margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg-hover); line-height: 1.45; word-break: break-word; }
.fb-thanks { text-align: center; padding: 28px 10px 8px; }
.fb-thanks h2 { margin: 10px 0 6px; }
.fb-check { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; font-weight: 800; color: var(--st-done); border: 2px solid var(--st-done); background: rgba(63, 185, 80, 0.1); }
.fb-card, .req-list .fb-card { grid-template-columns: 1fr; align-items: stretch; }
.fb-card.is-new { border-color: rgba(210, 153, 34, 0.55); }
.fb-main { all: unset; display: flex; flex-direction: column; gap: 3px; cursor: pointer; width: 100%; }
.fb-main .req-h { display: flex; align-items: center; gap: 8px; }
.fb-main .req-h .scn-st { margin-left: auto; }
.fb-msg { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; margin-top: 2px; }
.fb-card.is-open .fb-msg { -webkit-line-clamp: unset; display: block; }
.fb-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.fb-meta b { color: var(--text-dim); font-weight: 700; margin-right: 3px; }
.fb-card .req-acts { margin-top: 10px; }
.login-err p { margin: 0 0 6px; }
.login-err .login-code { color: var(--text-dim, #9aa4b2); font-size: 0.8rem; }
.login-err code { font-family: ui-monospace, Menlo, monospace; background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 6px; }
.login-err a { color: inherit; text-decoration: underline; }
.login-wait { font-size: 0.85rem; margin-top: 10px; }
