/* AFOLINE Planner — one stylesheet for every page */
:root {
  --paper: #F5F6F8;
  --surface: #FFFFFF;
  --ink: #1D2433;
  --muted: #5D6678;
  --line: #E2E5EB;
  --shoot: #2F5BEA;  --shoot-bg: #EAF0FE;
  --edit: #B8650A;   --edit-bar: #E8890C; --edit-bg: #FDF2E3;
  --upload: #12804F; --upload-bar: #12915E; --upload-bg: #E5F5EC;
  --late: #C62F2F;   --late-bg: #FDEBEB;
  --radius: 10px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--paper);
  padding-bottom: env(safe-area-inset-bottom, 0px); }
a { color: var(--shoot); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.1rem; font-weight: 700; }
small { color: var(--muted); }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--shoot); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.top { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px); }
.top-row { display: flex; align-items: center; gap: 14px; padding: 10px 20px; max-width: 1280px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; margin-right: auto; }
.brand:hover { text-decoration: none; }
.slate { display: inline-flex; width: 26px; height: 20px; border-radius: 3px; overflow: hidden; background: #fff; transform: skewX(-12deg); }
.slate i { flex: 1; }
.slate i:nth-child(1) { background: var(--shoot); }
.slate i:nth-child(2) { background: var(--edit-bar); }
.slate i:nth-child(3) { background: var(--upload-bar); }
.top-search input { width: 230px; padding: 7px 12px; border-radius: 8px; border: 1px solid #3A4357; background: #2A3245; color: #fff; font: inherit; font-size: 14px; }
.top-search input::placeholder { color: #A7B0C2; }
.top-link { color: #C9D0DD; font-size: 14px; font-weight: 600; white-space: nowrap; }
.nav { display: flex; gap: 2px; padding: 0 14px; max-width: 1280px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #C9D0DD; padding: 9px 12px 11px; font-size: 14px; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
.nav a:hover { color: #fff; text-decoration: none; }
.nav a.on { color: #fff; border-bottom-color: #fff; }

/* ---------- layout ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 22px 20px 60px; }
.narrow { max-width: 440px; margin: 30px auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.split.even { grid-template-columns: 1fr 1fr; }
.summary { color: var(--muted); margin: 4px 0 12px; }
.empty { background: var(--surface); border: 1px dashed #C9CED8; border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); }
.empty.big { padding: 50px 20px; font-size: 1.05rem; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid #CDD2DB;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; min-height: 38px; }
.btn:hover { background: #F0F2F5; text-decoration: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #2E374A; }
.btn-ok { background: var(--upload-bar); border-color: var(--upload-bar); color: #fff; }
.btn-ok:hover { background: #0E7A4F; }
.btn-danger { background: var(--late); border-color: var(--late); color: #fff; }
.btn-danger:hover { background: #A82525; }
.btn-ghost-danger { color: var(--late); border-color: #F0C4C4; }
.btn-ghost-danger:hover { background: var(--late-bg); }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
input, select, textarea { font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1px solid #CDD2DB; border-radius: 8px; padding: 8px 10px; min-height: 40px; width: 100%; }
textarea { min-height: 70px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--ink); }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 16px 0 4px; }
fieldset:first-of-type { border-top: 0; padding-top: 0; }
legend { font-weight: 800; font-size: 1rem; padding: 0 0 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid2 .span2 { grid-column: 1 / -1; }
.field-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.danger-zone { margin-top: 14px; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 7px 12px; border: 1px solid #CDD2DB; border-radius: 999px; font-size: 14px; font-weight: 600; background: #fff; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:checked + span small { color: #C9D0DD; }
.chip input:focus-visible + span { outline: 3px solid var(--shoot); outline-offset: 2px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); min-width: 150px; }
.filters label.grow { flex: 1; }
.filters input, .filters select { min-height: 38px; font-size: 14px; }

form.inline { display: inline-flex; gap: 6px; margin: 0; }
form.inline select { min-height: 34px; padding: 4px 8px; font-size: 14px; width: auto; max-width: 170px; }
.wrap-inline { flex-wrap: wrap; }
.wrap-inline input[type=date] { min-height: 34px; padding: 4px 8px; font-size: 14px; width: auto; }

/* ---------- flash ---------- */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 600; background: var(--upload-bg); color: #0B5E3A; border: 1px solid #BDE5CF; }
.flash ul { margin: 6px 0; padding-left: 18px; font-weight: 500; }
.flash-err { background: var(--late-bg); color: #8E1F1F; border-color: #F3C2C2; }
.flash-warn { background: #FFF6E5; color: #7A4A06; border-color: #F5D9A8; }

/* ---------- tables (become cards on phones) ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.rt { width: 100%; border-collapse: collapse; font-size: 14px; }
.rt th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #FAFBFC; white-space: nowrap; }
.rt td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.rt tbody tr:last-child td { border-bottom: 0; }
.rt tfoot th { border-top: 2px solid var(--line); border-bottom: 0; color: var(--ink); font-size: 14px; }
.rt td.actions { white-space: nowrap; text-align: right; }
.rt td.actions form { display: inline; }
.row-dim td { opacity: .55; }
.row-late td:first-child { box-shadow: inset 4px 0 0 var(--late); }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #EEF0F4; color: var(--muted); white-space: nowrap; }
.b-shoot-scheduled { background: var(--shoot-bg); color: var(--shoot); }
.b-shoot-done, .b-edit-done, .b-upload-uploaded, .b-script-ready, .b-pay-received { background: var(--upload-bg); color: var(--upload); }
.b-shoot-cancelled { background: #EEF0F4; color: #7A8295; }
.b-shoot-postponed, .b-pay-partial, .b-script-in_progress, .b-edit-editing { background: var(--edit-bg); color: var(--edit); }
.b-script-not_ready, .b-pay-pending, .b-edit-changes { background: var(--late-bg); color: var(--late); }
.b-edit-pending, .b-upload-scheduled { background: #EEF0F4; color: var(--ink); }
.late { display: inline-block; background: var(--late); color: #fff; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 4px; }
.late-text { color: var(--late); }
.alert-dot { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--late); color: #fff; font-size: 12px; font-weight: 800; }

/* ---------- dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); border-top: 5px solid; }
.tile:hover { text-decoration: none; background: #FBFBFC; }
.tile b { display: block; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.tile span { color: var(--muted); font-weight: 600; font-size: 14px; }
.tile-shoot { border-top-color: var(--shoot); }
.tile-edit { border-top-color: var(--edit-bar); }
.tile-upload { border-top-color: var(--upload-bar); }
.tile-late { border-top-color: var(--late); }
.alert-box { background: var(--late-bg); border: 1px solid #F3C2C2; border-left: 6px solid var(--late); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; }
.alert-box h2 { color: var(--late); margin-bottom: 2px; }
.alert-box p { margin: 0 0 8px; color: #8E1F1F; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 4px 0; }
ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
ul.list li:last-child { border-bottom: 0; }
.list-date { width: 96px; flex: none; font-weight: 700; font-size: 14px; }
.list-date small { display: block; font-weight: 500; }
.list-body { flex: 1; min-width: 0; }
.list-body small { display: block; }
.money-row { display: flex; flex-wrap: wrap; gap: 28px; margin: 6px 0 10px; }
.money-row b { display: block; font-size: 1.35rem; font-weight: 800; }
.money-row span { color: var(--muted); font-size: 13px; font-weight: 600; }
.export-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.export-row span { font-weight: 700; color: var(--muted); font-size: 14px; }

/* ---------- workload ---------- */
.bar { position: relative; height: 24px; background: #EEF0F4; border-radius: 6px; min-width: 140px; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--edit-bar); border-radius: 6px; }
.bar span { position: relative; padding-left: 8px; font-weight: 800; font-size: 13px; line-height: 24px; }
.small-link { font-size: 12px; }

/* ---------- My day ---------- */
.who { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.who-chip { padding: 9px 16px; border-radius: 999px; background: var(--surface); border: 1px solid #CDD2DB; color: var(--ink); font-weight: 700; }
.who-chip:hover { text-decoration: none; border-color: var(--ink); }
.who-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.day-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.day-hello { margin: 0; color: var(--muted); font-weight: 600; }
.day-title { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -.03em; margin: 2px 0 4px; }
.day-count { margin: 0; font-weight: 700; }
.day-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.lane { display: flex; align-items: center; gap: 10px; margin: 24px 0 10px; font-size: 1.05rem; }
.lane::before { content: ''; width: 34px; height: 12px; border-radius: 2px; transform: skewX(-20deg);
  background: repeating-linear-gradient(90deg, currentColor 0 7px, transparent 7px 11px); }
.lane-shoot { color: var(--shoot); }
.lane-edit { color: var(--edit); }
.lane-upload { color: var(--upload); }
.tasks { display: grid; gap: 10px; }
.task { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; background: var(--surface); border: 1px solid var(--line);
  border-left: 6px solid; border-radius: var(--radius); padding: 14px 16px; }
.t-shoot { border-left-color: var(--shoot); }
.t-edit { border-left-color: var(--edit-bar); }
.t-upload { border-left-color: var(--upload-bar); }
.task.is-late { border-left-color: var(--late); background: #FFFBFB; }
.task.is-done { opacity: .6; }
.task h3 { font-size: 1.05rem; margin: 0 0 4px; }
.task h3 span { font-weight: 500; color: var(--muted); }
.task .meta { margin: 2px 0; font-size: 14px; color: var(--muted); }
.task .note { margin: 8px 0 0; font-size: 14px; background: var(--paper); padding: 8px 10px; border-radius: 6px; }
.task-main { min-width: 0; flex: 1; }
.task-act { display: flex; flex-direction: column; gap: 8px; width: 260px; flex: none; }
.task-act form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.task-act input { font-size: 14px; min-height: 38px; }
.task-act .btn { width: 100%; min-height: 44px; font-size: 15px; }
.done-tag { font-weight: 800; color: var(--upload); margin: 0; }

/* ---------- calendar ---------- */
.cal-tools { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lg { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.lg input { width: 16px; height: 16px; }
.lg-shoot { color: var(--shoot); } .lg-edit { color: var(--edit); } .lg-upload { color: var(--upload); }
.lg-late { color: var(--late); cursor: default; }
.lg-late::before { content: ''; width: 10px; height: 10px; border-radius: 2px; background: var(--late); }
.cal-filters { display: flex; gap: 8px; }
.cal-filters select { width: auto; min-width: 150px; min-height: 38px; font-size: 14px; }
.cal-card { padding: 14px; }
.fc { --fc-border-color: var(--line); --fc-today-bg-color: #F2F5FF; --fc-button-bg-color: var(--surface); --fc-button-text-color: var(--ink);
  --fc-button-border-color: #CDD2DB; --fc-button-hover-bg-color: #F0F2F5; --fc-button-hover-border-color: #CDD2DB;
  --fc-button-active-bg-color: var(--ink); --fc-button-active-border-color: var(--ink); font-size: 14px; }
.fc .fc-button { font-weight: 700; text-transform: none; box-shadow: none !important; }
.fc .fc-button-active { color: #fff !important; }
.fc .fc-toolbar-title { font-size: 1.3rem; font-weight: 800; }
.fc a { color: inherit; }
.fc-event { cursor: pointer; border: 0 !important; border-left: 4px solid !important; border-radius: 4px !important; padding: 1px 4px; font-weight: 600; }
.fc-event .fc-event-main, .fc-event .fc-event-title, .fc-event .fc-event-time { color: var(--ink) !important; }
.fc-daygrid-dot-event .fc-daygrid-event-dot { display: none; }
.ev-shoot { background: var(--shoot-bg) !important; border-left-color: var(--shoot) !important; }
.ev-edit { background: var(--edit-bg) !important; border-left-color: var(--edit-bar) !important; }
.ev-upload { background: var(--upload-bg) !important; border-left-color: var(--upload-bar) !important; }
.fc-event.is-late { background: var(--late-bg) !important; border-left-color: var(--late) !important; }
.fc-event.st-done, .fc-event.st-uploaded { opacity: .55; }
.fc-event.st-done .fc-event-title, .fc-event.st-uploaded .fc-event-title { text-decoration: line-through; }
.fc-list-event.ev-shoot .fc-list-event-dot { border-color: var(--shoot); }
.fc-list-event.ev-edit .fc-list-event-dot { border-color: var(--edit-bar); }
.fc-list-event.ev-upload .fc-list-event-dot { border-color: var(--upload-bar); }
.fc-list-event.is-late .fc-list-event-dot { border-color: var(--late); }
.ev-dialog { border: 0; border-radius: 14px; padding: 22px 24px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(29,36,51,.3); color: var(--ink); }
.ev-dialog::backdrop { background: rgba(29,36,51,.45); }
.ev-kind { margin: 0; font-weight: 800; color: var(--muted); font-size: 13px; }
.ev-dialog dl { display: grid; grid-template-columns: 100px 1fr; gap: 6px 12px; margin: 10px 0 18px; font-size: 14px; }
.ev-dialog dt { color: var(--muted); font-weight: 700; }
.ev-dialog dd { margin: 0; }

/* ---------- activity log ---------- */
.log { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.log li { display: flex; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.log li:last-child { border-bottom: 0; }
.log time { width: 72px; flex: none; color: var(--muted); }
.log b { width: 150px; flex: none; }
.log .log-day { background: #FAFBFC; font-weight: 800; color: var(--muted); font-size: 13px; }

/* ---------- phones ---------- */
@media (max-width: 900px) {
  .split, .split.even, .cols { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .wrap { padding: 16px 14px 60px; }
  .top-row { padding: 10px 14px; flex-wrap: wrap; }
  .top-search { order: 3; width: 100%; }
  .top-search input { width: 100%; }
  h1 { font-size: 1.35rem; }
  .grid2 { grid-template-columns: 1fr; }
  .filters label { min-width: calc(50% - 5px); flex: 1; }
  .table-wrap { background: none; border: 0; overflow: visible; }
  table.rt, .rt tbody, .rt tr, .rt td, .rt tfoot { display: block; width: 100%; }
  .rt thead { display: none; }
  .rt tbody tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 0; }
  .rt td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 14px; text-align: right; }
  .rt td::before { content: attr(data-label); font-weight: 700; color: var(--muted); font-size: 13px; text-align: left; flex: none; }
  .rt td.actions { justify-content: flex-end; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
  .rt td.actions::before { content: none; }
  .rt tfoot tr { display: flex; flex-wrap: wrap; gap: 10px; background: var(--surface); border-radius: var(--radius); padding: 10px 14px; }
  .rt tfoot th { border: 0; padding: 0; }
  .row-late td:first-child { box-shadow: none; }
  .rt tr.row-late { border-left: 5px solid var(--late); }
  form.inline select { max-width: 160px; }
  .task { flex-direction: column; }
  .task-act { width: 100%; }
  .cal-filters { width: 100%; }
  .cal-filters select { flex: 1; min-width: 0; }
  .cal-card { padding: 8px; }
  .fc .fc-toolbar-title { font-size: 1.05rem; }
  .fc .fc-toolbar { gap: 8px; }
  .log li { flex-wrap: wrap; gap: 4px 12px; }
  .log b { width: auto; }
  .list-date { width: 80px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* fixes */
.form input, .form select, .form textarea, .filters input, .filters select { font-weight: 500; }
legend { float: left; width: 100%; }
fieldset > .grid2, fieldset > .chips, fieldset > .field-label { clear: both; }
/* month view: keep every event inside its day boxes */
.fc .fc-daygrid-event { box-sizing: border-box; max-width: calc(100% - 6px); margin: 1px 3px 2px !important; overflow: hidden; }
.fc .fc-daygrid-block-event { max-width: none; white-space: nowrap; }
.fc .fc-daygrid-block-event .fc-event-main { overflow: hidden; }
.fc .fc-daygrid-block-event .fc-event-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc .fc-daygrid-dot-event { white-space: normal; flex-wrap: wrap; align-items: flex-start; }
.fc .fc-daygrid-dot-event .fc-event-title { white-space: normal; overflow-wrap: anywhere; }
.fc .fc-h-event:not(.fc-event-start) { border-left-width: 2px !important; border-left-style: dashed !important; }
.fc .fc-h-event:not(.fc-event-start) .fc-event-title::before { content: '… '; }

/* My day: full schedule */
.jump input { min-height: 38px; width: auto; font-size: 14px; }
.day-nav { align-items: center; }
.schedule { margin-top: 34px; padding-top: 22px; border-top: 2px solid var(--line); scroll-margin-top: 110px; }
.sched-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sched-head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.seg { display: inline-flex; background: #E6E9EF; border-radius: 10px; padding: 3px; }
.seg-btn { border: 0; background: none; font: inherit; font-weight: 700; font-size: 14px; padding: 7px 18px; border-radius: 8px; cursor: pointer; color: var(--muted); min-height: 36px; }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(29,36,51,.15); }
.sched-day { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.sched-day.is-late { border-color: #F3C2C2; background: #FFFBFB; }
.sched-day.is-current { box-shadow: inset 4px 0 0 var(--ink); }
.sched-date { width: 84px; flex: none; color: var(--ink); }
.sched-date:hover { text-decoration: none; }
.sched-date b { display: block; font-size: 1.1rem; font-weight: 800; }
.sched-date small { display: block; font-weight: 600; }
.is-late .sched-date b { color: var(--late); }
.sched-items { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; }
.si { display: flex; align-items: baseline; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.si:last-child { border-bottom: 0; }
.si-kind { font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 4px; flex: none; }
.si-shoot .si-kind { background: var(--shoot-bg); color: var(--shoot); }
.si-edit .si-kind { background: var(--edit-bg); color: var(--edit); }
.si-upload .si-kind { background: var(--upload-bg); color: var(--upload); }
.si-title { font-weight: 600; flex: 1; min-width: 160px; }
.small-note { font-size: 13px; margin-top: 8px; }
@media (max-width: 760px) {
  .sched-day { flex-direction: column; gap: 6px; }
  .sched-date { width: auto; display: flex; gap: 8px; align-items: baseline; }
  .sched-date b, .sched-date small { display: inline; }
  .day-nav .btn { flex: 1; }
  .jump { flex: 1 1 100%; } .jump input { width: 100%; }
}
@media (max-width: 760px) {
  .fc-daygrid-event { white-space: nowrap !important; font-size: 11px; padding: 0 2px; }
  .fc-daygrid-event .fc-event-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fc-daygrid-dot-event { flex-wrap: nowrap; }
  .fc-daygrid-event .fc-event-time { display: none; }
  .fc .fc-daygrid-day-frame { min-height: 64px; }
}

/* v5: PIN, phone calendar, client page, reports, summary */
.pin-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 16px 0 4px; border-left: 6px solid var(--ink); }
.pin-box h2 { margin: 0 0 2px; }
.pin-box p { margin: 0; }
.pin-row { display: flex; gap: 8px; }
.pin-row input { width: 130px; font-size: 20px; letter-spacing: .3em; text-align: center; }
.phone-cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.phone-cal summary { cursor: pointer; font-weight: 700; }
.phone-cal p { margin: 8px 0; font-size: 14px; }
.copy-row { display: flex; gap: 8px; margin: 6px 0; }
.copy-row input { font-size: 13px; min-width: 0; }
.section-title { margin-top: 30px; }
.bar-pct.good i { background: var(--upload-bar); }
.bar-pct.mid i { background: var(--edit-bar); }
.bar-pct.low i { background: var(--late); }
.plan-person { padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan-person:last-child { border-bottom: 0; }
.plan-person ul { margin-top: 4px; }
.client-wrap { max-width: 760px; }
.client-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.client-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.client-list li:last-child { border-bottom: 0; }
.rt td form { display: inline; }
.fc-event.fc-event-draggable { cursor: grab; }
@media (max-width: 760px) { .pin-row { width: 100%; } .pin-row input { flex: 1; } }
.si-edit_start .si-kind { background: var(--edit-bg); color: var(--edit); border: 1px dashed var(--edit-bar); }
.date-pair label { display: flex; flex-direction: column; font-size: 11px; font-weight: 700; color: var(--muted); }
.date-pair input { min-height: 32px; padding: 3px 6px; font-size: 13px; width: 140px; }
@media (max-width: 760px) {
  .fc .fc-daygrid-dot-event { white-space: nowrap; flex-wrap: nowrap; }
  .fc .fc-daygrid-dot-event .fc-event-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fc .fc-daygrid-event { margin: 1px 2px !important; max-width: calc(100% - 4px); }
}
.fc .ev-edit-start { background: #fff !important; border-left-style: dashed !important; }
.fc-list-event.ev-edit-start .fc-list-event-dot { border-style: dashed; }

/* v10: booking fees, payouts, client report */
.model-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mp { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 6px 3px 3px; }
.mp .chip span { padding: 5px 12px; }
.mp input[type=number] { width: 90px; min-height: 32px; padding: 3px 8px; font-size: 13px; display: none; }
.mp.on { border-color: var(--ink); }
.mp.on input[type=number] { display: block; }
.si-edit_soon .si-kind { background: #fff; color: var(--edit); border: 1px solid var(--edit-bar); }
.tiles-3 { grid-template-columns: repeat(3, 1fr); }
.pay-pop { display: inline-block; position: relative; }
.pay-pop summary { list-style: none; }
.pay-pop summary::-webkit-details-marker { display: none; }
.pay-pop[open] .pay-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: 0 12px 30px rgba(29,36,51,.18); text-align: left; }
.pay-line { margin: -4px 0 10px; }
.pay-line .pay-pop[open] .pay-form { left: 0; right: auto; }
.client-report { display: grid; gap: 8px; }
.cr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cr > summary { display: grid; grid-template-columns: 1.4fr 1.2fr 1.2fr repeat(4, .8fr); gap: 12px; align-items: center; padding: 12px 16px; cursor: pointer; list-style: none; }
.cr > summary::-webkit-details-marker { display: none; }
.cr > summary:hover { background: #FAFBFC; }
.cr[open] > summary { border-bottom: 1px solid var(--line); }
.cr-name b { display: block; font-size: 1rem; }
.cr-name b::before { content: '▸ '; color: var(--muted); }
.cr[open] .cr-name b::before { content: '▾ '; }
.cr-cell { font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.cr-cell small, .cr-name small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.cr-cell.num { text-align: right; font-weight: 700; }
.cr .table-wrap { border: 0; border-radius: 0 0 var(--radius) var(--radius); }
.report-link { margin-top: 16px; }
@media (max-width: 900px) {
  .cr > summary { grid-template-columns: 1fr 1fr; }
  .cr-name { grid-column: 1 / -1; }
  .cr-cell.num { text-align: left; }
  .tiles-3 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .pay-pop[open] .pay-form { position: static; width: 100%; margin-top: 8px; box-shadow: none; }
  .cr .table-wrap { padding: 8px; }
}
/* pay form opens as a centered popup so tables never clip it */
.pay-pop[open] > summary::before { content: ''; position: fixed; inset: 0; background: rgba(29,36,51,.45); z-index: 40; cursor: default; }
.pay-pop[open] .pay-form, .pay-line .pay-pop[open] .pay-form { position: fixed; top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%); z-index: 41; width: min(320px, calc(100vw - 32px)); margin: 0; box-shadow: 0 20px 60px rgba(29,36,51,.3); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; text-align: left; }
@media (max-width: 760px) { .pay-pop[open] .pay-form { position: fixed; } }
.seg a.seg-btn { display: inline-flex; align-items: center; text-decoration: none; }

/* v12: edit-only jobs */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge.b-job { background: #F1ECFE; color: #5B3FC4; }
a.badge.b-job:hover { text-decoration: none; background: #E6DDFD; }
.job-box { border-left: 6px solid #5B3FC4; margin-bottom: 14px; }
.job-box h2 small { font-weight: 600; font-size: 13px; }
.danger-zone { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.cell-val { display: inline-block; }
@media (max-width: 760px) { .cell-val { text-align: right; } }

/* v14: quick + bulk payouts */
.btn-ghost { background: transparent; border-color: #CDD2DB; color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: #F0F2F5; }
.pay-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; padding: 10px 14px; }
.pay-toolbar + .table-wrap { border-radius: 0 0 var(--radius) var(--radius); }
.pay-toolbar label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; color: var(--muted); }
.pay-toolbar label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); margin-right: auto; min-height: 38px; }
.pay-toolbar input[type=date], .pay-toolbar select { min-height: 36px; font-size: 14px; width: auto; }
.pay-toolbar .btn:disabled { opacity: .45; cursor: not-allowed; }
.rt th.cb, .rt td.cb { width: 34px; padding-right: 0; }
.undo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin-bottom: 14px; border-radius: 8px; background: var(--upload-bg); color: #0B5E3A; border: 1px solid #BDE5CF; font-weight: 600; }
@media (max-width: 760px) {
  .pay-toolbar label.check { flex-basis: 100%; }
  .pay-toolbar .btn { flex: 1 1 100%; }
  .rt td.cb { display: block; padding: 8px 14px 0; }
  .rt td.cb:empty { display: none; }
  .rt td.cb::before { content: none; }
}

/* v15: payout add / remove */
.adj-form { margin-bottom: 12px; }
.adj-kind { margin-bottom: 12px; }
.adj-kind .seg-btn { display: inline-flex; align-items: center; gap: 6px; }
.adj-kind input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.adj-kind .seg-btn:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(29,36,51,.15); }
.adj-kind .seg-btn:has(input[value=deduct]:checked) { color: var(--late); }
.adj-kind .seg-btn:focus-within { outline: 3px solid var(--shoot); outline-offset: 2px; }
.adj-grid { display: grid; grid-template-columns: 140px 1.4fr 1fr 160px auto; gap: 10px; align-items: end; }
.adj-grid label { margin-bottom: 0; }
@media (max-width: 900px) { .adj-grid { grid-template-columns: 1fr 1fr; } .adj-grid .btn { grid-column: 1 / -1; } }

/* v16: Tracker + script writer */
.who-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.who-line .who { margin-bottom: 0; }
.who-lead { font-weight: 700; color: var(--muted); font-size: 14px; }
.trk-client { margin-bottom: 22px; scroll-margin-top: 110px; }
.trk-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.trk-head h2 { margin: 0; font-size: 1.15rem; }
.trk-prog { width: 160px; height: 8px; background: #E6E9EF; border-radius: 99px; overflow: hidden; }
.trk-prog i { display: block; height: 100%; background: var(--upload-bar); }
.rt.trk td { vertical-align: top; min-width: 130px; }
.rt.trk td:first-child { min-width: 170px; }
.step { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 8px; font-size: 13px; }
.step .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--upload-bar); color: #fff; font-weight: 800; font-size: 13px; }
.step .tick-empty { background: #fff; border: 2px solid #CDD2DB; }
.step.is-part .tick-empty { border-color: var(--edit-bar); }
.step-info { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.step-info small { color: var(--muted); }
.step.is-na small { color: #98A0B0; }
.step-links { flex-basis: 100%; font-size: 12px; }
.tick-f { display: inline; margin: 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.reel-step { flex-direction: column; gap: 6px; }
.reel-head { display: flex; align-items: center; gap: 8px; }
.chips-r { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-r { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 28px; padding: 0 8px; border-radius: 6px;
  font: inherit; font-size: 12px; font-weight: 800; border: 1px solid #CDD2DB; background: #fff; color: var(--ink); cursor: default; }
button.chip-r { cursor: pointer; }
button.chip-r.is-open:hover { border-color: var(--upload-bar); color: var(--upload); }
.chip-r.is-done { background: var(--upload-bg); border-color: #BDE5CF; color: var(--upload); }
.chip-r.is-na { background: #F3F4F7; color: #A7AEBB; border-style: dashed; }
ul.who-list, .who-list ul { list-style: none; margin: 0; padding: 0; font-size: 12px; line-height: 1.45; }
.who-list small { color: var(--muted); }
details.who-list summary { font-size: 12px; color: var(--shoot); cursor: pointer; }
.script-sub { margin: 4px 0 0; }
.script-card { padding: 14px; }
.script-editor { width: 100%; min-height: 55vh; font: 16px/1.6 var(--font); padding: 14px 16px; border-radius: 10px; resize: vertical; }
.script-box { font-size: 15px; line-height: 1.55; }
.script-read { white-space: pre-wrap; font-size: 16px; line-height: 1.65; padding: 6px 4px 14px; }
.script-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0 6px; }
.script-bar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); margin: 0; }
.script-bar label.grow { flex: 1; min-width: 200px; }
.script-bar select, .script-bar input { min-height: 38px; font-size: 14px; }
#script-count { margin-right: auto; align-self: center; }
@media (max-width: 760px) {
  .rt.trk td { min-width: 0; display: block; text-align: left; }
  .rt.trk td::before { display: block; margin-bottom: 4px; }
  .trk-prog { width: 100px; }
  .script-editor { min-height: 60vh; }
}

/* v17: bulk edits */
.bulk-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0; padding: 10px 14px; position: sticky; top: 96px; z-index: 5; }
.bulk-bar.has-sel { background: #F2F5FF; border-color: #C9D6FB; }
.bulk-bar + .bulk-wrap { border-radius: 0 0 var(--radius) var(--radius); }
.bulk-bar .sel-all { display: flex; align-items: center; gap: 8px; font-weight: 700; min-height: 38px; margin-right: auto; }
.bulk-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.bulk-acts label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; color: var(--muted); }
.bulk-acts label[hidden] { display: none; }
.bulk-acts select, .bulk-acts input { min-height: 36px; font-size: 14px; width: auto; }
.bulk-acts .btn:disabled { opacity: .45; cursor: not-allowed; }
.rt tr.row-sel td { background: #F6F8FF; }
@media (max-width: 760px) { .bulk-bar { position: static; } .bulk-acts { width: 100%; } .bulk-acts label, .bulk-acts .btn { flex: 1 1 45%; } .bulk-acts select, .bulk-acts input { width: 100%; } }

/* ================= v17: new calendar ================= */
:root { --c-shoot: #2F5BEA; --c-edit: #E8890C; --c-upload: #12915E; --c-late: #C62F2F; }
.cx-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cx-title { display: flex; align-items: center; gap: 8px; }
.cx-title h1 { margin: 0 4px; font-size: clamp(1.5rem, 3.2vw, 2.3rem); font-weight: 800; letter-spacing: -.03em; min-width: 9ch; }
.cx-nav { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #CDD2DB; background: var(--surface); font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); }
.cx-nav:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.cx-today { margin-left: 4px; }
.cx-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cx-views .seg-btn { min-width: 70px; }
.cx-filters { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cx-types { display: flex; gap: 8px; flex-wrap: wrap; }
.tp { --c: var(--ink); display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 10px; border-radius: 999px; border: 2px solid var(--c);
  background: var(--surface); color: var(--c); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; transition: background .15s, color .15s; }
.tp .ic { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.tp b { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: var(--c); color: #fff; font-size: 12px; text-align: center; }
.tp.on { background: var(--c); color: #fff; }
.tp.on .ic { background: #fff; }
.tp.on b { background: rgba(255,255,255,.25); }
.tp:not(.on) { opacity: .75; }
.tp-shoot { --c: var(--c-shoot); } .tp-edit { --c: var(--c-edit); } .tp-upload { --c: var(--c-upload); } .tp-late { --c: var(--c-late); }
.tp-late:not(.on) { opacity: 1; border-style: dashed; }
.cx-client { width: auto; min-width: 180px; min-height: 38px; font-size: 14px; }
.cx-people { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: thin; }
.pc { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; }
.pc:hover { border-color: var(--ink); }
.pc.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.av { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; flex: none; }
.av-all { background: #5D6678; font-size: 10px; }
.av-xs { width: 20px; height: 20px; font-size: 9px; margin-left: auto; }

.cx-body { min-height: 300px; transition: opacity .15s; }
.cx-body.is-loading { opacity: .5; }

/* event chip */
.ev { --c: var(--c-shoot); --bg: #EAF0FE; display: flex; align-items: center; gap: 7px; width: 100%; text-align: left; border: 0; border-radius: 8px;
  padding: 6px 7px; background: var(--bg); color: var(--ink); font: inherit; cursor: pointer; position: relative; box-shadow: inset 3px 0 0 var(--c); }
.ev:hover { filter: brightness(.97); }
.ev-edit { --c: var(--c-edit); --bg: #FDF2E3; } .ev-upload { --c: var(--c-upload); --bg: #E5F5EC; }
.ev.is-late { --bg: #FDEBEB; box-shadow: inset 3px 0 0 var(--c-late), 0 0 0 1px #F3C2C2; }
.ev.is-done { opacity: .55; }
.ev.is-done .ev-txt b { text-decoration: line-through; }
.ev-ic { width: 22px; height: 22px; border-radius: 6px; background: var(--c); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ev-ic svg { width: 14px; height: 14px; }
.ev-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.ev-txt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-txt small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-sm { padding: 3px 6px; gap: 5px; } .ev-sm .ev-ic { width: 18px; height: 18px; } .ev-sm .ev-ic svg { width: 12px; height: 12px; } .ev-sm .ev-txt b { font-size: 12px; }
.ev-tick { color: var(--upload); font-weight: 800; font-size: 12px; }
.ev-late { background: var(--c-late); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 4px; }
.ev[draggable="true"] { cursor: grab; }
.ev.dragging { opacity: .4; }

/* month */
.mg { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mg-head, .mg-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mg-head span { padding: 10px; font-size: 12px; font-weight: 800; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); }
.md { min-height: 128px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; }
.md:nth-child(7n) { border-right: 0; }
.md:hover { background: #FAFBFD; }
.md:focus-visible { outline: 3px solid var(--shoot); outline-offset: -3px; }
.md.is-out { background: #FAFBFC; } .md.is-out .md-n { color: #B5BBC7; }
.md-top { display: flex; align-items: center; gap: 6px; }
.md-n { font-weight: 800; font-size: 15px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.md.is-today .md-n { background: var(--ink); color: #fff; }
.md-load { flex: 1; height: 4px; background: #EEF0F4; border-radius: 99px; overflow: hidden; }
.md-load i { display: block; height: 100%; background: linear-gradient(90deg, var(--c-upload), var(--c-edit), var(--c-late)); background-size: 300% 100%; }
.md-evs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.md-more { border: 0; background: none; font: inherit; font-size: 12px; font-weight: 800; color: var(--shoot); text-align: left; padding: 2px 4px; cursor: pointer; }
.md.drop-on, .wk-day.drop-on { background: #EAF0FE; box-shadow: inset 0 0 0 2px var(--c-shoot); }
.md-dots, .ag-dc { display: flex; flex-wrap: wrap; gap: 3px; }
.dc { --c: var(--c-shoot); display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 800; color: #fff; background: var(--c); border-radius: 5px; padding: 1px 4px; }
.dc svg { width: 10px; height: 10px; }
.dc-edit { --c: var(--c-edit); } .dc-upload { --c: var(--c-upload); }

/* week */
.wk { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wk-day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 300px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wk-day.is-today { border: 2px solid var(--ink); }
.wk-day header { display: flex; align-items: baseline; gap: 6px; padding: 2px 2px 6px; border-bottom: 1px solid var(--line); }
.wk-dn { font-size: 12px; font-weight: 800; color: var(--muted); }
.wk-n { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.wk-day.is-today .wk-n { color: var(--shoot); }
.wk-c { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--muted); }
.wk-evs { display: flex; flex-direction: column; gap: 5px; }
.wk-empty { margin: 8px 2px; color: #A7AEBB; font-size: 13px; }

/* list / agenda */
.ag { display: flex; flex-direction: column; gap: 10px; }
.ag-day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ag-day.is-today { border: 2px solid var(--ink); }
.ag-day.is-past { opacity: .8; }
.ag-h { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #FAFBFC; border-bottom: 1px solid var(--line); }
.ag-n { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; width: 42px; }
.ag-w { display: flex; flex-direction: column; font-weight: 800; line-height: 1.2; }
.ag-w em { font-style: normal; color: var(--shoot); }
.ag-w small { color: var(--muted); font-weight: 600; }
.ag-dc { margin-left: auto; }
.ag-evs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; padding: 10px; }

/* day drawer */
.cx-drawer { position: fixed; inset: 0; z-index: 60; background: rgba(29,36,51,.0); pointer-events: none; visibility: hidden; transition: background .2s, visibility 0s .25s; }
.cx-drawer.open { background: rgba(29,36,51,.45); pointer-events: auto; visibility: visible; transition: background .2s; }
.cx-sheet { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--paper); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s ease; box-shadow: -20px 0 50px rgba(29,36,51,.2); }
.cx-drawer.open .cx-sheet { transform: none; }
.cx-d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 18px 12px; background: var(--ink); color: #fff; }
.cx-d-head h2 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.cx-d-kicker { margin: 0 0 2px; font-weight: 700; color: #C9D0DD; font-size: 13px; }
.cx-x { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.cx-d-body { padding: 14px 16px 40px; overflow-y: auto; flex: 1; }
.dr-g { --c: var(--c-shoot); display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 14px 0 8px; color: var(--c); }
.dr-g svg { width: 18px; height: 18px; }
.dr-g span { background: var(--c); color: #fff; border-radius: 99px; padding: 0 8px; font-size: 12px; }
.dr-edit { --c: var(--edit); } .dr-upload { --c: var(--upload); }
.dr-ev { --c: var(--c-shoot); background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.dr-ev.ev-edit { --c: var(--c-edit); } .dr-ev.ev-upload { --c: var(--c-upload); } .dr-ev.is-late { border-left-color: var(--c-late); }
.dr-ev.is-done { opacity: .7; }
.dr-ev-h { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.dr-sub { margin: 2px 0 6px; font-size: 13px; color: var(--muted); }
.dr-ev dl { display: grid; grid-template-columns: 96px 1fr; gap: 3px 10px; margin: 0 0 8px; font-size: 13px; }
.dr-ev dt { color: var(--muted); font-weight: 700; } .dr-ev dd { margin: 0; }
.dr-add { margin-top: 14px; font-weight: 700; }
.cx-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; z-index: 80; transition: opacity .4s; }
.cx-toast.out { opacity: 0; }

@media (max-width: 1000px) { .wk { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wk-day { min-height: 0; } }
@media (max-width: 760px) {
  .cx-top { gap: 10px; } .cx-title { width: 100%; } .cx-title h1 { flex: 1; text-align: center; font-size: 1.4rem; min-width: 0; }
  .cx-right { width: 100%; } .cx-views { flex: 1; } .cx-views .seg-btn { flex: 1; min-width: 0; } .cx-right .btn { flex: 1; }
  .cx-types { width: 100%; } .tp { flex: 1 1 45%; justify-content: center; font-size: 13px; } .cx-client { width: 100%; }
  .md { min-height: 62px; padding: 4px 3px; } .md-n { width: 24px; height: 24px; font-size: 13px; } .md-load { display: none; }
  .mg-head span { padding: 8px 4px; text-align: center; } .md-top { justify-content: center; }
  .wk { grid-template-columns: 1fr; }
  .ag-evs { grid-template-columns: 1fr; }
  .cx-sheet { top: auto; left: 0; width: 100%; max-height: 85vh; border-radius: 18px 18px 0 0; transform: translateY(100%); }
  .cx-drawer.open .cx-sheet { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .cx-sheet, .cx-drawer { transition: none; } }

.wk .ev-txt b, .ag .ev-txt b { white-space: normal; overflow-wrap: anywhere; }
.wk .ev { align-items: flex-start; flex-wrap: wrap; }
.wk .ev-late { order: 5; }
