:root {
    color: #172738;
    background: #f2f5fa;
    font: 16px/1.35 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.shell {
    width: min(100%, 480px);
    min-height: 100dvh;
    margin: 0 auto;
    background: #f2f5fa;
    display: flex;
    flex-direction: column;
}
.shell main { flex: 1; overflow: auto; padding: 14px 16px 18px; }
.home-bar, .screen-title, .schedule-bar, .action-bar { flex: none; }
.home-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #fff;
}
.logo { height: 64px; width: auto; max-width: calc(100% - 58px); object-fit: contain; }
.screen-title, .schedule-bar { background: #152538; color: #fff; }
.screen-title { padding: 16px 20px; }
.screen-title h1, .login-copy h1, .preview h2, .card h2 { margin: 0; }
.screen-title h1 { font-size: 24px; font-weight: 650; letter-spacing: 0; }
.login-copy { padding-top: 8px; }
.login-copy .logo { display: block; height: 64px; max-width: 240px; margin: 0 auto 24px; }
.login-copy p, .muted, .meta, .preview p, .card .sub { color: #55677c; }
.notice, .form-error {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #dce4ee;
}
.notice { border-left: 4px solid #2458d6; }
.form-error { color: #9b3030; border-left: 4px solid #9b3030; }
.profile { position: relative; margin-left: auto; }
.profile-button {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    background: #e8eef7;
    color: #152538;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.profile-button::-webkit-details-marker { display: none; }
.profile-photo { width: 46px; height: 46px; object-fit: cover; }
.profile-menu {
    position: absolute;
    z-index: 5;
    top: 54px;
    right: 0;
    width: 230px;
    padding: 12px;
    background: #fff;
    border: 1px solid #dce4ee;
    border-radius: 12px;
    box-shadow: 0 10px 28px #15253824;
}
.profile-menu p { margin: 0 0 8px; }
.profile-menu span, .profile-note { color: #55677c; font-size: 13px; font-weight: 500; }
.profile-file { display: block; margin: 8px 0; font-weight: 650; }
.profile-file input { display: block; width: 100%; margin-top: 6px; }
.home-primary, .tile-row { display: grid; gap: 8px; margin-bottom: 8px; }
.home-primary { margin-bottom: 15px; }
.tile-row { grid-template-columns: 1fr 1fr; }
.tile {
    display: flex;
    text-decoration: none;
    background: #e8eef7;
    border-radius: 14px;
    color: #172738;
}
.tile.wide { align-items: center; padding: 9px 12px; }
.tile.narrow { flex-direction: column; align-items: flex-start; min-height: 92px; padding: 11px 12px; }
.tile-icon {
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 9px;
    background: rgb(255 255 255 / 40%);
}
.tile.narrow .tile-icon { margin-bottom: 7px; }
.tile.wide .tile-label { margin-left: 11px; }
.tile-label { font-size: 17px; font-weight: 650; }
.chevron { margin-left: auto; color: var(--fg); font-size: 25px; line-height: 1; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.orders { --fg: #673b45; background: #eadcdd; }
.intake { --fg: #324a89; background: #dfe5fc; }
.schedule { --fg: #354f67; background: #dfe5ec; }
.chat { --fg: #675015; background: #f4e8bc; }
.offers { --fg: #394d8c; background: #e0e4fa; }
.notices { --fg: #3e5286; background: #e5e9fb; }
.equipment { --fg: #455574; background: #e3e6f1; }
.trips { --fg: #3f5356; background: #e5e8e8; }
.attendance { --fg: #5b4c5b; background: #e8e4e6; }
.tile-icon, .chevron { color: var(--fg); }
.metrics, .tabs, .action-bar, .split, .when { display: flex; gap: 8px; }
.split > .btn, .split form { flex: 1; }
.split form .btn { width: 100%; }
.metrics { margin-bottom: 13px; }
.metric, .card, .preview, .worker, .panel {
    background: #fff;
    border: 1px solid #dce4ee;
    border-radius: 12px;
}
.metric { flex: 1; padding: 10px; }
.metric strong { display: block; font-size: 22px; }
.metric span { color: #55677c; font-size: 12px; font-weight: 700; }
.metric.planned strong { color: #2458d6; }
.metric.active strong { color: #855011; }
.metric.done strong { color: #17614e; }
.tabs { margin-bottom: 8px; }
.tabs .btn, .modes .btn { flex: 1; }
.projects-link { width: 100%; margin-bottom: 15px; }
.card, .preview { border-radius: 16px; padding: 12px 14px; margin-bottom: 11px; }
.card-top, .assignment { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-top span, .meta { color: #55677c; font-size: 14px; font-weight: 650; }
.card h2 { margin: 8px 0 4px; font-size: 20px; }
.card p, .preview p { margin: 4px 0; white-space: pre-line; }
.assignment {
    justify-content: flex-start;
    margin: 9px 0 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f2f5fa;
    font-weight: 650;
}
.done-line { color: #17614e; font-weight: 700; }
.badge {
    display: inline-block;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .04em;
    white-space: nowrap;
}
.badge.planned, .chip.planned { color: #2458d6; background: #e8efff; }
.badge.active, .chip.active { color: #855011; background: #ffefcf; }
.badge.done, .chip.done { color: #17614e; background: #dff4ea; }
.preview .badge { margin-top: 9px; }
.preview h2 { font-size: 18px; }
.worker { margin: 0 0 8px; padding: 13px 14px; border-radius: 12px; font-size: 17px; font-weight: 650; }
.btn, button.btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #2458d6;
    color: #fff;
    font-size: 15px;
    font-weight: 650;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.btn.light { background: #fff; color: #172738; border-color: #dce4ee; }
.btn.navy, .modes .btn.navy { background: #152538; color: #fff; }
.btn.soft { background: #e8efff; color: #2458d6; }
.btn.mint { background: #dff4ea; color: #17614e; }
.btn.quiet { background: #f2f5fa; color: #55677c; }
.btn.grow, .action-bar .grow { flex: 1; }
.action-bar { padding: 10px 16px; background: #fff; }
.action-bar.stack { flex-direction: column; align-items: stretch; }
.login-copy form .btn, .profile-menu .btn, .action-bar.stack > .btn { width: 100%; }
.action-bar form { display: contents; }
.field { display: block; margin: 0 0 12px; font-size: 13px; font-weight: 700; }
.field input, .field textarea, .check-list {
    width: 100%;
    margin-top: 5px;
    border: 1px solid #dce4ee;
    border-radius: 10px;
    background: #fff;
}
.field input, .field textarea {
    min-height: 48px;
    padding: 9px 12px;
    font-size: 16px;
    font-weight: 450;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:disabled { color: #55677c; }
.when { margin: -7px 0 12px; }
.when .btn { flex: 1; }
.check-list { max-height: 220px; overflow: auto; padding: 8px 12px; }
.check-list label { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: 15px; font-weight: 550; }
.check-list input { width: auto; min-height: 0; }
.screen-form { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.screen-form main { flex: 1; }
.schedule-bar { display: flex; align-items: center; min-height: 46px; }
.schedule-bar a, .schedule-bar button {
    width: 37px;
    height: 46px;
    display: grid;
    place-items: center;
    color: #fff;
    background: transparent;
    border: 0;
    text-decoration: none;
    font-weight: 700;
}
.schedule-bar .today { width: 55px; font-size: 13px; }
.schedule-bar .spin { width: 46px; font-size: 20px; }
.date-jump { flex: 1; min-width: 0; padding: 4px 0; }
.date-jump strong { display: block; font-size: 19px; }
.date-jump label { position: relative; display: block; color: #c9d8e9; font-size: 12px; }
.date-jump input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    cursor: pointer;
}
.schedule-scroll { height: 100%; overflow: auto; }
.shell.board-schedule main { padding: 0; overflow: hidden; }
table.grid { border-collapse: separate; border-spacing: 0; min-width: 100%; }
table.grid th, table.grid td { border: 1px solid #dce4ee; vertical-align: top; }
table.grid th { position: sticky; top: 0; z-index: 2; color: #172738; font-size: 12px; }
table.grid .asset, table.grid .asset-cell {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 79px;
    min-width: 79px;
    background: #e9eef4;
    text-align: left;
}
table.grid thead .asset { z-index: 4; background: #ffa522; }
table.grid th.day { background: #ffa522; white-space: pre-line; }
table.grid th.day.today, table.grid td.today { background: #ffc763; }
table.grid td.today { background: #fffaf0; }
table.grid a.dayhead { display: flex; min-height: 51px; align-items: center; justify-content: center; padding: 4px; text-decoration: none; }
table.grid .asset, table.grid .asset-cell { padding: 4px 5px; font-size: 12px; font-weight: 700; }
.cell { display: flex; flex-direction: column; gap: 2px; min-height: 61px; padding: 2px; }
.cell-hit {
    display: block;
    flex: 1;
    min-height: 48px;
}
.chip {
    display: block;
    min-height: 37px;
    overflow: hidden;
    padding: 4px 5px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
    white-space: pre-line;
}
table.grid.week .chip { min-height: 28px; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
table.grid.week .cell { min-height: 48px; }
table.grid.week th, table.grid.week td.day { min-width: 96px; }
table.grid.wide .cell { min-height: 28px; }
.chip.history { color: #55677c; background: #e8ecf2; }
.modes { padding: 3px 8px; background: #fff; }
.chat-log {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
}
.bubble {
    max-width: min(420px, 73%);
    padding: 8px 12px;
    border: 1px solid #dce4ee;
    border-radius: 14px;
    background: #fff;
}
.bubble.own { margin-left: auto; border-color: transparent; background: #e1ebff; }
.bubble strong { display: block; margin-bottom: 4px; color: #152538; font-size: 13px; }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble time { display: block; margin-top: 5px; color: #55677c; font-size: 12px; text-align: right; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer input {
    flex: 1;
    min-height: 46px;
    padding: 9px 12px;
    border: 1px solid #dce4ee;
    border-radius: 12px;
}
.composer .btn { width: auto; }
#chat-feedback { color: #9b3030; }
#chat-feedback[hidden] { display: none; }
.empty-note { color: #55677c; padding: 20px 12px; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid #2458d6;
    outline-offset: 2px;
}
.home-desktop { display: none; }
.board-tile {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    min-height: 0;
    padding: 12px 14px;
    border-radius: 2px;
    color: #1c2430;
    font-size: 16px;
    font-weight: 650;
    line-height: 1.25;
    text-decoration: none;
}
.board-tile span { max-width: 16em; }
.board-tile.placeholder { padding: 0; }
.board-main .board-tile { align-items: center; }
.board-tile.orders,
.board-tile.ph-11 { background: #e7dbdb; }
.board-tile.intake,
.board-tile.notices { background: #d3dbff; }
.board-tile.schedule { background: #b4b4b4; }
.board-tile.chat { background: #e4d496; }
.board-tile.offers { background: #b8c4ff; }
.board-tile.equipment { background: #cbcedf; }
.board-tile.trips { background: #a6a6a6; }
.board-tile.attendance { background: #d9d9d9; }
.board-tile.ph-10 { background: #ede9e8; }
.board-tile.ph-12 { background: #e7d3d4; }
.board-tile.ph-13 { background: #f3e3e3; }
a.board-tile:hover { filter: brightness(0.97); }
.chat-panel-scroll {
    flex: 1;
    min-height: 0;
    max-height: min(42vh, 360px);
    overflow: auto;
    margin-bottom: 8px;
    padding: 4px 2px;
    border-radius: 10px;
    background: rgb(255 255 255 / 28%);
}
@media (min-width: 900px) {
    body { background: #e6ebf3; }
    .shell {
        width: min(100% - 32px, 920px);
        min-height: calc(100dvh - 32px);
        margin: 16px auto;
        border-radius: 18px;
        box-shadow: 0 12px 40px #1525381f;
    }
    .shell.home {
        width: min(100% - 32px, 1380px);
        max-width: 1380px;
        min-height: 0;
        background: #fff;
    }
    .shell.home main { background: #fff; }
    .shell.board-schedule { width: min(100% - 32px, 1180px); }
    .home-mobile { display: none; }
    .home-desktop {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(220px, 338fr) minmax(0, 555fr);
        column-gap: clamp(18px, 2.4vw, 32px);
        align-items: stretch;
    }
    .board-main {
        display: grid;
        grid-template-rows: repeat(4, minmax(0, 1fr));
        gap: clamp(14px, 1.7vw, 26px);
        aspect-ratio: 338 / 359;
        min-height: 0;
    }
    .board-nine-wrap {
        display: grid;
        grid-template-rows: 55fr 274fr 31fr;
        min-height: 0;
    }
    .board-nine {
        grid-row: 2;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: repeat(3, minmax(0, 1fr));
        gap: clamp(14px, 1.7vw, 26px);
        min-height: 0;
    }
    .home-primary { grid-template-columns: 1fr 1fr; }
    table.grid.week th, table.grid.week td.day { min-width: 0; }
}
@media (max-width: 359px) {
    .tile-label { font-size: 15px; }
}
