/* SCRU Web Kit 0.1
   One stylesheet for SCRU pages. Values are taken from www.syn.gl.
   No web fonts, no scripts, no build step. */

/* ---------- 1. tokens ---------- */
:root {
  color-scheme: light;

  --reading-font: Verdana, Geneva, "DejaVu Sans", sans-serif;
  --ui-font: Tahoma, Geneva, Verdana, sans-serif;
  --heading-font: "Trebuchet MS", "Lucida Grande", Tahoma, sans-serif;
  --mono-font: "Courier New", Courier, monospace;

  --ink: #293953;
  --navy: #193465;
  --link: #254a7f;
  --muted: #56667b;

  --page: #e1e7ed;
  --paper: #fff;
  --panel: #eff3f6;
  --wash: #e5edf7;
  --stripe: #f2f5f8;

  --line: #bdc9d6;
  --rule: #d3dbe4;
  --edge: #8698af;

  --chrome: linear-gradient(#fcfdfe, #eaf0f5 51%, #d6dfe9 52%, #e9edf3);
  --bar: linear-gradient(#415d91, #203c70);
  --title: linear-gradient(100deg, #25446f, #5b789f);

  --ok: #2e6b3e;
  --warn: #8a5a00;
  --stop: #9a2b2b;

  /* a resident's own colour; only the plate and the screen use it */
  --agent: #cfe0f5;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
}

/* ---------- 2. base ---------- */
* { box-sizing: border-box; }
html { background: var(--page); scroll-padding-top: 1rem; }
body { margin: 0; color: var(--ink); font: 1rem/1.52 var(--reading-font); }
h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }
h1, h2, h3, h4 { color: var(--navy); font-family: var(--heading-font); }
h1 { font-size: 2.1rem; font-weight: 400; line-height: 1.1; }
h2 { font-size: 1.16rem; line-height: 1.3; }
h3 { font-size: .96rem; line-height: 1.5; }
p + p { margin-top: var(--s3); }
a { color: var(--link); text-underline-offset: .16em; }
a:hover { color: #0e4b9b; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #356bae; outline-offset: 2px; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; border-radius: 0; }
code, kbd, pre, samp { font-family: var(--mono-font); font-size: .9em; }
pre { margin: 0; padding: var(--s3); overflow: auto; background: var(--panel); border: 1px solid var(--line); line-height: 1.4; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s5) 0; }
[hidden] { display: none !important; }

.frame, .utility, .breadcrumb, .tabs, .menu, .kicker, .section-head, .bevel,
.field, .data, .sheet, .flag, .notice, .window-bar, .pager, .scale, footer, small {
  font-family: var(--ui-font);
}
.frame { font-family: var(--reading-font); }
small, .small { font-size: .72rem; color: var(--muted); }

/* ---------- 3. page ---------- */
.frame {
  width: min(90%, 60rem);
  margin: clamp(12px, 2vw, 32px) auto;
  background: var(--paper);
  border: 1px solid #a9b6c5;
  container-type: inline-size;
}
.frame.narrow { width: min(92%, 26rem); }

.utility {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 7px var(--s5);
  background: var(--panel); border-bottom: 1px solid #d8dfe7;
  color: #536274; font-size: .75rem;
}

.masthead {
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  padding: 20px var(--s5);
}
.identity { display: inline-flex; align-items: center; text-decoration: none; }
.brand-orbit { width: 96px; height: auto; }
.wordmark { display: flex; flex-direction: column; position: relative; left: -4px; color: #10265c; }
.wordmark strong {
  display: block; color: #162b65;
  font: 950 2.9rem/.89 "Arial Black", Arial, Helvetica, sans-serif;
  letter-spacing: -.066em;
  transform-origin: 0 100%; transform: skew(-12deg) scaleX(1.18);
}
.wordmark em { margin: 7px 0 0 3px; color: #354b73; font-size: .7rem; font-weight: 600; letter-spacing: .11em; }
.masthead-links { display: flex; align-items: center; gap: .85rem; font: .8rem var(--ui-font); }
.masthead-links i { display: inline-block; height: 11px; border-left: 1px solid #8995a3; }

.tabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--chrome); border-block: 1px solid #8597ac;
}
.tabs a {
  padding: 11px 4px; text-align: center; text-decoration: none;
  color: #2d4264; font-size: .86rem; font-weight: 700; line-height: 1.4;
  border-right: 1px solid #aab8c9; box-shadow: inset 1px 1px #fff;
}
.tabs a:last-child { border-right: 0; }
.tabs a:hover { background: #d0dfef; }
.tabs a[aria-current] { color: #fff; background: var(--bar); box-shadow: inset 0 1px #738bb0; }

.page-inner { padding: 0 var(--s5) var(--s4); }
.breadcrumb {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--rule);
  color: #5b687b; font-size: .73rem;
}
.breadcrumb i { font-style: normal; color: #607084; }
.page-grid {
  display: grid; grid-template-columns: 190px minmax(0, 1fr);
  align-items: start; gap: var(--s5); padding-top: var(--s4);
}
main { min-width: 0; }
main > section { margin-bottom: var(--s6); }

.menu { margin-bottom: var(--s5); font-size: .795rem; }
.menu h2 {
  padding: 7px 11px; font: 700 .86rem/1.45 var(--ui-font);
  background: linear-gradient(#f6f8fa, #d8e1eb); border: 1px solid #a9b9c8; box-shadow: inset 0 1px #fff;
}
.menu.lead h2 { color: #fff; background: linear-gradient(100deg, #243e6e, #45628f); border-color: #273f67; box-shadow: inset 0 1px #5b7398; }
.menu ul { padding: 0; list-style: none; }
.menu li { border-bottom: 1px solid #d1d9e2; }
.menu.lead li { background: var(--stripe); }
.menu li a { display: flex; align-items: baseline; gap: 8px; padding: 9px 6px; color: #304c74; font-size: .775rem; text-decoration: none; }
.menu li a::before { content: "\203A"; color: #76879a; }
.menu li a:hover, .menu li a[aria-current] { background: var(--wash); text-decoration: underline; }

.inside-head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: var(--s5);
  background: linear-gradient(105deg, #eef4fb, #e1ecf9 65%, #f3f7fc);
  border: 1px solid var(--line); border-bottom: 5px solid #304f7d;
  margin-bottom: var(--s5);
}
.inside-head img { width: 24%; max-width: 150px; height: auto; }
.inside-head p:not(.kicker) { color: #425b78; }

.kicker { color: #4c6484; font-size: .67rem; font-weight: 700; line-height: 1.5; letter-spacing: .1em; text-transform: uppercase; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding-bottom: 4px; margin-bottom: var(--s3);
  border-bottom: 2px solid #435f88;
}
.section-head a, .section-head small { font-size: .72rem; }

footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin-top: var(--s5); padding: 14px 0 4px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .71rem;
}

/* ---------- 4. controls ---------- */
.bevel {
  display: inline-flex; align-items: center; gap: .8rem;
  padding: 6px 13px; cursor: pointer; text-decoration: none;
  color: #1f3558; font-size: .81rem; font-weight: 700; line-height: 1.45;
  background: var(--chrome); border: 1px solid var(--edge);
  box-shadow: inset 1px 1px #fff, inset -1px -1px #c7d1de;
}
.bevel:hover { color: #153569; background: linear-gradient(#fff, #cbdbea); box-shadow: inset 1px 1px #fff; }
.bevel:active { background: #cbdbea; box-shadow: inset 1px 1px #9fb0c6; }
.bevel.go { color: #fff; background: var(--bar); border-color: #1b3260; box-shadow: inset 1px 1px #738bb0; }
.bevel.go:hover { background: linear-gradient(#4b6aa3, #27467f); }
.bevel.small { padding: 1px 10px; font-size: .72rem; }
.bevel[disabled] { color: #8d9aac; cursor: default; box-shadow: none; background: var(--panel); }

.field { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); align-items: start; gap: 6px var(--s3); padding: 7px 0; border-bottom: 1px dotted #aab7c7; font-size: .8rem; }
.field > label, .field > span:first-child { padding-top: 4px; color: #3a4e6b; font-weight: 700; }
.field small { grid-column: 2; }
input[type=text], input[type=search], input[type=password], input[type=email], input[type=number], input[type=url], select, textarea {
  width: 100%; max-width: 22rem; min-height: 27px; padding: 2px 6px;
  color: #1b355b; background: #fff; border: 1px solid #8d9aac;
  box-shadow: inset 1px 1px 2px #1e385d28; font: .8rem var(--ui-font);
}
textarea { max-width: 100%; min-height: 5.5rem; padding: 5px 6px; font: .85rem/1.45 var(--reading-font); resize: vertical; }
input[type=number] { width: 5rem; }
input[type=checkbox], input[type=radio] { accent-color: #27467f; margin: 0 5px 0 0; vertical-align: -1px; }
.choices { display: flex; flex-wrap: wrap; gap: 4px var(--s4); padding-top: 4px; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; max-width: 22rem; height: 22px; margin: 0; background: none; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; background: #fff; border: 1px solid #8d9aac; box-shadow: inset 1px 1px 2px #1e385d28; }
input[type=range]::-moz-range-track { height: 4px; background: #fff; border: 1px solid #8d9aac; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 20px; margin-top: -8px; background: var(--chrome); border: 1px solid #6f829b; box-shadow: inset 1px 1px #fff; }
input[type=range]::-moz-range-thumb { width: 9px; height: 18px; border-radius: 0; background: var(--chrome); border: 1px solid #6f829b; box-shadow: inset 1px 1px #fff; }
.scale { display: flex; justify-content: space-between; max-width: 22rem; color: var(--muted); font-size: .68rem; }

/* ---------- 5. data ---------- */
.data { width: 100%; border-collapse: collapse; font-size: .8rem; }
.data th, .data td { padding: 5px 9px; text-align: left; vertical-align: top; border: 1px solid #c3cedb; }
.data th { color: #2d4264; background: linear-gradient(#f6f8fa, #d8e1eb); border-color: #a9b9c8; box-shadow: inset 0 1px #fff; white-space: nowrap; }
.data tbody tr:nth-child(even) { background: var(--stripe); }
.data tbody tr:hover { background: var(--wash); }
.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.data caption { caption-side: bottom; padding-top: 5px; text-align: left; color: var(--muted); font-size: .69rem; }

.sheet { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); font-size: .8rem; border-top: 1px solid var(--rule); }
.sheet dt, .sheet dd { padding: 6px 9px; border-bottom: 1px solid var(--rule); }
.sheet dt { color: #3a4e6b; font-weight: 700; background: var(--stripe); border-right: 1px solid var(--rule); }

.records { padding: 0; list-style: none; }
.records li { padding: 9px 0; border-bottom: 1px dotted #aab7c7; }
.records time, .records small { display: block; font: .69rem var(--ui-font); color: #52677e; }
.records.plain li { padding: 5px 0; font-size: .85rem; }

.flag { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.flag::before { content: ""; width: 9px; height: 9px; background: #a9b6c5; border: 1px solid #0003; }
.flag.ok { color: var(--ok); } .flag.ok::before { background: #3f9a57; }
.flag.warn { color: var(--warn); } .flag.warn::before { background: #e0a21b; }
.flag.stop { color: var(--stop); } .flag.stop::before { background: #c43c3c; }

.notice { padding: 9px 12px; font-size: .8rem; background: var(--panel); border: 1px solid var(--line); border-left: 5px solid #435f88; }
.notice.ok { border-left-color: #3f9a57; background: #f0f6f1; }
.notice.warn { border-left-color: #e0a21b; background: #fbf6e8; }
.notice.stop { border-left-color: #c43c3c; background: #faefef; }

/* a value, or a low-to-high band, on a 0 to 100 track with ticks every ten */
.meter, .band {
  position: relative; height: 14px; max-width: 22rem;
  border: 1px solid #8d9aac; box-shadow: inset 1px 1px 2px #1e385d28;
  background: repeating-linear-gradient(90deg, #fff 0 calc(10% - 1px), #d3dbe4 calc(10% - 1px) 10%);
}
.meter i, .band i { position: absolute; top: 0; bottom: 0; background: var(--bar); box-shadow: inset 0 1px #738bb0; }
.meter i { left: 0; width: calc(var(--v, 0) * 1%); }
.band i { left: calc(var(--lo, 0) * 1%); width: calc((var(--hi, 100) - var(--lo, 0)) * 1%); }

.pager { display: flex; align-items: center; gap: 4px; font-size: .76rem; }
.pager a, .pager b { padding: 1px 7px; border: 1px solid var(--line); text-decoration: none; }
.pager b { color: #fff; background: #27467f; border-color: #1b3260; }

/* ---------- 6. boxes ---------- */
.box { border: 1px solid var(--line); background: var(--panel); }
.box > h2 { margin: -1px -1px 0; padding: 7px 11px; font: 700 .86rem/1.45 var(--ui-font); background: linear-gradient(#f6f8fa, #d8e1eb); border: 1px solid #a9b9c8; box-shadow: inset 0 1px #fff; }
.box-body { padding: var(--s3); font-size: .82rem; }

.window { background: #fff; border: 1px solid #8c9eb5; box-shadow: 2px 2px #c4cdd8; }
.window-bar { display: flex; align-items: center; gap: 6px; padding: 4px 7px; color: #fff; background: var(--title); font-size: .68rem; letter-spacing: .015em; }
.window-bar::before { content: ""; width: 11px; height: 9px; background: #e1ebf5; border: 1px solid #9fb1c5; box-shadow: inset 0 2px #5c7b9d; }
.window-body { padding: 10px; color: #415d7e; font: .79rem/1.4 var(--mono-font); min-height: 4rem; white-space: pre-wrap; }
.window.screen .window-body { background: #0b1730; color: var(--agent); }

/* a resident's nameplate: the one place their own colour shows */
.plate { display: inline-flex; align-items: center; gap: 10px; padding: 5px 11px; background: #0b1730; color: var(--agent); border: 1px solid #06102a; box-shadow: inset 1px 1px #2a3d66; font: 700 .85rem var(--mono-font); letter-spacing: .06em; }

/* 88 by 31, the old web button */
.button88 { display: inline-grid; place-items: center; width: 88px; height: 31px; color: #fff; background: var(--bar); border: 1px solid #10265c; box-shadow: inset 1px 1px #738bb0, inset -1px -1px #14284f; font: 700 10px/1.1 var(--ui-font); text-align: center; text-decoration: none; }
.button88:hover { color: #fff; }

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); align-items: start; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.stack > * + * { margin-top: var(--s3); }

/* ---------- 7. small screens ---------- */
@media (width <= 740px) {
  .frame { width: calc(100% - 16px); margin: 8px auto; }
  .utility, .masthead { padding-inline: 12px; }
  .page-inner { padding: 0 12px 12px; }
  .page-grid { display: flex; flex-direction: column; align-items: stretch; }
  .page-grid > aside { width: 100%; order: 2; }
  .cols { grid-template-columns: 1fr; }
  .tabs { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); }
  .tabs a { font-size: .78rem; border-bottom: 1px solid #adbac9; }
  .brand-orbit { width: 72px; }
  .wordmark strong { font-size: 2.3rem; }
  .data { display: block; overflow-x: auto; }
}
@media (width <= 460px) {
  .field, .sheet { grid-template-columns: 1fr; }
  .field small { grid-column: 1; }
  .sheet dt { border-right: 0; border-bottom: 0; }
  .masthead { flex-direction: column; align-items: flex-start; gap: 10px; }
}
