:root {
  --ink: #17231f;
  --forest: #18382f;
  --forest-2: #245447;
  --paper: #f5f5f1;
  --surface: #ffffff;
  --line: #dcded8;
  --line-dark: #c6cac3;
  --muted: #707a74;
  --gold: #ad8d53;
  --gold-pale: #f1eadc;
  --rose: #b75963;
  --rose-pale: #f7e8ea;
  --refund-text: #9f2533;
  --refund-bg: #fdebed;
  --refund-border: #e7a8af;
  --blue: #3f6877;
  --blue-pale: #e7f0f3;
  --shadow: 0 20px 60px rgba(17, 33, 28, .16);
  --sidebar: 224px;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
}

.notification-section { margin-top: 16px; }
.notification-event-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 12px; padding: 16px; }
.notification-event { display: grid; gap: 10px; align-content: start; border: 1px solid var(--line); border-radius: 6px; padding: 14px; background: var(--surface); }
.notification-event h3 { font-size: 16px; margin: 8px 0 2px; }
.notification-event p { margin: 0; }
.notification-preview { white-space: pre-wrap; overflow-wrap: anywhere; background: #f6f7f8; border: 1px solid var(--line); border-radius: 6px; padding: 16px; line-height: 1.7; max-height: 55vh; overflow: auto; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 8px 14px; margin-top: 8px; }
.checkbox-grid label { display: flex; grid-template-columns: none; align-items: center; gap: 8px; min-height: 36px; }
.notification-config-modal { width: min(880px,100%); }
.notification-config-form { min-width: 0; }
.notification-config-section { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 5px; }
.notification-config-section legend { padding: 0 6px; color: var(--ink); font-size: 13px; font-weight: 700; }
.section-help, .field-hint { margin: 0; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.5; }
.notification-choice-list { max-height: 190px; margin-top: 10px; padding: 4px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 8px; }
.notification-choice-list .choice-row { padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; background: white; }
.notification-choice-list .choice-row:hover { border-color: var(--forest-2); background: #f6faf8; }
.notification-channel-choice-list .choice-row > span { display: grid; gap: 2px; }
.notification-channel-choice-list small { color: var(--muted); font-weight: 500; }
.notification-config-section.disabled { background: #f5f6f3; }
.notification-config-section.disabled .notification-choice-list { opacity: .65; }
.notification-field-table { min-width: 0; margin-top: 10px; }
.notification-field-header, .notification-field-row { min-width: 0; display: grid; grid-template-columns: 44px minmax(0,1fr) 72px 68px; align-items: center; gap: 8px; }
.notification-field-header { padding: 0 8px 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.notification-field-list { min-width: 0; display: grid; gap: 5px; overflow-anchor: none; }
.notification-field-row { min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: white; }
.notification-field-choice { min-height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.notification-field-name { min-width: 0; white-space: normal; overflow-wrap: break-word; line-height: 1.5; }
.notification-field-state { justify-self: start; padding: 3px 7px; border-radius: 999px; background: #eef1ee; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.notification-field-state.mandatory { background: var(--gold-pale); color: #715826; }
.field-order-controls { justify-self: end; }
.field-order-controls .icon-button:disabled { cursor: not-allowed; opacity: .4; }
.field-error { color: var(--rose); font-size: 11px; font-weight: 600; }
[aria-invalid="true"] { border-color: var(--rose) !important; box-shadow: 0 0 0 3px rgba(183,89,99,.1) !important; }
.filters.notification-history-filters { grid-template-columns: repeat(6,minmax(130px,1fr)); margin: 0 16px 14px; }
.notification-history-filters label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.notification-history-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notification-history-actions .result-count { margin-left: auto; }
.quick-contact { max-width: 720px; }
.quick-contact .detail-field { position: relative; padding-right: 52px; }
.quick-contact .detail-field strong { overflow-wrap: anywhere; word-break: break-word; }
.quick-contact .icon-button { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.quick-contact-note { display: grid; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); padding-bottom: max(18px, env(safe-area-inset-bottom)); scroll-margin-bottom: 220px; }
.quick-contact-note label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.quick-contact-note textarea { min-height: 120px; resize: vertical; color: var(--text); font-size: 16px; line-height: 1.55; }
.quick-contact-note .button { justify-self: start; }
.quick-note-success { margin: 0; color: var(--forest-2); font-weight: 700; }
.quick-note-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.quick-note-label output { color: var(--muted); font-size: 11px; font-weight: 500; }
.quick-public-shell { min-height: 100dvh; background: #f3f4f1; }
.quick-public-header { min-height: 92px; padding: 22px max(20px,calc((100% - 560px)/2)); background: var(--forest); color: white; display: flex; align-items: center; }
.quick-public-header .brand-mark strong { font-size: 23px; }
.quick-public-content { width: min(100%,600px); margin: 0 auto; padding: 20px 20px max(30px,env(safe-area-inset-bottom)); }
.quick-public-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: white; }
.quick-public-card > header { padding: 22px 20px 18px; border-bottom: 1px solid var(--line); }
.quick-public-card h1 { margin: 0 0 5px; font-size: 22px; font-weight: 650; }
.quick-public-card header p:last-child { margin: 0; }
.quick-public-fields { display: grid; }
.quick-public-field { position: relative; display: grid; gap: 6px; min-height: 76px; padding: 15px 60px 15px 20px; border-bottom: 1px solid var(--line); }
.quick-public-field span { color: var(--muted); font-size: 12px; }
.quick-public-field strong { overflow-wrap: anywhere; font-size: 16px; line-height: 1.45; }
.quick-public-field .icon-button { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
.quick-public-card > .muted { margin: 12px 20px 0; }
.quick-public-card .quick-contact-note { margin: 0; padding: 20px 20px max(22px,env(safe-area-inset-bottom)); border-top: 0; }
.quick-public-card .quick-contact-note textarea { min-height: 132px; }
.quick-public-error { padding: 24px 20px; }
.quick-public-error h1 { font-size: 20px; }

@media (max-width: 520px) {
  .quick-contact-note .button { width: 100%; min-height: 44px; }
  .quick-public-header { min-height: 78px; padding: 18px; }
  .quick-public-content { padding: 14px 12px max(22px,env(safe-area-inset-bottom)); }
  .quick-public-card > header { padding: 20px 18px 16px; }
  .quick-public-field { padding-inline: 18px 58px; }
  .quick-public-card .quick-contact-note { padding-inline: 18px; }
  .notification-event-grid { grid-template-columns: 1fr; padding: 12px; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .notification-choice-list { grid-template-columns: 1fr; max-height: 210px; }
  .notification-field-header, .notification-field-row { grid-template-columns: 38px minmax(0,1fr) 54px 66px; gap: 5px; }
  .notification-field-row { padding-inline: 5px; }
  .notification-field-state { padding-inline: 5px; }
  .notification-section .panel-header { align-items: flex-start; }
  .filters.notification-history-filters { grid-template-columns: 1fr; margin-inline: 12px; }
  .notification-history-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .notification-history-actions .result-count { grid-column: 1 / -1; margin-left: 0; }
  .adjustment-row { grid-template-columns: 52px minmax(0,1fr); align-items: start; }
  .adjustment-row .adjustment-value { grid-column: 2; min-width: 0; justify-items: start; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--paper); }
body { letter-spacing: 0; font-size: 14px; font-family: var(--font-sans); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 42%) 1fr; background: var(--surface); }
.login-brand { position: relative; min-height: 100vh; padding: 42px; overflow: hidden; background: var(--forest); color: white; display: flex; flex-direction: column; justify-content: space-between; }
.brand-mark, .sidebar-brand { display: flex; flex-direction: column; }
.brand-mark strong { font-family: var(--font-sans); font-size: 30px; font-weight: 600; }
.brand-mark span, .sidebar-brand span { margin-top: 5px; font-size: 10px; color: rgba(255,255,255,.58); }
.login-brand blockquote { max-width: 470px; margin: 0; font-family: var(--font-sans); font-size: 20px; line-height: 1.8; }
.login-motif { position: absolute; inset: 18% -8% auto 18%; height: 55%; opacity: .35; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; transform: rotate(-5deg); }
.login-motif span { border: 1px solid rgba(219,195,148,.6); background: linear-gradient(180deg, rgba(255,255,255,.08), transparent 65%); }
.login-panel { display: grid; place-items: center; padding: 40px; }
.login-form { width: min(390px, 100%); }
.login-form h1 { margin: 0 0 8px; font-family: var(--font-sans); font-size: 32px; font-weight: 600; }
label { display: grid; gap: 7px; color: #4c5752; font-size: 12px; font-weight: 600; }
.login-form label { margin-top: 24px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line-dark); border-radius: 4px; background: white; color: var(--ink); outline: none; }
input:where([type="checkbox"], [type="radio"]) { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; flex: 0 0 18px; accent-color: var(--forest); }
textarea { min-height: 88px; resize: vertical; }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36,84,71,.1); }
input:where([type="checkbox"], [type="radio"]):focus-visible { outline: 3px solid rgba(36,84,71,.22); outline-offset: 2px; }
.button { min-height: 38px; border: 1px solid var(--line-dark); border-radius: 4px; padding: 8px 14px; background: white; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 650; }
.button:hover { border-color: var(--forest-2); }
.button.primary { background: var(--forest); border-color: var(--forest); color: white; }
.button.danger { color: var(--rose); border-color: #dfb9bd; }
.button.ghost { border-color: transparent; background: transparent; }
.button.full { width: 100%; margin-top: 28px; }
.button.small { min-height: 30px; padding: 5px 9px; font-size: 12px; }
.button svg, .icon-button svg { width: 17px; height: 17px; }
.form-error { min-height: 20px; color: var(--rose); font-size: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: #fafaf7; padding: 26px 16px 20px; display: flex; flex-direction: column; z-index: 20; }
.sidebar-brand { padding: 0 14px 24px; border-bottom: 1px solid var(--line); }
.sidebar-brand strong { font-family: var(--font-sans); font-size: 22px; font-weight: 600; }
.sidebar-brand span { color: var(--muted); }
#nav { margin-top: 24px; display: grid; gap: 4px; }
.nav-item { width: 100%; height: 42px; border: 0; border-radius: 5px; padding: 0 12px; background: transparent; color: #4d5853; display: flex; align-items: center; gap: 12px; font-weight: 650; text-align: left; }
.nav-item svg { width: 17px; }
.nav-item.active { background: #e5efeb; color: var(--forest); box-shadow: inset 3px 0 var(--forest-2); }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 16px 14px 0; display: grid; gap: 4px; color: var(--muted); }
.workspace { min-width: 0; }
.topbar { height: 68px; padding: 0 28px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 15; backdrop-filter: blur(12px); }
#breadcrumb { color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.top-actions select { width: auto; min-height: 34px; padding: 5px 30px 5px 9px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.user-chip > span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--forest); color: white; font-weight: 700; }
.user-chip div { display: grid; gap: 2px; }
.user-chip small { color: var(--muted); }
.icon-button { width: 36px; height: 36px; min-width: 36px; min-height: 36px; flex: 0 0 36px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); }
.icon-button.compact { width: 30px; height: 30px; min-width: 30px; min-height: 30px; flex-basis: 30px; }
.icon-button:hover { border-color: var(--forest-2); background: #f4f8f6; }
.icons-unavailable .icon-button { width: auto; min-width: 36px; padding: 0 10px; border-radius: 4px; }
.icons-unavailable .icon-button::after { content: attr(aria-label); font-size: 12px; font-weight: 650; white-space: nowrap; }
.inline-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.customer-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.customer-tag { min-height: 24px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border: 1px solid var(--tag-color); border-radius: 4px; background: white; color: var(--ink); font-size: 12px; font-weight: 650; }
.customer-tag > span { width: 9px; height: 9px; border-radius: 2px; background: var(--tag-color); }
.customer-tag-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.customer-tag-section .panel-header { margin-bottom: 8px; }
.tag-choice { min-height: 42px; grid-template-columns: minmax(0,1fr) auto; align-items: center; padding: 7px 9px; border: 1px solid var(--line); border-radius: 4px; }
.tag-choice input { width: 18px; min-height: 18px; }
.content { min-height: calc(100vh - 68px); padding: 34px 28px max(60px, calc(env(safe-area-inset-bottom) + 32px)); max-width: 1500px; margin: 0 auto; }
.page-header { margin-bottom: 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-header h1 { margin: 0 0 7px; font-family: var(--font-sans); font-size: 28px; font-weight: 650; }
.page-header p { margin: 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); border: 1px solid var(--line); background: white; margin-bottom: 22px; }
.metric { min-height: 116px; padding: 21px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.metric:last-child { border-right: 0; }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { font-family: var(--font-sans); font-size: 29px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric.alert strong { color: var(--rose); }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 20px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 6px; }
.panel-header { min-height: 58px; padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-header h2 { margin: 0; font-family: var(--font-sans); font-size: 17px; font-weight: 650; }
.panel-body { padding: 18px; }
.filters { padding: 14px; margin-bottom: 14px; display: grid; grid-template-columns: minmax(240px, 2fr) repeat(4, minmax(120px, 1fr)) auto; gap: 8px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.search-field { position: relative; }
.search-field svg { position: absolute; z-index: 1; left: 11px; top: 50%; width: 18px; height: 18px; color: var(--muted); pointer-events: none; transform: translateY(-50%); }
.search-field input { padding-left: 40px !important; padding-right: 34px; }
.tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab { min-height: 42px; padding: 0 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); white-space: nowrap; }
.tab.active { color: var(--forest); border-bottom-color: var(--forest); font-weight: 700; }
.tab:focus-visible, .button:focus-visible, .icon-button:focus-visible, .nav-item:focus-visible { outline: 3px solid rgba(36,84,71,.24); outline-offset: 2px; }
.table-shell { border: 1px solid var(--line); border-radius: 6px; background: white; overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 840px; }
th { height: 44px; padding: 10px 12px; background: #f3f4f0; color: #66706b; font-size: 11px; text-align: left; white-space: nowrap; }
td { padding: 13px 12px; border-top: 1px solid var(--line); white-space: nowrap; }
tbody tr:hover { background: #fafbf9; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--forest-2); font-weight: 750; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 3px; background: #e6efeb; color: var(--forest); font-size: 11px; font-weight: 700; }
.badge.gold { background: var(--gold-pale); color: #7b602d; }
.badge.rose { background: var(--rose-pale); color: var(--rose); }
.badge.blue { background: var(--blue-pale); color: var(--blue); }
.badge.refund { background: var(--refund-bg); color: var(--refund-text); border: 1px solid var(--refund-border); }
.system-field { min-height: 68px; padding: 8px 0; display: grid; align-content: start; justify-items: start; gap: 6px; }
.system-field > span:first-child { color: var(--muted); font-size: 12px; }
.system-field small { color: var(--muted); }
.empty { min-height: 180px; display: grid; place-items: center; color: var(--muted); text-align: center; }
.list { display: grid; }
.list-row { min-height: 64px; padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 80px minmax(0,1fr) auto; align-items: center; gap: 12px; }
.list-row:last-child { border-bottom: 0; }
.list-row strong, .list-row span { overflow: hidden; text-overflow: ellipsis; }
.template-list-row { grid-template-columns: 58px minmax(220px,1fr) auto; }
.template-items-editor { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.template-item-row { display: grid; grid-template-columns: minmax(180px,1.6fr) minmax(100px,1fr) minmax(110px,1fr); align-items: end; gap: 9px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.template-item-row > .button { justify-self: start; margin-bottom: 1px; }
.order-edit-items { margin-top: 18px; }
.order-edit-item-row { display: grid; grid-template-columns: minmax(170px,1.5fr) repeat(4,minmax(105px,1fr)) minmax(150px,1.2fr) 38px; align-items: end; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.order-finance-notice { margin-bottom: 14px; padding: 12px 14px; border: 1px solid #d6a7ab; border-left: 4px solid #9b4b53; background: #fff8f8; display: grid; gap: 7px; }
.order-finance-notice > div { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.order-finance-notice small { color: var(--muted); }
.danger-note { margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid #9b4b53; background: #fff8f8; color: #71383e; }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(20,29,26,.38); }
.drawer { position: fixed; top: 0; right: 0; z-index: 35; width: min(640px, 100vw); height: 100vh; background: white; box-shadow: var(--shadow); display: grid; grid-template-rows: auto minmax(0,1fr); }
.drawer.customer-panorama { width: min(860px, 100vw); }
.drawer-header { min-height: 88px; padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-start; }
#drawer-heading { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
#drawer-heading > .button { margin-top: 10px; }
.drawer-header h2 { margin: 4px 0; font-family: var(--font-sans); font-size: 24px; font-weight: 650; }
.drawer-body { overflow: auto; padding: 0 24px 40px; }
.detail-tabs { position: sticky; top: 0; z-index: 2; background: white; margin: 0 -24px 22px; padding: 0 20px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.detail-field { min-height: 76px; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; gap: 7px; }
.detail-field span { color: var(--muted); font-size: 11px; }
.detail-field strong { white-space: normal; overflow-wrap: anywhere; }
.xhs-connection .detail-field.wide { grid-column: 1 / -1; grid-template-columns: minmax(0,1fr) 40px; align-items: center; }
.xhs-connection .detail-field.wide > span { grid-column: 1 / -1; }
.xhs-connection .detail-field.wide code { overflow-wrap: anywhere; white-space: normal; }
.timeline { border-left: 1px solid var(--line-dark); margin-left: 7px; padding-left: 22px; display: grid; gap: 20px; }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -28px; top: 4px; width: 10px; height: 10px; border: 2px solid white; border-radius: 50%; background: var(--forest-2); box-shadow: 0 0 0 1px var(--forest-2); }
.timeline-item small { color: var(--muted); }
.timeline-item p { margin: 7px 0 0; line-height: 1.65; }
.modal-layer { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 20px; background: rgba(20,29,26,.48); }
.modal { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: hidden; background: white; border-radius: 6px; box-shadow: var(--shadow); display: grid; grid-template-rows: auto minmax(0,1fr); }
.modal > header { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.modal h2 { margin: 0; font-family: var(--font-sans); font-size: 22px; font-weight: 650; }
#modal-body { min-height: 0; padding: 22px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.customer-body-data { min-width: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.customer-body-person { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 6px; display: grid; align-content: start; gap: 12px; }
.customer-body-person legend { padding: 0 6px; color: var(--ink); font-size: 13px; font-weight: 700; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
#modal-body .form-actions { position: sticky; bottom: -22px; z-index: 3; margin: 22px -22px -22px; padding: 14px 22px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.98); }
.choice-row { min-width: 0; min-height: 36px; display: flex; grid-template-columns: none; align-items: center; gap: 8px; cursor: pointer; }
.choice-row > span, .choice-row > strong { min-width: 0; overflow-wrap: anywhere; }
.sort-row { min-width: 0; min-height: 40px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; }
.sort-row__actions { display: flex; align-items: center; gap: 4px; }
.notification-field-row.sort-row { grid-template-columns: 44px minmax(0,1fr) 72px 68px; gap: 8px; }
.filter-toolbar { min-width: 0; align-items: end; }
.filter-toolbar__group { min-width: 0; display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 8px; align-items: end; }
.filter-toolbar__actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.money-grid { display: grid; grid-template-columns: repeat(5,1fr); border: 1px solid var(--line); margin-bottom: 18px; }
.money-grid-six { grid-template-columns: repeat(6,minmax(0,1fr)); }
.money-grid div { padding: 14px; border-right: 1px solid var(--line); display: grid; gap: 5px; }
.money-grid div:last-child { border-right: 0; }
.money-grid span { color: var(--muted); font-size: 11px; }
.money-grid strong { font-family: var(--font-sans); font-size: 19px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.link-button, table, .detail-field strong, .calendar-day, .timeline, input, select { font-variant-numeric: tabular-nums; }
.condition-builder { display: grid; gap: 10px; margin: 14px 0; }
.condition-row { display: grid; grid-template-columns: minmax(170px,1.1fr) minmax(110px,.7fr) minmax(190px,1.4fr) 36px; gap: 8px; align-items: end; }
.condition-row .icon-button { border-radius: 4px; }
.management-primary-filters { grid-template-columns: minmax(260px,2fr) minmax(180px,.7fr); }
.multi-choice { position: relative; min-width: 0; }
.multi-choice > summary { min-height: 40px; padding: 7px 10px; border: 1px solid var(--line-dark); border-radius: 4px; background: white; list-style: none; cursor: pointer; display: grid; grid-template-columns: auto minmax(0,1fr) 18px; gap: 8px; align-items: center; }
.multi-choice > summary::-webkit-details-marker { display: none; }
.multi-choice > summary span { color: var(--muted); font-size: 11px; }
.multi-choice > summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.multi-choice > summary svg { width: 16px; }
.multi-choice[open] > summary { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36,84,71,.1); }
.multi-choice > summary:focus-visible, .select-choice > summary:focus-visible { outline: 3px solid rgba(36,84,71,.22); outline-offset: 2px; }
.multi-choice-menu { position: absolute; z-index: 12; top: 44px; left: 0; width: 100%; min-width: 220px; max-height: 280px; padding: 10px; border: 1px solid var(--line-dark); background: white; box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-rows: auto minmax(0,1fr); }
.multi-choice-options { max-height: 220px; overflow: auto; margin-top: 8px; display: grid; }
.multi-choice-options button { min-height: 36px; padding: 7px 6px; display: flex; align-items: center; gap: 8px; font-family: var(--font-sans); font-size: 13px; text-align: left; cursor: pointer; }
.multi-choice-options button { width: 100%; border: 0; border-radius: 3px; background: transparent; color: var(--ink); }
.multi-choice-options button:hover, .multi-choice-options button[aria-selected="true"] { background: #edf4f1; }
.multi-choice-options button:focus-visible { outline: 2px solid var(--forest-2); outline-offset: -2px; }
.choice-check { width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid #9aaba3; border-radius: 3px; display: grid; place-items: center; color: var(--forest); font-size: 12px; line-height: 1; }
.enhanced-native-select { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0 !important; opacity: 0 !important; pointer-events: none !important; clip-path: inset(50%); }
.select-choice { position: relative; min-width: 0; }
.select-choice > summary { min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-dark); border-radius: 4px; background: white; list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0,1fr) 18px; gap: 8px; align-items: center; }
.select-choice > summary::-webkit-details-marker { display: none; }
.select-choice > summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.select-choice > summary svg { width: 16px; }
.select-choice[open] > summary { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36,84,71,.1); }
.select-choice.disabled > summary { cursor: not-allowed; background: #f1f2ef; color: var(--muted); }
.select-choice-menu { position: absolute; z-index: 24; top: 44px; left: 0; width: 100%; min-width: 180px; max-height: 280px; padding: 9px; border: 1px solid var(--line-dark); border-radius: 4px; background: white; box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-rows: auto minmax(0,1fr); }
.select-choice-menu[data-floating="1"] { position: fixed; z-index: 70; }
.select-choice-options { max-height: 220px; overflow: auto; display: grid; gap: 2px; }
.select-choice-menu .search-field { margin-bottom: 7px; }
.select-choice-options button { width: 100%; min-height: 36px; padding: 7px 8px; border: 0; border-radius: 3px; background: transparent; color: var(--ink); font-family: var(--font-sans); font-size: 13px; text-align: left; cursor: pointer; }
.select-choice-options button:hover, .select-choice-options button[aria-selected="true"] { background: #edf4f1; }
.select-choice-options button:focus-visible { outline: 2px solid var(--forest-2); outline-offset: -2px; }
.select-choice-options button:disabled { color: #9aa39f; cursor: not-allowed; background: transparent; }
.filter-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.filter-tags > span { min-height: 30px; padding: 5px 7px 5px 10px; border: 1px solid #c9d8d1; border-radius: 4px; background: #edf4f1; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.filter-tags button { width: 20px; height: 20px; padding: 0; border: 0; background: transparent; display: grid; place-items: center; }
.filter-tags svg { width: 14px; }
.result-count { margin-left: auto; color: var(--muted); font-size: 12px; }
.management-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.management-toolbar details { position: relative; }
.management-toolbar summary { list-style: none; cursor: pointer; }
.column-picker { position: absolute; z-index: 5; right: 0; top: 44px; min-width: 180px; padding: 12px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 8px; }
.column-picker label { display: flex; align-items: center; gap: 7px; }
.column-picker input { width: auto; min-height: 0; }
.assignment-toggle { appearance: none; width: 38px; min-height: 22px; height: 22px; padding: 2px; border: 1px solid #9aaba3; border-radius: 999px; background: #dfe5e2; cursor: pointer; vertical-align: middle; transition: background .16s ease, border-color .16s ease; }
.assignment-toggle::after { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(20,29,26,.24); transition: transform .16s ease; }
.assignment-toggle:checked { border-color: var(--forest); background: var(--forest); }
.assignment-toggle:checked::after { transform: translateX(16px); }
.assignment-toggle:focus-visible { outline: 3px solid rgba(36,84,71,.22); outline-offset: 2px; box-shadow: none; }
.range-inputs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.appointment-time-mode { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 4px; }
.appointment-time-mode legend { padding: 0 6px; color: #4c5752; font-size: 12px; font-weight: 650; }
.appointment-time-mode .segmented { flex-wrap: wrap; }
.appointment-time-mode .segmented label { min-height: 36px; padding: 7px 12px; border: 1px solid var(--line-dark); border-radius: 4px; display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 7px; cursor: pointer; }
.appointment-time-mode input { width: auto; min-height: 0; }
.availability-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.error-text { color: var(--rose); }
.reception-section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.reception-section:first-child { padding-top: 0; }
.reception-week-grid, [data-special-dates], [data-busy-periods] { display: grid; gap: 9px; }
.reception-week-row { display: grid; grid-template-columns: 64px 110px repeat(3,minmax(110px,1fr)); gap: 9px; align-items: end; }
.reception-week-row > strong { align-self: center; }
.reception-rule-row { display: grid; grid-template-columns: repeat(5,minmax(110px,1fr)) 36px; gap: 9px; align-items: end; }
.reception-rule-row.busy { grid-template-columns: minmax(120px,1fr) repeat(2,minmax(170px,1.25fr)) 100px minmax(120px,1fr) 36px; }
.reception-rule-row .icon-button { margin-bottom: 2px; }
.pagination { margin-top: 14px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.schedule-context { display: grid; grid-template-columns: repeat(4,minmax(150px,220px)) auto; gap: 10px; margin-bottom: 14px; align-items: end; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.calendar-navigation, .segmented { display: flex; align-items: center; gap: 4px; }
.segmented .button { min-width: 48px; }
.segmented .button.active { background: var(--forest); border-color: var(--forest); color: white; }
.range-caption { margin: -4px 0 12px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.schedule-order-count { display: inline-block; margin-left: 12px; color: var(--ink); font-weight: 700; white-space: nowrap; }
.schedule-order-count strong { color: var(--forest); font-size: 15px; }
.coordination-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--muted); }
.coordination-heading > div { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.customer-basic-tools { margin: -1px -1px 0; }
.basic-details { padding-top: 18px; }
.customer-schedules { margin-top: 18px; }
.customer-team { margin-top: 18px; }
.customer-360-summary { position: sticky; top: 0; z-index: 3; margin: 0 -24px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: #f7f8f5; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.customer-360-summary + .detail-tabs { top: 45px; }
.customer-return { margin: 12px 0 4px; }
.order-anchors { position: sticky; top: 91px; z-index: 2; margin: 0 -4px 14px; padding: 8px 4px; background: white; display: flex; gap: 8px; overflow-x: auto; }
.order-anchors a { flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--line); color: var(--ink); font-size: 12px; text-decoration: none; }
.customer-order-stream { min-width: 0; display: grid; gap: 28px; padding-bottom: 32px; }
.source-touchpoints { display: grid; gap: 12px; padding-bottom: 32px; }
.source-touchpoint { padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.source-touchpoint header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.source-touchpoint header > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
.source-touchpoint time { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.source-touchpoint-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 18px; padding-top: 12px; }
.source-touchpoint-facts > div { min-width: 0; display: grid; gap: 3px; }
.source-touchpoint-facts span { color: var(--muted); font-size: 12px; }
.source-touchpoint-facts strong, .source-touchpoint-facts a { overflow-wrap: anywhere; }
.order-section { min-width: 0; scroll-margin-top: 140px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.order-subsection[id] { scroll-margin-top: 140px; }
.customer-name-link { justify-self: start; font-size: 15px; }
.order-section-header { min-width: 0; min-height: 70px; padding: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order-section-header h2 { margin: 3px 0 0; font-size: 18px; }
.order-statuses { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.order-context { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--line); }
.order-subsection { min-width: 0; padding: 18px 0; border-top: 1px solid var(--line); }
.order-subsection h3 { margin: 0 0 12px; font-size: 14px; }
.order-subsection-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.order-subsection-header h3 { margin: 0; }
.adjustment-section { padding: 12px 0; border-top: 1px solid var(--line); }
.adjustment-section h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.adjustment-value { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.discount-amount { color: var(--refund-text); }
.order-actions { margin-top: 12px; }
.compact-list .list-row, .transaction-list .list-row { min-height: 56px; }
.adjustment-row { grid-template-columns: 64px minmax(0,1fr) minmax(118px,auto); align-items: center; }
.adjustment-row > span { white-space: nowrap; }
.adjustment-row > div:nth-child(2) small { display: inline-block; margin-top: 4px; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.adjustment-row .adjustment-value { min-width: 118px; display: grid; justify-items: end; gap: 7px; }
.inline-empty { min-height: 92px; padding: 18px; }
.inline-empty p { margin: 6px 0 0; }
.transaction-amount { text-align: right; font-variant-numeric: tabular-nums; }
.transaction-reversed { display: block; margin-top: 4px; color: var(--refund-text); font-size: 12px; font-weight: 700; }
.post-stage-strip { width: 100%; min-width: 0; max-width: 100%; display: grid; grid-template-columns: repeat(6,90px); margin-bottom: 14px; overflow-x: auto; }
.post-stage-strip span { min-width: 90px; padding: 9px 6px; border: 1px solid var(--line); border-right: 0; color: var(--muted); text-align: center; font-size: 11px; }
.post-stage-strip span:last-child { border-right: 1px solid var(--line); }
.post-stage-strip span.active { background: var(--ink); color: white; }
.compact-timeline { margin-top: 14px; }
.section-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.choice-grid { border: 1px solid var(--line); border-radius: 4px; padding: 12px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.choice-grid legend { padding: 0 6px; color: var(--muted); font-size: 12px; }
.choice-grid label { display: flex; align-items: center; gap: 7px; }
.choice-grid input { width: auto; min-height: 0; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(110px,1fr)); min-width: 820px; border-left: 1px solid var(--line); }
.calendar-shell { overflow-x: auto; overflow-y: visible; margin-bottom: 32px; border: 1px solid var(--line); background: white; scrollbar-gutter: stable; }
.calendar-weekdays { display: contents; }
.calendar-weekdays > div { min-height: 44px; padding: 8px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f3f4f0; color: #53605a; display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; }
.calendar-weekdays small { color: var(--muted); font-size: 10px; font-weight: 500; }
.calendar-day { min-height: 126px; padding: 9px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: white; color: var(--ink); text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.calendar-date { width: 100%; color: var(--ink); display: flex; align-items: baseline; justify-content: space-between; }
.calendar-date strong { font-size: 19px; }
.calendar-date small, .calendar-day > small { color: var(--muted); font-size: 10px; }
.calendar-day.has-events { background: #f6faf8; }
.calendar-day b { color: var(--forest); font-size: 14px; }
.calendar-day.outside-month { background: #f7f7f4; color: #7f8983; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--gold); }
.calendar-day.selected { box-shadow: inset 0 0 0 3px var(--forest-2); }
.calendar-day:focus-visible { position: relative; z-index: 2; outline: 3px solid rgba(36,84,71,.24); outline-offset: -3px; }
.calendar-event { margin-top: 6px; padding: 6px; border-left: 3px solid var(--forest-2); background: #eaf1ee; font-size: 11px; white-space: normal; }
.schedule-calendar-day { min-height: 174px; padding: 0; gap: 0; }
.schedule-calendar-day__heading { width: 100%; min-height: 66px; padding: 9px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); text-align: left; }
.schedule-calendar-day__heading:hover { background: #f6faf8; }
.schedule-event-list { min-width: 0; padding: 6px; display: grid; gap: 4px; }
.schedule-event-card { width: 100%; min-width: 0; padding: 5px 6px; border: 1px solid #bfd5cc; border-left: 3px solid var(--forest-2); border-radius: 4px; background: #edf7f2; color: var(--ink); text-align: left; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
button.schedule-event-card { cursor: pointer; }
.schedule-event-card:hover { border-color: var(--forest-2); background: #e3f1eb; }
.schedule-event-card--selections { border-left-color: #6c7cb3; background: #f0f2fb; }
.schedule-event-card--appointments { border-left-color: var(--gold); background: #fff7e8; }
.calendar-mobile-event-detail { display: none; }
.shooting-calendar-shell { overflow: visible; }
.shooting-team-calendar { min-width: 0; align-items: stretch; }
.shooting-calendar-day { min-height: 174px; padding: 0; gap: 0; }
.shooting-calendar-day__heading { width: 100%; min-height: 66px; padding: 9px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); text-align: left; }
.shooting-calendar-day__heading:hover { background: #f6faf8; }
.shooting-calendar-day__counts { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 3px 7px; color: var(--forest); font-size: 11px; font-weight: 700; line-height: 1.35; }
.shooting-calendar-day__counts .attention { color: #9a6814; }
.calendar-team-list { padding: 8px; display: grid; gap: 6px; }
.calendar-team-card { width: 100%; min-width: 0; min-height: 34px; padding: 7px 8px; border: 1px solid #bfd5cc; border-left: 4px solid var(--forest-2); border-radius: 4px; background: #edf7f2; color: var(--ink); text-align: left; font-size: 11px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.calendar-team-card--pending { border-color: #e4c27a; border-left-color: var(--gold); background: #fff7e8; color: #76591a; }
.calendar-team-card--conflict { border-color: #deb6bc; border-left-color: var(--rose); background: var(--rose-pale); color: var(--rose); }
.calendar-unavailable { margin: 0 8px 8px; padding: 7px; border: 1px solid #d7dad5; border-radius: 4px; background: #f0f1ee; color: var(--muted); display: grid; gap: 3px; font-size: 10px; line-height: 1.35; }
.calendar-unavailable strong { color: #58625d; font-size: 10px; }
.calendar-day-empty { color: var(--muted); font-size: 10px; }
.shooting-calendar-mobile-detail { display: none; }
.schedule-date-list { margin-bottom: 32px; border: 1px solid var(--line); background: white; display: grid; }
.schedule-date-list > button { min-height: 68px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); background: white; color: var(--ink); display: grid; grid-template-columns: minmax(170px,1fr) auto minmax(180px,1fr); gap: 18px; align-items: center; text-align: left; }
.schedule-date-list > button:last-child { border-bottom: 0; }
.schedule-date-list > button:hover { background: #f6faf8; }
.schedule-date-list time { color: var(--muted); font-variant-numeric: tabular-nums; }
.schedule-date-list span { color: var(--muted); text-align: right; }
.matrix-desktop-groups { margin-bottom: 32px; display: grid; gap: 18px; }
.matrix-shell { overflow: visible; border: 1px solid var(--line); background: white; }
.matrix { width: 100%; min-width: 0; table-layout: fixed; }
.matrix th:first-child, .matrix td:first-child { width: 140px; background: #f4f3ef; }
.shooting-day-view { margin-bottom: 32px; }
.schedule-day-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 12px; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.schedule-capacity-banner { margin: -2px 0 14px; padding: 9px 12px; border: 1px solid #b9d6c8; border-radius: 10px; background: #f1faf5; color: #245a43; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.schedule-capacity-banner.is-over { border-color: #e8b8b1; background: #fff3f1; color: #9c3529; }
.detailed-shooting-matrix { margin-bottom: 32px; }
.detailed-matrix-block { margin-top: 14px; overflow: visible; }
.detailed-matrix-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; background: white; border: 1px solid var(--line); }
.detailed-matrix-table th, .detailed-matrix-table td { min-width: 0; padding: 9px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.55; overflow-wrap: anywhere; white-space: normal; }
.detailed-matrix-table thead th { background: #eef1ed; color: var(--ink); text-align: left; font-size: 13px; }
.detailed-matrix-table thead th:first-child, .detailed-matrix-table tbody th { width: 132px; background: #f5f5f1; color: var(--muted); text-align: left; font-size: 12px; }
.detailed-matrix-table tbody td { font-size: 13px; }
.detailed-matrix-table tbody tr:last-child th, .detailed-matrix-table tbody tr:last-child td { border-bottom: 0; }
.detailed-matrix-table th:last-child, .detailed-matrix-table td:last-child { border-right: 0; }
.schedule-team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.schedule-team-card { min-width: 0; min-height: 82px; padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--forest-2); border-radius: 5px; background: white; color: var(--ink); text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; overflow-wrap: anywhere; }
button.schedule-team-card { width: 100%; cursor: pointer; }
.schedule-team-card:hover { border-color: var(--forest-2); box-shadow: 0 4px 14px rgba(24,56,47,.08); }
.schedule-team-card--pending { border-left-color: var(--gold); background: #fffbf2; }
.schedule-team-card--conflict { border-left-color: var(--rose); background: var(--rose-pale); }
.schedule-team-card__names { display: flex; flex-wrap: wrap; gap: 5px 16px; font-size: 15px; font-weight: 700; line-height: 1.5; }
.schedule-team-card__status { color: var(--muted); font-size: 12px; font-weight: 650; }
.schedule-team-card--pending .schedule-team-card__status { color: #80631e; }
.schedule-team-card--conflict .schedule-team-card__status { color: var(--rose); }
.schedule-unavailable { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); background: #f0f1ee; }
.schedule-unavailable h3 { margin: 0 0 8px; font-size: 13px; }
.schedule-unavailable-row { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.schedule-unavailable-row:first-of-type { border-top: 0; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; z-index: 2; background: #f4f3ef; min-width: 140px; }
.matrix th { position: sticky; top: 0; z-index: 3; }
.matrix th small { margin-top: 4px; display: block; color: var(--muted); font-weight: 500; }
.matrix th, .matrix td { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.matrix td { vertical-align: top; line-height: 1.7; }
.matrix-mobile-orders { display: none; }
.matrix-order-card { border: 1px solid var(--line); background: white; }
.matrix-order-card > header { padding: 13px; border-bottom: 1px solid var(--line); background: #f3f4f0; }
.matrix-order-card > header small { margin-top: 4px; display: block; color: var(--muted); }
.matrix-order-card dl { margin: 0; }
.matrix-order-card dl > div { padding: 10px 13px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(96px,.38fr) minmax(0,1fr); gap: 12px; }
.matrix-order-card dl > div:last-child { border-bottom: 0; }
.matrix-order-card dt { color: var(--muted); font-size: 11px; font-weight: 700; }
.matrix-order-card dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(210px,1fr)); gap: 10px; overflow-x: auto; }
.kanban-column { min-height: 430px; background: #eceeea; border-top: 3px solid var(--forest-2); padding: 10px; }
.kanban-column h3 { margin: 4px 4px 12px; font-size: 13px; }
.kanban-card { padding: 13px; background: white; border: 1px solid var(--line); border-radius: 5px; margin-bottom: 8px; }
.post-filter-toolbar { margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: white; display: grid; gap: 10px; }
.post-filter-toolbar label { min-width: 0; gap: 4px; color: var(--muted); font-size: 11px; }
.post-filter-toolbar input, .post-filter-toolbar select { height: 36px; min-height: 36px; padding-block: 6px; }
.post-filter-toolbar .search-field { grid-column: auto; }
.post-filter-toolbar__primary { grid-template-columns: minmax(260px,2fr) repeat(4,minmax(128px,1fr)); }
.post-filter-toolbar__timeline { grid-template-columns: minmax(150px,.8fr) minmax(360px,1.8fr) minmax(150px,.8fr) auto; }
.post-date-range { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: minmax(130px,1fr) auto minmax(130px,1fr); gap: 7px; align-items: end; }
.post-date-range legend { margin-bottom: 3px; padding: 0; color: var(--muted); font-size: 11px; font-weight: 600; }
.post-date-range > span { height: 36px; display: grid; place-items: center; color: var(--muted); }
.post-filter-toolbar .filter-toolbar__actions { flex-wrap: nowrap; }
.post-filter-toolbar .filter-toolbar__actions .button { height: 36px; min-height: 36px; white-space: nowrap; }
.post-date-error { grid-column: 1 / -1; margin: -2px 0 0; }
.post-results-toolbar { margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.post-view-toggle { margin: 0; }
.post-kanban { padding-bottom: 32px; }
.post-kanban .kanban-column { min-height: 320px; }
.post-kanban .kanban-column h3 { display: flex; justify-content: space-between; }
.post-card-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kanban-card.blocked { border-color: #d7b46d; }
.kanban-card dl { margin: 10px 0; display: grid; gap: 7px; }
.kanban-card dl div { display: grid; gap: 2px; }
.kanban-card dt { color: var(--muted); font-size: 10px; }
.kanban-card dd { margin: 0; font-size: 12px; line-height: 1.5; }
.compact-empty { min-height: 90px; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 15px; border-radius: 4px; background: var(--ink); color: white; box-shadow: var(--shadow); }
.toast.error { background: #873f47; }
.mobile-only { display: none; }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .metric:nth-child(3) { border-right: 0; }
  .metric:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .filters { grid-template-columns: repeat(3, 1fr); }
  .filters.notification-history-filters { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .search-field { grid-column: span 2; }
  .filter-toolbar__group { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .post-filter-toolbar__primary { grid-template-columns: minmax(230px,2fr) repeat(2,minmax(130px,1fr)); }
  .post-filter-toolbar__timeline { grid-template-columns: minmax(150px,1fr) minmax(340px,2fr); }
  .post-filter-toolbar__timeline .filter-toolbar__actions { justify-content: flex-start; }
  .money-grid-six { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .order-edit-item-row { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .order-edit-item-row > .icon-button { justify-self: start; }
}
@media (max-width: 760px) {
  .filters.notification-history-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reception-week-row, .reception-rule-row, .reception-rule-row.busy { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 12px; border: 1px solid var(--line); border-radius: 4px; }
  .reception-week-row > strong, .reception-rule-row .icon-button { grid-column: 1 / -1; }
  .reception-rule-row .icon-button { width: 100%; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 34vh; padding: 26px; }
  .login-brand blockquote { font-size: 15px; max-width: 330px; }
  .login-panel { padding: 30px 22px; align-items: start; }
  .app-shell { display: block; }
  .sidebar { position: fixed; transform: translateX(-105%); transition: transform .2s ease; width: min(290px, 84vw); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow); }
  .mobile-only { display: inline-grid; }
  .topbar { height: 58px; padding: 0 12px; gap: 8px; }
  #breadcrumb, .top-actions select, .user-chip div { display: none; }
  .top-actions { margin-left: auto; }
  .content { padding: 22px 14px 50px; min-height: calc(100vh - 58px); }
  .page-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .page-header .page-actions { width: 100%; }
  .page-header .page-actions .button { white-space: nowrap; }
  .page-header h1 { font-size: 24px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric { min-height: 98px; padding: 15px; border-bottom: 1px solid var(--line); }
  .metric:nth-child(odd) { border-right: 1px solid var(--line); }
  .metric:nth-child(even) { border-right: 0; }
  .split { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .filters .button { width: 100%; }
  .drawer { width: 100vw; }
  .drawer-header { min-height: 74px; padding: 16px; }
  .drawer-body { padding: 0 16px 30px; }
  .detail-tabs { margin: 0 -16px 18px; padding: 0 12px; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .customer-body-data { grid-template-columns: 1fr; }
  .modal-layer { padding: 0; align-items: end; }
  .modal { max-height: 92vh; width: 100%; border-radius: 6px 6px 0 0; }
  #modal-body { padding: 18px 16px; }
  #modal-body .form-actions { bottom: -18px; margin: 18px -16px -18px; padding-inline: 16px; }
  .filter-toolbar__group { grid-template-columns: 1fr; }
  .filter-toolbar__actions { justify-content: stretch; }
  .filter-toolbar__actions .button { flex: 1 1 120px; }
  .post-filter-toolbar__primary, .post-filter-toolbar__timeline { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .post-filter-search, .post-date-range, .post-filter-toolbar__timeline .filter-toolbar__actions, .post-date-error { grid-column: 1 / -1; }
  .post-filter-toolbar .filter-toolbar__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .notification-field-row.sort-row { grid-template-columns: 38px minmax(0,1fr) 54px 66px; gap: 5px; }
  .post-results-toolbar { align-items: flex-start; flex-direction: column; }
  .money-grid { grid-template-columns: repeat(2,1fr); }
  .money-grid div { border-bottom: 1px solid var(--line); }
  .condition-row { grid-template-columns: 1fr 1fr 36px; }
  .condition-row > label:nth-child(3) { grid-column: 1 / 3; }
  .condition-row .multi-choice { grid-column: 1 / 3; }
  .schedule-context { grid-template-columns: 1fr 1fr; }
  .schedule-context .button { grid-column: 1 / -1; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; }
  .calendar { min-width: 700px; grid-template-columns: repeat(7, minmax(96px,1fr)); }
  .calendar-day { min-height: 112px; }
  .schedule-event-calendar-shell { overflow: visible; }
  .schedule-event-calendar {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  .schedule-event-calendar .calendar-weekdays { display: contents; }
  .schedule-event-calendar .calendar-weekdays > div {
    min-width: 0;
    min-height: 30px;
    padding: 4px 1px;
    justify-content: center;
    font-size: 9px;
    text-align: center;
  }
  .schedule-event-calendar .calendar-weekdays small { display: none; }
  .schedule-calendar-day { min-width: 0; min-height: 82px; padding: 0; gap: 0; overflow: hidden; }
  .schedule-calendar-day.outside-month { display: flex; }
  .schedule-calendar-day__heading { min-width: 0; min-height: 82px; padding: 5px 3px; }
  .schedule-calendar-day__heading .calendar-date small { display: none; }
  .schedule-calendar-day__heading .calendar-date strong { font-size: 15px; }
  .schedule-calendar-day__heading > small { display: none; }
  .schedule-calendar-day__heading b { font-size: 8px; line-height: 1.2; overflow-wrap: anywhere; }
  .schedule-event-calendar .schedule-event-list { display: none; }
  .calendar-mobile-event-detail {
    display: block;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    background: white;
  }
  .calendar-mobile-event-detail__heading { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
  .calendar-mobile-event-detail__heading strong { color: var(--ink); font-size: 13px; }
  .calendar-mobile-event-detail .schedule-event-list { padding: 8px 0 0; display: grid; }
  .calendar-mobile-event-detail .schedule-event-card { font-size: 12px; }
  /* The shooting month view remains a real seven-column calendar on phones.
     Team/unavailability detail is intentionally opened by selecting a date so
     the natural month never degenerates into a horizontally scrolling list. */
  .shooting-calendar-shell { overflow: visible; }
  .shooting-team-calendar {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  .shooting-team-calendar .calendar-weekdays { display: contents; }
  .shooting-team-calendar .calendar-weekdays > div {
    min-width: 0;
    min-height: 30px;
    padding: 4px 1px;
    justify-content: center;
    font-size: 9px;
    text-align: center;
  }
  .shooting-team-calendar .calendar-weekdays small { display: none; }
  .shooting-team-calendar .shooting-calendar-day.outside-month { display: flex; }
  .shooting-calendar-day {
    min-width: 0;
    min-height: 82px;
    padding: 0;
    gap: 0;
    overflow: hidden;
  }
  .shooting-calendar-day__heading {
    min-width: 0;
    min-height: 82px;
    padding: 5px 3px;
  }
  .shooting-calendar-day__heading .calendar-date small { display: none; }
  .shooting-calendar-day__heading .calendar-date strong { font-size: 15px; }
  .shooting-calendar-day__counts {
    min-width: 0;
    margin-top: 4px;
    display: grid;
    gap: 2px;
    font-size: 8px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  .shooting-calendar-day__counts span { min-width: 0; overflow-wrap: anywhere; }
  .shooting-team-calendar .calendar-team-list,
  .shooting-team-calendar .calendar-unavailable { display: none; }
  .shooting-calendar-mobile-detail {
    display: block;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    background: white;
  }
  .shooting-calendar-mobile-detail .coordination-heading { align-items: flex-start; gap: 8px; }
  .shooting-calendar-mobile-detail .schedule-team-grid { margin-top: 10px; }
  .schedule-date-list > button { grid-template-columns: 1fr; gap: 5px; }
  .schedule-date-list span { text-align: left; }
  .matrix-desktop-groups { display: none; }
  .matrix-mobile-orders { margin-bottom: 32px; display: grid; gap: 12px; }
  .schedule-team-grid { grid-template-columns: 1fr; }
  .detailed-matrix-table thead th:first-child, .detailed-matrix-table tbody th { width: 88px; }
  .detailed-matrix-table th, .detailed-matrix-table td { padding: 7px 6px; font-size: 11px; }
  .schedule-day-summary { justify-content: flex-start; }
  .customer-360-summary { margin: 0 -16px; padding: 9px 16px; }
  .order-anchors { top: 88px; }
  .order-section-header { align-items: flex-start; flex-wrap: wrap; }
  .order-context { grid-template-columns: 1fr; }
  .source-touchpoint header { align-items: flex-start; flex-direction: column; }
  .source-touchpoint-facts { grid-template-columns: minmax(0,1fr); }
  .transaction-list .list-row { grid-template-columns: 68px minmax(0,1fr); }
  .transaction-list .transaction-amount { grid-column: 2; text-align: left; }
  .template-list-row { grid-template-columns: 44px minmax(0,1fr); align-items: start; }
  .template-list-row > .inline-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
  .template-item-row { grid-template-columns: 1fr 1fr; align-items: end; }
  .template-item-row > label:first-child, .template-item-row > label:last-of-type { grid-column: 1 / -1; }
  .template-item-row > .button { justify-self: start; }
  .order-edit-item-row { grid-template-columns: 1fr 1fr; }
  .order-edit-item-row > label:first-child, .order-edit-item-row > label:last-of-type { grid-column: 1 / -1; }
  .order-edit-item-row > .icon-button { grid-column: 1 / -1; justify-self: start; }
  .table-shell.mobile-cards { border: 0; overflow: visible; background: transparent; }
  .table-shell.mobile-cards table, .table-shell.mobile-cards thead, .table-shell.mobile-cards tbody, .table-shell.mobile-cards tr, .table-shell.mobile-cards td { display: block; min-width: 0; }
  .table-shell.mobile-cards thead { display: none; }
  .table-shell.mobile-cards tr { margin-bottom: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 5px; background: white; }
  .table-shell.mobile-cards td { border: 0; padding: 4px 0; white-space: normal; }
  .table-shell.mobile-cards td::before { content: attr(data-label); display: inline-block; min-width: 78px; color: var(--muted); font-size: 11px; }
}

@media (max-width: 520px) {
  .filters.notification-history-filters { grid-template-columns: 1fr; }
}
