:root {
  --bg: #f4f7f5;
  --surface: #fff;
  --surface-hover: #fafcfb;
  --line: #e3ebe6;
  --text: #162b23;
  --muted: #65766e;
  --brand: #087c56;
  --brand-hover: #056744;
  --mint: #e8f6ee;
  --side: #102f27;
  --lime: #c5f6ac;
  --entry-admin: #edf5ff;
  --entry-admin-hover: #e2efff;
  --entry-assistant: #f6effb;
  --entry-assistant-hover: #eee2f8;
  --author-admin-bg: #dceafb;
  --author-admin-text: #2a527d;
  --author-assistant-bg: #eadbf5;
  --author-assistant-text: #644284;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --side-width: 218px;
  --top-height: 72px;
  color: var(--text);
  font-family: var(--sans);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:not(:disabled), select { cursor: pointer; }
button:disabled { opacity: .58; cursor: wait; }
a { color: var(--brand); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #4aa984; outline-offset: 2px;
}
button, a, label { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
svg { flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.layout { min-height: 100dvh; }
.sidebar {
  display: flex; flex-direction: column; align-items: stretch; position: fixed; inset: 0 auto 0 0; z-index: 5;
  width: var(--side-width); padding: 25px 16px 18px; background: var(--side); color: #fff;
}
.brand { display: inline-flex; gap: 11px; align-items: center; background: transparent; border: 0; padding: 0; text-align: left; color: inherit; }
.sidebar .brand { padding-left: 9px; align-self: flex-start; }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; background: var(--lime); color: #123b2c; border-radius: 13px; }
.brand-mark svg { stroke-width: 1.9; }
.brand-text { display: grid; gap: 1px; font-size: 24px; font-weight: 800; letter-spacing: -.06em; line-height: 1; }
.brand-text span { display: block; font-size: .69rem; font-weight: 530; letter-spacing: 0; color: #a4c1b4; line-height: 1.4; }
.desktop-nav { display: grid; gap: 5px; margin-top: 51px; }
.nav-item { display: flex; gap: 13px; align-items: center; min-height: 47px; width: 100%; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; text-align: left; color: #b9d0c5; font-size: .92rem; font-weight: 560; }
.nav-item:hover { background: #21463a; color: #fff; }
.sidebar .nav-active { color: var(--lime); background: #275044; font-weight: 700; }
.sidebar-end { margin-top: auto; padding-top: 13px; border-top: 1px solid #2a4c41; }
.main-frame { min-width: 0; margin-left: var(--side-width); }
.topbar { height: var(--top-height); display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 0 clamp(22px, 3.1vw, 48px); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-title, .topbar-actions { display: flex; gap: 13px; align-items: center; }
.topbar-title { color: #4c6258; font-size: .89rem; font-weight: 650; }
.topbar-title svg { color: #628175; }
.topbar-actions { gap: 19px; }
.demo-switch, .live-label { position: relative; display: inline-flex; gap: 7px; align-items: center; min-height: 31px; padding: 0 9px; border: 1px solid #dcebe1; border-radius: 100px; color: #3f705a; background: #f3f9f5; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.demo-switch:focus-within { outline: 3px solid #4aa984; outline-offset: 2px; }
.demo-switch select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.demo-dot, .live-label > span { width: 7px; height: 7px; border-radius: 50%; background: #56a681; }
.live-label.offline { background: #fff7e9; color: #81531c; border-color: #f4dec4; }
.live-label.offline > span { background: #c88237; }
.profile-button { display: inline-flex; align-items: center; gap: 9px; padding: 3px 0 3px 12px; border: 0; border-left: 1px solid var(--line); background: transparent; text-align: left; }
.profile-button > svg { color: var(--muted); }
.profile-text { display: grid; gap: 2px; min-width: 109px; }
.profile-text b { font-size: .84rem; font-weight: 710; }
.profile-text small { color: var(--muted); font-size: .73rem; }
.avatar { flex: none; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; font-size: .7rem; font-weight: 790; }
.av-0 { background: #e9defa; color: #644594; }
.av-1 { background: #deefe4; color: #216447; }
.av-2 { background: #e0ebfb; color: #335e9d; }
.av-3 { background: #fae8d8; color: #895326; }
.avatar-small { width: 24px; height: 24px; font-size: .56rem; }
.mobile-brand, .mobile-nav { display: none; }
.workspace { width: 100%; max-width: 1660px; margin: 0 auto; padding: 35px clamp(22px, 3.1vw, 48px) 48px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.page-heading h1 { font-size: clamp(2.1rem, 3.4vw, 2.82rem); letter-spacing: -.055em; font-weight: 810; line-height: 1.07; }
.page-heading p { margin-top: 8px; font-size: .94rem; color: var(--muted); font-weight: 500; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 41px; padding: 8px 13px; border: 1px solid transparent; border-radius: 9px; white-space: nowrap; text-decoration: none; font-weight: 680; font-size: .85rem; line-height: 1.1; }
.button-primary { color: #fff; background: var(--brand); box-shadow: 0 2px 3px #0a6a4420; }
.button-primary:hover { background: var(--brand-hover); }
.new-order { min-height: 46px; padding-inline: 15px 17px; margin-bottom: 1px; }
.button-secondary { color: #40594e; background: #fff; border-color: #dde7e0; }
.button-secondary:hover { background: #f2f7f4; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 25px; }
.stat { display: flex; align-items: flex-start; gap: 12px; min-width: 0; min-height: 108px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 2px 2px #10362a03; }
.stat-glyph { display: grid; flex: none; place-items: center; width: 41px; height: 41px; border-radius: 11px; }
.stat-mint { color: #087754; background: #e7f5ec; }
.stat-blue { color: #376daa; background: #eaf2fc; }
.stat-violet { color: #7650a9; background: #f1eafb; }
.stat-body { display: grid; gap: 4px; min-width: 0; }
.stat-label { color: #536b60; font-size: .84rem; font-weight: 650; line-height: 1.25; }
.stat-body strong { font-size: clamp(1.48rem, 2.3vw, 1.95rem); letter-spacing: -.045em; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-body small { color: var(--muted); font-size: .73rem; line-height: 1.25; }
.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 19px; align-items: start; }
.calendar-layout.with-city-summary { grid-template-columns: minmax(0, 1fr) minmax(228px, .35fr); }
.calendar-main { min-width: 0; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 2px 2px #10362a03; min-width: 0; }
.week-panel { padding: 15px 17px 14px; }
.week-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.week-header h2, .agenda-title h2, .aside-title h2 { font-size: 1.055rem; font-weight: 780; letter-spacing: -.022em; }
.week-tools, .week-nav { display: flex; align-items: center; gap: 7px; }
.week-nav { gap: 4px; }
.today-button { min-height: 33px; padding: 4px 10px; font-size: .77rem; }
.icon-button { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; color: #466155; border: 1px solid #e2ebe5; border-radius: 8px; background: #fff; }
.icon-button:hover { background: #eef6f1; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.day-cell { display: grid; justify-items: center; align-content: center; gap: 4px; min-width: 0; min-height: 70px; padding: 6px 0; border: 1px solid transparent; border-radius: 10px; background: #f6f9f7; color: #5d7468; }
.day-cell:hover { border-color: #b9d8c7; background: #eef6f0; }
.day-cell > span:first-child { font-size: .75rem; font-weight: 670; }
.day-cell b { font-size: 1.17rem; font-weight: 770; color: #263f34; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.day-marker { display: block; height: 9px; font-size: .78rem; font-weight: 850; letter-spacing: .11em; color: #62a58a; line-height: .7; }
.day-today:not(.day-selected) { border-color: #a9d6bc; }
.day-selected, .day-selected:hover { background: #087c56; border-color: #087c56; color: #dff7eb; }
.day-selected b, .day-selected .day-marker { color: #fff; }
.order-filters { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin-top: 16px; margin-bottom: 17px; }
.filter-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.filter-field { position: relative; display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.filter-field select { width: 100%; padding: 0 28px 0 35px; min-height: 38px; border: 1px solid #dfe9e3; border-radius: 8px; appearance: none; background: white; color: #405d4f; font-size: .77rem; font-weight: 680; text-overflow: ellipsis; }
.filter-icon, .select-chevron { position: absolute; left: 11px; display: grid; place-items: center; color: #59766a; pointer-events: none; }
.select-chevron { left: auto; right: 9px; }
.segmented { display: inline-flex; gap: 2px; align-items: center; flex: none; padding: 3px; background: #eaf0ec; border-radius: 9px; }
.segmented button { min-height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #526c5f; font-size: .77rem; font-weight: 650; white-space: nowrap; }
.segmented .segment-active { color: #216044; background: #fff; box-shadow: 0 1px 3px #133e2a19; }
.agenda-day + .agenda-day { margin-top: 18px; }
.agenda-title { display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0 1px 9px; }
.agenda-title h2 { min-width: 0; }
.agenda-title > span { flex: none; border: 1px solid #ddece3; border-radius: 100px; padding: 3px 8px; color: #3d7359; background: #edf8f1; font-size: .7rem; font-weight: 690; }
.day-schedule-button { display: inline-flex; align-items: center; gap: 5px; flex: none; min-height: 34px; margin-inline-start: auto; padding: 3px 7px; border: 0; border-radius: 7px; background: transparent; color: var(--brand); font-size: .76rem; font-weight: 700; white-space: nowrap; }
.day-schedule-button:hover { background: var(--mint); }
.order-list { overflow: hidden; }
.order-row { display: flex; align-items: center; min-width: 0; padding-inline: 11px 8px; background: var(--order-bg, var(--surface)); }
.order-row + .order-row { border-top: 1px solid var(--line); }
.order-row:hover { background: var(--order-hover, var(--surface-hover)); }
.entry-admin { --order-bg: var(--entry-admin); --order-hover: var(--entry-admin-hover); }
.entry-assistant { --order-bg: var(--entry-assistant); --order-hover: var(--entry-assistant-hover); }
.order-status { display: grid; flex: none; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid #e5ede8; border-radius: 50%; background: #f6f9f7; color: #6b8376; }
.order-status:hover { border-color: #7fbaa0; }
.status-done { color: #0e8158; border-color: #d8f0e2; background: #e7f6ed; }
.order-body { display: grid; flex: 1; align-items: center; grid-template-columns: 77px minmax(75px, 1fr) minmax(132px, .48fr) minmax(54px, auto) auto; min-width: 0; gap: 9px; min-height: 65px; padding: 8px 3px 8px 10px; text-align: left; border: 0; background: transparent; }
.order-body:focus-visible { outline-offset: -2px; }
.order-time { color: #29483a; white-space: nowrap; font-size: .76rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.order-main { min-width: 0; display: grid; gap: 5px; }
.order-main > b, .order-main small > span:first-of-type, .order-person > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-main > b { font-size: .85rem; font-weight: 735; }
.order-main small { display: flex; align-items: center; gap: 4px; min-width: 0; color: var(--muted); font-size: .72rem; }
.media-count { display: flex; align-items: center; flex: none; gap: 2px; }
.order-meta { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.order-executor { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 7px; min-width: 0; max-width: 100%; }
.order-person { display: flex; min-width: 0; max-width: 100%; align-items: center; gap: 5px; color: var(--muted); font-size: .72rem; font-weight: 620; }
.order-schedule { display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; max-width: 100%; color: var(--muted); font-size: .68rem; line-height: 1.28; }
.order-schedule .schedule-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-author { display: flex; align-items: baseline; gap: 4px; min-width: 0; max-width: 100%; color: var(--muted); font-size: .67rem; }
.author-chip { display: inline-block; padding: 3px 6px; border-radius: 5px; background: var(--surface-hover); color: var(--text); font-size: .68rem; line-height: 1.12; font-weight: 750; overflow-wrap: anywhere; }
.author-admin { background: var(--author-admin-bg); color: var(--author-admin-text); }
.author-assistant { background: var(--author-assistant-bg); color: var(--author-assistant-text); }
.order-amount { display: grid; justify-items: end; gap: 4px; white-space: nowrap; font-size: .78rem; }
.order-amount b { font-weight: 770; }
.order-amount small { color: #177a58; font-size: .65rem; }
.order-amount > span { color: #82988d; }
.order-next { color: #779388; }
.calendar-aside { padding: 14px; }
.aside-title { display: flex; align-items: center; gap: 8px; min-height: 34px; margin-bottom: 7px; }
.aside-title h2 { font-size: .96rem; }
.aside-icon { width: 32px; height: 32px; display: grid; place-items: center; background: #eff6f1; color: #488367; border-radius: 8px; }
.day-schedule-empty { margin: 2px; color: var(--muted); font-size: .8rem; }
.people-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 166px), 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.person-row { display: flex; align-items: flex-start; gap: 7px; padding: 8px; min-width: 0; border-radius: 8px; background: #f3f8f5; }
.person-row .avatar { width: 27px; height: 27px; font-size: .61rem; }
.person-copy { display: grid; flex: 1; min-width: 0; gap: 3px; overflow-wrap: anywhere; }
.person-copy b { font-size: .78rem; line-height: 1.25; }
.person-status { display: flex; gap: 5px; align-items: baseline; color: #4d675a; font-size: .73rem; line-height: 1.25; }
.status-time { white-space: nowrap; }
.person-copy small { color: var(--muted); font-size: .71rem; line-height: 1.3; white-space: pre-wrap; }
.schedule-dot, .city-dot { flex: none; border-radius: 50%; display: inline-block; width: 7px; height: 7px; background: #86b7a0; }
.schedule-dot { align-self: flex-start; margin-top: .31em; }
.schedule-dot.open { background: #369771; }
.schedule-dot.off { background: #9569af; }
.schedule-dot.muted { background: #8e9f95; }
.count-pill { padding: 2px 5px; border-radius: 5px; color: #536e5e; background: #e7f0ea; font-size: .67rem; font-weight: 700; }
.text-button:hover { text-decoration: underline; }
.city-list { display: grid; gap: 13px; padding: 7px 0 3px; }
.city-row > div:first-child { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 7px; color: #4a6457; font-size: .76rem; font-weight: 640; margin-bottom: 5px; }
.city-row b { color: #294d3b; }
.city-bar { border-radius: 10px; overflow: hidden; background: #edf3ef; height: 5px; }
.city-bar i { display: block; height: 100%; border-radius: inherit; }
.city-0 { background: #4caf87; }
.city-1 { background: #8daae6; }
.city-2 { background: #b298d4; }
.city-3 { background: #e4b67f; }
.aside-empty { padding: 9px 0; font-size: .8rem; color: var(--muted); }
.empty-orders { display: grid; place-items: center; min-height: 122px; align-content: center; gap: 8px; color: var(--muted); font-size: .88rem; padding: 12px; }
.empty-orders > svg { color: #6d9e87; }
.text-button { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 720; }

dialog { width: min(650px, calc(100% - 30px)); max-height: min(900px, calc(100dvh - 42px)); padding: 0; color: var(--text); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 22px 75px #102f2740; }
dialog::backdrop { background: #112e2659; }
.dialog-shell { display: flex; flex-direction: column; min-height: 0; max-height: min(900px, calc(100dvh - 44px)); background: #fff; }
.dialog-head, .dialog-footer { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 21px; }
.dialog-head { border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 1.33rem; font-weight: 780; letter-spacing: -.03em; }
.dialog-content { overflow: auto; min-height: 0; padding: 18px 21px; overscroll-behavior: contain; }
.dialog-footer { justify-content: flex-end; border-top: 1px solid var(--line); }
.dialog-close { border-color: transparent; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-wide { grid-column: 1 / -1; }
.form-field { display: grid; min-width: 0; gap: 5px; align-content: start; font-size: .83rem; font-weight: 690; color: #365347; }
.form-field :is(input, select, textarea) { min-width: 0; width: 100%; padding: 9px 10px; min-height: 41px; border: 1px solid #dce8df; border-radius: 8px; background: white; color: var(--text); font-size: max(16px, .9rem); font-weight: 480; }
.form-field textarea { resize: vertical; }
.form-field input::placeholder, .form-field textarea::placeholder { color: #768a80; }
.order-visit-fields, .time-fields { display: grid; align-items: end; min-width: 0; }
.order-visit-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 12px; }
.time-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.75rem), 1fr)); gap: 8px; }
.visit-control {
  display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; padding-inline: 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
/* Keep padding on the wrapper so iOS date and time inputs stay inside the track. */
.visit-control > input {
  display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 42px;
  padding: 0; border: 0; border-radius: 0; background: transparent;
  -webkit-appearance: none; appearance: none;
}
.visit-control > input::-webkit-date-and-time-value { text-align: start; }
.visit-control:focus-within { outline: 3px solid #4aa984; outline-offset: 2px; }
.visit-control > input:focus-visible { outline: none; }
.form-error { color: #a33340; background: #fff1f2; border-radius: 7px; padding: 8px 10px; margin-top: 8px; font-size: .84rem; line-height: 1.33; }
.dialog-section { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.dialog-section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 9px; }
.dialog-section-head > h3 { font-size: 1rem; font-weight: 760; letter-spacing: -.015em; }
.dialog-section-head > span, .field-hint { color: var(--muted); font-size: .78rem; }
.field-hint { line-height: 1.4; margin-top: 6px; }
.record-meta { margin-top: 12px; font-size: .81rem; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.order-created { margin-top: 12px; color: var(--muted); font-size: .77rem; }
.master-order-info { display: grid; gap: 8px; font-size: .91rem; }
.master-order-info > b { font-size: 1.08rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.master-order-info :is(span, a) { display: flex; align-items: center; gap: 7px; }
.file-add { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 43px; padding: 6px 10px; border: 1px dashed #9ccbb5; border-radius: 9px; background: #f2f9f5; color: var(--brand); font-size: .84rem; font-weight: 720; cursor: pointer; }
.file-add:focus-within { outline: 3px solid #4aa984; outline-offset: 2px; }
.file-add input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.media-list:not(:empty) { margin-top: 8px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 83px), 1fr)); gap: 8px; margin: 3px 0 8px; }
.photo-tile { min-width: 0; position: relative; }
.photo-open { display: grid; float: none; position: relative; width: 100%; aspect-ratio: 1; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; padding: 0; color: var(--muted); background: var(--bg); }
.photo-open:hover { outline: 2px solid var(--brand); outline-offset: -2px; }
.photo-open img { position: absolute; width: 100%; height: 100%; inset: 0; object-fit: cover; }
.photo-tile > .file-remove { position: absolute; top: 4px; right: 4px; z-index: 1; }
.file-row { display: flex; gap: 8px; align-items: center; min-height: 37px; padding: 4px 2px; border-bottom: 1px solid #edf3ef; }
.file-open { color: #36584a; font-size: .83rem; font-weight: 620; display: flex; align-items: center; flex: 1; min-width: 0; gap: 6px; background: transparent; border: 0; text-align: left; padding: 3px 0; }
.file-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.file-open:hover { text-decoration: underline; }
.file-row > small { color: var(--muted); white-space: nowrap; font-size: .74rem; }
.file-remove { width: 28px; height: 28px; color: #985064; }
.media-viewer { width: min(940px, calc(100% - 20px)); height: min(85dvh, 760px); }
.media-viewer-shell { height: 100%; min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--surface); }
.media-viewer-shell header, .media-viewer-shell footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 13px; }
.media-viewer-shell header { border-bottom: 1px solid var(--line); }
.media-viewer-shell header strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-viewer-shell footer { justify-content: end; border-top: 1px solid var(--line); }
.media-viewer-body { display: grid; place-items: center; overflow: hidden; min-height: 0; padding: 8px; background: var(--bg); color: var(--muted); }
.media-viewer-body > :is(img, video) { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.compensation-fields { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.switch-field, .complete-field { display: flex; position: relative; align-items: center; gap: 8px; min-height: 41px; color: #315549; font-size: .82rem; font-weight: 720; cursor: pointer; }
.switch-field input { position: absolute; width: 40px; height: 26px; opacity: 0; }
.switch-track { display: inline-block; position: relative; flex: none; width: 35px; height: 21px; border-radius: 40px; background: #d0dcd4; }
.switch-track::before { content: ""; display: block; position: absolute; inset: 3px auto auto 3px; width: 15px; height: 15px; border-radius: 50%; background: white; }
.switch-field input:checked + .switch-track { background: var(--brand); }
.switch-field input:checked + .switch-track::before { transform: translateX(14px); }
.switch-field input:focus-visible + .switch-track { outline: 3px solid #4aa984; outline-offset: 2px; }
.complete-field input { width: 18px; height: 18px; margin: 0 1px; accent-color: var(--brand); }
.payout-line { display: flex; justify-content: space-between; gap: 8px; margin: 9px 0 3px; padding: 8px 10px; border-radius: 7px; background: #eff8f2; font-size: .84rem; color: #315b49; }
.saving :is([data-close],.file-add,[data-media-remove],[data-queued-remove]) { pointer-events: none; opacity: .6; }

#notices { display: grid; gap: 7px; position: fixed; right: 16px; bottom: 16px; max-width: min(390px, calc(100vw - 32px)); z-index: 20; pointer-events: none; }
.notice { display: flex; gap: 7px; align-items: center; padding: 11px 13px; border-radius: 10px; color: white; background: #23634e; box-shadow: 0 4px 18px #12433333; font-size: .85rem; font-weight: 650; }
.notice-error { background: #873f4e; }
.loading-screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); }
.loading-dot { width: 11px; height: 11px; border: 2px solid var(--brand); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sign-in { min-height: 100dvh; display: grid; grid-template-columns: minmax(340px, .95fr) minmax(0, 1.05fr); }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; min-height: 100%; padding: clamp(26px, 4.6vw, 72px); background: radial-gradient(circle at 70% 55%, #2d5a47, #102f27 65%); color: white; }
.login-art { position: absolute; inset: 0; display: grid; place-items: center; color: #9ddd8e42; pointer-events: none; transform: rotate(-9deg); }
.login-art svg { width: min(45vw, 320px); height: min(45vw, 320px); stroke-width: .75; }
.login-brand-copy { z-index: 1; font-size: clamp(2rem, 4vw, 4.25rem); line-height: .99; letter-spacing: -.055em; font-weight: 820; color: #d7f2df; }
.login-panel { display: grid; place-items: center; padding: 29px; min-height: 100%; }
.login-card { width: min(100%, 392px); }
.login-card h1 { margin: 0 0 7px; font-size: clamp(2rem, 4.5vw, 3.15rem); letter-spacing: -.065em; }
.login-card > p { margin: 0 0 24px; color: var(--muted); font-size: .95rem; }
#login-form, #server-setup { display: grid; gap: 13px; }
#login-form .button, #server-setup .button { min-height: 46px; margin-top: 2px; }
.auth-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; margin-top: 12px; }
.auth-links > :is(button, a) { display: inline-flex; align-items: center; min-height: 36px; font-size: .86rem; }
.registration-card { width: min(100%, 436px); }
.registration-chooser > p { margin-bottom: 18px; }
.registration-roles { display: grid; gap: 10px; }
.registration-role {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  min-height: 73px; padding: 11px 13px; color: var(--text); text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
}
.registration-role:hover, .registration-role:focus-visible { background: var(--surface-hover); border-color: var(--brand); }
.registration-role > svg { color: var(--muted); }
.registration-role-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: var(--mint); color: var(--brand); }
.registration-role[data-registration-role="assistant"] .registration-role-icon { background: var(--author-assistant-bg); color: var(--author-assistant-text); }
.registration-role[data-registration-role="master"] .registration-role-icon { background: var(--author-admin-bg); color: var(--author-admin-text); }
.registration-role-copy { display: grid; gap: 3px; }
.registration-role-copy strong { font-size: 1rem; font-weight: 780; }
.registration-role-copy small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
#register-form { display: grid; gap: 13px; }
#register-form button[type=submit] { min-height: 46px; }
#register-form .field-hint { margin-top: -7px; }
.registration-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.registration-person { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); overflow-wrap: anywhere; }
.registration-person > :is(span, small) { color: var(--muted); font-size: .82rem; }
.registration-show { display: inline-flex; justify-self: start; align-items: center; gap: 8px; min-height: 32px; color: var(--muted); font-size: .82rem; cursor: pointer; }
.registration-show input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.login-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: -5px 0 17px; }
.login-methods button { min-height: 39px; font-size: .85rem; }
.code-hint { margin: 0; }
#login-form > .text-button { min-height: 30px; font-size: .85rem; }
.login-demo { font-weight: 680; text-decoration: none; }
.login-demo:hover { text-decoration: underline; }
.login-mobile-brand { display: none; }

@media (max-width: 1260px) {
  :root { --side-width: 186px; }
  .workspace, .topbar { padding-inline: 25px; }
  .calendar-layout { gap: 13px; }
  .calendar-layout.with-city-summary { grid-template-columns: minmax(0, 1fr) minmax(205px, .34fr); }
  .order-body { gap: 7px; }
  .order-person .avatar-small { display: none; }
}
@media (max-width: 1030px) {
  :root { --side-width: 168px; }
  .workspace, .topbar { padding-inline: 20px; }
  .order-body { grid-template-columns: 75px minmax(70px, 1fr) minmax(112px, .43fr) minmax(51px, auto); }
  .order-next { display: none; }
  .stat { padding: 13px; }
}
@media (max-width: 930px) {
  .calendar-layout.with-city-summary { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  :root { --top-height: 61px; }
  .sidebar, .topbar-title, .profile-text, .profile-button > svg { display: none; }
  .main-frame { margin-left: 0; }
  .topbar { height: calc(var(--top-height) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) max(15px, env(safe-area-inset-right)) 0 max(15px, env(safe-area-inset-left)); }
  .mobile-brand { display: flex; gap: 8px; }
  .mobile-brand .brand-mark { width: 35px; height: 35px; border-radius: 10px; }
  .mobile-brand .brand-mark svg { width: 21px; height: 21px; }
  .mobile-brand .brand-text { font-size: 21px; color: #193c2d; }
  .mobile-brand .brand-text span { display: none; }
  .topbar-actions { gap: 9px; }
  .profile-button { border: 0; padding: 0; }
  .profile-button .avatar { width: 32px; height: 32px; }
  .workspace { padding: 21px max(15px, env(safe-area-inset-right)) calc(83px + env(safe-area-inset-bottom, 0px)) max(15px, env(safe-area-inset-left)); }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 5; display: flex; align-items: stretch; justify-content: space-evenly; padding: 4px max(5px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom, 0px)) max(5px, env(safe-area-inset-left)); border-top: 1px solid #deebe3; background: white; }
  .mobile-nav .nav-item { flex: 1; width: auto; min-width: 0; min-height: 50px; padding: 3px 1px; justify-content: center; flex-direction: column; gap: 3px; color: #576f63; background: white; font-size: .65rem; line-height: 1; }
  .mobile-nav .nav-active { color: var(--brand); font-weight: 800; background: #ebf7ef; }
  .page-heading { margin-bottom: 16px; gap: 9px; align-items: center; }
  .page-heading h1 { font-size: clamp(1.65rem, 5vw, 2.25rem); }
  .page-heading p { margin-top: 5px; font-size: .83rem; }
  .new-order { min-height: 41px; gap: 4px; padding-inline: 9px 10px; font-size: .75rem; }
  .new-order svg { width: 16px; height: 16px; }
  .stat-grid { gap: 7px; margin-bottom: 15px; }
  .stat { display: grid; align-content: start; gap: 6px; min-height: 102px; padding: 9px; border-radius: 10px; }
  .stat-glyph { width: 27px; height: 27px; border-radius: 7px; }
  .stat-glyph svg { width: 16px; height: 16px; }
  .stat-body { gap: 3px; }
  .stat-label { font-size: .68rem; }
  .stat-body strong { font-size: clamp(1.03rem, 4.15vw, 1.7rem); }
  .stat-body small { font-size: .6rem; }
  .week-panel { padding: 11px; }
  .week-header { margin-bottom: 9px; }
  .week-grid { gap: 4px; }
  .day-cell { min-height: 59px; gap: 3px; border-radius: 7px; }
  .day-cell > span:first-child { font-size: .68rem; }
  .day-cell b { font-size: 1.05rem; }
  .day-marker { font-size: .71rem; }
  .order-filters { margin: 11px 0 13px; gap: 6px; }
  .filter-group { gap: 4px; }
  .filter-field select { padding: 0 20px 0 23px; min-height: 36px; font-size: .69rem; max-width: 140px; }
  .filter-icon { left: 5px; }
  .filter-icon svg, .select-chevron svg { width: 13px; height: 13px; }
  .select-chevron { right: 5px; }
  .segmented button { min-height: 28px; padding: 0 6px; font-size: .69rem; }
  .agenda-title { margin-bottom: 7px; gap: 5px; }
  .agenda-title h2 { font-size: .93rem; }
  .day-schedule-button { min-height: 36px; padding-inline: 5px; font-size: .69rem; }
  .order-row { padding-inline: 7px 8px; }
  .order-status { width: 29px; height: 29px; }
  .order-body { grid-template-columns: minmax(60px, auto) minmax(0, 1fr) auto; grid-template-rows: min-content min-content min-content; gap: 3px 6px; min-height: 64px; padding: 9px 0 9px 7px; }
  .order-time { grid-column: 1; grid-row: 1; align-self: center; font-size: .68rem; }
  .order-main { display: contents; }
  .order-main > b { grid-column: 2; grid-row: 1; align-self: center; font-size: .76rem; }
  .order-main > small { grid-column: 2; grid-row: 2; font-size: .65rem; }
  .order-meta { grid-column: 2 / -1; grid-row: 3; display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 8px; }
  .order-person, .order-schedule, .order-author, .order-body .author-chip { font-size: .66rem; }
  .order-amount { grid-column: 3; grid-row: 1 / 3; align-self: center; font-size: .73rem; }
  .order-amount small { font-size: .59rem; }
  .calendar-aside { padding: 10px; }
  .aside-title { gap: 5px; }
  .aside-title h2 { font-size: .77rem; }
  .aside-icon { width: 26px; height: 26px; }
  .aside-icon svg { width: 15px; }
  .city-row > div:first-child { font-size: .69rem; }
  .people-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 136px), 1fr)); }
  .person-row { gap: 5px; padding: 6px; }
  .person-row .avatar { width: 24px; height: 24px; font-size: .54rem; }
  .person-copy b { font-size: .73rem; }
  .person-status { font-size: .69rem; }
  #notices { bottom: calc(65px + env(safe-area-inset-bottom, 0px)); }
  dialog { max-height: calc(100dvh - 24px); width: min(620px, calc(100% - 16px)); border-radius: 12px; }
  .dialog-shell { max-height: calc(100dvh - 26px); }
  .dialog-head, .dialog-footer { padding: 11px 13px; }
  .dialog-content { padding: 13px; }
  .sign-in { grid-template-columns: minmax(0, 1fr); }
  .login-brand { display: none; }
  .login-mobile-brand { display: flex; margin-bottom: 23px; color: #1f4535; }
  .login-mobile-brand .brand-text span { color: #5b7467; }
}
@media (max-width: 375px) {
  .new-order { padding-inline: 7px; }
  .page-heading h1 { font-size: 1.5rem; }
  .filter-field select { max-width: 106px; }
  .form-grid, .compensation-fields { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .registration-fields { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001s !important; } }
