/* shell.css
   The frame around the views: navigation pane, top bar with the gear,
   and the dialogs (jump box, lists and settings). Calm and monochrome. */

/* minmax(0, 1fr): the view may never grow wider than the window; a wide
   outliner or board scrolls inside its own area, not the whole page
   (found while testing). */
/* The layout rule (2 Dec 2026): the app's frame never scrolls, not even
   when the browser wants to show a focused box. "clip" (unlike "hidden")
   makes it impossible; only the lists, grids and panes inside scroll. */
.shell {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  height: 100vh;
  overflow: clip;
}

/* With the pane hidden, the view takes the one remaining column. */
.shell.pane-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.shell.pane-hidden .nav-column {
  display: none;
}

/* ---- navigation pane ---------------------------------------------------- */

.nav-column {
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--stroke);
}

.nav-pane {
  flex: 1;
  overflow-y: auto;
}

.nav-title {
  padding: 0.9rem 1rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.4rem;
}

.nav-list:focus {
  outline: none;
}

.nav-item {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item.here {
  background: var(--surface);
  border-color: var(--stroke);
}

.nav-item.marked {
  outline: 2px solid var(--stroke);
  outline-offset: -2px;
}

.nav-item.archived {
  color: var(--muted);
  padding-left: 1.4rem;
}

.nav-count {
  color: var(--muted);
  font-size: 0.85rem;
}

.nav-separator {
  border-top: 1px solid var(--line);
  margin: 0.4rem 0.4rem;
}

.nav-hint {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0.5rem 0.6rem;
}

/* ---- main column ---------------------------------------------------------- */

.main-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: clip;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem 0.5rem 0.6rem;
}

.top-bar .gear-button { margin-left: auto; } /* the gear stays top right */

.folder-status {
  font-size: 0.85rem;
  color: var(--muted);
}

.folder-status.read-only {
  color: var(--ink);
  font-weight: 600;
}

/* A short message after an action, for example "Moved … to Renovation". */
.notice {
  font-size: 0.85rem;
  color: var(--ink);
}

/* The search box, top right next to the gear (Ctrl+F; 2 Dec 2026). The
   results open under it, over the view. */
.top-bar .search-box { margin-left: auto; position: relative; }
.top-bar .search-box + .gear-button { margin-left: 0; }

.search-input {
  font: inherit;
  font-size: 0.9rem;
  width: 18rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line-mid);
  border-radius: 6px;
}

.search-input:focus { outline: none; border-color: var(--stroke); }

.search-results {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 150;
  width: 26rem;
  max-height: 60vh;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0.3rem 0;
  background: var(--surface);
  border: 1px solid var(--stroke);
  box-shadow: 4px 4px 0 var(--line);
}

.search-results li { padding: 0.45rem 0.8rem; cursor: default; }
.search-results li.chosen { background: var(--fill); }
.search-results .search-where { color: var(--muted); font-size: 0.8rem; }
.search-results .search-snippet { color: var(--ink-soft); font-size: 0.85rem; margin-top: 0.15rem; }
.search-results mark { background: var(--line); color: inherit; font-weight: 600; padding: 0 1px; } /* monochrome, as the design guidelines ask */
.search-results .no-match { color: var(--muted); }
.search-results .search-status { color: var(--muted); font-size: 0.85rem; cursor: default; }

/* The pane buttons (left pane in the top bar, context pane in a view's
   header): a small window drawing, darker while the pane is shown. */
.pane-button {
  border: none;
  background: none;
  padding: 0.2rem;
  line-height: 0;
  color: var(--line-strong);
  cursor: pointer;
}

.pane-button[aria-pressed="true"] { color: var(--ink); }
.pane-button:hover { color: var(--ink-soft); }
.pane-button-right { margin-left: 0.5rem; }

.gear-button {
  border: none;
  padding: 0.25rem;
  line-height: 0;
  color: var(--ink);
  background: none;
}

.view-place {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 1rem 1rem;
  min-height: 0;
  overflow: clip;
}

.coming-soon {
  color: var(--muted);
  padding: 1.5rem 1.25rem;
}

/* ---- dialogs ------------------------------------------------------------- */

/* The grey layer behind a dialog (gear, jump box, chooser). Its z-index
   keeps it above everything in the views: without it, the grid's sticky
   header and columns (z-index 1-3) were drawn on top of the grey, so parts
   of the page stayed bright while the gear was open (found by Stany). */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--backdrop);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
}

.jump-box {
  width: min(34rem, 90vw);
  background: var(--surface);
  border: 2px solid var(--stroke);
}

.jump-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 1.1rem;
  padding: 0.8rem 1rem;
  border: none;
  border-bottom: 1px solid var(--line);
}

.jump-input:focus {
  outline: none;
}

.jump-results {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
}

.jump-results li {
  padding: 0.5rem 0.7rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}

.jump-results li.chosen {
  background: var(--fill);
}

.jump-results .no-match {
  color: var(--muted);
}

.settings {
  width: min(52rem, 92vw);
  height: min(36rem, 80vh);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--stroke);
}

.settings:focus {
  outline: none;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.settings-close {
  border: none;
  font-size: 1.3rem;
  padding: 0 0.4rem;
}

.settings-body {
  flex: 1;
  display: grid;
  grid-template-columns: 12rem 1fr;
  min-height: 0;
}

.settings-tabs {
  list-style: none;
  margin: 0;
  padding: 0.75rem 0.5rem;
  border-right: 1px solid var(--line);
}

.settings-tabs li {
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.settings-tabs li.chosen {
  background: var(--fill);
  border-color: var(--stroke);
}

.settings-content {
  padding: 0.75rem 1.5rem;
  overflow-y: auto;
}

.settings-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.settings-input {
  font: inherit;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.8rem;
  border: 1px dashed var(--muted);
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.settings-input:focus {
  outline: none;
  border: 1.5px solid var(--focus);
}

.settings-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--fill);
}

.settings-row:focus,
.settings-row.chosen {
  outline: 1.5px solid var(--focus);
  outline-offset: -1.5px;
}

.settings-row-name {
  flex: 1;
}

.drag-mark {
  color: var(--muted);
  width: 1rem;
}

.row-button {
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border-color: var(--line-mid);
}

.settings-subtitle {
  margin: 1rem 0 0.3rem;
  color: var(--muted);
}

.settings-problem {
  color: var(--ink);
  font-weight: 600;
}

/* Resources: the name and the hours are boxes that look like plain text
   until you point at them or type in them. */
.person-name,
.person-hours {
  font: inherit;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  background: none;
  min-width: 0;
}

.person-name:hover,
.person-hours:hover,
.person-name:focus,
.person-hours:focus {
  border-color: var(--muted);
  outline: none;
}

.person-hours {
  width: 3rem;
  text-align: right;
}

.settings-row-detail {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* Holidays: a line with a label, boxes and a button. */
.settings-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.settings-line > span:first-child {
  width: 4.5rem;
  color: var(--muted);
}

.settings-line input {
  font: inherit;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line-mid);
  border-radius: 4px;
}

.settings-line .holiday-name {
  margin-bottom: 0;
  flex: 1;
  padding: 0.3rem 0.5rem;
}

.holiday-year {
  width: 5rem;
}

.holiday-day {
  width: 7.5rem;
  color: var(--ink-soft);
}

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

.keys-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--fill);
}

.keys-table .key {
  font-family: ui-monospace, Consolas, monospace;
  white-space: nowrap;
}

.keys-table .where {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Printing any other view with Ctrl+P (the browser's own print): only the
   view itself goes on paper, without the pane, the top bar or key hints. */
@media print {
  .nav-column,
  .top-bar,
  .key-hints,
  .context-pane { display: none !important; }

  .shell { display: block !important; height: auto !important; overflow: visible !important; }
  .main-column,
  .view-place { display: block !important; height: auto !important; overflow: visible !important; }
}

/* "Are you sure?" (shared/confirm-box.js), for example before deleting cards. */
.confirm-box {
  width: min(26rem, 92vw);
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--stroke);
}
.confirm-box:focus { outline: none; }
.confirm-question { margin: 0 0 0.4rem; font-weight: 600; }
.confirm-detail { margin: 0 0 1rem; color: var(--ink-soft); font-size: 0.9rem; }
.confirm-buttons { display: flex; justify-content: flex-end; gap: 0.5rem; }
.confirm-buttons button { font: inherit; padding: 0.25rem 0.9rem; border: 1px solid var(--line-mid); border-radius: 6px; background: none; color: var(--ink); }
.confirm-buttons .confirm-yes { border-color: var(--red); color: var(--red); font-weight: 600; }
.confirm-buttons button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
