/* Girderly application, wide screens first. The phone app layout is in mobile.css. */
.app-body { --bar: 40px; }
.app-body .demo-bar { position: sticky; top: 0; z-index: 15; height: var(--bar); flex-wrap: nowrap; white-space: nowrap; }
.xc { --xc-bar: #8a6a00; --xc-bar-hi: #6b5200; --xc-b2: #b9b4a2; --xc-b2-hi: #8d887a; --xc-grid: #e8e6df; --xc-base: #b0ac9e; --xc-ink: #211f1a; --xc-ink2: #57534a; --xc-hover: rgba(138, 106, 0, .07); --xc-tip: #2a2620; }
/* Budget in grey first, cost in mustard second */
.xc-v .xc-legend i.s0, .xc-v .xc-colbar.s0 { background: #b9b4a2; }
.xc-v .xc-legend i.s1, .xc-v .xc-colbar.s1 { background: #8a6a00; }

/* Header: brand, project switcher, person, then the sections */
.top { position: sticky; top: var(--bar); z-index: 12; background: var(--navy); color: #f1efe8; }
.top-row { display: flex; align-items: center; gap: 22px; min-height: 64px; padding: 8px 28px; }
.top .brand { color: #fff; }
.switcher, .user { position: relative; }
.switcher-btn, .user-btn { display: flex; align-items: center; gap: 11px; min-height: 46px; border-radius: var(--radius); cursor: pointer; text-align: left; line-height: 1.25; }
.switcher-btn { min-width: 270px; padding: 4px 12px; border: 1px solid #5b5547; background: #38332b; color: #fff; }
.switcher-btn:hover { border-color: #e0c45c; }
.switcher-btn > .icon:first-child { color: #e9cf6a; }
.switcher-btn > .icon:last-child { margin-left: auto; }
.switcher-btn span, .user-btn > span:not(.avatar) { display: grid; }
.switcher-btn b { font: 600 17px/1.25 var(--head); }
.switcher-btn small, .user-btn small { font-size: 12.5px; color: #c9c5b8; }
.org { margin-left: auto; color: #c9c5b8; font-size: 14px; }
.user-btn { padding: 4px 8px; border: 0; background: none; color: #fff; }
.user-btn:hover { background: #38332b; }
.user-btn b { font-size: 14.5px; }
.avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-tint); color: #4a3900; font-size: 13.5px; font-weight: 700; }
.popover { position: absolute; z-index: 20; top: calc(100% + 6px); padding: 6px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: 0 18px 36px -14px rgba(33, 31, 26, .45); }
.pop-project { left: 0; width: 330px; max-height: 70vh; overflow-y: auto; }
.pop-user { right: 0; width: 220px; }
.popover ul { display: grid; gap: 4px; }
.popover button, .sheet-list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 6px 10px; border: 0; border-radius: var(--radius); background: none; text-align: left; cursor: pointer; }
.popover button span, .sheet-list button span { display: grid; flex: 1; line-height: 1.3; }
.popover small, .sheet-list small { color: var(--ink-2); font-size: 13px; }
.popover button:hover, .sheet-list button:hover { background: var(--soft); }
.popover button.is-on, .sheet-list button.is-on { background: var(--accent-tint); }
.topnav { padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.topnav ul { display: flex; flex-wrap: wrap; column-gap: 8px; }
.topnav a { display: flex; align-items: center; gap: 7px; min-height: 46px; padding: 3px 9px 0; border-bottom: 3px solid transparent; color: var(--ink-2); font-size: 14.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.topnav a:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.topnav a.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.topnav a.is-active .icon { color: var(--accent); }
.topnav .icon { width: 16px; height: 16px; }
@media (max-width: 1260px) { .topnav .icon { display: none; } }
@media (max-width: 960px) { .org { display: none; } .user { margin-left: auto; } .user-btn > span:not(.avatar) { display: none; } .switcher-btn { min-width: 0; } .top-row { gap: 14px; padding-inline: 18px; } .topnav { padding-inline: 10px; } .topnav a { min-height: 40px; } }

.content { width: 100%; max-width: 1400px; margin: 0 auto; padding: 22px 28px 56px; }
.content > * + *, .stack > * + *, #results > * + * { margin-top: 16px; }
h1 { font: 700 29px/1.2 var(--head); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; }
.page-head p { margin-top: 3px; color: var(--ink-2); }
.page-actions, .actionbar { display: flex; flex-wrap: wrap; gap: 8px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; font-size: 14px; font-weight: 600; text-decoration: none; }
.back .icon { width: 15px; height: 15px; }
.content > .back + .record-head { margin-top: 4px; }
.record-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; }
.record-head > div:first-child { min-width: 0; }
.record-head p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; color: var(--ink-2); }

.card { min-width: 0; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card-flush { padding: 0; }
.card-flush > .card-head { padding: 14px 16px 10px; margin: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card h2, .section-h { font: 700 19px/1.25 var(--head); }
.card-head > a { font-size: 14px; font-weight: 600; white-space: nowrap; }
.card h3 { margin: 16px 0 6px; font-size: 14.5px; }
.section-h { margin-bottom: 8px; }
.section-h span { color: var(--ink-2); font: 400 15px var(--font); }
.cols { display: grid; gap: 16px; align-items: start; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); }
.cols-reports { align-items: stretch; }
@media (max-width: 1180px) { .cols-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .cols-2 { grid-template-columns: minmax(0, 1fr); } }
.muted { color: var(--ink-2); }
.pad { padding: 4px 16px 16px; }
.hint { margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.prose { max-width: 68ch; white-space: pre-line; overflow-wrap: anywhere; }
.late { color: var(--danger); font-weight: 700; }

/* Figures in one ruled strip */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { display: grid; align-content: start; gap: 2px; padding: 13px 18px 14px; background: var(--surface); color: var(--ink); text-decoration: none; }
a.stat:hover { background: #fbf8ea; }
.stat > span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.stat strong { font: 700 28px/1.2 var(--head); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat small { font-size: 13px; color: var(--ink-2); }
.stat-bad strong { color: var(--danger); }
@media (max-width: 1050px) { .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12.5px; font-weight: 700; line-height: 1.45; white-space: nowrap; }
.tone-ok { background: var(--ok-tint); color: var(--ok); }
.tone-warn { background: var(--warn-tint); color: var(--warn); }
.tone-danger { background: var(--danger-tint); color: var(--danger); }
.tone-info { background: var(--info-tint); color: var(--info); }
.tone-wait { background: var(--wait-tint); color: var(--wait); }
.tone-plain { background: var(--soft); color: var(--ink-2); }
.metered { display: flex; align-items: center; gap: 9px; min-width: 0; }
.metered b { font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter { position: relative; flex: 1; min-width: 40px; height: 8px; overflow: hidden; border-radius: 3px; background: var(--soft); }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.meter.is-money i { background: #6f6a5b; }
.meter.is-bad i { background: var(--danger); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font-size: 13px; font-weight: 700; color: var(--ink-2); background: #faf9f6; white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tfoot th, tfoot td { border-top: 2px solid var(--line-2); border-bottom: 0; font-weight: 700; }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover { background: #fbf8ea; }
td .sub { display: block; font-size: 13px; color: var(--ink-2); font-weight: 400; }
td .sub.late { color: var(--danger); font-weight: 700; }
td a { text-decoration: none; color: var(--ink); }
td a:hover { text-decoration: underline; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wrap { min-width: 190px; }
.w-meter { width: 150px; min-width: 120px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 46ch; }
.plain th, .plain td { padding: 8px 6px; }
.plain thead th { background: none; }
.plain a { color: var(--accent-dark); }
.card > .plain { margin: 0; }
.sheet td, .sheet th { white-space: nowrap; padding-block: 8px; }
.list-count { color: var(--ink-2); font-size: 14px; }
.list-count + * { margin-top: 8px !important; }

.facts > div { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.facts dt { color: var(--ink-2); font-size: 14px; }
.facts dd { font-weight: 600; overflow-wrap: anywhere; }
.prose + .facts { margin-top: 14px; border-top: 1px solid var(--line); }
.progressline { margin-bottom: 8px; }
.progressline .meter { height: 12px; }

.queue > li + li { border-top: 1px solid var(--line); }
.queue a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; color: var(--ink); text-decoration: none; }
.queue a:hover { background: #fbf8ea; }
.q-ico { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: var(--radius); }
.q-text { display: grid; flex: 1; min-width: 0; line-height: 1.35; }
.q-text strong { font-size: 14.5px; font-weight: 700; }
.q-text span { font-size: 13px; color: var(--ink-2); }
.queue a > .icon:last-child { color: var(--ink-2); }
.card-flush > .queue { border-top: 1px solid var(--line); }

.work > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.work a { display: grid; flex: 1; min-width: 0; color: var(--ink); text-decoration: none; line-height: 1.35; }
.work a span { font-size: 13px; color: var(--ink-2); }
.work-update > li .metered { flex: 0 0 140px; }
.site .card-head { align-items: flex-start; }
.site .card-head p { color: var(--ink-2); font-size: 14px; }
.site h2 a { color: var(--ink); text-decoration: none; }
.logline { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 700; }
.logline > span:first-of-type { flex: 1; }
.logline.is-missing { background: var(--wait-tint); border-color: #e2cc74; }
.sitefoot { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.sitefoot a { display: inline-flex; align-items: center; min-height: 28px; }

.jump { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.jump a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.jump a:hover { border-color: var(--accent); }
.jump .icon { color: var(--accent); }
.jump span { display: grid; line-height: 1.3; }
.jump small { color: var(--ink-2); font-size: 13px; }

.history li { display: grid; padding: 9px 0; border-top: 1px solid var(--line); }
.history li:first-child { border-top: 0; padding-top: 0; }
.history small { color: var(--ink-2); }
.bookings > li { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.bookings > li:first-child { border-top: 0; padding-top: 0; }
.bookings > li > div { display: grid; }
.bookings span:not(.badge) { color: var(--ink-2); font-size: 14px; }
.rowacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.steps { display: flex; flex-wrap: wrap; gap: 8px 6px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.steps li { display: flex; align-items: center; gap: 8px; flex: 1; font-size: 14px; color: var(--ink-2); }
.steps li + li::before { content: ""; flex: 1; height: 2px; min-width: 14px; margin-right: 6px; background: var(--line-2); }
.steps i { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border: 2px solid var(--line-2); border-radius: 50%; font-style: normal; font-size: 13px; font-weight: 700; }
.steps .is-done i { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps .is-done i .icon { width: 14px; height: 14px; }
.steps .is-done, .steps .is-now { color: var(--ink); font-weight: 700; }
.steps .is-now i { border-color: var(--accent); }
.callout { display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--radius); background: var(--warn-tint); color: #5c2400; }
.callout > .icon { margin-top: 2px; }
.callout-info { background: var(--info-tint); color: #123a59; }

/* Filters */
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.searchfield { display: flex; align-items: center; gap: 9px; flex: 1 1 240px; max-width: 360px; min-height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink-2); }
.searchfield:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-tint); }
.searchfield input { flex: 1; min-width: 0; height: 38px; border: 0; background: none; color: var(--ink); outline: none; }
.filter select { min-height: 40px; max-width: 100%; padding: 0 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); }
.filter-selects { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-end { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.tabs { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; flex: none; min-height: 36px; padding: 0 13px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tab.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pill { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--soft); color: var(--ink); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
.segmented { display: inline-flex; padding: 3px; gap: 3px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); }
.segmented button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 4px; background: none; font-size: 14px; font-weight: 600; cursor: pointer; }
.segmented .is-on { background: var(--surface); box-shadow: 0 1px 3px rgba(33, 31, 26, .2); }

/* Timeline */
.gantt { --lab: 290px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.card .gantt { --lab: 240px; border-radius: var(--radius); }
@media (max-width: 1050px) { .gantt, .card .gantt { --lab: 200px; } }
.g-scroll { overflow-x: auto; overflow-y: hidden; cursor: grab; }
.g-scroll.is-panning { cursor: grabbing; user-select: none; }
.g-inner { position: relative; width: calc(var(--lab) + var(--tw)); min-width: 100%; }
.g-row { display: grid; grid-template-columns: var(--lab) var(--tw); height: 42px; }
.g-lab { position: sticky; left: 0; z-index: 4; display: grid; align-content: center; min-width: 0; padding: 0 12px; background: var(--surface); border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--soft); line-height: 1.22; }
.g-lab :is(a, span) { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px; font-weight: 700; color: var(--ink); text-decoration: none; }
.g-lab a:hover { text-decoration: underline; }
.g-lab small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; color: var(--ink-2); }
.g-track { position: relative; min-width: 0; border-bottom: 1px solid var(--soft); }
.g-body { position: relative; }
.g-body .g-track { background: repeating-linear-gradient(90deg, #eceae3 0 1px, transparent 1px calc(var(--dw) * 7)) var(--off) 0; }
.zoom-d .g-body .g-track { background: linear-gradient(90deg, transparent calc(100% * 5 / 7), #f4f2ec calc(100% * 5 / 7)) var(--off) 0 / calc(var(--dw) * 7) 100%; }
.g-top { height: 48px; }
.g-top .g-lab { font-size: 13px; font-weight: 700; color: var(--ink-2); background: #faf9f6; border-bottom-color: var(--line-2); }
.g-top .g-track { background: #faf9f6; border-bottom: 1px solid var(--line-2); }
.g-months, .g-ticks { position: relative; height: 23px; }
.g-months b { position: absolute; top: 0; bottom: 0; overflow: hidden; padding: 4px 0 0 6px; border-left: 1px solid var(--line-2); font-size: 12.5px; white-space: nowrap; }
.g-ticks b { position: absolute; top: 3px; padding-left: 4px; border-left: 1px solid var(--line); font-size: 12px; font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.zoom-d .g-ticks b { padding: 0; border: 0; text-align: center; }
.g-ticks b.is-off { color: #7d796d; background: #efede6; }
.g-todaytag { position: absolute; z-index: 2; top: 2px; transform: translateX(-50%); padding: 0 7px; border-radius: 4px; background: #a52020; color: #fff; font-size: 12px; font-weight: 700; line-height: 19px; }
.g-group { height: 34px; }
.g-group .g-lab, .g-group .g-track { background-color: #f1efe8; border-bottom-color: var(--line); }
.g-group .g-lab :is(span, button) { font: 700 15px var(--head); }
.g-group button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.g-group button .icon { width: 15px; height: 15px; }
.g-today { position: absolute; z-index: 1; top: 0; bottom: 0; left: calc(var(--lab) + var(--x)); width: 2px; margin-left: -1px; background: #a52020; opacity: .75; }
.g-links { position: absolute; z-index: 1; left: var(--lab); top: 0; pointer-events: none; }
.g-links path { fill: none; stroke: #9a9688; stroke-width: 1.2; }
.g-links .g-head { fill: #9a9688; stroke: none; }
.g-bar { position: absolute; z-index: 2; top: 11px; height: 19px; overflow: hidden; border: 1px solid #a8a28d; border-radius: 3px; background: #e9e6da; }
.g-bar:hover, .g-bar:focus-visible { filter: brightness(.93); }
.g-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.g-slip { position: absolute; top: 0; bottom: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(165, 32, 32, .9) 0 3px, rgba(255, 255, 255, .55) 3px 6px); }
.g-bar.is-late { border: 2px solid var(--danger); }
.g-bar.is-summary { background: #d8d4c6; border-color: #7d776a; }
.g-bar.is-summary .g-fill { background: #4d473a; }
.g-bar.is-booked { background: #5d5647; border-color: #5d5647; color: #fff; }
.g-bar.is-request { background: var(--accent-tint); border: 1px dashed var(--accent); color: #3b2e00; }
.g-bar.is-booked.is-focus { background: var(--accent); border-color: var(--accent); }
.g-bar .g-fill:empty:is([style="width:0%"]) { display: none; }
.g-in { position: relative; display: block; overflow: hidden; padding: 0 6px; font-size: 12px; font-weight: 700; line-height: 17px; white-space: nowrap; text-overflow: ellipsis; }
.g-plan { position: absolute; z-index: 1; top: 32px; height: 4px; border-radius: 2px; background: #8d887a; }
.g-over { position: absolute; z-index: 1; top: 20px; height: 0; border-top: 2px dashed var(--danger); }
.g-stone, .g-planstone { position: absolute; z-index: 2; top: 13px; width: 15px; height: 15px; margin-left: -7.5px; transform: rotate(45deg); border-radius: 2px; background: var(--ink); }
.g-stone.is-done { background: var(--accent); }
.g-stone.is-late { background: var(--danger); }
.g-planstone { z-index: 1; background: none; border: 2px solid #8d887a; }
.g-text { position: absolute; z-index: 2; top: 12px; font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.g-text.is-late { color: var(--danger); }
.g-tipbox { position: fixed; z-index: 40; max-width: 330px; padding: 7px 11px; border-radius: var(--radius); background: var(--navy); color: #fff; font-size: 13px; line-height: 1.4; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .55); pointer-events: none; }
.g-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); }
#results > .gantt + .g-legend { margin-top: 10px; }
.g-legend li { display: flex; align-items: center; gap: 7px; }
.g-legend i { width: 22px; height: 11px; border-radius: 2px; }
.g-legend .k-done { background: var(--accent); }
.g-legend .k-open { background: #e9e6da; border: 1px solid #a8a28d; }
.g-legend .k-slip { background: repeating-linear-gradient(135deg, rgba(165, 32, 32, .9) 0 3px, #fff 3px 6px); }
.g-legend .k-plan { height: 4px; background: #8d887a; }
.g-legend .k-late { height: 0; border-top: 2px dashed var(--danger); }
.g-legend .k-today { width: 2px; height: 14px; background: #a52020; }
.g-legend .k-booked { background: #5d5647; }
.g-legend .k-request { background: var(--accent-tint); border: 1px dashed var(--accent); }

.empty { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius-lg); }
.empty h3 { font: 700 19px var(--head); }
.empty p { color: var(--ink-2); }
.locked, .notfound { display: grid; justify-items: center; gap: 10px; max-width: 460px; margin: 60px auto; padding: 32px 24px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.locked > .icon { width: 30px; height: 30px; color: var(--accent); }

/* Popups and forms */
dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 70px -20px rgba(20, 18, 14, .55); overflow: hidden; }
dialog::backdrop { background: rgba(33, 29, 20, .5); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 700 21px var(--head); }
.icon-btn { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.icon-btn:hover { background: var(--bg); }
.modal-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 12px 14px; flex: 1 1 auto; min-height: 0; padding: 16px 18px 20px; overflow-y: auto; }
.wide, .form-error { grid-column: 1 / -1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: #faf9f6; }
.modal-note { color: var(--ink-2); }
.modal-note b { color: var(--ink); }
.field { display: grid; align-content: start; gap: 4px; min-width: 0; font-size: 14px; font-weight: 700; }
.field em, .crews legend em { font-style: normal; font-weight: 400; color: var(--ink-2); font-size: 12.5px; }
.field :is(input, select, textarea), .crewrow :is(input, select) { width: 100%; min-width: 0; min-height: 40px; padding: 7px 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); font-size: 15px; font-weight: 400; }
.field textarea { resize: vertical; }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 1px var(--danger); }
.error { color: var(--danger); font-size: 13px; font-weight: 600; }
.error:empty { display: none; }
.form-error { padding: 10px 12px; border-radius: var(--radius); background: var(--danger-tint); color: var(--danger); font-weight: 600; }
.preview-box { padding: 10px 12px; border-radius: var(--radius); background: var(--soft); font-size: 14px; }
.preview-box ul { margin: 4px 0; padding-left: 18px; list-style: disc; }
.preview-box.is-bad { background: var(--danger-tint); color: #701212; font-weight: 600; }
.preview-box.is-good { background: var(--ok-tint); color: #184521; font-weight: 600; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.crews legend { font-size: 14px; font-weight: 700; }
.crews .hint { margin: 0 0 8px; font-size: 13px; }
.crewrow { display: grid; grid-template-columns: minmax(0, 1fr) 78px 78px 40px; align-items: end; gap: 8px; margin-bottom: 8px; }
.crewrow label { display: grid; gap: 2px; min-width: 0; font-size: 12.5px; color: var(--ink-2); }
.sheet-list { display: grid; gap: 4px; }
.sheet-list button { min-height: 54px; border: 1px solid var(--line); }
@media (max-width: 520px) { .modal-body { grid-template-columns: minmax(0, 1fr); } }

.toasts { position: fixed; z-index: 30; right: 20px; bottom: 20px; display: grid; gap: 8px; max-width: 380px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--navy); color: #fff; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .5); animation: rise .2s ease-out; }
.toast .icon { color: #9fe0a8; }
.toast-warn .icon { color: #ffc490; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* Role screen */
.signin { max-width: 1040px; margin: 0 auto; padding: 56px 24px; text-align: center; }
.signin .brand { justify-content: center; }
.signin h1 { margin-top: 28px; font-size: 32px; }
.signin-sub { margin-top: 6px; color: var(--ink-2); }
.signin .roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 30px; text-align: left; }
.role { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 22px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); cursor: pointer; text-align: left; }
.role:hover { border-color: var(--accent); box-shadow: 0 16px 30px -20px rgba(80, 60, 0, .6); }
.role-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: var(--radius); background: var(--accent-tint); color: #4a3900; }
.role-icon .icon { width: 24px; height: 24px; }
.role-title { margin-top: 8px; font: 700 21px var(--head); }
.role-name { font-weight: 700; color: var(--accent-dark); }
.role-short { display: none; }
.role-points { display: grid; gap: 7px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.role-points span { display: flex; gap: 8px; }
.role-points .icon { width: 15px; height: 15px; margin-top: 3px; color: var(--accent); }
@media (max-width: 900px) and (min-width: 761px) { .signin .roles { grid-template-columns: minmax(0, 1fr); } }
.noscript { padding: 40px; text-align: center; }
/* Loading placeholder shown while a screen opens */
.page-skel { display: grid; grid-column: 1 / -1; align-content: start; gap: 14px; width: 100%; min-width: 0; padding: 2px; }
.page-skel i { display: block; height: 96px; border-radius: var(--radius-lg, 8px); background: linear-gradient(90deg, rgba(100, 112, 128, .13) 25%, rgba(100, 112, 128, .05) 50%, rgba(100, 112, 128, .13) 75%); background-size: 200% 100%; animation: skel-shimmer 1s linear infinite; }
.page-skel .sk-title { width: min(280px, 70%); height: 30px; }
.page-skel .sk-line { width: min(420px, 90%); height: 14px; }
.page-skel > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.page-skel .sk-block { height: 280px; }
@keyframes skel-shimmer { to { background-position: -200% 0; } }
@media (max-width: 760px) { .page-skel > div { grid-template-columns: minmax(0, 1fr); } .page-skel > div i { height: 68px; } }
.page-in > * { animation: page-in .3s ease-out both; }
@keyframes page-in { from { opacity: 0; } }
.page-skel.is-flush { box-sizing: border-box; padding: 22px 24px; }
.sched > * + * { margin-top: 14px; }
.textbtn { padding: 0; border: 0; background: none; color: var(--accent-dark); font-weight: 700; text-decoration: underline; cursor: pointer; }
