/* The Steel Office (DESIGN.md): square drawer-front panels on a cabinet-grey
   ground, a dark steel top bar, one carbon accent, no radius, no shadows. */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(fonts/archivo-latin-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(fonts/archivo-latin-ext-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --shell: #2e3330;
  --rail: #4a504c;
  --well: #1e221f;
  --bg: #c9ccc6;
  --surface: #eef0ec;
  --label: #ffffff;
  --band: #e2e5df;
  --border: #d6d9d3;
  --frame: #6f756f;
  --text: #1a1c1b;
  --muted: #565c57;
  --shell-text: #e4e7e2;
  --shell-muted: #c3c9c2;
  --accent: #23324d;
  --accent-deep: #18243a;
  --accent-text: #ffffff;
  --danger: #a3261e;
  --caution: #8a5a12;
  --good: #2f6b45;
  --radius: 0;
  --reveal: 2px;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--accent);
  color: var(--accent-text);
}

html {
  scrollbar-color: var(--frame) var(--band);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.35 Archivo, 'Helvetica Neue', Arial, sans-serif;
  font-stretch: 92%;
  font-variant-numeric: tabular-nums;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* -- top bar: dark steel ---------------------------------------------------- */

.top {
  display: flex;
  align-items: stretch;
  height: 44px;
  padding: 0 12px 0 0;
  background: var(--shell);
  color: var(--shell-text);
}

.top :focus-visible {
  outline-color: var(--label);
  outline-offset: -2px;
}

.brand {
  display: flex;
  align-items: center;
  width: 224px;
  padding: 0 16px;
  border-right: 2px solid var(--well);
  font-weight: 700;
  font-size: 14px;
  color: var(--label);
  text-decoration: none;
}

.shortcuts {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
}

.shortcuts a {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-right: 1px solid var(--rail);
  color: var(--shell-muted);
  text-decoration: none;
  white-space: nowrap;
}

.shortcuts a:hover {
  color: var(--label);
  background: var(--rail);
}

.shortcuts a.active {
  color: var(--label);
  font-weight: 700;
}

.spacer {
  flex: 1;
}

.who {
  align-self: center;
  color: var(--shell-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top .link-button {
  color: var(--label);
  margin-left: 8px;
}

/* Plain links read as text, underlined, never the browser's blue (classed links style themselves). */
a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--reveal) var(--reveal) 64px;
  display: flex;
  flex-direction: column;
  gap: var(--reveal);
}

main > .status {
  background: var(--surface);
  margin: 0;
  padding: 10px 12px;
}

h3 {
  font-size: 16px;
  font-weight: 700;
  font-stretch: 96%;
  margin: 16px 0 6px;
}

h1 {
  font-size: 22px;
  font-weight: 750;
  font-stretch: 100%;
  line-height: 1.2;
  margin: 0 0 4px;
}

/* A panel's title is a white label card in a 1px square frame. */
h2 {
  display: inline-flex;
  margin: 0 0 8px;
  padding: 4px 10px;
  background: var(--label);
  border: 1px solid var(--frame);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted,
.status {
  color: var(--muted);
}

.card {
  background: var(--surface);
  padding: 12px;
}

.card.narrow {
  width: 100%;
  max-width: 440px;
  margin: 10vh auto 0;
  padding: 16px;
  border-top: 2px solid var(--text);
}

/* A page's own wrapper (Organization, Canopy) stacks its panels with reveals too. */
main > div:not([hidden], .layout) {
  display: flex;
  flex-direction: column;
  gap: var(--reveal);
}

/* The organization header is the page's header panel, closed by a heavy rule. */
.org-head {
  background: var(--surface);
  padding: 12px;
  border-bottom: 2px solid var(--text);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
.button {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  background: var(--label);
  border: 1px solid var(--frame);
  border-radius: 0;
  padding: 0 8px;
  min-height: 30px;
}

input:hover,
select:hover {
  border-color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  outline: none;
}

input:focus-visible,
select:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  padding: 0 12px;
  border-color: var(--text);
  font-weight: 600;
  transition: background-color 120ms ease-out;
}

.button:hover {
  background: var(--band);
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.button.primary:hover {
  background: var(--accent-deep);
}

.button.danger {
  color: var(--danger);
  border-color: var(--danger);
}

.button:disabled,
select:disabled {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--border);
  cursor: default;
}

.link-button {
  font: inherit;
  background: none;
  border: 0;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 4px;
}

.inline-form {
  display: flex;
  gap: 8px;
}

.invite-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.invite-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.invite-form label > * {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  font-size: 13px;
}

/* Organization page: tick the companies someone may open. */
.companies-field {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.company-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px 16px;
  max-height: 220px;
  overflow-y: auto;
  padding: 6px 8px;
  background: var(--label);
  border: 1px solid var(--border);
}

.company-checks label,
.invite-form .company-checks label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
}

.company-checks label.all {
  grid-column: 1 / -1;
  font-weight: 700;
}

.add-access {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 6px 0;
}

.add-access .company-checks,
.add-access .full {
  flex-basis: 100%;
  margin: 0;
}

tr.add-row td,
tbody tr.add-row:hover td {
  background: var(--band);
}

.invite-result {
  margin-top: 12px;
  padding: 12px;
  background: var(--label);
  border: 1px solid var(--accent);
}

.invite-result p {
  margin: 0 0 8px;
}

.copy-row {
  display: flex;
  gap: 8px;
}

.copy-row input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
}

/* A second scrollbar above a table wider than its box (table-resize.js); styled so it
   stays visible where the system hides scrollbars until you scroll. */
.table-scroll-top {
  overflow-x: scroll;
  overflow-y: hidden;
  margin-top: 8px;
  margin-bottom: 2px;
}

.table-scroll-top > div {
  height: 1px;
}

.table-scroll-top::-webkit-scrollbar {
  height: 12px;
}

.table-scroll-top::-webkit-scrollbar-track {
  background: var(--band);
}

.table-scroll-top::-webkit-scrollbar-thumb {
  background: var(--frame);
}

/* Tables resized by dragging a heading edge (table-resize.js): long text ends in an ellipsis. */
table[data-col-sized] th,
table[data-col-sized] td {
  overflow: hidden;
  text-overflow: ellipsis;
}

th[data-col-edge] {
  box-shadow: inset -3px 0 0 var(--accent);
}

html[data-col-edge],
html[data-col-edge] * {
  cursor: col-resize !important;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 5px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  background: var(--band);
  border-top: 1px solid var(--text);
  border-bottom: 1px solid var(--text);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tbody tr:hover td {
  background: var(--label);
}

tr:last-child td {
  border-bottom: 0;
}

td.actions {
  text-align: right;
}

.person-email {
  color: var(--muted);
  font-size: 13px;
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 6px;
}

/* Organization page ---------------------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.org-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.org-title p {
  margin: 0;
}

.name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.name-row h1 {
  margin: 0;
}

/* Setup: two large choices for what kind of organization this is. */
.card.narrow.setup {
  max-width: 520px;
}

.choices {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choices legend {
  padding: 0;
  margin-bottom: 4px;
}

.form .choice,
.choice {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--label);
  border: 1px solid var(--border);
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}

.choice:hover {
  border-color: var(--text);
}

.choice:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.choice input {
  min-height: 0;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.choice > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice .muted {
  font-size: 13px;
}

/* A person's books and role in each, in one cell. */
.access-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.access-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.access-book {
  min-width: 140px;
}

.add-books {
  padding-left: 0;
}

.person-name {
  font-weight: 600;
}

tr.pending .person-name {
  font-weight: 400;
}

td.nowrap {
  white-space: nowrap;
}

td.actions {
  white-space: nowrap;
}

td.actions > * + * {
  margin-left: 6px;
}

td.empty,
p.empty {
  color: var(--muted);
  padding: 12px;
  margin: 0;
}

.tag.warn {
  color: var(--caution);
}

.panel-form {
  margin: 8px 0 12px;
  padding: 12px;
  background: var(--band);
}

.invite-form .full {
  grid-column: 1 / -1;
  margin: 0;
}

/* Secondary help and options, closed until asked for. */
details.help {
  margin: 12px 0;
}

details.help > summary {
  cursor: pointer;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  width: fit-content;
}

details.help[open] > summary {
  margin-bottom: 8px;
}

.pending-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.pending-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.card > .muted:first-of-type {
  margin-top: 0;
}

.roles {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0;
}

.roles dt {
  font-weight: 600;
}

.roles dd {
  margin: 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: var(--text);
  color: var(--label);
  padding: 10px 16px;
  border: 1px solid var(--text);
}

/* -- landing ---------------------------------------------------------------- */

.hero {
  background: var(--surface);
  padding: 32px 16px 20px;
  border-bottom: 2px solid var(--text);
}

.hero h1 {
  max-width: 24ch;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero p {
  max-width: 62ch;
  margin: 12px 0 0;
  font-size: 14px;
}

.sign-in-card {
  max-width: none;
}

.sign-in-card .stack {
  max-width: 320px;
}

#signed-in {
  background: var(--surface);
  padding: 12px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--reveal);
  background: var(--bg);
  margin-top: 8px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: var(--label);
  border: 1px solid var(--frame);
  color: var(--text);
  text-decoration: none;
  transition: background-color 120ms ease-out;
}

.tile:hover,
.tile:focus-visible {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  outline: none;
}

.tile-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

/* Home: the statement and the sign-in sit side by side as drawer fronts,
   filling the viewport; the right column's last panel takes the rest. */
main.home {
  max-width: 1200px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  grid-template-rows: auto 1fr;
}

main.home > #signed-out,
main.home > #signed-in {
  grid-row: 2;
}

main.home > * {
  grid-column: 2;
  margin: 0;
}

main.home > .hero {
  grid-column: 1;
  grid-row: 1 / -1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 32px;
  border-bottom: 0;
}

main.home > .hero h1 {
  font-size: 36px;
  max-width: 20ch;
}

main.home > .card,
main.home > #signed-in {
  padding: 12px 16px 16px;
}

main.home .tiles {
  grid-template-columns: 1fr;
}

/* Sign-in: the form is one full-height drawer front, hung from the top bar. */
main.dock {
  max-width: none;
  align-items: center;
}

main.dock > .status,
main.dock > .card.narrow {
  width: 440px;
  max-width: 100%;
}

main.dock > .card.narrow {
  margin: 0;
  padding: 24px;
  border-top: 0;
}

/* -- forms (sign-in, organization) ------------------------------------------ */

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.small {
  font-size: 12px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  margin-top: 12px;
}

.form label,
.field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.form label > input,
.form label > select {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  font-size: 13px;
  color: var(--text);
}

.form p {
  margin: 0;
}

.button.wide {
  width: 100%;
}

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 12px 0 0;
}

.or::before,
.or::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

.qr {
  display: block;
  margin: 12px auto;
  background: var(--label);
  border: 1px solid var(--frame);
}

.secret {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.codes {
  list-style: none;
  padding: 0;
  margin: 16px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.notice {
  box-shadow: inset 0 0 0 1px var(--accent);
}

@media (max-width: 720px) {
  .top {
    flex-wrap: wrap;
    height: auto;
    padding: 0;
  }

  .brand {
    width: auto;
    min-height: 44px;
    flex: 1;
  }

  .who {
    display: none;
  }

  .shortcuts {
    order: 3;
    width: 100%;
    min-height: 40px;
    border-top: 1px solid var(--rail);
  }

  .hero h1,
  main.home > .hero h1 {
    font-size: 22px;
    line-height: 1.2;
  }

  main.home {
    display: flex;
    min-height: 0;
  }

  main.home > .hero {
    padding: 24px 16px;
  }

  main.dock > .status,
  main.dock > .card.narrow {
    width: 100%;
  }

  .invite-form {
    grid-template-columns: 1fr;
  }

  .org-head {
    align-items: stretch;
    flex-direction: column;
  }
}

/* -- footer ------------------------------------------------------------------- */

/* Under the page's content, in the same column and lined up with panel text. */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 14px 16px;
  font-size: 12px;
  color: var(--muted);
}

@media print {
  .site-footer {
    display: none;
  }
}

/* -- feedback button ---------------------------------------------------------- */

/* A small square tab at the bottom-right, translucent until hovered; under the
   toast, hidden in print, an icon on narrow windows. The page keeps a gutter
   under its content so the last lines can scroll clear of it. */
body {
  padding-bottom: 44px;
}

.feedback-tab {
  position: fixed;
  right: 8px;
  bottom: 8px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  color: var(--label);
  background: var(--shell);
  border: 1px solid #5a615c;
  border-radius: 0;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 120ms ease-out;
}

.feedback-tab:hover,
.feedback-tab:focus-visible {
  opacity: 1;
  background: var(--rail);
}

@media (max-width: 640px) {
  .feedback-tab {
    width: 30px;
    padding: 0;
    justify-content: center;
  }
  .feedback-tab-label {
    display: none;
  }
}

@media print {
  .feedback-tab {
    display: none;
  }
}

.feedback-dialog {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--text);
  border-radius: 0;
}

.feedback-dialog::backdrop {
  background: rgba(26, 28, 27, 0.5);
}

.feedback-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.feedback-form h2 {
  margin: 0;
  font-size: 18px;
}

.feedback-form p {
  margin: 0;
}

.feedback-form .dd {
  display: block;
}

.feedback-form textarea {
  width: 100%;
}

.feedback-form textarea {
  font: inherit;
  color: var(--text);
  background: var(--label);
  border: 1px solid var(--frame);
  border-radius: 0;
  padding: 6px 8px;
  resize: vertical;
}

.feedback-form textarea:focus {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  outline: none;
}

.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.feedback-field input {
  width: 100%;
}

.feedback-drop {
  padding: 8px;
  border: 1px dashed var(--frame);
}

.feedback-drop[data-dragging] {
  background: var(--band);
  border-color: var(--accent);
}

.feedback-attach {
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-attach .button {
  flex: none;
}

.feedback-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feedback-thumbs:not(:empty) {
  margin-bottom: 8px;
}

.feedback-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
}

.feedback-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feedback-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  padding: 0;
  font: inherit;
  line-height: 1;
  color: var(--label);
  background: var(--shell);
  border: 0;
  cursor: pointer;
}

.feedback-status {
  color: var(--danger);
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* -- admin page ----------------------------------------------------------------- */

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.state-dot {
  width: 10px;
  height: 10px;
  background: var(--muted);
}

.state-ok {
  color: var(--good);
}
.state-ok .state-dot {
  background: var(--good);
}
.state-warn {
  color: var(--caution);
}
.state-warn .state-dot {
  background: var(--caution);
}
.state-down {
  color: var(--danger);
}
.state-down .state-dot {
  background: var(--danger);
}
.state-off {
  color: var(--muted);
  font-weight: 400;
}
.state-off .state-dot {
  background: transparent;
  border: 1px solid var(--muted);
}

.group-row th {
  background: var(--surface);
  border-top: 0;
  border-bottom: 1px solid var(--text);
  padding-top: 10px;
}

.feedback-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

tr.unread td {
  font-weight: 700;
}

.message-cell {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.status-tag.status-new {
  color: var(--accent);
}
.status-tag.status-done {
  color: var(--good);
}

.detail-dialog {
  width: min(720px, calc(100% - 32px));
}

.detail-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 10px;
  background: var(--label);
  border: 1px solid var(--border);
}

.detail-images {
  align-items: flex-start;
}

.detail-image {
  display: block;
  max-width: 120px;
  max-height: 90px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.detail-image.zoomed {
  max-width: 100%;
  max-height: none;
  cursor: zoom-out;
}

.detail-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  margin: 0;
}

.detail-facts dt {
  color: var(--muted);
}

.detail-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/*
 * Dropdowns. Every <select> is shown this way (assets/dropdown.js keeps the real
 * select, hidden, behind it), and the module picker's <details> matches. The list
 * is position: fixed so tables that scroll sideways don't clip it.
 */
.dd {
  position: relative;
  display: inline-block;
  vertical-align: middle;
  max-width: 100%;
}

.dd[hidden] {
  display: none;
}

.dd-native {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.dd-button,
.multi-select summary {
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: 30px;
  padding: 0 28px 0 8px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  background: var(--label);
  border: 1px solid var(--frame);
  border-radius: 0;
  cursor: pointer;
  list-style: none;
}

.dd-button {
  width: 100%;
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.dd-button::after,
.multi-select summary::after {
  content: '\25BE';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.dd-button:hover,
.multi-select summary:hover {
  border-color: var(--text);
}

.dd-button:focus-visible,
.multi-select summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.dd.open .dd-button,
.multi-select[open] summary {
  border-color: var(--text);
}

.dd-button:disabled,
.multi-select summary.locked {
  color: var(--muted);
  background: var(--surface);
  border-color: var(--border);
  cursor: default;
}

/* The box is as wide as its longest choice, so it doesn't change size as you choose. */
.dd-label {
  display: grid;
  min-width: 0;
}

.dd-label > * {
  grid-area: 1 / 1;
  overflow: hidden;
  white-space: nowrap;
}

.dd-text {
  text-overflow: ellipsis;
}

.dd-sizer {
  visibility: hidden;
  height: 0;
}

.dd-list {
  position: fixed;
  z-index: 100;
  box-sizing: border-box;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  list-style: none;
  font-size: 13px;
  color: var(--text);
  background: var(--label);
  border: 1px solid var(--text);
}

.dd-list[hidden] {
  display: none;
}

.dd-option {
  padding: 5px 12px 5px 8px;
  cursor: pointer;
  white-space: nowrap;
}

.dd-option.active {
  background: var(--band);
}

.dd-option[aria-selected='true'] {
  font-weight: 600;
  box-shadow: inset var(--reveal) 0 0 var(--accent);
}

.dd-option[aria-disabled='true'] {
  color: var(--muted);
  cursor: default;
}

.dd-group {
  padding: 6px 8px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Optional modules: the same box, opening in place with a tick box per module. */
.multi-select {
  min-width: 190px;
}

.multi-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--text);
  border-top: 0;
  background: var(--label);
}

.module-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}
