/* Logbook: Ground's documents. The tools are the kit's; the page is the canvas. */
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--g-bg); color: var(--g-text); font: var(--g-text-size) / 1.4 var(--g-font-sans); }
body { display: grid; grid-template-rows: auto auto 1fr; }
button, select { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Top: the file, open and save, and the way back to the panel. */
.top { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--g-panel); border-bottom: 1px solid var(--g-line); min-width: 0; }
.top .mark { border-radius: 8px; flex: none; }
.top .doc { min-width: 0; }
.top .where { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .file { font: 600 15px / 1.1 var(--g-font-display); max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .where { color: var(--g-text-3); font-size: 12px; }
.top .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; margin-left: 4px; padding: 4px 10px 4px 8px; min-height: 36px; color: var(--g-text); text-decoration: none; border: 1px solid var(--g-line); border-radius: var(--g-radius, 8px); flex: 0 1 auto; min-width: 0; }
.who[hidden] { display: none; }
.who:hover { background: var(--g-panel-2); border-color: var(--g-line-strong); }
.who:focus-visible { outline: 3px solid var(--g-focus-ring); outline-offset: 1px; }
.who g-icon { flex: none; }
.who-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.who-text strong, .who-text small { font-size: 12px; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text small { color: var(--g-text-3); }

/* The formatting bar: one row, the most used tools; everything keyboard-reachable. */
.bar { display: flex; align-items: center; gap: 2px; padding: 5px 10px; background: var(--g-panel); border-bottom: 1px solid var(--g-line); overflow-x: auto; scrollbar-width: thin; }
.bar .spacer { flex: 1; }
.bar .sep { width: 1px; height: 22px; margin: 0 6px; background: var(--g-line); flex: none; }
.tool { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border: 1px solid transparent; border-radius: var(--g-radius); background: transparent; color: var(--g-text); cursor: pointer; }
.tool:hover { background: var(--g-panel-2); }
.tool:focus-visible { outline: none; box-shadow: var(--g-focus); }
.tool[aria-pressed="true"] { background: var(--g-accent-soft); color: var(--g-accent-strong); border-color: var(--g-accent); }
.tool:disabled { color: var(--g-text-3); cursor: default; background: transparent; }
.tool g-icon { --g-icon-size: 18px; }
.style { flex: none; height: 34px; min-width: 150px; padding: 0 30px 0 10px; border: 1px solid var(--g-line); border-radius: var(--g-radius); background: var(--g-panel-2); color: var(--g-text); cursor: pointer; }
.style:focus-visible { outline: none; box-shadow: var(--g-focus); }

/* The page. */
.stage { position: relative; min-height: 0; background: var(--g-bg); }
#logbook_canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
#logbook_canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--g-focus-ring); }
.loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--g-text-2); pointer-events: none; }

/* Open: the person's documents, the company's and their department's. */
.files .space { margin: 10px 10px 2px; font-size: 12px; font-weight: 600; color: var(--g-text-3); }
.files { display: grid; gap: 2px; min-width: min(460px, 80vw); max-height: 60vh; overflow: auto; }
.files button { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border: 0; border-radius: var(--g-radius); background: transparent; color: var(--g-text); text-align: left; cursor: pointer; }
.files button:hover, .files button:focus-visible { background: var(--g-accent-soft); outline: none; }
.files .when { font-size: 12px; color: var(--g-text-3); }
.empty { color: var(--g-text-3); }

@media (max-width: 900px) {
  .who-text, .top .label { display: none; }
  .top .file { max-width: 40vw; }
}
/* A phone: the name takes the room left, on one line each; the state is its colour and word. */
@media (max-width: 600px) {
  .top { gap: 6px; padding: 8px 10px; }
  .top .mark { width: 26px; height: 26px; }
  .top .doc { flex: 1 1 auto; }
  .top .file { max-width: none; }
  .top .spacer { display: none; }
  .who { padding: 4px 8px; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
