/* Impact owner dashboard */
:root {
  --yellow: #FFE600; --yellow-dk: #E6CF00; --navy: #041D35; --navy-2: #072A4A; --navy-3: #0B3760;
  --blue: #075A9C; --blue-lt: #DCEBF7; --red: #E8193F; --green: #12805C;
  --bg: #F2F6F9; --card: #fff; --text: #1A2433; --muted: #5B6A7E; --line: #DCE4EC; --line-2: #EDF1F5;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif; --sans: 'Manrope', system-ui, sans-serif;
  --r: 0.625rem; --shadow: 0 0.75rem 2rem -0.75rem rgba(4,29,53,.28);
  --ease: cubic-bezier(.16,1,.3,1);
  --hour: 4rem; /* calendar row height */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 0.9375rem; color: var(--text); background: var(--bg); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ico { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; color: var(--navy); margin: 0; line-height: 1; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.625rem; padding: 0 1.125rem; border: 0; border-radius: 0.5rem; font-family: var(--display); font-weight: 700; font-size: 1.0625rem; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; white-space: nowrap; transition: background-color .2s, transform .2s var(--ease), box-shadow .2s; }
.btn:active { transform: translateY(1px); }
.btn-yellow { background: var(--yellow); color: var(--navy); }
.btn-yellow:hover { background: var(--yellow-dk); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-3); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #0d6a4b; }
.btn-ghost { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--navy); }
.btn-danger { background: #fff; color: var(--red); box-shadow: inset 0 0 0 1.5px #f3c4cf; }
.btn-danger:hover { box-shadow: inset 0 0 0 1.5px var(--red); }
.btn-sm { min-height: 2.25rem; padding: 0 0.875rem; font-size: 0.9375rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn { width: 2.375rem; height: 2.375rem; display: grid; place-items: center; border: 0; border-radius: 0.5rem; background: transparent; color: var(--navy); }
.icon-btn:hover { background: var(--line-2); }
.link { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.link.danger { color: var(--red); }

/* fields */
.fld { display: block; margin-top: 0.75rem; }
.fld > span { display: block; margin-bottom: 0.3125rem; font-size: 0.75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fld input, .fld select, .fld textarea, .ov-add input, .ov-add select, .hours input { width: 100%; min-height: 2.625rem; padding: 0.5rem 0.75rem; border: 1.5px solid var(--line); border-radius: 0.5rem; background: #fff; transition: border-color .2s, box-shadow .2s; }
.fld textarea { resize: vertical; min-height: 4rem; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .ov-add input:focus, .hours input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(7,90,156,.15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.75rem; }
.row3 { display: grid; grid-template-columns: 0.8fr 1.4fr 0.8fr; gap: 0 0.75rem; }
.form-err { margin: 0; color: var(--red); font-weight: 600; font-size: 0.875rem; }
.form-err:empty { display: none; }
.hint { margin: 0.375rem 0 0; color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.switch { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.875rem; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 2.75rem; height: 1.5rem; flex-shrink: 0; border-radius: 1rem; background: #c5d1dc; position: relative; transition: background-color .2s; }
.switch span::after { content: ''; position: absolute; top: 0.1875rem; left: 0.1875rem; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(1.25rem); }
.switch input:focus-visible + span { outline: 3px solid rgba(7,90,156,.35); outline-offset: 2px; }

/* segmented */
.seg { display: inline-flex; padding: 0.1875rem; border-radius: 0.5rem; background: var(--line-2); }
.seg button { border: 0; background: none; padding: 0.4375rem 0.875rem; border-radius: 0.375rem; font-weight: 700; font-size: 0.875rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.375rem; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(4,29,53,.15); }
.seg button b { min-width: 1.25rem; padding: 0 0.3125rem; border-radius: 1rem; background: var(--red); color: #fff; font-size: 0.6875rem; line-height: 1.25rem; }
.seg button b:empty { display: none; }
.seg-full { display: flex; }
.seg-full button { flex: 1; justify-content: center; }

/* ============ LOGIN ============ */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(120% 80% at 80% 0%, var(--navy-3), var(--navy) 60%); }
.login-card { width: min(100%, 24rem); padding: 2.25rem 2rem; border-radius: 1rem; background: #fff; box-shadow: 0 2rem 4rem -1.5rem rgba(0,0,0,.6); }
.login-logo { width: 11rem; display: block; margin: 0 auto 1.25rem; }
.login-card h1 { font-size: 2rem; text-align: center; }
.login-card > p { margin: 0.5rem 0 0.5rem; text-align: center; color: var(--muted); }
.login-card .btn { margin-top: 1.25rem; min-height: 3rem; font-size: 1.1875rem; }
.login-card .form-err { margin-top: 0.75rem; color: var(--red); text-align: center; }

/* ============ SHELL ============ */
.app { display: grid; grid-template-columns: 13.5rem 1fr; min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 1.25rem 0.875rem; background: var(--navy); color: #fff; }
.side-logo { width: 9.5rem; margin: 0 0 2rem 0.5rem; }
.tabs { display: flex; flex-direction: column; gap: 0.25rem; }
.tab { position: relative; display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.875rem; border: 0; border-radius: 0.5rem; background: none; color: rgba(255,255,255,.72); font-family: var(--display); font-weight: 700; font-size: 1.1875rem; letter-spacing: .05em; text-transform: uppercase; text-align: left; transition: background-color .2s, color .2s; }
.tab .ico { width: 1.25rem; height: 1.25rem; }
.tab:hover { background: rgba(255,255,255,.07); color: #fff; }
.tab.on { background: rgba(255,230,0,.12); color: var(--yellow); }
.tab.on::before { content: ''; position: absolute; left: -0.875rem; top: 0.5rem; bottom: 0.5rem; width: 0.25rem; border-radius: 0 0.25rem 0.25rem 0; background: var(--yellow); }
.badge { margin-left: auto; min-width: 1.375rem; padding: 0 0.375rem; border-radius: 1rem; background: var(--red); color: #fff; font-family: var(--sans); font-size: 0.75rem; line-height: 1.375rem; text-align: center; letter-spacing: 0; }
.side-out { margin-top: auto; border: 0; background: none; color: rgba(255,255,255,.55); font-weight: 600; text-align: left; padding: 0.75rem 0.875rem; }
.side-out:hover { color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem clamp(1rem, 2.5vw, 2rem); background: rgba(242,246,249,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-logo { display: none; }
.search { position: relative; flex: 1; max-width: 30rem; margin-right: auto; }
.search .ico { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; min-height: 2.625rem; padding: 0 0.875rem 0 2.5rem; border: 1.5px solid var(--line); border-radius: 0.5rem; background: #fff; }
.search input:focus { outline: none; border-color: var(--blue); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 0.375rem); z-index: 40; max-height: 60vh; overflow: auto; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); padding: 0.375rem; }
.search-results button { display: block; width: 100%; text-align: left; padding: 0.625rem 0.75rem; border: 0; border-radius: 0.375rem; background: none; }
.search-results button:hover { background: var(--line-2); }
.search-results small { display: block; color: var(--muted); }
.search-results p { margin: 0; padding: 0.75rem; color: var(--muted); }

.view { padding: 1.25rem clamp(1rem, 2.5vw, 2rem) 3rem; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.view-head h2 { font-size: 2.25rem; }

/* ============ CALENDAR ============ */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.cal-nav { display: flex; align-items: center; gap: 0.375rem; }
.cal-nav h2 { margin-left: 0.75rem; font-size: 1.75rem; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 0.375rem; }
.legend i { width: 0.875rem; height: 0.875rem; border-radius: 0.1875rem; }
.lg-confirmed { background: var(--navy); }
.lg-pending { background: var(--yellow); box-shadow: inset 0 0 0 1.5px var(--navy); }
.lg-quote { background: var(--blue); }
.lg-block { background: repeating-linear-gradient(135deg, #b8c4d0 0 3px, #dfe6ec 3px 6px); }
.review-banner { margin-bottom: 1rem; padding: 0.875rem 1rem; border-radius: var(--r); background: #FFF8C2; border: 1.5px solid #f0dc4a; font-size: 0.9375rem; }
.review-banner .link { margin-left: 0.25rem; }

.day-strip { display: none; }
.cal { position: relative; display: grid; grid-template-columns: 3.75rem repeat(var(--days, 7), minmax(0, 1fr)); background: #fff; border-radius: var(--r); box-shadow: 0 1px 3px rgba(4,29,53,.08), 0 0 0 1px var(--line); overflow: clip; }
.cal-head { position: sticky; top: 4.375rem; z-index: 5; padding: 0.625rem 0.5rem; background: #fff; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line-2); text-align: center; }
.cal-head:first-child { border-left: 0; }
.cal-head b { display: block; font-family: var(--display); font-size: 0.9375rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cal-head span { display: inline-grid; place-items: center; min-width: 2.125rem; height: 2.125rem; margin-top: 0.125rem; border-radius: 50%; font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--navy); }
.cal-head.today span { background: var(--yellow); }
.cal-head small { display: block; font-size: 0.6875rem; color: var(--muted); }
.cal-times { position: relative; }
.cal-times span { position: absolute; right: 0.5rem; transform: translateY(-50%); font-size: 0.6875rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.cal-col { position: relative; border-left: 1px solid var(--line-2); background: repeating-linear-gradient(135deg, #f4f6f8 0 6px, #eef1f4 6px 12px); cursor: crosshair; }
.cal-col .open { position: absolute; left: 0; right: 0; background: #fff; }
.cal-col .gridline { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line-2); pointer-events: none; }
.cal-col .gridline.half { border-top-style: dashed; border-color: #f1f4f7; }
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--red); z-index: 3; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -0.3125rem; top: -0.375rem; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--red); }

.ev { position: absolute; left: 0.25rem; right: 0.25rem; z-index: 2; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; padding: 0.3125rem 0.5rem 0.3125rem 0.625rem; border: 0; border-radius: 0.375rem; text-align: left; font-size: 0.75rem; line-height: 1.3; background: var(--navy); color: #fff; box-shadow: 0 2px 6px -2px rgba(4,29,53,.45); transition: transform .2s var(--ease), box-shadow .2s; }
.ev::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 0.25rem; background: var(--yellow); }
.ev:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -4px rgba(4,29,53,.5); z-index: 4; }
.ev b { display: block; font-weight: 800; font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .t { font-weight: 700; opacity: .8; }
.ev .s { display: block; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.quote { background: var(--blue); }
.ev.quote::before { background: #9fd0f7; }
.ev.pending { background: var(--yellow); color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy); }
.ev.pending::before { background: var(--navy); }
.ev.pending .flag { display: inline-block; margin-top: 0.125rem; padding: 0 0.3125rem; border-radius: 0.25rem; background: var(--navy); color: var(--yellow); font-size: 0.625rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ev.completed { background: #c9d4de; color: var(--navy); box-shadow: none; }
.ev.completed::before { background: var(--green); }
.ev.block { background: repeating-linear-gradient(135deg, #c9d3dd 0 5px, #dde4ea 5px 10px); color: var(--navy); box-shadow: none; }
.ev.block::before { background: #8797a8; }
.ev.short b { display: inline; }
.ev.short .s { display: none; }

/* ============ INBOX ============ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 0.875rem; }
.card { position: relative; display: flex; flex-direction: column; gap: 0.5rem; padding: 1.125rem 1.25rem; border: 0; border-radius: var(--r); background: #fff; text-align: left; box-shadow: 0 1px 3px rgba(4,29,53,.08), 0 0 0 1px var(--line); transition: box-shadow .2s, transform .2s var(--ease); }
button.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.card h3 { font-size: 1.5rem; }
.card p { margin: 0; color: var(--text); line-height: 1.45; }
.card .when { font-weight: 700; color: var(--navy); }
.card .muted { color: var(--muted); font-size: 0.875rem; }
.card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }
.card.done { opacity: .6; }
.empty { grid-column: 1 / -1; padding: 3rem 1rem; text-align: center; color: var(--muted); background: #fff; border-radius: var(--r); box-shadow: 0 0 0 1px var(--line); }
.empty b { display: block; font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; color: var(--navy); margin-bottom: 0.25rem; }

.status { display: inline-flex; align-items: center; padding: 0.125rem 0.5rem; border-radius: 1rem; font-size: 0.6875rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--line-2); color: var(--muted); }
.status.request { background: #FFE9EE; color: var(--red); }
.status.pending { background: var(--yellow); color: var(--navy); }
.status.confirmed { background: #DDF3EA; color: var(--green); }
.status.completed { background: var(--blue-lt); color: var(--blue); }
.src { display: inline-flex; align-items: center; gap: 0.25rem; }

/* ============ CHAT ============ */
#view-chat .view-head .hint { max-width: 40rem; }
.chat-wrap { display: grid; grid-template-columns: 20rem 1fr; gap: 1rem; height: calc(100vh - 14rem); height: calc(100dvh - 14rem); min-height: 26rem; }
.chat-list { overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; }
.chat-list .empty { padding: 2rem 1rem; }
.chat-item { position: relative; display: flex; flex-direction: column; gap: 0.25rem; padding: 0.875rem 1rem; border: 0; border-radius: var(--r); background: #fff; text-align: left; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s; }
.chat-item:hover { box-shadow: 0 0 0 1.5px var(--blue); }
.chat-item.on { box-shadow: 0 0 0 2px var(--navy); }
.chat-item.unread { background: #FFFDE6; }
.ci-top { display: flex; align-items: center; gap: 0.375rem; }
.ci-top b { font-weight: 800; color: var(--navy); }
.ci-top small { margin-left: auto; font-size: 0.75rem; color: var(--muted); }
.ci-last { font-size: 0.875rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item em { position: absolute; right: 0.875rem; bottom: 0.75rem; padding: 0 0.4375rem; border-radius: 1rem; background: var(--red); color: #fff; font-style: normal; font-size: 0.6875rem; font-weight: 800; line-height: 1.25rem; }
.dot { display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.chat-thread { display: flex; flex-direction: column; min-height: 0; background: #fff; border-radius: var(--r); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.chat-empty { margin: auto; padding: 2rem; text-align: center; color: var(--muted); }
.chat-empty b { display: block; font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; color: var(--navy); }
.ct-head { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.125rem; border-bottom: 1px solid var(--line); }
.ct-back { display: none; }
.ct-who { display: flex; flex-direction: column; min-width: 0; }
.ct-who b { font-family: var(--display); font-size: 1.375rem; text-transform: uppercase; color: var(--navy); line-height: 1.1; }
.ct-who span { display: flex; align-items: center; gap: 0.375rem; font-size: 0.8125rem; color: var(--muted); }
.ct-actions { margin-left: auto; display: flex; gap: 0.375rem; flex-wrap: wrap; justify-content: flex-end; }
.ct-meta { margin: 0; padding: 0.5rem 1.125rem; font-size: 0.8125rem; color: var(--muted); background: var(--line-2); }
.ct-msgs { flex: 1; overflow-y: auto; padding: 1.125rem; display: flex; flex-direction: column; gap: 0.625rem; background: #f8fafc; }
.bubble { max-width: 75%; }
.bubble p { margin: 0; padding: 0.625rem 0.875rem; border-radius: 1rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.bubble small { display: block; margin-top: 0.25rem; font-size: 0.6875rem; color: var(--muted); }
.bubble.visitor { align-self: flex-start; }
.bubble.visitor p { background: #fff; box-shadow: 0 0 0 1px var(--line); border-bottom-left-radius: 0.25rem; }
.bubble.owner { align-self: flex-end; text-align: right; }
.bubble.owner p { background: var(--navy); color: #fff; border-bottom-right-radius: 0.25rem; text-align: left; }
.ct-reply { display: flex; gap: 0.5rem; padding: 0.75rem; border-top: 1px solid var(--line); }
.ct-reply textarea { flex: 1; resize: none; min-height: 2.75rem; padding: 0.625rem 0.75rem; border: 1.5px solid var(--line); border-radius: 0.5rem; }
.ct-reply textarea:focus { outline: none; border-color: var(--blue); }

/* ============ SETTINGS ============ */
.settings { max-width: 54rem; }
.settings .view-head { position: sticky; top: 4.375rem; z-index: 6; padding: 0.75rem 0; margin: -0.75rem 0 0.5rem; background: var(--bg); }
.panel { margin-bottom: 1rem; padding: 1.375rem 1.5rem; border-radius: var(--r); background: #fff; box-shadow: 0 1px 3px rgba(4,29,53,.08), 0 0 0 1px var(--line); }
.panel h3 { font-size: 1.375rem; }
.hours { margin-top: 1rem; display: grid; gap: 0.5rem; }
.hour-row { display: grid; grid-template-columns: 10rem 1fr; align-items: start; gap: 0.75rem; padding: 0.5rem 0; border-top: 1px solid var(--line-2); }
.hour-row:first-child { border-top: 0; }
.hour-row .switch { margin-top: 0.5rem; font-family: var(--display); font-size: 1.125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ranges { display: flex; flex-direction: column; gap: 0.375rem; }
.range { display: flex; align-items: center; gap: 0.5rem; }
.range input { max-width: 8.5rem; }
.range .icon-btn { width: 2.125rem; height: 2.125rem; color: var(--muted); }
.closed-txt { margin-top: 0.625rem; color: var(--muted); font-weight: 600; }
.add-range { align-self: flex-start; margin-top: 0.125rem; font-size: 0.875rem; }
.overrides { margin-top: 0.75rem; display: grid; gap: 0.375rem; }
.ov { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.625rem 0.875rem; border-radius: 0.5rem; background: var(--line-2); font-weight: 600; }
.ov small { color: var(--muted); font-weight: 600; margin-left: 0.5rem; }
.ov-add { margin-top: 0.875rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.ov-add input[type=date] { width: auto; }
.ov-add select { width: auto; }
.ov-times { display: inline-flex; align-items: center; gap: 0.375rem; }
.ov-times input { width: 8rem; }
.dur-grid { margin-top: 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 0.75rem; align-items: end; }
.dur-grid .fld { margin: 0; }
.dur-grid .fld > span small { text-transform: none; letter-spacing: 0; font-weight: 600; }
.dur-in { position: relative; }
.dur-in input { padding-right: 3rem !important; }
.dur-in em { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 700; color: var(--muted); font-size: 0.8125rem; }
.formula { margin: 1rem 0 0; padding: 0.75rem 1rem; border-radius: 0.5rem; background: var(--blue-lt); color: var(--navy); font-size: 0.875rem; line-height: 1.55; }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0 1rem; }

/* ============ DRAWER ============ */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(4,29,53,.45); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(100%, 34rem); background: #fff; box-shadow: -1rem 0 3rem -1rem rgba(4,29,53,.4); animation: slideIn .35s var(--ease); }
@keyframes slideIn { from { transform: translateX(100%); } }
.drawer form { height: 100%; display: flex; flex-direction: column; }
.dr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.125rem 1.375rem 1rem; border-bottom: 1px solid var(--line); }
.dr-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.dr-head h2 { margin-top: 0.5rem; font-size: 1.875rem; }
.dr-body { flex: 1; overflow-y: auto; padding: 0 1.375rem 1.5rem; overscroll-behavior: contain; }
.dr-sec { padding: 1.125rem 0; border-bottom: 1px solid var(--line-2); }
.dr-sec:last-child { border-bottom: 0; }
.dr-sec h3 { font-size: 1.125rem; letter-spacing: .06em; color: var(--blue); }
.requested { margin: 0.625rem 0 0; padding: 0.5rem 0.75rem; border-radius: 0.5rem; background: #FFF8C2; font-size: 0.875rem; font-weight: 600; }
.purged-note { margin-top: 1rem; padding: 0.75rem; border-radius: 0.5rem; background: var(--line-2); color: var(--muted); font-weight: 600; font-size: 0.875rem; }
.dur { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.875rem; }
.dur-label { font-size: 0.75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--navy); border-radius: 0.5rem; overflow: hidden; }
.stepper button { width: 2.375rem; height: 2.375rem; border: 0; background: #fff; font-size: 1.25rem; font-weight: 700; color: var(--navy); }
.stepper button:hover { background: var(--yellow); }
.stepper output { min-width: 4.5rem; padding: 0 0.5rem; text-align: center; font-family: var(--display); font-weight: 800; font-size: 1.375rem; color: var(--navy); border-left: 1.5px solid var(--line); border-right: 1.5px solid var(--line); line-height: 2.375rem; }
.dur-formula { font-size: 0.8125rem; color: var(--muted); }
.dur.manual .stepper { border-color: var(--blue); }
.conflicts { margin-top: 0.875rem; padding: 0.75rem 0.875rem; border-radius: 0.5rem; background: #FFE9EE; color: #8a0f27; font-size: 0.875rem; line-height: 1.5; }
.conflicts b { display: block; }
.conflicts ul { margin: 0.25rem 0 0; padding-left: 1.125rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.875rem; }
.chip { padding: 0.4375rem 0.75rem; border: 1.5px solid var(--line); border-radius: 2rem; background: #fff; font-size: 0.8125rem; font-weight: 700; color: var(--text); }
.chip.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.loads { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.375rem; margin-top: 0.75rem; }
.loads button { padding: 0.5rem 0.25rem; border: 1.5px solid var(--line); border-radius: 0.5rem; background: #fff; font-family: var(--display); font-weight: 800; font-size: 1rem; text-transform: uppercase; color: var(--navy); line-height: 1.1; }
.loads button small { display: block; font-family: var(--sans); font-size: 0.6875rem; font-weight: 600; text-transform: none; color: var(--muted); }
.loads button.on { border-color: var(--navy); background: #FFFDE6; box-shadow: inset 0 0 0 1px var(--navy); }
.trailers { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.75rem; font-weight: 700; font-size: 0.875rem; }
.estimate { margin: 0.75rem 0 0; font-size: 0.875rem; color: var(--muted); }
.estimate b { font-family: var(--display); font-size: 1.375rem; color: var(--navy); margin-right: 0.25rem; }
.estimate:empty { display: none; }
.facts { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.25rem; font-size: 0.875rem; }
.facts:empty { display: none; }
.facts li { padding: 0.375rem 0.625rem; border-radius: 0.375rem; background: var(--line-2); }
.facts b { color: var(--muted); font-weight: 700; margin-right: 0.25rem; }
.quick { display: flex; gap: 0.375rem; flex-wrap: wrap; margin-top: 0.75rem; }
.quick:empty { display: none; }
.quick a { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.4375rem 0.75rem; border-radius: 0.5rem; background: var(--line-2); color: var(--navy); font-weight: 700; font-size: 0.8125rem; text-decoration: none; }
.quick a:hover { background: var(--yellow); }
.quick .ico { width: 1rem; height: 1rem; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: 0.75rem; }
.photos a { display: block; aspect-ratio: 1; border-radius: 0.5rem; overflow: hidden; background: var(--line-2); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dr-foot { padding: 0.875rem 1.375rem calc(0.875rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.dr-foot .form-err { margin-bottom: 0.625rem; }
.dr-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dr-actions .grow { flex: 1; }

/* ============ MODAL / POP / TOAST ============ */
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 1rem; background: rgba(4,29,53,.5); animation: fade .2s; }
.modal-card { width: min(100%, 28rem); padding: 1.5rem; border-radius: 0.875rem; background: #fff; box-shadow: var(--shadow); }
.modal-card h2 { font-size: 1.75rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }
.modal-card .form-err { margin-top: 0.75rem; }
.pop { position: fixed; z-index: 45; display: flex; flex-direction: column; padding: 0.375rem; border-radius: 0.625rem; background: #fff; box-shadow: var(--shadow), 0 0 0 1px var(--line); animation: fade .15s; }
.pop button { padding: 0.625rem 0.875rem; border: 0; border-radius: 0.375rem; background: none; text-align: left; font-weight: 700; }
.pop button:hover { background: var(--line-2); }
.toast { position: fixed; left: 50%; bottom: 1.5rem; z-index: 90; transform: translateX(-50%); padding: 0.75rem 1.125rem; border-radius: 0.625rem; background: var(--navy); color: #fff; font-weight: 600; box-shadow: var(--shadow); animation: toastIn .3s var(--ease); max-width: calc(100% - 2rem); }
@keyframes toastIn { from { transform: translate(-50%, 1rem); opacity: 0; } }

/* ============ MOBILE ============ */
@media (max-width: 52rem) {
  :root { --hour: 4.5rem; }
  .app { display: block; padding-bottom: calc(4rem + env(safe-area-inset-bottom)); }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 30; height: auto; flex-direction: row; padding: 0 0.5rem env(safe-area-inset-bottom); }
  .side-logo, .side-out { display: none; }
  .tabs { flex: 1; flex-direction: row; justify-content: space-around; gap: 0; }
  .tab { flex: 1; flex-direction: column; gap: 0.1875rem; padding: 0.625rem 0.25rem 0.5rem; font-size: 0.875rem; text-align: center; border-radius: 0; }
  .tab.on { background: none; }
  .tab.on::before { left: 25%; right: 25%; top: 0; bottom: auto; width: auto; height: 0.1875rem; border-radius: 0 0 0.25rem 0.25rem; }
  .tab .badge { position: absolute; top: 0.375rem; left: calc(50% + 0.375rem); margin: 0; min-width: 1.125rem; line-height: 1.125rem; font-size: 0.625rem; }
  .top { flex-wrap: wrap; padding: 0.625rem 1rem; background: var(--navy); border-bottom: 0; }
  .top-logo { display: block; width: 6.25rem; margin-right: auto; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .search input { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
  .search input::placeholder { color: rgba(255,255,255,.6); }
  .search .ico { color: rgba(255,255,255,.7); }
  .top .btn { min-height: 2.375rem; padding: 0 0.75rem; }
  .top .btn span { display: none; }
  .top .btn-ghost { background: rgba(255,255,255,.1); color: #fff; box-shadow: none; }
  .view { padding: 1rem 1rem 2rem; }
  .cal-bar { margin-bottom: 0.75rem; }
  .cal-nav h2 { font-size: 1.375rem; margin-left: 0.25rem; }
  .legend { display: none; }
  .day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.25rem; margin-bottom: 0.75rem; }
  .day-strip button { padding: 0.375rem 0 0.4375rem; border: 0; border-radius: 0.625rem; background: #fff; box-shadow: 0 0 0 1px var(--line); color: var(--navy); position: relative; }
  .day-strip button small { display: block; font-size: 0.6875rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
  .day-strip button b { font-family: var(--display); font-size: 1.375rem; line-height: 1.1; }
  .day-strip button.on { background: var(--navy); color: #fff; box-shadow: none; }
  .day-strip button.on small { color: rgba(255,255,255,.7); }
  .day-strip button.today:not(.on) b { color: var(--red); }
  .day-strip button i { position: absolute; bottom: 0.1875rem; left: 50%; transform: translateX(-50%); width: 0.3125rem; height: 0.3125rem; border-radius: 50%; background: var(--blue); }
  .day-strip button.on i { background: var(--yellow); }
  .cal-head { display: none; }
  .cal { grid-template-columns: 3.25rem 1fr; }
  .ev { font-size: 0.8125rem; }
  .ev b { font-size: 0.9375rem; }
  .cards { grid-template-columns: 1fr; }
  .view-head h2 { font-size: 1.875rem; }
  .settings .view-head { top: 6.75rem; }
  .panel { padding: 1.125rem 1rem; }
  .hour-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .drawer { width: 100%; top: 0; border-radius: 0; animation-name: sheetIn; }
  @keyframes sheetIn { from { transform: translateY(100%); } }
  .dr-head { padding: 0.875rem 1rem; }
  .dr-body { padding: 0 1rem 1.25rem; }
  .dr-foot { padding-left: 1rem; padding-right: 1rem; }
  .loads { grid-template-columns: repeat(3, 1fr); }
  .row3 { grid-template-columns: 1fr 1fr; }
  .row3 .fld:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  .dr-actions .btn { flex: 1 1 auto; }
  .chat-wrap { grid-template-columns: 1fr; height: calc(100dvh - 15rem); }
  .chat-wrap .chat-thread { display: none; }
  .chat-wrap.open .chat-list { display: none; }
  .chat-wrap.open .chat-thread { display: flex; }
  .ct-back { display: grid; margin-left: -0.5rem; }
  .ct-head { flex-wrap: wrap; padding: 0.625rem 0.75rem; }
  .ct-actions { width: 100%; justify-content: flex-start; }
  .bubble { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
