/* ---- Page header -------------------------------------------------------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-head__text { min-width: 0; }
.page-head h1 {
  position: relative;
  padding-left: 16px;
  color: var(--navy);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.024em;
}
/* The site's section-title bar, scaled for a working tool. */
.page-head h1::before { content: ""; position: absolute; left: 0; top: 0.12em; bottom: 0.1em; width: 4px; border-radius: 2px; background: var(--blue); }
.lede { max-width: 76ch; margin-top: 10px; padding-left: 16px; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.lede strong { color: var(--navy); font-weight: 600; }
.lede .slug { margin-left: 6px; color: var(--text-3); }
.crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; padding-left: 16px; color: var(--text-3); font-size: 12.5px; }
.crumbs a { color: var(--blue-ink); font-weight: 500; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-head__actions { display: flex; gap: 8px; align-items: center; flex: none; }
.pager { display: flex; gap: 4px; }
.pager .icon-btn { border-color: var(--line); }

/* ---- Buttons and links ------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--navy);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn:hover { border-color: var(--blue-300); background: var(--blue-50); }
.btn:active { transform: translateY(1px); }
.btn--primary { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: var(--shadow-brand); }
.btn--primary:hover { border-color: var(--blue-hover); background: var(--blue-hover); }
.btn--danger { border-color: var(--blocked); background: var(--blocked); color: #fff; }
.btn--danger:hover { border-color: #a82d22; background: #a82d22; }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--sm { height: 30px; padding: 0 11px; border-radius: 8px; font-size: 12.5px; gap: 6px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--blue-50); color: var(--navy); }
.icon-btn--sm { width: 28px; height: 28px; border-radius: 7px; }

.link { display: inline-flex; align-items: center; gap: 5px; color: var(--blue-ink); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.link .i { transition: transform 0.15s var(--ease); }
.link:hover { color: var(--blue-hover); }
.link:hover .i { transform: translateX(2px); }
.link-btn { padding: 0; border: 0; background: none; color: var(--blue-ink); font-size: 12px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s, opacity 0.15s;
}
.copy-btn:hover { border-color: var(--blue-300); color: var(--blue-ink); }

/* ---- Status, tags, codes ---------------------------------------------------
   Filled dot: decided and usable. Hollow: not started or set aside. Amber: work blocks it. */

.st { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 12.5px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.st::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--held); }
.st--ready::before { background: var(--ready); }
.st--work { color: var(--work); }
.st--work::before { background: var(--work); }
.st--alt::before { background: var(--lilac); }
.st--held { color: var(--text-3); }
.st--held::before, .st--neutral::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--held); }
.st--active::before { background: var(--surface); box-shadow: inset 0 0 0 2px var(--blue); }
.st--blocked { color: var(--blocked); }
.st--blocked::before { background: var(--blocked); }

.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--chip); color: var(--text-2); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.tag--blue { background: var(--blue-100); color: var(--blue-ink); }
.tag--amber { background: var(--work-bg); color: var(--work); }
.code, .code-btn { display: inline-block; padding: 1px 5px; border-radius: 4px; background: var(--chip); color: var(--navy); font-family: var(--mono); font-size: 11.5px; font-weight: 500; line-height: 1.5; letter-spacing: 0; }
.code--lg { padding: 2px 7px; font-size: 13px; }
.code-btn { border: 0; transition: background 0.15s, color 0.15s; }
.code-btn:hover { background: var(--blue-100); color: var(--blue-ink); }
.count { display: inline-block; min-width: 20px; padding: 0 7px; border-radius: 10px; background: var(--chip); color: var(--text-3); font-size: 11.5px; font-weight: 500; line-height: 19px; text-align: center; }
.label { color: var(--text-3); font-size: 12px; font-weight: 500; }
kbd { display: inline-block; margin-left: 2px; padding: 0 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--text-3); font: 500 10.5px/16px var(--mono); }

/* ---- Form controls ---------------------------------------------------- */

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input, .select { height: 36px; padding: 0 12px; }
.textarea { display: block; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--blue-300); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); box-shadow: var(--ring); outline: none; }
.input::placeholder, .textarea::placeholder { color: #9aa5bd; }
.select { appearance: none; padding-right: 32px; background: var(--surface) var(--chevron) no-repeat right 11px center; cursor: pointer; }
.select--compact { width: auto; height: 32px; font-size: 13px; }
.input--date { width: 150px; height: 32px; font-size: 13px; }
.input-row { display: flex; gap: 6px; align-items: center; }
.stack { display: grid; gap: 6px; }
.stack--inline { display: flex; align-items: center; gap: 10px; }

.status-select {
  --dot: transparent;
  --ring-dot: var(--held);
  width: 100%;
  height: 30px;
  padding: 0 26px 0 27px;
  appearance: none;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background:
    radial-gradient(circle at 13px 50%, var(--dot) 3.4px, var(--ring-dot) 3.6px, var(--ring-dot) 4.6px, transparent 5px),
    var(--chevron) no-repeat right 9px center,
    var(--surface);
  background-repeat: no-repeat;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.status-select:hover { border-color: var(--blue-300); }
.status-select:focus { border-color: var(--blue); box-shadow: var(--ring); }
.status-select[data-tone="active"] { --dot: var(--surface); --ring-dot: var(--blue); }
.status-select[data-tone="ready"] { --dot: var(--ready); --ring-dot: var(--ready); }
.status-select[data-tone="blocked"] { --dot: var(--blocked); --ring-dot: var(--blocked); color: var(--blocked); border-color: #f0c4bf; }

.search-field { position: relative; display: flex; align-items: center; }
.search-field .i { position: absolute; left: 11px; color: var(--text-3); pointer-events: none; }
.search-field input {
  width: 260px;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--surface);
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s, width 0.2s var(--ease);
}
.search-field input:focus { border-color: var(--blue); box-shadow: var(--ring); }
.search-field--block input { width: 100%; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--chip); }
.seg__item {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg__item:hover { color: var(--navy); }
.seg__item.is-active { background: var(--surface); color: var(--navy); box-shadow: 0 1px 2px rgba(19, 52, 102, 0.12), 0 0 0 1px rgba(19, 52, 102, 0.04); }
.seg--sm .seg__item { height: 26px; padding: 0 9px; font-size: 12px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 20px; }
.toolbar > .search-field { margin-left: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter span { color: var(--text-3); font-size: 12px; }
.filter:hover { border-color: var(--blue-300); color: var(--navy); }
.filter--ready::before, .filter--work::before, .filter--alt::before, .filter--held::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.filter--ready::before { background: var(--ready); }
.filter--work::before { background: var(--work); }
.filter--alt::before { background: var(--lilac); }
.filter--held::before { box-shadow: inset 0 0 0 1.5px var(--held); }
.filter.is-active { border-color: var(--navy); background: var(--navy); color: #fff; }
.filter.is-active span { color: rgba(255, 255, 255, 0.7); }
.filter--toggle.is-active { border-color: var(--blue); background: var(--blue-50); color: var(--blue-ink); }
.filter--toggle.is-active span { color: var(--blue-ink); }
.hint-line { display: flex; align-items: center; gap: 7px; margin: -6px 0 18px; color: var(--text-3); font-size: 12.5px; }

/* ---- Panels -------------------------------------------------------------- */

.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.panel__head h2 { color: var(--navy); font-size: 15px; font-weight: 600; letter-spacing: -0.005em; }
.panel__pad { padding: 18px; }
.panel__pad > p { color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.panel__sub { display: flex; align-items: center; gap: 8px; padding: 16px 18px 6px; }
.panel__sub h3 { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.panel__empty { padding: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.panel__more { display: block; padding: 4px 18px 14px; color: var(--blue-ink); font-size: 12.5px; font-weight: 500; text-decoration: none; }
.panel__more:hover { text-decoration: underline; }

.empty { display: grid; justify-items: center; gap: 6px; padding: 48px 20px; color: var(--text-2); text-align: center; font-size: 13.5px; }
.empty__title { color: var(--navy); font-size: 15px; font-weight: 600; }
.empty .btn { margin-top: 8px; }

.disclosure { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 18px; }
.disclosure > summary { display: flex; align-items: center; gap: 10px; padding: 13px 0; color: var(--navy); font-size: 13.5px; font-weight: 500; list-style: none; cursor: pointer; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ""; width: 12px; height: 12px; flex: none; background: var(--chevron) no-repeat center; transform: rotate(-90deg); transition: transform 0.2s var(--ease); }
.disclosure[open] > summary::before { transform: none; }
.disclosure[open] { padding-bottom: 18px; }
.disclosure--flat { margin-top: 14px; padding: 0; border: 0; }
.disclosure--flat[open] { padding-bottom: 0; }

.callout { display: flex; gap: 10px; margin: 0 0 12px; padding: 11px 13px; border-radius: 9px; font-size: 13px; line-height: 1.55; }
.callout .i { flex: none; margin-top: 2px; }
.callout strong { font-weight: 600; }
.callout--work { background: var(--work-bg); color: var(--work-ink); }
.callout--work .i { color: var(--work); }
.callout--held { background: var(--held-bg); color: var(--text-2); }

.private-note { display: flex; gap: 10px; margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--lilac-200); border-radius: 10px; background: var(--lilac-50); color: var(--text-2); }
.private-note > .i { flex: none; margin-top: 3px; color: var(--lilac); }
.private-note .label { display: block; margin-bottom: 4px; color: #5f55c9; }

/* ---- The desk: book pages sit on a cool neutral surface, like proofs on a table ---- */

.desk {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--desk);
}
.desk > .thumb {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: calc(100% - 28px);
  max-height: calc(100% - 28px);
  width: auto;
  height: auto;
  background: #fff;
  border-radius: 2px;
  box-shadow: var(--paper);
  transition: transform 0.35s var(--ease);
}
.desk > .thumb--empty, .thumb--empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  inset: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  background: transparent;
  box-shadow: none;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 500;
}
.desk--sm { width: 64px; aspect-ratio: 4 / 3; border-radius: 6px; }
.desk--sm > .thumb { max-width: calc(100% - 8px); max-height: calc(100% - 8px); }
.desk--xs { width: 40px; aspect-ratio: 4 / 3; border-radius: 5px; }
.desk--xs > .thumb { max-width: calc(100% - 6px); max-height: calc(100% - 6px); box-shadow: 0 1px 2px rgba(19, 52, 102, 0.2); }
.desk--sm .thumb--empty span, .desk--xs .thumb--empty span, .desk--row .thumb--empty span { display: none; }
.desk--row { width: 92px; aspect-ratio: 3 / 2; border-radius: 7px; }
.desk--row > .thumb { max-width: calc(100% - 12px); max-height: calc(100% - 12px); }
.desk--lg { aspect-ratio: 3 / 2; max-height: 540px; border-radius: 12px; cursor: zoom-in; }
.desk--lg > .thumb { max-width: calc(100% - 48px); max-height: calc(100% - 40px); }
.desk--lg:hover > .thumb { transform: scale(1.012); }
.desk--xl { aspect-ratio: 4 / 3; border-radius: 12px; }
.desk--xl > .thumb { max-width: calc(100% - 48px); max-height: calc(100% - 48px); }
.desk__zoom { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 7px; background: rgba(255, 255, 255, 0.92); color: var(--navy); font-size: 11.5px; font-weight: 500; opacity: 0; transition: opacity 0.15s; }
.desk:hover .desk__zoom, .desk:focus-visible .desk__zoom { opacity: 1; }

/* ---- Protected field ------------------------------------------------------ */

.field { position: relative; margin: 0 -12px; padding: 10px 12px; border-radius: 10px; transition: background 0.15s; }
.field:hover { background: var(--surface-2); }
.field.is-editing, .field.is-locked:hover { background: transparent; }
.field__head { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.field__label { color: var(--text-3); font-size: 12px; font-weight: 500; }
.field__flag { padding: 0 6px; border-radius: 4px; background: var(--work-bg); color: var(--work); font-size: 11px; font-weight: 600; line-height: 18px; }
.field__count, .field__live { color: var(--text-3); font-size: 11.5px; }
.field__count.is-over, .field__live.is-over { color: var(--work); font-weight: 600; }
.field__tools { display: flex; align-items: center; gap: 10px; margin-left: auto; opacity: 0; transition: opacity 0.15s; }
.field:hover .field__tools, .field:focus-within .field__tools, .field.is-edited .field__tools { opacity: 1; }
.field__lock { display: inline-grid; color: var(--text-3); }
.field__value { margin-top: 2px; color: var(--text); font-size: 14px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.field__value .prose, .field__value .facts { white-space: normal; }
.field__value.mono { font-size: 13px; }
.field__placeholder { color: #98a3bb; }
.field__original { margin-top: 10px; padding: 10px 12px; border-left: 2px solid var(--line-2); border-radius: 0 8px 8px 0; background: var(--surface-2); color: var(--text-2); font-size: 13px; line-height: 1.55; white-space: pre-line; }
.field__original span { display: block; margin-bottom: 4px; color: var(--text-3); font-size: 11.5px; font-weight: 500; }
.field__hint { margin-top: 6px; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.field__editor { margin-top: 6px; }
.field__input { display: block; width: 100%; padding: 10px 12px; border: 1px solid var(--blue); border-radius: 9px; background: var(--surface); box-shadow: var(--ring); color: var(--text); font-size: 14px; line-height: 1.6; resize: vertical; outline: none; }
input.field__input { height: 38px; padding: 0 12px; }
.field__actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.field__keys { margin-right: auto; color: var(--text-3); font-size: 11.5px; }
@media (hover: none) { .field__tools { opacity: 1; } }

/* ---- Lists of links and files ------------------------------------------- */

.file-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  text-align: left;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.file-btn { min-width: 0; }
.file-btn > span { display: grid; flex: 1; min-width: 0; line-height: 1.4; }
.file-btn > span, .file-btn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-btn b { color: var(--navy); font-weight: 500; }
.file-btn > .i:first-child { flex: none; color: var(--text-3); }
.file-btn > .i:last-child { flex: none; color: var(--text-3); }
.file-btn:hover { border-color: var(--blue-300); background: var(--blue-50); }
.file-btn--inline { display: inline-flex; width: auto; max-width: 100%; }
.sub-label { margin: 16px 0 8px; color: var(--text-3); font-size: 12px; font-weight: 500; }
.plain-list { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.8; }
.plain-list a { color: var(--blue-ink); text-decoration: none; }
.plain-list a:hover { text-decoration: underline; }

/* ---- Prose (rendered Markdown) ----------------------------------------- */

.prose { color: var(--text); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 12px; }
.prose h2 { margin: 40px 0 12px; color: var(--navy); font-size: 19px; font-weight: 600; line-height: 1.3; letter-spacing: -0.012em; scroll-margin-top: 24px; }
.prose h3 { margin: 28px 0 8px; color: var(--navy); font-size: 15.5px; font-weight: 600; line-height: 1.35; scroll-margin-top: 24px; }
.prose h4, .prose h5, .prose h6 { margin: 20px 0 6px; color: var(--navy); font-size: 14px; font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin: 3px 0; padding-left: 2px; }
.prose li::marker { color: var(--blue); }
.prose strong { color: var(--navy); font-weight: 600; }
.prose code { padding: 1px 5px; border-radius: 4px; background: var(--chip); color: var(--navy); font-family: var(--mono); font-size: 0.84em; }
.prose a, .md-link { color: var(--blue-ink); text-decoration: underline; text-decoration-color: rgba(26, 102, 217, 0.3); text-underline-offset: 3px; }
.md-link { padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.prose a:hover, .md-link:hover { text-decoration-color: currentColor; }
.prose hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }
.prose blockquote { margin: 0 0 14px; padding: 2px 0 2px 16px; border-left: 3px solid var(--blue-200); color: var(--text-2); }
.md-ref { color: var(--navy); font-weight: 500; }
.md-pre { margin: 0 0 14px; padding: 12px 14px; overflow: auto; border-radius: 9px; background: var(--surface-2); font: 12.5px/1.6 var(--mono); }
.md-table { margin: 4px 0 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.md-table table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
.md-table th { padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--navy); font-weight: 600; text-align: left; white-space: nowrap; }
.md-table td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.md-table tr:first-child td { border-top: 0; }
.prose--tight { font-size: 13.5px; line-height: 1.6; }
.prose--tight p { margin-bottom: 8px; }
.prose--tight ul, .prose--tight ol { margin-bottom: 8px; }

/* ---- Drawer ------------------------------------------------------------- */

.drawer-root { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.drawer-root:empty { display: none; }
.scrim { position: absolute; inset: 0; background: rgba(19, 52, 102, 0.16); opacity: 0; pointer-events: auto; transition: opacity 0.22s; }
.drawer {
  position: absolute;
  top: 8px;
  right: 8px;
  bottom: 8px;
  width: min(580px, calc(100vw - 16px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  pointer-events: auto;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.28s var(--ease);
}
.drawer-root.is-open .scrim { opacity: 1; }
.drawer-root.is-open .drawer { transform: none; }
/* Frosted header, echoing the site's blurred navigation bar. */
.drawer__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px) saturate(1.4);
}
.drawer__kicker { margin-bottom: 4px; color: var(--text-3); font-size: 12.5px; }
.drawer__kicker a { color: var(--blue-ink); font-weight: 500; text-decoration: none; }
.drawer__kicker a:hover { text-decoration: underline; }
.drawer__head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--navy); font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.drawer__body { display: grid; gap: 22px; padding: 20px 24px 28px; }
.drawer__section h3 { margin-bottom: 10px; color: var(--navy); font-size: 13px; font-weight: 600; }
.drawer__section > p { color: var(--text-2); font-size: 13.5px; line-height: 1.6; margin-bottom: 10px; }
.drawer__id { color: var(--text-3); font-size: 11px; }

/* ---- Command palette ------------------------------------------------------- */

#palette-root:empty, #dialog-root:empty { display: none; }
.palette-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(19, 52, 102, 0.2); backdrop-filter: blur(2px); }
.palette {
  position: fixed;
  z-index: 61;
  top: 11vh;
  left: 50%;
  display: flex;
  flex-direction: column;
  width: min(660px, calc(100vw - 24px));
  max-height: 72vh;
  overflow: hidden;
  border: 1px solid rgba(177, 202, 255, 0.7);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: var(--shadow-pop);
  transform: translateX(-50%);
  animation: pop 0.16s var(--ease);
}
.palette__input { display: flex; align-items: center; gap: 12px; padding: 0 16px 0 18px; border-bottom: 1px solid var(--line); color: var(--text-3); }
.palette__input input { flex: 1; height: 56px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15.5px; }
.palette__input input::-webkit-search-cancel-button { display: none; }
.palette__list { overflow-y: auto; padding: 6px 8px 8px; }
.palette__group { margin: 12px 10px 4px; color: var(--text-3); font-size: 11.5px; font-weight: 500; }
.palette__item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 14px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-3);
  text-align: left;
}
.palette__item > .i:last-child { opacity: 0; }
.palette__item.is-selected { background: var(--blue-50); color: var(--blue-ink); }
.palette__item.is-selected > .i:last-child { opacity: 1; }
.palette__text { display: grid; min-width: 0; }
.palette__title, .palette__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette__title { color: var(--navy); font-size: 13.5px; font-weight: 500; }
.palette__sub { color: var(--text-3); font-size: 12px; }
.palette__snip { margin-top: 2px; color: var(--text-2); font-size: 12px; line-height: 1.45; }
.palette__snip mark { padding: 0 1px; border-radius: 3px; background: rgba(48, 131, 255, 0.18); color: var(--navy); }
.palette__empty { padding: 28px 12px; color: var(--text-2); text-align: center; font-size: 13.5px; }
.palette__foot { display: flex; gap: 18px; margin: 0; padding: 9px 18px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 11.5px; }

/* ---- Dialog and toast ------------------------------------------------- */

.dialog-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(19, 52, 102, 0.28); }
.dialog { position: fixed; z-index: 81; top: 50%; left: 50%; width: min(460px, calc(100vw - 32px)); padding: 22px 24px 20px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-pop); transform: translate(-50%, -50%); }
.dialog h2 { margin-bottom: 8px; color: var(--navy); font-size: 17px; font-weight: 600; line-height: 1.35; }
.dialog p { color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.dialog p strong { color: var(--navy); }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.toast {
  position: fixed;
  z-index: 90;
  bottom: 22px;
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--navy);
  box-shadow: var(--shadow-pop);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 0.2s, transform 0.25s var(--ease);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.toast--error { background: #8f2a20; }

/* ---- Online (admin.eyadprimed.com) ----------------------------------------- */

.account { display: flex; align-items: center; gap: 8px; padding: 6px 12px 0; font-size: 12px; }
.account__email { flex: 1; min-width: 0; overflow: hidden; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.save-warning { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.save-warning span { flex: 1 1 320px; }
.pair-code { display: inline-flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 14px; border: 1px dashed var(--blue-300); border-radius: 10px; background: var(--blue-50); }
.pair-code .mono { color: var(--navy); font-size: 20px; font-weight: 500; letter-spacing: 0.08em; }
.pair-form { display: flex; gap: 8px; max-width: 360px; margin-top: 14px; }
.pair-form .input { letter-spacing: 0.08em; text-transform: uppercase; }
.pc-note { display: none; color: var(--text-3); font-size: 12.5px; }
/* Online without a paired PC, file actions are hidden; links inside documents stay as plain text. */
.pc-off .file-btn[data-open-path], .pc-off .btn[data-open-path], .pc-off .icon-btn[data-open-path] { display: none; }
.pc-off .md-link[data-open-path] { color: inherit; text-decoration: none; pointer-events: none; }
.pc-off .pc-note { display: block; }
