/* Black-and-white schematic look; green/red are the only colours (status). */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #777777;
  --line: #111111;
  --soft: #f2f2f2;
  --free: #1fa64a;
  --booked: #e0352b;
  --shared: #f0a020;
  --sel: #111111;
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { padding-bottom: 76px; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font: 12px ui-monospace, Menlo, monospace; background: var(--soft); padding: 1px 4px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pad { padding: 8px 14px; }
[hidden] { display: none !important; }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1.5px solid var(--line); }
.tabs { display: flex; }
.tabs button { flex: 1; border: 0; background: none; padding: 11px 2px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--fg); border-bottom-color: var(--fg); }
.mockbar { display: flex; gap: 8px; align-items: center; padding: 6px 12px; font-size: 12.5px; background: repeating-linear-gradient(45deg, var(--soft), var(--soft) 6px, var(--bg) 6px, var(--bg) 12px); border-top: 1px dashed var(--line); }
.mockbar select { flex: 1; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }

/* room switcher (bottom) */
.rooms { position: fixed; bottom: 0; left: 0; right: 0; display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1.5px solid var(--line); z-index: 5; }
.rooms button { flex: 1; border: 1.5px solid var(--line); background: var(--bg); border-radius: 10px; padding: 7px 4px; display: flex; flex-direction: column; align-items: center; }
.rooms button small { color: var(--muted); font-size: 11px; }
.rooms button.on { background: var(--fg); color: var(--bg); }
.rooms button.on small { color: var(--bg); opacity: .7; }

/* map */
.map-head { display: flex; gap: 6px; align-items: baseline; padding: 10px 14px 0; flex-wrap: wrap; }
.legend { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; }
svg.map { display: block; width: 100%; max-width: 560px; margin: 0 auto; touch-action: manipulation; }
.outline { fill: none; stroke: var(--line); stroke-width: 3; }
.window { stroke: var(--line); stroke-width: 7; stroke-dasharray: 2 3; }
.door-gap { stroke: var(--bg); stroke-width: 5; }
.door { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.stairs rect, .stairs line { fill: none; stroke: var(--line); stroke-width: 1; }
.room-label { font-size: 11px; fill: var(--muted); font-style: italic; }
.desk-rect { fill: none; stroke: var(--line); stroke-width: 1.5; }
.desk-label { font-size: 10px; fill: var(--muted); }
.machine { cursor: pointer; }
.machine .card { fill: var(--bg); stroke: var(--line); stroke-width: 1.5; }
.machine.booked .card { stroke-width: 2.2; }
.machine .icon rect, .machine .icon line { fill: none; stroke: var(--line); stroke-width: 1.4; }
.machine .icon .light { stroke: var(--line); stroke-width: 1.4; }
.machine.free .icon .light { fill: var(--free); }
.machine.booked .icon .light { fill: var(--booked); }
.machine.shared .icon .light { fill: var(--shared); }
.machine.shared .dur { fill: #b86e00; font-weight: 600; }
.machine.shared .avatar-dot, .machine.shared .avatar-ring { stroke: var(--shared); }
.wall { fill: none; stroke: var(--line); stroke-width: 3; stroke-linecap: round; }
.ur3 circle, .ur3 path { fill: var(--bg); stroke: var(--line); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ur3 path { fill: none; stroke-width: 2.2; }
.item-box rect { fill: var(--soft); stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 3 2; }
.item-box text { font-size: 10px; font-weight: 700; fill: var(--fg); }
.machine .name { font-size: 11.5px; font-weight: 700; fill: var(--fg); }
.machine .dur { font-size: 11px; fill: var(--fg); }
.machine.free .dur { fill: var(--free); font-weight: 600; }
.machine.booked .dur { fill: var(--booked); font-weight: 600; }
.machine .holder { font-size: 9.5px; fill: var(--muted); }
.avatar-dot { fill: var(--fg); stroke: var(--booked); stroke-width: 2.5; }
.avatar-ring { fill: none; stroke: var(--booked); stroke-width: 2.5; }
.avatar-txt { font-size: 9px; font-weight: 700; fill: var(--bg); }
.machine:active .card { fill: var(--soft); }
.editbar { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 8px 14px; padding: 8px; border: 1px dashed var(--line); font-size: 13px; }
.desk { cursor: default; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line); flex: none; }
.dot.free { background: var(--free); }
.dot.booked { background: var(--booked); }
.dot.shared { background: var(--shared); }
.pill.shared { background: var(--shared); }
.avatar.ring.shared { box-shadow: 0 0 0 2.5px var(--shared); }
.stack { display: inline-flex; }
.stack .avatar + .avatar { margin-left: -8px; }

/* list */
h3.group { margin: 16px 14px 4px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #ddd; cursor: pointer; }
.row.static { cursor: default; }
.row-main { flex: 1; min-width: 0; }
.row-side { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; }
.tag { font-size: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 1px 7px; white-space: nowrap; }

/* avatars */
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--fg); color: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; object-fit: cover; flex: none; vertical-align: middle; }
.avatar.ring { box-shadow: 0 0 0 2.5px var(--booked); }
.avatar.big { width: 46px; height: 46px; font-size: 15px; }

/* sheet */
.sheet { position: fixed; inset: 0; background: var(--bg); overflow-y: auto; z-index: 10; }
.sheet-body { padding: 0 14px 40px; max-width: 640px; margin: 0 auto; }
.sheet-head { position: sticky; top: 0; background: var(--bg); display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1.5px solid var(--line); margin-bottom: 10px; z-index: 2; }
.sheet-head h2 { margin: 0; font-size: 18px; flex: 1; }
.sheet h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin: 20px 0 6px; }
.pill { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 10px; color: #fff; }
.pill.free { background: var(--free); }
.pill.booked { background: var(--booked); }
.photo { width: 100%; max-height: 220px; object-fit: cover; border: 1.5px solid var(--line); border-radius: 8px; }
.photo.placeholder { height: 90px; display: flex; align-items: center; justify-content: center; color: var(--muted); border-style: dashed; background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 8px, var(--soft) 8px, var(--soft) 16px); }
.status-line { font-weight: 600; }
.holder-box { display: flex; gap: 10px; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0 12px; }
.holder-box > div { flex: 1; }
table.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
table.kv th { text-align: left; font-weight: 500; color: var(--muted); width: 90px; vertical-align: top; padding: 5px 0; }
table.kv td { padding: 5px 0; border-bottom: 1px solid #eee; }
.bar { height: 7px; border: 1px solid var(--line); border-radius: 4px; margin: 4px 0 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--fg); }
.people { list-style: none; padding: 0; margin: 0; }
.people li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #eee; }
.people li > div { flex: 1; }

/* buttons & forms */
.btn { display: inline-block; border: 1.5px solid var(--line); background: var(--bg); border-radius: 9px; padding: 9px 14px; font-weight: 600; text-decoration: none; color: var(--fg); cursor: pointer; text-align: center; }
.btn.small { padding: 5px 10px; font-size: 13px; white-space: nowrap; }
.btn.primary { background: var(--fg); color: var(--bg); }
.btn.ghost { border: 0; padding: 6px 0; }
.btn.wide { width: 100%; margin: 6px 0; }
form label { display: block; font-size: 12.5px; font-weight: 600; margin: 14px 0 5px; text-transform: uppercase; letter-spacing: .03em; }
form input[type=text], form input[type=datetime-local], form input[type=date], form input[type=time] { width: 100%; padding: 9px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--bg); }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { flex: 1; border: 0; border-right: 1.5px solid var(--line); background: var(--bg); padding: 8px 2px; font-weight: 600; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--fg); color: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips button { border: 1px solid var(--line); background: var(--bg); border-radius: 14px; padding: 3px 10px; font-size: 13px; }
.two { display: flex; gap: 10px; }
.two > div { flex: 1; }
.vpn { margin-top: 8px; padding: 9px; border: 1px dashed var(--line); border-radius: 8px; font-size: 13.5px; }
.vpn a { display: block; margin-top: 4px; font-weight: 700; color: var(--fg); }
.error { color: var(--booked); font-weight: 600; }
textarea.code { width: 100%; font: 11px ui-monospace, Menlo, monospace; }

/* week availability strip */
.week { border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.week .day, .week .ticks { display: flex; align-items: center; gap: 6px; height: 20px; }
.week .day span, .week .ticks span { width: 46px; font-size: 11.5px; flex: none; }
.week .track { position: relative; flex: 1; height: 12px; border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(25% - 1px), #ccc calc(25% - 1px), #ccc 25%); }
.week .ticks div { position: relative; flex: 1; height: 14px; }
.week .ticks b { position: absolute; font-size: 10px; font-weight: 400; color: var(--muted); transform: translateX(-50%); }
.week .ticks b:first-child { transform: none; }
.week .ticks b:last-child { transform: translateX(-100%); }
.week i { position: absolute; top: 0; bottom: 0; }
.week i.busy { background: repeating-linear-gradient(45deg, var(--booked), var(--booked) 2px, #f6c3c0 2px, #f6c3c0 5px); }
.week i.sel { border: 2px solid var(--sel); background: rgba(31, 166, 74, .35); }
.week i.now { width: 2px; background: var(--fg); }

.empty { text-align: center; padding: 60px 24px; }
.empty .big { font-size: 40px; }
