/* =====================================================================
   watch.css: the Hatter's Watch's own rules (R91). Tokens and components
   come from /chassis/roses.css (ORGAN 9). Cream paper is the default here
   (Séb: "light mode is the standard"); night is one tap away.
   ===================================================================== */

:root { --hair: rgba(var(--ink-rgb), .16); --hair2: rgba(var(--ink-rgb), .3); }
html { scroll-behavior: smooth; }
body { min-height: 100vh; }
button { font: inherit; border: 1.5px solid var(--accent); background: var(--card); color: var(--ink); border-radius: 12px; padding: 7px 16px; min-height: 42px; cursor: pointer; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px; }
button:active { background: var(--panel2); }
button.primary { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); font-weight: 700; }
button.ghost { border-color: var(--line); color: var(--muted); }
button.danger { border-color: var(--deep-red); color: var(--bad); }
button.small { min-height: 34px; padding: 4px 12px; font-size: 14px; }
button:disabled { opacity: .45; cursor: default; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: var(--field); color: var(--ink); min-height: 40px; }
input[type=checkbox] { min-height: 0; width: 20px; height: 20px; accent-color: var(--accent-fill); }
input::placeholder { color: var(--placeholder); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input.short { width: 110px; }
input.initials { width: 80px; text-transform: uppercase; text-align: center; }
[hidden] { display: none !important; }
.num { font-family: 'Helvetica Neue', Helvetica, sans-serif; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sans { font-family: 'Helvetica Neue', Helvetica, sans-serif; }
a { color: var(--accent2); }

/* ---- header ---- */
header { display: flex; align-items: center; gap: 12px; padding: 12px 22px; background: var(--paper); border-bottom: 2px solid var(--accent-fill); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
header h1 { font-size: 22px; margin: 0; font-weight: 400; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
header h1 .brand { font-family: 'Great Vibes', cursive; color: var(--accent); font-size: 27px; }
header h1 .suits { color: var(--deep-red); font-size: 15px; }
header h1 .title { font-family: 'IM Fell English SC', serif; letter-spacing: .06em; }
header .who { font-family: 'IM Fell English', serif; font-style: italic; color: var(--muted); font-size: 15px; }
header .spacer { flex: 1; }
@media (max-width: 700px) { header { padding: 10px 14px; } header h1 .brand { display: none; } }

nav.tabs { display: flex; gap: 8px; padding: 12px 22px 0; max-width: 1240px; margin: 0 auto; flex-wrap: wrap; align-items: center; }
nav.tabs .tab { font-size: 15px; padding: 8px 16px; }
nav.tabs .crumb { font-family: 'IM Fell English', serif; font-style: italic; color: var(--muted); }
main { max-width: 1240px; margin: 0 auto; padding: 16px 22px 120px; }
@media (max-width: 700px) { main, nav.tabs { padding-left: 14px; padding-right: 14px; } }

/* ---- sections ---- */
.rule { display: flex; align-items: center; gap: 14px; margin: 22px 0 12px; color: var(--accent); font-family: 'IM Fell English SC', serif; font-weight: 400; font-size: 20px; letter-spacing: .1em; }
.rule::before, .rule::after { content: ""; flex: 1; border-top: 1px solid var(--hair2); }
.card { margin-bottom: 14px; }
.card h3 { font-family: 'IM Fell English SC', serif; font-weight: 400; color: var(--ink); font-size: 21px; margin: 0 0 4px; letter-spacing: .03em; }
.card .sub { color: var(--muted); font-family: 'IM Fell English', serif; font-style: italic; font-size: 15.5px; margin: 0 0 10px; }
.note { color: var(--muted); font-family: 'IM Fell English', serif; font-style: italic; font-size: 15.5px; }
.empty { text-align: center; color: var(--muted); font-family: 'IM Fell English', serif; font-style: italic; padding: 28px 10px; border: 1px dashed var(--line2); border-radius: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.walls { border-left: 3px solid var(--accent2); padding: 8px 14px; background: rgba(var(--teal-rgb), .08); border-radius: 0 10px 10px 0; }

/* ---- the file drop ---- */
.drop { display: block; border: 2px dashed var(--line2); border-radius: 14px; padding: 26px 18px; text-align: center; cursor: pointer; background: var(--card); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--gold-tint); }
.drop strong { font-family: 'IM Fell English SC', serif; font-weight: 400; font-size: 20px; color: var(--accent); display: block; }
.drop input { display: none; }

/* ---- period cards ---- */
.periods { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.period { cursor: pointer; transition: border-color .15s; }
.period:hover { border-color: var(--accent); }
.period h3 { font-size: 22px; }
.period .facts { margin-top: 8px; }

/* ---- facts ---- */
.facts { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.fact { font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size: 13.5px; border: 1px solid var(--line2); border-radius: 99px; padding: 3px 11px; color: var(--muted); }
.fact b { color: var(--ink); font-weight: 600; }
.fact.bad { border-color: var(--deep-red); color: var(--bad); }
.fact.bad b { color: var(--bad); }
.fact.ok { border-color: var(--ok); color: var(--ok); }
.flagnote { border-left: 3px solid var(--warn); background: var(--amberbg); padding: 8px 12px; border-radius: 0 10px 10px 0; margin: 8px 0; font-size: 15.5px; }

/* ---- tables ---- */
table { border-collapse: collapse; width: 100%; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
th { text-align: left; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
th.num { text-align: right; }
tr.total td { border-top: 2px solid var(--accent-fill); border-bottom: none; font-weight: 700; }
.scroll { overflow-x: auto; }
tr.click { cursor: pointer; }
tr.click:hover td { background: rgba(var(--accent-rgb), .08); }
tr.held td { background: rgba(var(--red-rgb), .06); }
td.name { font-weight: 600; }
.tag { font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size: 12px; border-radius: 99px; padding: 1px 8px; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.tag.ok { border-color: var(--ok); color: var(--ok); }
.tag.bad { border-color: var(--deep-red); color: var(--bad); }
.tag.warn { border-color: var(--amber-fill); color: var(--amber); }
.tag.gold { border-color: var(--accent); color: var(--accent); }
.badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.badge { font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size: 12px; border-radius: 99px; padding: 1px 8px; white-space: nowrap; font-weight: 600; }
.badge.high { background: var(--red-fill); color: #fff; }
.badge.medium { background: var(--amber-fill); color: var(--on-accent); }
.badge.low { border: 1px solid var(--line2); color: var(--muted); }
.badge.ruled { border: 1px solid var(--ok); color: var(--ok); }
.ot { color: var(--bad); font-weight: 700; }

/* ---- filters ---- */
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 12px; }
.filters input { min-width: 220px; }

/* ---- the drawer (R32: full-height on the right, list stays clickable) ---- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--card); border-left: 2px solid var(--accent-fill); box-shadow: -8px 0 30px var(--shadow); z-index: 8; overflow-y: auto; padding: 18px 22px 60px; transform: translateX(102%); transition: transform .2s; }
.drawer.open { transform: none; }
.drawer .head { display: flex; align-items: flex-start; gap: 12px; position: sticky; top: -18px; background: var(--card); padding: 10px 0; z-index: 1; border-bottom: 1px solid var(--hair2); margin-bottom: 8px; }
.drawer h2 { font-family: 'IM Fell English SC', serif; font-weight: 400; color: var(--accent); font-size: 26px; margin: 0; }
.day { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 10px 0; background: var(--paper); }
.day .dayhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.day .dayhead b { font-family: 'IM Fell English SC', serif; font-weight: 400; font-size: 18px; }
.block { font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size: 13.5px; color: var(--muted); margin: 4px 0; }
.punch { border-top: 1px solid var(--hair); padding: 8px 0; }
.punch .times { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.punch .times b { font-family: 'Helvetica Neue', Helvetica, sans-serif; font-variant-numeric: tabular-nums; }
.punch.void .times { text-decoration: line-through; color: var(--faint); }
.punch .role { color: var(--muted); }
.punch .orig { color: var(--faint); font-size: 13.5px; text-decoration: line-through; }
.flag { display: flex; gap: 8px; align-items: baseline; margin: 4px 0 0; font-size: 15px; }
.flag .detail { color: var(--muted); }
.ruled { color: var(--ok); font-size: 14.5px; margin-top: 4px; font-family: 'Helvetica Neue', Helvetica, sans-serif; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.fixform { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; padding: 10px; border: 1px dashed var(--line2); border-radius: 10px; }
.fixform label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); font-family: 'Helvetica Neue', Helvetica, sans-serif; text-transform: uppercase; letter-spacing: .06em; }
.fixform .span2 { grid-column: 1 / -1; }
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 7; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.open { opacity: 1; pointer-events: auto; }

/* ---- the UNI list ---- */
.uni td { font-size: 19px; }
.uni td.big { font-size: 26px; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; white-space: nowrap; }
.uni td.wk { font-size: 13px; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; white-space: nowrap; line-height: 1.3; }
.uni td.wk .ot { color: var(--bad); }
.uni tr.sal td { color: var(--muted); font-style: italic; }
.printhead { display: none; }
.holdband { border: 1.5px solid var(--deep-red); border-radius: 14px; padding: 12px 18px; background: rgba(var(--red-rgb), .08); margin-bottom: 14px; }
.holdband h3 { color: var(--bad); }

/* ---- statement ---- */
.statement h2 { font-family: 'IM Fell English SC', serif; font-weight: 400; color: var(--accent); font-size: 28px; margin: 0; }
.statement table td, .statement table th { font-size: 14.5px; padding: 4px 8px; }

/* ---- dashboard bars ---- */
.bar { height: 10px; border-radius: 99px; background: rgba(var(--paper-rgb), .9); border: 1px solid var(--line); overflow: hidden; min-width: 120px; }
.bar i { display: block; height: 100%; background: var(--accent-fill); }

/* ---- settings ---- */
.field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.field > span { font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 18px; }
td input[type=text], td input:not([type]) { width: 100%; }

/* ---- door / login ---- */
#login { position: fixed; inset: 0; background: var(--paper); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
#login .box { background: var(--card); border: 1.5px solid var(--accent); border-radius: 14px; padding: 30px 28px; max-width: 380px; width: 100%; text-align: center; }
#login h2 { font-family: 'IM Fell English SC', serif; color: var(--accent); font-size: 30px; font-weight: 400; margin: 2px 0 6px; }
#login input { width: 100%; margin: 10px 0; }
#login blockquote { font-family: 'IM Fell English', serif; font-style: italic; color: var(--muted); margin: 10px 0 14px; font-size: 15px; }

/* ---- modal (the anchor question) ---- */
.modal { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; z-index: 12; padding: 16px; }
.modal .box { background: var(--card); border: 1.5px solid var(--accent); border-radius: 14px; padding: 24px 26px; max-width: 520px; width: 100%; }

/* ---- print: the UNI list or a statement only ---- */
@media print {
  :root { --paper: #fff; --card: #fff; --ink: #000; --muted: #444; --line: #999; --hair: #bbb; --hair2: #888; --accent: #000; --bad: #b00; }
  header, nav.tabs, .noprint, .toast, .drawer, .scrim { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  main { padding: 0; max-width: none; }
  .printhead { display: block; margin-bottom: 8px; }
  .card { border: none; padding: 0; page-break-inside: avoid; margin-bottom: 18px; }
  .uni td { font-size: 14pt; padding: 4px 8px; }
  .uni td.big { font-size: 18pt; }
  .uni td.wk { font-size: 9.5pt; }
  .holdband { border-color: #b00; background: none; }
}
.nowrap { white-space: nowrap; }
