/* ShoreOS: Look 1 "Shore Brand" (cream and forest green) */
:root {
  --bg: #F5F0E6;
  --card: #FFFDF8;
  --line: #E3DACB;
  --line-strong: #D8CDB9;
  --ink: #1D2A23;
  --muted: #56625B;
  --forest: #1F4D3A;
  --forest-dark: #163A2B;
  --amber-fg: #84560A;
  --amber-bg: #FBEFD8;
  --amber-dot: #B07714;
  --amber-line: #D9B26A;
  --green-fg: #2E6B3C;
  --green-bg: #E6F2E4;
  --red-fg: #9E3426;
  --red-bg: #F7E3DF;
  --red-line: #D99A8E;
  --none-fg: #56625B;
  --none-bg: #EFE9DD;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 14px;
  --nav-h: 66px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
a { color: var(--forest); }
a:hover { color: var(--forest-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }

.app { max-width: 680px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.view { flex: 1; padding: 0 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); outline: none; }
.view.no-nav { padding-bottom: 32px; }
.loading { color: var(--muted); padding: 40px 4px; }

/* header */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 4px 10px; }
.top .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wordmark { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--forest); letter-spacing: .5px; line-height: 1.1; }
.top .sub { font-size: 12px; color: var(--muted); }
.top .right { flex-shrink: 0; display: flex; gap: 8px; align-items: center; }
.greet { font-family: var(--serif); font-size: 32px; font-weight: 600; line-height: 1.1; margin: 0 4px 4px; }
.lede { margin: 0 4px 12px; font-size: 14px; color: var(--muted); }

/* layout */
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2, .grid3, .grid4 { display: grid; gap: 10px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.section { margin-top: 16px; }
.section > h2, .h2 { font-family: var(--serif); font-size: 22px; font-weight: 700; margin: 0 4px 8px; display: flex; align-items: center; gap: 8px; }
.count { font-family: var(--sans); font-size: 12px; font-weight: 600; background: var(--forest); color: #fff; border-radius: 999px; padding: 1px 8px; }
.count.amber { background: var(--amber-dot); }
.count.red { background: var(--red-fg); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.gap6 { gap: 6px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
a.card { text-decoration: none; color: inherit; }
.card.amber { border: 1.5px solid var(--amber-line); }
.card.red { border: 1.5px solid var(--red-line); }
.card.tight { padding: 10px 12px; gap: 2px; }
.card .name { font-size: 14px; font-weight: 600; }
.label { font-size: 12px; color: var(--muted); }
.note { font-size: 12px; color: var(--muted); line-height: 1.4; }
.note.amber { color: var(--amber-fg); }
.note.red { color: var(--red-fg); }
.note.green { color: var(--green-fg); }
.big { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.1; }
.huge { font-family: var(--serif); font-size: 34px; font-weight: 700; color: var(--forest); line-height: 1; }
.mid { font-family: var(--serif); font-size: 24px; font-weight: 700; line-height: 1.1; }
.baseline { display: flex; align-items: baseline; gap: 6px; }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.small { font-size: 12px; }
.center { text-align: center; }
.empty { color: var(--muted); font-size: 14px; padding: 6px 2px; }

/* pills */
.pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.green { background: var(--green-bg); color: var(--green-fg); }
.pill.amber { background: var(--amber-bg); color: var(--amber-fg); }
.pill.amber::before { background: var(--amber-dot); }
.pill.red { background: var(--red-bg); color: var(--red-fg); }
.pill.none { background: var(--none-bg); color: var(--none-fg); }
.pill.plain::before { display: none; }
.tag { font-size: 11px; font-weight: 600; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 8px; color: var(--muted); white-space: nowrap; }
.tag.forest { border-color: var(--forest); color: var(--forest); }

/* lists */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list > .item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; min-height: 48px; }
.list > .item:first-child { border-top: 0; }
.list > a.item:hover { background: #FAF6EE; }
.item .main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item .main .title { font-weight: 600; font-size: 14px; }
.item .main .sub { font-size: 12px; color: var(--muted); }
.item .end { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.item.stackable { flex-wrap: wrap; }
.chev::after { content: "›"; font-size: 20px; color: var(--muted); margin-left: 4px; }

/* table */
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th, table.t td { padding: 9px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
table.t thead th { border-top: 0; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; background: #FAF6EE; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tr.total td { font-weight: 600; background: #FAF6EE; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--forest); background: var(--forest); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--forest-dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--forest); }
.btn.ghost:hover { background: #EEF3EE; color: var(--forest-dark); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; white-space: nowrap; }
.btn.danger { background: var(--red-fg); border-color: var(--red-fg); }
.btn.ghost.danger { background: transparent; color: var(--red-fg); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }
.btnrow .btn { flex: 1 1 auto; }
.linkbtn { background: none; border: 0; color: var(--forest); font-weight: 600; cursor: pointer; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2.5px solid var(--amber-dot); outline-offset: 2px; }

/* forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .field > label.l { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=tel], input[type=search], input[type=month], input[type=time], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; font-size: 16px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--forest); outline: none; box-shadow: 0 0 0 3px rgba(31, 77, 58, .15); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; padding: 6px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--forest); flex-shrink: 0; }
.checks .check { border-top: 1px solid var(--line); padding: 10px 2px; }
.checks .check:first-child { border-top: 0; }
.err { color: var(--red-fg); background: var(--red-bg); padding: 8px 12px; border-radius: 8px; font-size: 13px; margin: 0; }
.ok { color: var(--green-fg); background: var(--green-bg); padding: 8px 12px; border-radius: 8px; font-size: 13px; margin: 0; }
.warn { color: var(--amber-fg); background: var(--amber-bg); padding: 8px 12px; border-radius: 8px; font-size: 13px; margin: 0; }
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: #fff; }
.seg label { flex: 1; text-align: center; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 10px 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: var(--forest); color: #fff; }
.seg input:focus-visible + span { outline: 2.5px solid var(--amber-dot); outline-offset: -3px; }
.addon { display: grid; grid-template-columns: 1fr 120px 36px; gap: 6px; align-items: center; }
.totalbox { background: #FAF6EE; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }

/* bed map: beds drawn as pictures */
.bedmap { display: grid; gap: 6px; }
.bedmap.pun { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.bedmap.main { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bed { border-radius: 8px; border: 1.5px solid; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 5px 0 4px; font-size: 11px; font-weight: 600; cursor: pointer; min-height: 46px; background: none; font-family: var(--sans); }
.bedmap.main .bed { min-height: 54px; font-size: 12px; }
.bed svg { width: 20px; height: 20px; }
.bedmap.main .bed svg { width: 24px; height: 24px; }
.bed.occupied { background: var(--forest); border-color: var(--forest); color: #fff; }
.bed.leaving { background: var(--amber-bg); border-color: var(--amber-dot); color: #6E4706; }
.bed.booked { background: var(--card); border-color: var(--forest); border-style: dashed; color: var(--forest); }
.bed.free { background: var(--card); border-color: #B9AE9A; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1.5px solid; }
.legend i.occupied { background: var(--forest); border-color: var(--forest); }
.legend i.leaving { background: var(--amber-bg); border-color: var(--amber-dot); }
.legend i.booked { background: var(--card); border-color: var(--forest); border-style: dashed; }
.legend i.free { background: var(--card); border-color: #B9AE9A; }
.campus-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 2px 6px; display: flex; justify-content: space-between; }

/* entries board */
.entry { display: flex; align-items: center; gap: 10px; }
.tick { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.tick.done { background: var(--green-bg); color: var(--green-fg); }
.tick.miss { background: var(--red-bg); color: var(--red-fg); }
.tick.wait { background: var(--none-bg); color: var(--muted); }

/* bar */
.bar { height: 8px; background: var(--none-bg); border-radius: 999px; overflow: hidden; position: relative; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--forest); border-radius: 999px; }
.bar > i.amber { background: var(--amber-dot); }
.bar > i.red { background: var(--red-fg); }
.bar > b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .5; }

/* bottom navigation */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; border-top: 1px solid var(--line); background: var(--card); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
.bottom-nav .in { display: flex; justify-content: space-around; width: 100%; max-width: 680px; }
.bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 56px; min-height: 48px; font-size: 11px; text-decoration: none; color: var(--muted); }
.bottom-nav a[aria-current=page] { color: var(--forest); font-weight: 600; }
.bottom-nav .badge { position: absolute; top: 0; right: 8px; background: var(--red-fg); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; min-width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* modal */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(29, 42, 35, .45); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; }
.modal-head h2 { font-family: var(--serif); font-size: 24px; font-weight: 700; }
.modal-head .x { border: 0; background: none; font-size: 28px; line-height: 1; width: 44px; height: 44px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 4px 16px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.modal .actions { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--bg); padding-top: 6px; }
.modal .actions .btn { flex: 1; }
@media (min-width: 700px) {
  .modal-wrap { align-items: center; }
  .modal { border-radius: 18px; }
}

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); z-index: 60; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.toast.bad { background: var(--red-fg); }

/* login */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 24px 4px; max-width: 400px; margin: 0 auto; gap: 18px; }
.login .wordmark { font-size: 40px; }
.login .card { padding: 20px; gap: 14px; }

details.more > summary { cursor: pointer; list-style: none; font-weight: 600; color: var(--forest); padding: 8px 4px; font-size: 14px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: " ▾"; }
details.more[open] > summary::after { content: " ▴"; }

@media (max-width: 360px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bedmap.pun { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .big { font-size: 26px; }
}
@media print {
  .bottom-nav, .noprint, .toast { display: none !important; }
  .view { padding-bottom: 0; }
  body { background: #fff; }
  .card, .list, .tablewrap { break-inside: avoid; }
}
