/* drive.css: the drive's screens, scoped to .kd (every top-level element of the fragment carries it) and built on the face's
 * tokens (--k-*, tokens.css when the drive wears the face, another product's when it does not); the fallbacks below hold for a
 * shell that predates the tokens. The family's faces of 2026-10-28 (fonts.css, through the face's tokens): IBM Plex Sans for reading,
 * Plex Sans Condensed for titles, Plex Mono for every figure (Inter, Inter Tight and JetBrains Mono under an older shell); one action
 * colour. Phone: 640 px and below, one column, sheets instead of popovers. */

.kd {
  --kd-bg: var(--k-bg, #fafaf8);
  --kd-surface: var(--k-surface, #ffffff);
  --kd-surface-2: var(--k-surface-2, #f1f1ee);
  --kd-ink: var(--k-ink, #16191c);
  --kd-ink-2: var(--k-ink-2, #5f656c);
  --kd-line: var(--k-line, #dddcd7);
  --kd-accent: var(--k-accent, #0f7a70);
  --kd-on-accent: var(--k-on-accent, #ffffff);
  --kd-focus: var(--k-focus, var(--kd-accent));
  --kd-danger: var(--k-danger, #a6342a);
  --kd-warn: var(--k-warn, #8a6508);
  --kd-ok: var(--k-ok, #27693f);
  --kd-radius: var(--k-radius, 4px);
  --kd-ui: var(--k-font-ui, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
  --kd-mono: var(--k-font-mono, "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace);
  --kd-display: "IBM Plex Sans Condensed", "Inter Tight", var(--kd-ui); /* titles and labels, as the chosen page (2026-10-28) */

  --kd-accent-strong: color-mix(in srgb, var(--kd-accent) 78%, #000);
  --kd-accent-faint: color-mix(in srgb, var(--kd-accent) 9%, var(--kd-surface));
  --kd-ink-soft: color-mix(in srgb, var(--kd-ink) 84%, var(--kd-bg));
  --kd-line-strong: color-mix(in srgb, var(--kd-ink) 20%, var(--kd-line));
  --kd-hover: color-mix(in srgb, var(--kd-ink) 5%, transparent);
  --kd-shadow-1: var(--k-shadow-1, 0 1px 2px rgb(18 26 42 / 0.06), 0 2px 8px rgb(18 26 42 / 0.05)); /* a sheet on the canvas */
  --kd-shadow-2: var(--k-shadow-2, 0 2px 4px rgb(18 26 42 / 0.06), 0 12px 28px rgb(18 26 42 / 0.12)); /* raised under the pointer */
  --kd-sheet-radius: calc(var(--kd-radius) * 1.5);
  --kd-head-h: 4.5rem;
  --kd-gutter: 1.5rem;
  --kd-pad: clamp(1.25rem, 2.6vw, 2.5rem);

  font-family: var(--kd-ui);
  font-size: 1rem;
  color: var(--kd-ink);
  scrollbar-color: color-mix(in srgb, var(--kd-ink) 26%, transparent) transparent;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

.kd *, .kd *::before, .kd *::after { box-sizing: border-box; }
.kd [hidden], .kd[hidden] { display: none !important; }
.kd :focus-visible { outline: 2px solid var(--kd-focus); outline-offset: 2px; }
.kd :focus:not(:focus-visible) { outline: none; }
.kd p, .kd h1, .kd h2, .kd ul, .kd ol, .kd figure { margin: 0; }
.kd ul, .kd ol { padding: 0; list-style: none; }
.kd button { font: inherit; color: inherit; }
.kd .kd-num { font-family: var(--kd-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.kd .kd-i { width: 1.25rem; height: 1.25rem; flex: none; display: block; }
.kd [data-icon] { display: inline-flex; flex: none; }

/* the shell's view grid and its fade do not apply: a drive view lays itself out */
.kd.kd-view:not([hidden]) { display: block; animation: none; min-width: 0; }

/* --- buttons and fields ------------------------------------------------------------------------------------------------- */

.kd .kd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: var(--kd-radius);
  background: transparent;
  font: 500 0.875rem/1 var(--kd-ui);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}
.kd .kd-btn .kd-i { width: 1.125rem; height: 1.125rem; }
.kd .kd-btn:disabled { opacity: 0.45; cursor: default; }
.kd .kd-btn-primary { background: var(--kd-accent); color: var(--kd-on-accent); }
.kd .kd-btn-primary:hover:not(:disabled) { background: var(--kd-accent-strong); }
.kd .kd-btn-secondary { border-color: var(--kd-accent); color: var(--kd-accent); }
.kd .kd-btn-secondary:hover:not(:disabled) { background: var(--kd-accent-faint); }
.kd .kd-btn-quiet { color: var(--kd-accent); padding: 0 0.625rem; }
.kd .kd-btn-quiet:hover:not(:disabled) { background: var(--kd-accent-faint); }
.kd .kd-btn-danger { background: var(--kd-danger); color: #ffffff; }
.kd .kd-btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--kd-danger) 82%, #000); }
.kd .kd-btn-lg { min-height: 3rem; padding: 0 1.5rem; font-size: 1rem; }
.kd .kd-danger-text { color: var(--kd-danger); }
.kd .kd-btn-quiet.kd-danger-text:hover:not(:disabled) { background: color-mix(in srgb, var(--kd-danger) 8%, var(--kd-surface)); }

.kd .kd-iconbtn {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--kd-radius);
  background: transparent;
  color: var(--kd-ink-2);
  cursor: pointer;
}
.kd .kd-iconbtn:hover { background: var(--kd-hover); color: var(--kd-ink); }

.kd .kd-seg { display: inline-flex; border: 1px solid var(--kd-line); border-radius: var(--kd-radius); background: var(--kd-surface); padding: 2px; gap: 2px; }
.kd .kd-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 2.25rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--kd-ink-2);
  font: 500 0.8125rem var(--kd-ui);
  cursor: pointer;
}
.kd .kd-seg-btn .kd-i { width: 1.125rem; height: 1.125rem; }
.kd .kd-seg-btn:hover { color: var(--kd-ink); }
.kd .kd-seg-btn[aria-pressed="true"] { background: var(--kd-accent-faint); color: var(--kd-accent-strong); }
.kd .kd-seg-text .kd-seg-btn { padding: 0 0.75rem; }
.kd .kd-seg-text .kd-num { font-size: 0.75rem; color: inherit; opacity: 0.8; }

.kd .kd-field { display: flex; flex-direction: column; gap: 0.375rem; min-width: 0; }
.kd .kd-field-label { font: 500 0.8125rem/1.3 var(--kd-ui); color: var(--kd-ink-2); }
.kd .kd-input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--kd-line-strong);
  border-radius: var(--kd-radius);
  background: var(--kd-surface);
  color: var(--kd-ink);
  font: 0.9375rem var(--kd-ui);
}
.kd .kd-input:focus { border-color: var(--kd-accent); outline: 1px solid var(--kd-accent); outline-offset: 0; }
.kd .kd-input[aria-invalid="true"] { border-color: var(--kd-danger); }
.kd .kd-input::placeholder { color: var(--kd-ink-2); opacity: 0.8; }
.kd .kd-select { appearance: auto; padding-right: 0.5rem; }
.kd .kd-field-error { color: var(--kd-danger); font-size: 0.8125rem; line-height: 1.4; margin-top: 0.5rem; }
.kd input[type="radio"], .kd input[type="checkbox"] { accent-color: var(--kd-accent); width: 1.0625rem; height: 1.0625rem; margin: 0; flex: none; }

.kd .kd-meter { height: 4px; border-radius: 2px; background: var(--kd-surface-2); overflow: hidden; }
.kd .kd-meter-fill { height: 100%; width: 0; background: var(--kd-accent); border-radius: 2px; transition: width 160ms ease-out; }
.kd .kd-meter-fill.is-full { background: var(--kd-warn); }

/* --- My drive: the header -------------------------------------------------------------------------------------------- */

.kd .kd-files { position: relative; --kd-tree-w: 15.5rem; }
.kd .kd-files.is-resizing { cursor: col-resize; user-select: none; }

.kd .kd-head {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  min-height: var(--kd-head-h);
  padding: 0 var(--kd-pad);
  background: var(--kd-surface);
  border-bottom: 1px solid var(--kd-line);
  box-shadow: var(--kd-shadow-1); /* 2026-10-28: the head is a white band with depth over the canvas */
}
.kd .kd-files.has-chips { --kd-head-h: 6.875rem; }
.kd .kd-files.has-chips .kd-head-row { padding-top: 0.875rem; }
.kd .kd-head-row { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-width: 0; }
.kd .kd-tree-toggle { margin-left: -0.5rem; }
.kd .kd-crumbs { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.kd .kd-crumb-list { display: flex; align-items: center; min-width: 0; }
.kd .kd-crumb-item { display: flex; align-items: center; min-width: 0; flex: 0 1 auto; }
.kd .kd-crumb-here { flex: 0 1 auto; min-width: 2rem; }
.kd .kd-crumb {
  display: inline-flex;
  text-align: left;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  max-width: 13rem;
  height: 2.5rem;
  padding: 0 0.375rem;
  border: 0;
  border-radius: var(--kd-radius);
  background: transparent;
  color: var(--kd-ink-2);
  font: 600 1.375rem/1 var(--kd-display);
  letter-spacing: -0.012em;
  cursor: pointer;
}
.kd .kd-crumb-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.15em 0; }
.kd .kd-crumb:hover { color: var(--kd-ink); background: var(--kd-hover); }
.kd .kd-crumb-current { color: var(--kd-ink); max-width: 100%; }
.kd .kd-crumb-caret { width: 1.125rem; height: 1.125rem; color: var(--kd-ink-2); }
.kd .kd-crumb-sep { color: var(--kd-line-strong); font: 400 1.375rem/1 var(--kd-display); padding: 0 0.0625rem; }
.kd .kd-crumb.is-droptarget { background: var(--kd-accent-faint); color: var(--kd-accent-strong); outline: 2px solid var(--kd-accent); outline-offset: -2px; }
.kd .kd-back { display: none; }

.kd .kd-head-tools { display: flex; align-items: center; gap: 0.5rem; flex: none; }
.kd .kd-searchwrap { position: relative; }
.kd .kd-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: clamp(12rem, 22vw, 21rem);
  height: 2.5rem;
  padding: 0 0.1875rem 0 0.75rem;
  border: 1px solid var(--kd-line);
  border-radius: var(--kd-radius);
  background: var(--kd-surface);
  color: var(--kd-ink-2);
  cursor: text;
}
.kd .kd-filter-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  flex: none;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--kd-line);
  border-radius: 0 3px 3px 0;
  background: transparent;
  color: var(--kd-ink-2);
  cursor: pointer;
}
.kd .kd-filter-btn .kd-i { width: 1.0625rem; height: 1.0625rem; transition: transform 120ms ease-out; }
.kd .kd-filter-btn:hover { background: var(--kd-hover); color: var(--kd-ink); }
.kd .kd-filter-btn[aria-expanded="true"] .kd-i { transform: rotate(180deg); }
.kd .kd-filter-btn.is-on { color: var(--kd-accent); }
.kd .kd-filter-btn.is-on::after { content: ""; position: absolute; top: 0.3125rem; right: 0.3125rem; width: 0.4375rem; height: 0.4375rem; border-radius: 50%; background: var(--kd-accent); box-shadow: 0 0 0 2px var(--kd-surface); }
.kd .kd-search:focus-within { border-color: var(--kd-accent); outline: 1px solid var(--kd-accent); }
.kd .kd-search-ico .kd-i { width: 1.125rem; height: 1.125rem; }
.kd .kd-search input { flex: 1; width: 0; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--kd-ink); font: 0.875rem var(--kd-ui); outline: none; }
.kd .kd-search input::placeholder { color: var(--kd-ink-2); }
.kd .kd-search input::-webkit-search-cancel-button { display: none; }
.kd .kd-kbd { font: 0.6875rem/1 var(--kd-mono); color: var(--kd-ink-2); border: 1px solid var(--kd-line); border-radius: 3px; padding: 0.25rem 0.375rem; }
.kd .kd-search:focus-within .kd-kbd { display: none; }
.kd .kd-search-open, .kd .kd-search-cancel { display: none; }
/* the results drop-down: under the field, wider than it, right edges aligned */
.kd .kd-suggest, .kd .kd-filters {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--kd-line-strong);
  border-radius: var(--kd-radius);
  background: var(--kd-surface);
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--kd-ink) 30%, transparent);
}
.kd .kd-suggest { width: min(40rem, calc(100vw - 2rem)); max-height: min(36rem, calc(100vh - 7rem)); }
.kd .kd-suggest[hidden], .kd .kd-filters[hidden] { display: none; }
.kd .kd-suggest-head { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.75rem 1rem 0.5rem; color: var(--kd-ink-2); font-size: 0.8125rem; border-bottom: 1px solid var(--kd-line); }
.kd .kd-suggest-head .kd-num { font-size: 0.75rem; color: var(--kd-ink); }
.kd .kd-sg-filtered { margin-left: auto; color: var(--kd-accent); font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.kd .kd-suggest-list { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0.25rem; scrollbar-width: thin; }
.kd .kd-sg-item {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0.375rem 0.625rem;
  border-radius: 3px;
  cursor: pointer;
}
.kd .kd-sg-item.is-active { background: var(--kd-accent-faint); box-shadow: inset 2px 0 0 var(--kd-accent); }
.kd .kd-sg-ico { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 3px; background: var(--kd-surface-2); color: var(--kd-ink-2); }
.kd .kd-sg-ico .kd-i { width: 1.125rem; height: 1.125rem; }
.kd .kd-sg-main { display: flex; flex-direction: column; gap: 0.1875rem; min-width: 0; }
.kd .kd-sg-name { display: flex; min-width: 0; font-size: 0.875rem; font-weight: 500; color: var(--kd-ink); }
.kd .kd-sg-path { display: flex; align-items: center; gap: 0.25rem; min-width: 0; font-size: 0.75rem; color: var(--kd-ink-2); white-space: nowrap; overflow: hidden; }
.kd .kd-sg-path-ico { width: 0.8125rem; height: 0.8125rem; flex: none; }
.kd .kd-sg-crumb { overflow: hidden; text-overflow: ellipsis; min-width: 1.5rem; }
.kd .kd-sg-crumb:last-child { flex: 0 1 auto; color: var(--kd-ink-soft); }
.kd .kd-sg-sep { flex: none; color: var(--kd-line-strong); }
.kd .kd-sg-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1875rem; font-size: 0.6875rem; color: var(--kd-ink-2); white-space: nowrap; }
.kd .kd-sg-none { padding: 1.25rem 1rem; font-size: 0.875rem; line-height: 1.5; color: var(--kd-ink-2); }
.kd .kd-suggest-all { flex: none; display: flex; align-items: center; justify-content: center; min-height: 2.75rem; border: 0; border-top: 1px solid var(--kd-line); border-radius: 0 0 var(--kd-radius) var(--kd-radius); background: transparent; color: var(--kd-accent); font: 500 0.875rem var(--kd-ui); cursor: pointer; }
.kd .kd-suggest-all:hover { background: var(--kd-accent-faint); }
.kd mark.kd-hl { background: color-mix(in srgb, var(--kd-accent) 18%, transparent); color: inherit; border-radius: 2px; padding: 0 0.0625rem; box-shadow: inset 0 -1.5px 0 var(--kd-accent); }

/* the filter panel */
.kd .kd-filters { width: min(27rem, calc(100vw - 2rem)); max-height: calc(100vh - 7rem); overflow: auto; overflow-x: hidden; }
.kd .kd-filters-form { display: flex; flex-direction: column; gap: 0.875rem; min-width: 0; padding: 0.5rem 1.125rem 1rem; }
.kd .kd-filters-form > * { min-width: 0; }
.kd .kd-filters-root { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd .kd-filters-head { display: flex; align-items: center; justify-content: space-between; margin-right: -0.625rem; }
.kd .kd-filters-title { font: 600 1rem/1.3 var(--kd-display); }
.kd .kd-range { display: grid; grid-template-columns: 1fr 1fr; gap: 0.375rem 0.75rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.kd .kd-range-label { grid-column: 1 / -1; padding: 0; font: 500 0.8125rem/1.3 var(--kd-ui); color: var(--kd-ink); }
.kd .kd-range-hint { color: var(--kd-ink-2); font-weight: 400; }
.kd .kd-range-side { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; font-size: 0.75rem; color: var(--kd-ink-2); }
.kd .kd-input-date { font-family: var(--kd-mono); font-size: 0.8125rem; min-width: 0; padding-right: 0.375rem; }
.kd .kd-filters-help { font-size: 0.75rem; line-height: 1.5; color: var(--kd-ink-2); }
.kd .kd-filters-foot { display: flex; justify-content: space-between; gap: 0.5rem; padding-top: 0.25rem; }
.kd .kd-filters-foot .kd-btn-quiet { margin-left: -0.625rem; }

/* the active filters, under the search */
.kd .kd-chips { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.375rem; width: 100%; padding: 0 0 0.625rem; }
.kd .kd-chips-label { font-size: 0.75rem; color: var(--kd-ink-2); margin-right: 0.125rem; }
.kd .kd-chip { display: inline-flex; align-items: center; gap: 0.125rem; max-width: 22rem; height: 1.75rem; padding: 0 0.125rem 0 0.625rem; border: 1px solid color-mix(in srgb, var(--kd-accent) 45%, var(--kd-line)); border-radius: 999px; background: var(--kd-accent-faint); color: var(--kd-accent-strong); font-size: 0.75rem; }
.kd .kd-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd .kd-chip-x { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.kd .kd-chip-x .kd-i { width: 0.8125rem; height: 0.8125rem; }
.kd .kd-chip-x:hover { background: color-mix(in srgb, var(--kd-accent) 18%, transparent); }
.kd .kd-chips-act { min-height: 1.75rem; padding: 0 0.5rem; font-size: 0.75rem; }

.kd .kd-split { display: inline-flex; }
.kd .kd-split > .kd-btn:first-child { border-radius: var(--kd-radius) 0 0 var(--kd-radius); }
.kd .kd-split-more { border-radius: 0 var(--kd-radius) var(--kd-radius) 0; padding: 0 0.5rem; margin-left: 1px; }

/* --- My drive: the tree column and the items ------------------------------------------------------------------------- */

.kd .kd-body { display: grid; grid-template-columns: var(--kd-tree-w) auto minmax(0, 1fr); align-items: start; min-height: calc(100vh - var(--kd-head-h)); padding: 0 var(--kd-pad) 0 calc(var(--kd-pad) - 0.5rem); }
.kd .kd-files[data-tree="closed"] .kd-body { grid-template-columns: minmax(0, 1fr); }
.kd .kd-files[data-tree="closed"] :is(.kd-side, .kd-splitter) { display: none; }

.kd .kd-side {
  position: sticky;
  top: var(--kd-head-h);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--kd-head-h));
  height: calc(100dvh - var(--kd-head-h));
  padding: 0.75rem 0.75rem 1.25rem 0;
  overflow: auto;
  scrollbar-width: thin;
}
.kd .kd-side-head { display: flex; align-items: center; gap: 0.25rem; min-height: 2.25rem; padding: 0 0 0.375rem 0.5rem; }
.kd .kd-side-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 0.5rem; font: 600 0.75rem/1 var(--kd-ui); letter-spacing: 0.04em; text-transform: uppercase; color: var(--kd-ink-2); }
.kd .kd-side-count { font-size: 0.6875rem; font-weight: 400; letter-spacing: 0; text-transform: none; }
.kd .kd-tree-collapse { width: 2rem; height: 2rem; }
.kd .kd-tree-collapse .kd-i { width: 1.125rem; height: 1.125rem; }
.kd .kd-side-close { display: none; }

/* the tree: guides like tree(1), a line under every ancestor that has more below, ├ and └ for the row itself */
.kd .kd-tree { --kd-g: 1.125rem; display: flex; flex-direction: column; padding-bottom: 1.5rem; }
.kd .kd-tree-row {
  display: grid;
  grid-template-columns: auto 1.25rem 1.25rem minmax(0, 1fr);
  align-items: center;
  gap: 0 0.3125rem;
  height: 2.125rem;
  padding: 0 0.5rem 0 0.25rem;
  border-radius: var(--kd-radius);
  color: var(--kd-ink-soft);
  font-size: 0.875rem;
  cursor: pointer;
  user-select: none;
}
/* a guide sits under its parent's chevron: a cell is as wide as one level, its line at the chevron's centre (gap + half a caret) */
.kd .kd-tree-guides { display: flex; align-self: stretch; }
.kd .kd-g { position: relative; width: var(--kd-g); flex: none; }
.kd .kd-g::before, .kd .kd-g::after { content: none; position: absolute; background: var(--kd-line-strong); }
.kd .kd-g.is-pipe::before, .kd .kd-g.is-tee::before { content: ""; left: 0.9375rem; top: 0; bottom: 0; width: 1px; }
.kd .kd-g.is-elbow::before { content: ""; left: 0.9375rem; top: 0; height: 50%; width: 1px; }
.kd .kd-g.is-tee::after, .kd .kd-g.is-elbow::after { content: ""; left: 0.9375rem; right: -0.25rem; top: 50%; height: 1px; }
.kd .kd-tree-row.is-leaf .kd-g:last-child::after { right: -1.6875rem; }
/* the way to the folder shown, in the accent: down every line it follows, into the row it enters */
.kd .kd-g.is-pipe.is-hot::before, .kd .kd-g.is-tee.is-through::before, .kd .kd-g.is-in::before, .kd .kd-g.is-in::after { background: var(--kd-accent); }
.kd .kd-g.is-tee.is-in::before { background: linear-gradient(var(--kd-accent) 0 50%, var(--kd-line-strong) 50% 100%); }
.kd .kd-g.is-in::before, .kd .kd-g.is-in::after, .kd .kd-g.is-hot::before, .kd .kd-g.is-through::before { width: 1.5px; }
.kd .kd-g.is-in::after { width: auto; height: 1.5px; }
.kd .kd-tree-row:hover { background: var(--kd-hover); color: var(--kd-ink); }
.kd .kd-tree-row.is-onpath { color: var(--kd-ink); font-weight: 500; }
.kd .kd-tree-row.is-onpath .kd-tree-ico { color: var(--kd-accent); }
.kd .kd-tree-row.is-current { background: var(--kd-accent-faint); color: var(--kd-accent-strong); font-weight: 600; box-shadow: inset 2px 0 0 var(--kd-accent); }
.kd .kd-tree-row.is-droptarget { background: var(--kd-accent-faint); outline: 2px solid var(--kd-accent); outline-offset: -2px; }
.kd .kd-tree-row.is-dragging { opacity: 0.45; }
.kd .kd-tree-row:focus-visible { outline-offset: -2px; }
.kd .kd-tree-caret { display: grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 3px; color: var(--kd-ink-2); }
.kd .kd-tree-caret .kd-i { width: 0.875rem; height: 0.875rem; transition: transform 120ms ease-out; }
.kd .kd-tree-caret.is-open .kd-i { transform: rotate(90deg); }
.kd .kd-tree-caret:not(.is-leaf):hover { background: var(--kd-hover); color: var(--kd-ink); }
.kd .kd-tree-ico { width: 1.125rem; height: 1.125rem; color: var(--kd-ink-2); }
.kd .kd-tree-row.is-current .kd-tree-ico { color: var(--kd-accent); }
.kd .kd-tree-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.kd .kd-storage { margin-top: auto; padding: 1rem 0.5rem 0; border-top: 1px solid var(--kd-line); }
.kd .kd-storage-text { font-size: 0.75rem; line-height: 1.4; color: var(--kd-ink); margin-bottom: 0.5rem; }
.kd .kd-storage-note { font-size: 0.6875rem; line-height: 1.5; color: var(--kd-ink-2); margin-top: 0.5rem; }

.kd .kd-splitter { position: relative; align-self: stretch; width: 1px; background: var(--kd-line); cursor: col-resize; }
.kd .kd-splitter::after { content: ""; position: absolute; inset: 0 -5px; }
.kd .kd-splitter:hover, .kd .kd-splitter:focus-visible, .kd .kd-files.is-resizing .kd-splitter { background: var(--kd-accent); outline: none; box-shadow: 0 0 0 1px var(--kd-accent); }
.kd .kd-scrim { display: none; }

.kd .kd-main { position: relative; min-width: 0; padding: 0 0 5rem var(--kd-gutter); }
.kd .kd-files[data-tree="closed"] .kd-main { padding-left: 0; }

.kd .kd-bar {
  position: sticky;
  top: var(--kd-head-h);
  z-index: 5;
  display: flex;
  align-items: center;
  min-height: 3.5rem;
  background: var(--kd-bg);
}
/* the list's rows sit on a sheet (2026-10-28) */
.kd .kd-items-list { border: 1px solid var(--kd-line); border-radius: var(--kd-sheet-radius); background: var(--kd-surface); box-shadow: var(--kd-shadow-1); overflow: hidden; }
.kd .kd-bar-view, .kd .kd-bar-sel { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-width: 0; }
.kd .kd-summary { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 1rem; color: var(--kd-ink-2); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; }
.kd .kd-summary .kd-num { font-size: 0.75rem; }
.kd .kd-summary .kd-clear { min-height: 2rem; align-self: baseline; margin-left: 0.25rem; } /* on the count's line, a step from it (3.7.0) */
.kd .kd-sort { color: var(--kd-ink-soft); gap: 0.25rem; font-weight: 500; }
.kd .kd-sort .kd-i { width: 0.9375rem; height: 0.9375rem; color: var(--kd-ink-2); }
.kd .kd-sort:hover:not(:disabled) { background: var(--kd-hover); }
.kd .kd-bar-sel { gap: 0.25rem; }
.kd .kd-sel-count { font-weight: 500; font-size: 0.9375rem; margin-right: auto; padding-left: 0.25rem; }
.kd .kd-sel-count .kd-num { font-size: 0.875rem; font-weight: 500; }
.kd .kd-sel-acts { display: flex; align-items: center; gap: 0.25rem; }

/* the grid */
.kd .kd-items { position: relative; }
.kd .kd-spacer { grid-column: 1 / -1; pointer-events: none; }
.kd .kd-items-grid { display: flex; flex-direction: column; gap: 1.5rem; padding: 0.25rem 0 1rem; }
.kd .kd-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.875rem; }
.kd .kd-item { position: relative; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: default; outline-offset: 2px; }
.kd .kd-item.is-dragging { opacity: 0.45; }

.kd .kd-tile {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  height: 3.75rem;
  padding: 0 0.75rem 0 0.875rem;
  border: 1px solid var(--kd-line);
  border-radius: var(--kd-sheet-radius);
  background: var(--kd-surface);
  box-shadow: var(--kd-shadow-1);
  transition: box-shadow 120ms ease-out, border-color 120ms ease-out;
}
.kd .kd-tile:hover { box-shadow: var(--kd-shadow-2); border-color: color-mix(in srgb, var(--kd-accent) 35%, var(--kd-line)); }
.kd .kd-tile-ico { color: var(--kd-accent); }
.kd .kd-tile-ico { width: 1.5rem; height: 1.5rem; color: var(--kd-ink-2); grid-column: 1; grid-row: 1; }
.kd .kd-tile .kd-check { grid-column: 1; grid-row: 1; }
.kd .kd-tile-text { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.kd .kd-tile-name { font-weight: 500; font-size: 0.875rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd .kd-tile-count { font-size: 0.6875rem; color: var(--kd-ink-2); }

.kd .kd-card { display: flex; flex-direction: column; border: 1px solid var(--kd-line); border-radius: var(--kd-sheet-radius); background: var(--kd-surface); overflow: hidden; box-shadow: var(--kd-shadow-1); transition: box-shadow 120ms ease-out; }
.kd .kd-card:hover { box-shadow: var(--kd-shadow-2); }
.kd .kd-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  background: var(--kd-surface-2);
  color: var(--kd-ink-2);
  border-bottom: 1px solid var(--kd-line);
  overflow: hidden;
}
.kd .kd-thumb-ico { width: 2.25rem; height: 2.25rem; stroke-width: 1.25; }
.kd .kd-thumb-ext { font: 500 0.8125rem/1 var(--kd-mono); letter-spacing: 0.02em; color: var(--kd-ink-2); }
.kd .kd-thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 160ms ease-out; background: var(--kd-surface); }
.kd .has-img > .kd-thumb-img { opacity: 1; }
.kd .kd-thumb.has-img :is(.kd-thumb-ico, .kd-thumb-ext) { visibility: hidden; }
.kd .kd-card-foot { display: flex; flex-direction: column; gap: 0.3125rem; padding: 0.625rem 0.75rem 0.6875rem; min-width: 0; }
.kd .kd-card-name { display: flex; align-items: center; gap: 0.375rem; min-width: 0; font-weight: 500; font-size: 0.875rem; line-height: 1.3; }
.kd .kd-card-meta { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.6875rem; color: var(--kd-ink-2); white-space: nowrap; }
.kd .kd-name { display: flex; min-width: 0; }
.kd .kd-stem { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kd .kd-ext { flex: none; white-space: nowrap; }
.kd .kd-shared { display: inline-flex; flex: none; color: var(--kd-ink-2); }
.kd .kd-shared .kd-i { width: 0.875rem; height: 0.875rem; }

/* the check and the actions button, shared by tiles, cards and rows */
.kd .kd-check {
  display: grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  border: 1.5px solid var(--kd-line-strong);
  border-radius: 50%;
  background: var(--kd-surface);
  color: transparent;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease-out;
}
.kd .kd-check .kd-i { width: 0.875rem; height: 0.875rem; stroke-width: 2.25; }
.kd .kd-card .kd-check { position: absolute; top: 0.5rem; left: 0.5rem; z-index: 1; }
.kd .kd-more {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: var(--kd-radius);
  background: transparent;
  color: var(--kd-ink-2);
  cursor: pointer;
  opacity: 0;
}
.kd .kd-more:hover { background: var(--kd-hover); color: var(--kd-ink); }
.kd .kd-card .kd-more { position: absolute; top: 0.375rem; right: 0.375rem; z-index: 1; background: var(--kd-surface); border: 1px solid var(--kd-line); width: 2rem; height: 2rem; }
.kd .kd-tile .kd-more { position: absolute; top: 50%; right: 0.3125rem; margin-top: -1.125rem; background: inherit; }
.kd .kd-tile:is(:hover, :focus-within) .kd-tile-text { padding-right: 2.25rem; }
.kd .kd-item:is(:hover, :focus-within, .is-selected) .kd-more, .kd .kd-item:is(:hover, .is-selected) .kd-check { opacity: 1; }
.kd .kd-tile:is(:hover, .is-selected) .kd-tile-ico { visibility: hidden; }
.kd .kd-item.is-selected .kd-check { background: var(--kd-accent); border-color: var(--kd-accent); color: var(--kd-on-accent); }

.kd .kd-tile:hover, .kd .kd-card:hover { border-color: var(--kd-line-strong); }
.kd .kd-item.is-selected:is(.kd-tile, .kd-card) { border-color: var(--kd-accent); box-shadow: inset 0 0 0 1px var(--kd-accent); background: var(--kd-accent-faint); }
.kd .kd-card.is-selected .kd-thumb { border-bottom-color: var(--kd-accent); }
.kd .kd-item.is-droptarget { border-color: var(--kd-accent); box-shadow: inset 0 0 0 1px var(--kd-accent); background: var(--kd-accent-faint); }

/* the list: the person's columns (--kd-cols, set from columns.js), each cell padded so its header's edge is the column's edge */
.kd .kd-listhead, .kd .kd-row {
  display: grid;
  grid-template-columns: var(--kd-cols, 2.25rem minmax(160px, 1fr) minmax(64px, 96px) minmax(92px, 116px) 0px 2.5rem);
  align-items: center;
}
.kd .kd-cell { min-width: 0; padding: 0 0.75rem 0 0.5rem; }
.kd .kd-listhead { position: sticky; top: calc(var(--kd-head-h) + 3.5rem); z-index: 4; height: 2.375rem; padding: 0 0.5rem; background: var(--kd-bg); border-bottom: 1px solid var(--kd-line); }
.kd .kd-lh { position: relative; display: flex; align-items: center; height: 100%; font: 500 0.75rem/1 var(--kd-ui); color: var(--kd-ink-2); text-align: left; }
.kd .kd-lh.is-end { justify-content: flex-end; }
.kd .kd-lh-btn { display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; height: 1.75rem; padding: 0 0.25rem; margin: 0 -0.25rem; border: 0; border-radius: 3px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.kd .kd-lh-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd .kd-lh-btn:hover { color: var(--kd-ink); background: var(--kd-hover); }
.kd .kd-lh.is-sorted .kd-lh-btn { color: var(--kd-ink); }
.kd .kd-lh-arrow { width: 0.8125rem; height: 0.8125rem; flex: none; }
.kd .kd-col-grip { position: absolute; top: 0.375rem; bottom: 0.375rem; right: -5px; z-index: 1; width: 9px; cursor: col-resize; touch-action: none; }
.kd .kd-col-grip::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: var(--kd-line); }
.kd .kd-col-grip:hover::after, .kd .kd-col-grip:focus-visible::after, .kd .kd-files.is-resizing .kd-col-grip:active::after { left: 3px; width: 3px; background: var(--kd-accent); }
.kd .kd-col-grip:focus-visible { outline: none; }
.kd .kd-files.is-resizing .kd-listhead, .kd .kd-files.is-resizing .kd-items-list { cursor: col-resize; }
.kd .kd-row { min-height: 3rem; padding: 0 0.5rem; border-bottom: 1px solid var(--kd-line); font-size: 0.875rem; }
.kd .kd-cols-btn { color: var(--kd-ink-soft); gap: 0.375rem; font-weight: 500; }
.kd .kd-cols-btn .kd-i { width: 1rem; height: 1rem; color: var(--kd-ink-2); }
.kd .kd-cols-btn:hover:not(:disabled), .kd .kd-cols-btn[aria-expanded="true"] { background: var(--kd-hover); }
.kd .kd-row:hover { background: var(--kd-hover); }
.kd .kd-row.is-selected { background: var(--kd-accent-faint); box-shadow: inset 2px 0 0 var(--kd-accent); }
.kd .kd-row.is-droptarget { background: var(--kd-accent-faint); box-shadow: inset 0 0 0 2px var(--kd-accent); }
.kd .kd-col-lead { position: relative; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; }
.kd .kd-col-lead > * { grid-area: 1 / 1; }
.kd .kd-row-ico { position: relative; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 3px; color: var(--kd-ink-2); overflow: hidden; }
.kd .kd-row-ico[data-kind="folder"] { color: var(--kd-ink-2); }
.kd .kd-row-ico .kd-thumb-img { border-radius: 3px; }
.kd .kd-row-ico.has-img > .kd-i { visibility: hidden; }
.kd .kd-row:is(:hover, .is-selected) .kd-row-ico { visibility: hidden; }
.kd .kd-row-name { display: flex; flex-direction: column; min-width: 0; }
.kd .kd-row-line { display: flex; align-items: center; gap: 0.375rem; min-width: 0; font-weight: 500; }
.kd .kd-row-sub { display: none; }
.kd .kd-row .kd-col-location, .kd .kd-row .kd-col-type { color: var(--kd-ink-2); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd .kd-row .kd-col-size { text-align: right; font-size: 0.75rem; color: var(--kd-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kd .kd-row :is(.kd-col-imported, .kd-col-modified, .kd-col-created) { font-size: 0.75rem; color: var(--kd-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kd .kd-col-more { display: grid; place-items: center; }
.kd .kd-col-fill { min-width: 0; }

/* the Columns menu, the users list's popover */
.kd .kd-popover { position: fixed; z-index: 90; min-width: 15rem; padding: 0.625rem 0.375rem 0.375rem; border: 1px solid var(--kd-line-strong); border-radius: var(--kd-radius); background: var(--kd-surface); box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--kd-ink) 30%, transparent); }
.kd .kd-popover-title { padding: 0 0.625rem 0.375rem; font: 500 0.6875rem/1.3 var(--kd-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--kd-ink-2); }
.kd .kd-popover-item { display: flex; align-items: center; gap: 0.625rem; min-height: 2.25rem; padding: 0 0.625rem; border-radius: 3px; font-size: 0.875rem; cursor: pointer; }
.kd .kd-popover-item:hover { background: var(--kd-surface-2); }
.kd .kd-popover-item.is-off { color: var(--kd-ink-2); cursor: default; }
.kd .kd-popover-item.is-off:hover { background: transparent; }
.kd .kd-popover-note { margin-left: auto; font: 0.6875rem var(--kd-mono); color: var(--kd-ink-2); }
.kd .kd-popover-reset { width: 100%; justify-content: flex-start; gap: 0.625rem; padding: 0 0.625rem; color: var(--kd-ink); font-weight: 400; }
.kd .kd-popover-reset .kd-i { width: 1.0625rem; height: 1.0625rem; color: var(--kd-ink-2); }

/* loading, error, empty */
.kd .kd-skeleton { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.875rem; padding-top: 0.25rem; }
.kd .kd-skeleton > span { display: block; aspect-ratio: 4 / 3.6; border-radius: var(--kd-radius); background: var(--kd-surface-2); }
.kd .kd-skeleton-rows { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--kd-line); border-radius: var(--kd-radius); background: var(--kd-surface); }
.kd .kd-skeleton-rows > span { aspect-ratio: auto; height: 3.5rem; border-radius: 0; background: transparent; border-bottom: 1px solid var(--kd-line); position: relative; }
.kd .kd-skeleton-rows > span::before { content: ""; position: absolute; left: 1rem; top: 1.25rem; height: 0.875rem; width: 40%; border-radius: 2px; background: var(--kd-surface-2); }
.kd .kd-skeleton-rows > span:last-child { border-bottom: 0; }

.kd .kd-inline-error { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-radius: var(--kd-radius); background: var(--kd-surface-2); color: var(--kd-ink); font-size: 0.9375rem; margin-top: 0.5rem; }

.kd .kd-empty { max-width: 34rem; padding: 3.5rem 0 2rem; }
.kd .kd-empty-title { font: 600 1.25rem/1.3 var(--kd-display); letter-spacing: -0.01em; color: var(--kd-ink); }
.kd .kd-empty-text { margin-top: 0.5rem; font-size: 0.9375rem; line-height: 1.55; color: var(--kd-ink-2); }
.kd .kd-empty-acts { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.kd .kd-empty-page { padding: 2.5rem 0 1rem; }

/* dragging */
.kd .kd-files.is-dropping .kd-main::after {
  content: "";
  position: absolute;
  inset: 0.375rem -0.625rem 0.375rem 0.875rem;
  z-index: 5;
  border: 2px dashed var(--kd-accent);
  border-radius: var(--kd-radius);
  background: color-mix(in srgb, var(--kd-accent) 4%, transparent);
  pointer-events: none;
}
.kd .kd-drop {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1.125rem;
  border-radius: var(--kd-radius);
  background: var(--kd-accent);
  color: var(--kd-on-accent);
  font-size: 0.9375rem;
  transform: translateX(-50%);
  pointer-events: none;
}
.kd .kd-drop b { font-weight: 600; }
.kd .kd-band { position: absolute; z-index: 3; border: 1px solid var(--kd-accent); background: color-mix(in srgb, var(--kd-accent) 12%, transparent); pointer-events: none; }

.kd .kd-fab { display: none; }

/* --- transfers: the tray in My drive, the body of the Transfers page ---------------------------------------------------- */

.kd .kd-transfers { background: var(--kd-surface); border: 1px solid var(--kd-line-strong); border-radius: var(--kd-radius); overflow: hidden; }
.kd .kd-transfers.is-tray {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 25;
  display: flex;
  flex-direction: column;
  width: min(25rem, calc(100vw - 2rem));
  max-height: min(32rem, 70vh);
}
.kd .kd-tt-head { display: flex; align-items: center; gap: 0.25rem; min-height: 3.25rem; padding: 0 0.375rem 0 1rem; }
.kd .kd-transfers.is-tray .kd-tt-head { cursor: pointer; }
.kd .kd-tt-headtext { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 0.75rem; }
.kd .kd-tt-title { font-weight: 600; font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd .kd-tt-sum { font-size: 0.75rem; color: var(--kd-ink-2); }
.kd .kd-tt-btn.is-up .kd-i { transform: rotate(180deg); }
.kd .kd-tt-overall { border-radius: 0; height: 2px; background: var(--kd-line); }
.kd .kd-transfers[data-state="done"] .kd-tt-overall .kd-meter-fill { background: var(--kd-ok); }
.kd .kd-transfers[data-state="attention"] .kd-tt-overall .kd-meter-fill { background: var(--kd-warn); }
.kd .kd-tt-body { overflow: auto; min-height: 0; scrollbar-width: thin; }
.kd .kd-transfers.is-collapsed .kd-tt-body { display: none; }
.kd .kd-tt-banner-acts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.kd .kd-tt-banner { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; margin: 0.75rem 1rem 0; padding: 0.875rem 1rem; border-radius: var(--kd-radius); background: var(--kd-surface-2); font-size: 0.8125rem; line-height: 1.5; }
.kd .kd-tt-conn { margin: 0.75rem 1rem 0; color: var(--kd-warn); font-size: 0.8125rem; }
.kd .kd-tt-list { padding: 0.25rem 0; }
.kd .kd-tt-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.kd .kd-tt-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: center; gap: 0.625rem; padding: 0.625rem 0.5rem 0.625rem 0.875rem; }
.kd .kd-tt-row + .kd-tt-row { border-top: 1px solid var(--kd-line); }
.kd .kd-tt-row.is-sub { padding-left: 2.25rem; background: color-mix(in srgb, var(--kd-surface-2) 45%, var(--kd-surface)); }
.kd .kd-tt-ico { display: grid; place-items: center; color: var(--kd-ink-2); }
.kd .kd-tt-ico .kd-i { width: 1.25rem; height: 1.25rem; }
.kd .kd-tt-toggle { width: 2rem; height: 2rem; }
.kd .kd-tt-toggle.is-empty { visibility: hidden; }
.kd .kd-tt-toggle .kd-i { width: 1rem; height: 1rem; transition: transform 120ms ease-out; }
.kd .kd-tt-toggle[aria-expanded="true"] .kd-i { transform: rotate(90deg); }
.kd .kd-tt-mid { min-width: 0; display: flex; flex-direction: column; gap: 0.3125rem; }
.kd .kd-tt-line { display: flex; align-items: baseline; gap: 0.75rem; min-width: 0; }
.kd .kd-tt-name { flex: 1; min-width: 0; font-size: 0.8125rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd .kd-tt-pct { font-size: 0.6875rem; color: var(--kd-ink-2); }
.kd .kd-tt-bar { height: 3px; border-radius: 2px; background: var(--kd-surface-2); overflow: hidden; }
.kd .kd-tt-fill { height: 100%; width: 0; background: var(--kd-accent); transition: width 160ms linear; }
.kd .kd-tt-status { font: 0.6875rem/1.45 var(--kd-mono); color: var(--kd-ink-2); }
.kd .kd-tt-row:is(.is-done, .is-canceled, .is-resumable, .is-refused) .kd-tt-bar { display: none; }
.kd .kd-tt-row.is-done .kd-tt-status { color: var(--kd-ok); }
.kd .kd-tt-row:is(.is-error, .is-resumable) .kd-tt-status { color: var(--kd-danger); font-family: var(--kd-ui); font-size: 0.75rem; }
.kd .kd-tt-row.is-resumable .kd-tt-status, .kd .kd-tt-row.is-waiting .kd-tt-status { color: var(--kd-warn); }
.kd .kd-tt-row:is(.is-paused, .is-waiting) .kd-tt-fill { background: var(--kd-warn); }
.kd .kd-tt-row.is-error .kd-tt-fill { background: var(--kd-danger); }
.kd .kd-tt-acts { display: flex; gap: 0; }
.kd .kd-tt-btn { width: 2.25rem; height: 2.25rem; }
.kd .kd-tt-btn .kd-i { width: 1.0625rem; height: 1.0625rem; }
.kd .kd-tt-foot { display: flex; justify-content: flex-end; padding: 0.25rem 0.5rem 0.5rem; border-top: 1px solid var(--kd-line); }
.kd .kd-tt-foot .kd-btn { min-height: 2.25rem; }
.kd .kd-transfers-page .kd-transfers { max-width: 52rem; }
.kd .kd-transfers-page .kd-tt-head { min-height: 3.5rem; }

/* --- the pages: Shared with me, Links, Transfers ---------------------------------------------------------------------- */

.kd .kd-page { max-width: calc(72rem + 2 * var(--kd-pad)); padding: 2.25rem var(--kd-pad) 5rem; }
.kd .kd-page-head { max-width: 46rem; margin-bottom: 1.75rem; }
.kd .kd-page-title { font: 600 1.75rem/1.15 var(--kd-display); letter-spacing: -0.015em; color: var(--kd-ink); }
.kd .kd-page-lede { margin-top: 0.625rem; font-size: 0.9375rem; line-height: 1.55; color: var(--kd-ink-2); }
.kd .kd-page-bar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }

/* the Shared page's two tabs (2026-10-28): a ruled bar, the chosen tab underlined in the accent; a tab one may not open stays, greyed,
   with the line that says who may */
.kd .kd-tabs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.25rem 1.5rem; margin: 0 0 1.25rem; border-bottom: 1px solid var(--kd-line); }
.kd .kd-tab { position: relative; display: inline-flex; align-items: baseline; gap: 0.5rem; min-height: 2.75rem; padding: 0 0.125rem; border: 0; background: none; color: var(--kd-ink-2); font: 500 0.9375rem/1 var(--kd-ui); cursor: pointer; }
.kd .kd-tab .kd-num { padding: 0.125rem 0.4375rem; border-radius: 999px; background: var(--kd-surface-2); color: var(--kd-ink-2); font-size: 0.75rem; }
.kd .kd-tab:hover:not(:disabled) { color: var(--kd-ink); }
.kd .kd-tab[aria-selected="true"] { color: var(--kd-ink); font-weight: 600; }
.kd .kd-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--kd-accent); }
.kd .kd-tab[aria-selected="true"] .kd-num { background: var(--kd-accent-faint); color: var(--kd-accent-strong); }
.kd .kd-tab:disabled { opacity: 0.5; cursor: not-allowed; }
.kd .kd-tab .kd-num:empty { display: none; }
.kd .kd-tab-why { align-self: center; margin-left: auto; color: var(--kd-ink-2); font-size: 0.8125rem; }

.kd .kd-ledger { border: 1px solid var(--kd-line); border-radius: var(--kd-sheet-radius); background: var(--kd-surface); box-shadow: var(--kd-shadow-1); }
.kd .kd-ledger:empty { display: none; }
.kd .kd-ledger-row { display: grid; align-items: center; column-gap: 1.25rem; min-height: 3.75rem; padding: 0.625rem 0.75rem 0.625rem 1rem; font-size: 0.875rem; }
.kd .kd-ledger-row + .kd-ledger-row { border-top: 1px solid var(--kd-line); }
.kd .kd-ledger-head { display: grid; align-items: center; column-gap: 1.25rem; padding: 0 0.75rem 0.5rem 1rem; font: 500 0.75rem/1 var(--kd-ui); color: var(--kd-ink-2); }
.kd .kd-links-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 6.5rem 4rem 6.5rem 11.5rem; column-gap: 1rem; }
.kd .kd-phone-label { display: none; }
.kd .kd-shared-row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.4fr) 7rem 15rem; }
.kd .kd-links-name { display: flex; align-items: center; gap: 0.75rem; min-width: 0; font-weight: 500; }
.kd .kd-links-ico { width: 1.25rem; height: 1.25rem; color: var(--kd-ink-2); }
.kd .kd-links-who { display: flex; align-items: center; gap: 0.625rem; min-width: 0; color: var(--kd-ink-soft); }
.kd .kd-links-who .kd-links-ico { width: 1.0625rem; height: 1.0625rem; }
.kd .kd-links-whotext { display: flex; flex-direction: column; min-width: 0; }
.kd .kd-links-sub { font-size: 0.75rem; color: var(--kd-ink-2); }
.kd .kd-links-exp, .kd .kd-links-views, .kd .kd-shared-when { font-size: 0.75rem; color: var(--kd-ink-2); white-space: nowrap; }
.kd .kd-links-acts { display: flex; align-items: center; justify-content: flex-end; gap: 0.125rem; }
.kd .kd-links-acts .kd-btn { min-height: 2.25rem; }
.kd .kd-links-acts .kd-more, .kd .kd-shared-more { opacity: 1; display: none; }
.kd .kd-shared-what { color: var(--kd-ink-soft); }
.kd .kd-ledger-row.is-ended { color: var(--kd-ink-2); }
.kd .kd-ledger-row.is-ended .kd-links-name { font-weight: 400; }

/* status marks, the family's shapes: ● open, ◐ waiting, ○ ended */
.kd .kd-state { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; white-space: nowrap; }
.kd .kd-state-dot { width: 0.625rem; height: 0.625rem; border-radius: 50%; flex: none; border: 1.5px solid currentColor; }
.kd .kd-state[data-mark="on"] { color: var(--kd-ok); }
.kd .kd-state[data-mark="on"] .kd-state-dot { background: currentColor; }
.kd .kd-state[data-mark="half"] { color: var(--kd-warn); }
.kd .kd-state[data-mark="half"] .kd-state-dot { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.kd .kd-state[data-mark="off"] { color: var(--kd-ink-2); }

/* --- the public page ------------------------------------------------------------------------------------------------------ */

.kd.kd-public { background: var(--kd-bg); --kd-pub-pad: clamp(1.25rem, 5vw, 4rem); }
.kd .kd-pub-head, .kd .kd-pub-hero, .kd .kd-pub-promises { width: calc(100% - 2 * var(--kd-pub-pad)); max-width: 72rem; margin: 0 auto; }
.kd .kd-pub-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; }
.kd .kd-pub-brand { display: inline-flex; align-items: center; gap: 0.625rem; }
.kd .kd-pub-mark { color: var(--kd-accent); }
.kd .kd-pub-mark .kd-i { width: 1.75rem; height: 1.75rem; }
.kd .kd-pub-name { font: 600 1.125rem/1 var(--kd-display); letter-spacing: -0.01em; }
.kd .kd-pub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
  padding-top: clamp(3rem, 9vh, 6.5rem);
  padding-bottom: clamp(3rem, 9vh, 6rem);
  border-top: 1px solid var(--kd-line);
}
.kd .kd-pub-title { font: 600 clamp(2.375rem, 4.3vw, 3.625rem)/1.04 var(--kd-display); letter-spacing: -0.028em; color: var(--kd-ink); max-width: 13ch; }
.kd .kd-pub-lede { margin-top: 1.5rem; max-width: 33rem; font-size: 1.0625rem; line-height: 1.6; color: var(--kd-ink-soft); }
.kd .kd-pub-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 2.25rem; }
.kd .kd-pub-note { font-size: 0.875rem; color: var(--kd-ink-2); }
.kd .kd-pub-sample { min-width: 0; }
.kd .kd-sample { border: 1px solid var(--kd-line); border-top: 3px solid var(--kd-accent); border-radius: var(--kd-radius); background: var(--kd-surface); }
.kd .kd-sample-head { display: flex; align-items: center; gap: 0.375rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--kd-line); font: 600 1.0625rem/1.2 var(--kd-display); letter-spacing: -0.01em; }
.kd .kd-sample-crumb, .kd .kd-sample-sep { color: var(--kd-ink-2); }
.kd .kd-sample-sep { color: var(--kd-line-strong); font-weight: 400; }
.kd .kd-sample-rows li { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr) auto; align-items: center; gap: 0.875rem; min-height: 3rem; padding: 0 1.25rem; border-bottom: 1px solid var(--kd-line); font-size: 0.875rem; }
.kd .kd-sample-ico { color: var(--kd-ink-2); }
.kd .kd-sample-ico .kd-i { width: 1.25rem; height: 1.25rem; }
.kd .kd-sample-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.kd .kd-sample-rows .kd-num, .kd .kd-sample-tline .kd-num { font-size: 0.75rem; color: var(--kd-ink-2); white-space: nowrap; }
.kd .kd-sample-transfer { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 1.25rem 1.125rem; background: color-mix(in srgb, var(--kd-surface-2) 50%, var(--kd-surface)); }
.kd .kd-sample-tline { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr) auto; align-items: center; gap: 0.875rem; font-size: 0.875rem; }
.kd .kd-sample-transfer .kd-meter { margin-left: 2.125rem; height: 3px; }
.kd .kd-sample-fill { width: 64%; }
.kd .kd-sample-status { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-left: 2.125rem; font-size: 0.75rem; color: var(--kd-ink-2); }
.kd .kd-pub-caption { margin-top: 0.75rem; font: 0.75rem/1.5 var(--kd-mono); color: var(--kd-ink-2); }
.kd .kd-pub-promises { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 4rem; padding-bottom: 5rem; }
.kd .kd-pub-promises li { padding-top: 1.5rem; border-top: 1px solid var(--kd-ink); }
.kd .kd-pub-promises h2 { font: 600 1.125rem/1.3 var(--kd-display); letter-spacing: -0.01em; }
.kd .kd-pub-promises p { margin-top: 0.5rem; font-size: 0.9375rem; line-height: 1.55; color: var(--kd-ink-2); max-width: 30ch; }

/* --- the viewer ------------------------------------------------------------------------------------------------------------ */

.kd.kd-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #121416;
  color: #f1f1ee;
  overscroll-behavior: contain;
}
.kd .kd-viewer-bar { display: flex; align-items: center; gap: 0.75rem; min-height: 3.75rem; padding: 0.5rem 1rem; }
.kd .kd-viewer-title { flex: 1; min-width: 0; }
.kd .kd-viewer-name { font-weight: 500; font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd .kd-viewer-meta { display: flex; gap: 1.25rem; margin-top: 0.125rem; font: 0.75rem/1.4 var(--kd-mono); color: #a3a8ad; }
.kd .kd-viewer-acts { display: flex; gap: 0.5rem; flex: none; }
.kd .kd-vbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--kd-radius);
  background: transparent;
  color: #f1f1ee;
  font: 500 0.875rem/1 var(--kd-ui);
  text-decoration: none;
  cursor: pointer;
}
.kd .kd-vbtn .kd-i { width: 1.125rem; height: 1.125rem; }
.kd .kd-vbtn:hover { background: rgba(255, 255, 255, 0.08); }
.kd .kd-vbtn-icon { width: 2.5rem; padding: 0; justify-content: center; border-color: transparent; }
.kd.kd-viewer :focus-visible { outline-color: #8fd3ca; }
.kd .kd-viewer-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 5rem 1.5rem; }
.kd .kd-viewer-media { max-width: 100%; max-height: 100%; display: block; }
.kd .kd-viewer-stage img.kd-viewer-media { object-fit: contain; max-height: calc(100vh - 5.5rem); }
.kd .kd-viewer-stage video.kd-viewer-media { max-height: calc(100vh - 5.5rem); background: #000; }
.kd .kd-viewer-stage audio.kd-viewer-media { width: min(32rem, 100%); }
.kd .kd-viewer-doc { width: min(62rem, 100%); height: 100%; border: 0; background: #ffffff; border-radius: 2px; }
.kd .kd-viewer-wait { color: #a3a8ad; font-size: 0.9375rem; max-width: 30rem; text-align: center; }
.kd .kd-viewer-nav {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: var(--kd-radius);
  background: rgba(255, 255, 255, 0.07);
  color: #f1f1ee;
  cursor: pointer;
  transform: translateY(-50%);
}
.kd .kd-viewer-nav .kd-i { width: 1.5rem; height: 1.5rem; }
.kd .kd-viewer-nav:hover:not(:disabled) { background: rgba(255, 255, 255, 0.14); }
.kd .kd-viewer-nav:disabled { opacity: 0.25; cursor: default; }
.kd .kd-viewer-prev { left: 1rem; }
.kd .kd-viewer-next { right: 1rem; }

/* --- the layer: menus, sheets, dialogs ---------------------------------------------------------------------------------- */

.kd .kd-scrim-layer { position: fixed; inset: 0; z-index: 85; background: rgba(22, 25, 28, 0.36); }
.kd .kd-menu {
  position: fixed;
  z-index: 90;
  min-width: 13.5rem;
  max-width: min(22rem, calc(100vw - 1rem));
  padding: 0.25rem;
  border: 1px solid var(--kd-line-strong);
  border-radius: var(--kd-radius);
  background: var(--kd-surface);
}
.kd .kd-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.375rem;
  padding: 0 0.75rem 0 0.625rem;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--kd-ink);
  font: 0.875rem/1.2 var(--kd-ui);
  text-align: left;
  cursor: pointer;
}
.kd .kd-menu-item:hover { background: var(--kd-surface-2); }
.kd .kd-menu-item:focus-visible { background: var(--kd-accent-faint); outline: 2px solid var(--kd-focus); outline-offset: -2px; }
.kd .kd-menu-item:disabled { color: var(--kd-ink-2); cursor: default; }
.kd .kd-menu-ico { width: 1.125rem; height: 1.125rem; color: var(--kd-ink-2); flex: none; }
.kd .kd-menu-item.kd-danger-text, .kd .kd-menu-item.kd-danger-text .kd-menu-ico { color: var(--kd-danger); }
.kd .kd-menu-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd .kd-menu-check { width: 1rem; height: 1rem; color: var(--kd-accent); }
.kd .kd-menu-sep { height: 1px; margin: 0.25rem 0.375rem; background: var(--kd-line); }

.kd .kd-dialog {
  position: fixed;
  z-index: 90;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  width: min(28rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  border: 1px solid var(--kd-line-strong);
  border-radius: var(--kd-radius);
  background: var(--kd-surface);
  transform: translate(-50%, -50%);
}
.kd .kd-dialog-wide { width: min(35rem, calc(100vw - 2rem)); }
.kd .kd-dialog-head { display: flex; align-items: flex-start; gap: 0.75rem; padding: 1.25rem 0.75rem 0.25rem 1.5rem; }
.kd .kd-dialog-title { flex: 1; min-width: 0; padding-top: 0.375rem; font: 600 1.25rem/1.3 var(--kd-display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.kd .kd-dialog-body { padding: 0.75rem 1.5rem 1.25rem; overflow: auto; min-height: 0; }
.kd .kd-dialog-foot { display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; padding: 1rem 1.5rem 1.25rem; border-top: 1px solid var(--kd-line); }
.kd .kd-dialog-foot .kd-btn-quiet:first-child { margin-right: auto; margin-left: -0.625rem; }
.kd .kd-dialog.is-busy { cursor: progress; }
.kd .kd-dialog-lede { font-size: 0.9375rem; line-height: 1.55; color: var(--kd-ink-soft); margin-bottom: 1rem; }
.kd .kd-confirm-text { font-size: 0.9375rem; line-height: 1.55; }
.kd .kd-confirm-detail { margin-top: 0.5rem; font-size: 0.875rem; line-height: 1.5; color: var(--kd-ink-2); }

/* A link's password and its Suggest one (3.7.0). */
.kd .kd-pass-row { display: flex; gap: 0.5rem; align-items: center; }
.kd .kd-pass-row .kd-input { flex: 1; min-width: 0; font-family: var(--kd-mono); }
.kd .kd-pass-row .kd-pass-suggest { flex: none; }

/* Details (3.7.0): a label column and the values, each time with where it came from beneath it. */
.kd .kd-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: 1.25rem; row-gap: 0.625rem; margin: 0; }
.kd .kd-details-label { font: 500 0.8125rem/1.45 var(--kd-ui); color: var(--kd-ink-2); padding-top: 0.0625rem; }
.kd .kd-details-value { margin: 0; font-size: 0.875rem; line-height: 1.45; overflow-wrap: anywhere; }
.kd .kd-details-value .kd-num { font-size: 0.8125rem; }
.kd .kd-details-note { display: block; font-size: 0.8125rem; line-height: 1.4; color: var(--kd-ink-2); }

.kd .kd-choices { display: flex; flex-direction: column; }
.kd .kd-choice {
  position: relative;
  display: grid;
  grid-template-columns: auto 1.25rem minmax(0, 1fr);
  align-items: start;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--kd-line);
  background: var(--kd-surface);
  cursor: pointer;
}
.kd .kd-choice + .kd-choice, .kd .kd-choice-extra + .kd-choice { margin-top: -1px; }
.kd .kd-choices > :first-child { border-radius: var(--kd-radius) var(--kd-radius) 0 0; }
.kd .kd-choices > .kd-choice:last-of-type { border-radius: 0 0 var(--kd-radius) var(--kd-radius); }
.kd .kd-choice.is-on { z-index: 1; border-color: var(--kd-accent); background: var(--kd-accent-faint); }
.kd .kd-choice-input { margin-top: 0.125rem; }
.kd .kd-choice-ico { width: 1.25rem; height: 1.25rem; color: var(--kd-ink-2); }
.kd .kd-choice.is-on .kd-choice-ico { color: var(--kd-accent); }
.kd .kd-choice-text { display: flex; flex-direction: column; gap: 0.1875rem; }
.kd .kd-choice-title { font-weight: 500; font-size: 0.9375rem; }
.kd .kd-choice-hint { font-size: 0.8125rem; line-height: 1.45; color: var(--kd-ink-2); }
.kd .kd-choice-extra { position: relative; z-index: 1; margin-top: -1px; padding: 0 1rem 0.875rem 4.25rem; border: 1px solid var(--kd-accent); border-top: 0; background: var(--kd-accent-faint); }
.kd .kd-limits { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.25rem; }
.kd .kd-input-num { font-family: var(--kd-mono); font-size: 0.875rem; }
.kd .kd-check-row { display: flex; align-items: flex-start; gap: 0.75rem; margin-top: 1rem; cursor: pointer; }
.kd .kd-check-row input { margin-top: 0.1875rem; }
.kd .kd-check-text { display: flex; flex-direction: column; gap: 0.125rem; }
.kd .kd-check-title { font-weight: 500; font-size: 0.875rem; }
.kd .kd-check-hint { font-size: 0.8125rem; color: var(--kd-ink-2); }
.kd .kd-grant { margin-top: 1.25rem; padding: 0.875rem 1rem; border-radius: var(--kd-radius); background: var(--kd-surface-2); font-size: 0.875rem; line-height: 1.55; color: var(--kd-ink); }
.kd .kd-link-row { display: flex; gap: 0.5rem; }
.kd .kd-link-field { font: 0.8125rem var(--kd-mono); }

.kd .kd-pick { max-height: min(50vh, 22rem); overflow: auto; border: 1px solid var(--kd-line); border-radius: var(--kd-radius); padding: 0.25rem; }
.kd .kd-pick-row { display: flex; align-items: center; gap: 0.625rem; min-height: 2.5rem; padding: 0 0.75rem 0 calc(0.625rem + var(--depth, 0) * 1.25rem); border-radius: 3px; font-size: 0.875rem; cursor: pointer; }
.kd .kd-pick-row:hover { background: var(--kd-surface-2); }
.kd .kd-pick-row:has(input:checked) { background: var(--kd-accent-faint); color: var(--kd-accent-strong); font-weight: 500; }
.kd .kd-pick-row.is-off { color: var(--kd-ink-2); cursor: default; }
.kd .kd-pick-row.is-off:hover { background: transparent; }
.kd .kd-pick-ico { width: 1.125rem; height: 1.125rem; color: var(--kd-ink-2); }
.kd .kd-pick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd .kd-pick-note { font: 0.6875rem var(--kd-mono); color: var(--kd-ink-2); }

/* sheets: a menu or a dialog rising from the foot of a phone */
.kd .kd-sheet {
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  max-width: none;
  max-height: 88vh;
  overflow: auto;
  border: 0;
  border-top: 1px solid var(--kd-line-strong);
  border-radius: 8px 8px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  transform: none;
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);
}
.kd .kd-sheet.is-entering { transform: translateY(100%); }
.kd .kd-menu.kd-sheet { padding: 0.25rem 0.5rem calc(0.75rem + env(safe-area-inset-bottom)); }
.kd .kd-sheet-title { padding: 1rem 0.75rem 0.75rem; margin-bottom: 0.25rem; border-bottom: 1px solid var(--kd-line); font-weight: 600; font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kd .kd-sheet .kd-menu-item { min-height: 3rem; font-size: 1rem; gap: 1rem; }
.kd .kd-sheet .kd-menu-ico { width: 1.25rem; height: 1.25rem; }
.kd .kd-dialog.kd-sheet .kd-dialog-foot { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }

/* --- the phone ------------------------------------------------------------------------------------------------------------- */

@media (min-width: 641px) {
  .kd .kd-files { container: kdfiles / inline-size; }
}

@container kdfiles (max-width: 860px) {
  .kd .kd-newfolder > span:last-child { display: none; }
  .kd .kd-newfolder { width: 2.5rem; padding: 0; }
  .kd .kd-kbd { display: none; }
  .kd .kd-search { width: clamp(10rem, 24cqw, 15rem); }
  .kd .kd-group { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
  .kd .kd-sel-acts .kd-btn > span:last-child { display: none; }
  .kd .kd-cols-btn > span:last-child { display: none; }
}

@media (max-width: 1100px) {
  .kd .kd-links-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) 6.5rem 6rem 7rem; }
  .kd .kd-links-row > .kd-links-views { display: none; }
  .kd .kd-links-copy > span { display: none; }
}

@media (max-width: 900px) {
  .kd .kd-pub-hero { grid-template-columns: minmax(0, 1fr); }
  .kd .kd-pub-sample { max-width: 34rem; }
  .kd .kd-pub-promises { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kd .kd-pub-promises li { padding: 1.25rem 0; border-top: 1px solid var(--kd-line); }
  .kd .kd-pub-promises li:first-child { border-top-color: var(--kd-ink); }
}

@media (max-width: 640px) {
  .kd { --kd-head-h: auto; --kd-pad: 1rem; }
  .kd .kd-head { position: static; display: block; min-height: 0; padding: 0.75rem var(--kd-pad) 0.25rem; border-bottom: 0; }
  .kd .kd-head-row { flex-wrap: nowrap; align-items: flex-end; }
  .kd .kd-tree-toggle { order: 3; margin: 0; }
  .kd .kd-head-tools { order: 2; gap: 0; }
  .kd .kd-crumbs { order: 1; }
  .kd .kd-crumb-item:not(.kd-crumb-here) { display: none; }
  .kd .kd-crumb-current { padding-left: 0; height: auto; min-height: 2.75rem; font-size: 1.5rem; }
  .kd .kd-crumb-current .kd-crumb-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.15; text-align: left; }
  .kd .kd-back { display: inline-flex; align-items: center; gap: 0.125rem; align-self: flex-start; max-width: 100%; height: 2.25rem; padding: 0 0.5rem 0 0; margin-left: -0.25rem; border: 0; background: transparent; color: var(--kd-accent); font: 500 0.9375rem var(--kd-ui); }
  .kd .kd-back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kd .kd-back .kd-i { width: 1.25rem; height: 1.25rem; }
  .kd .kd-search, .kd .kd-newfolder, .kd .kd-split { display: none; }
  .kd .kd-search-open { display: inline-grid; width: 2.75rem; height: 2.75rem; }
  .kd .kd-tree-toggle { width: 2.75rem; height: 2.75rem; }
  .kd .kd-files.is-searching .kd-head-row > :not(.kd-head-tools) { display: none; }
  .kd .kd-files.is-searching .kd-head-tools { flex: 1; min-width: 0; }
  .kd .kd-files.is-searching .kd-searchwrap { flex: 1; min-width: 0; }
  .kd .kd-files.is-searching .kd-search { display: flex; width: 100%; height: 2.75rem; }
  .kd .kd-files.is-searching .kd-search-open { display: none; }
  .kd .kd-files.is-searching .kd-search-cancel { display: inline-flex; min-height: 2.75rem; margin-left: 0.25rem; }
  .kd .kd-filter-btn { width: 2.5rem; height: 2.5rem; }
  .kd .kd-kbd { display: none; }
  /* the drop-down and the filters become a sheet the width of the phone, from under the field to the foot */
  .kd.kd-view:has(.kd-files.is-searching) .kd-fab { display: none; }
  .kd .kd-suggest, .kd .kd-filters {
    position: fixed;
    z-index: 45;
    top: var(--kd-sheet-top, 4rem);
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-height: none;
    border-width: 1px 0 0;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -8px 24px -12px color-mix(in srgb, var(--kd-ink) 30%, transparent);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .kd .kd-sg-item { min-height: 3.75rem; }
  .kd .kd-suggest-all { min-height: 3.25rem; border-radius: 0; }
  .kd .kd-range { grid-template-columns: 1fr 1fr; }
  .kd .kd-filters-foot .kd-btn { min-height: 2.75rem; }
  .kd .kd-files.has-chips { --kd-head-h: auto; }
  .kd .kd-files.has-chips .kd-head-row { padding-top: 0; }
  .kd .kd-chips { justify-content: flex-start; padding: 0.5rem 0 0.25rem; }
  .kd .kd-chip { height: 2rem; }
  .kd .kd-chip-x { width: 1.75rem; height: 1.75rem; }
  .kd .kd-side-close { display: inline-grid; }

  .kd .kd-body { display: block; min-height: 0; padding: 0 var(--kd-pad); }
  .kd .kd-splitter { display: none; }
  .kd .kd-files[data-tree] .kd-side {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: flex;
    max-height: 80vh;
    padding: 0 0.5rem calc(1rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--kd-line-strong);
    border-radius: 8px 8px 0 0;
    background: var(--kd-surface);
    transform: translateY(105%);
    visibility: hidden;
    transition: transform 200ms cubic-bezier(0.2, 0, 0, 1), visibility 0s linear 200ms;
  }
  .kd .kd-files[data-sheet="open"] .kd-side { transform: none; visibility: visible; transition: transform 200ms cubic-bezier(0.2, 0, 0, 1); }
  .kd .kd-side-head { position: sticky; top: 0; z-index: 1; padding: 0.5rem 0 0.5rem 0.75rem; margin-bottom: 0.25rem; background: var(--kd-surface); border-bottom: 1px solid var(--kd-line); }
  .kd .kd-side-title { font: 600 0.9375rem/1.2 var(--kd-ui); letter-spacing: 0; text-transform: none; color: var(--kd-ink); }
  .kd .kd-side-head .kd-iconbtn { width: 2.75rem; height: 2.75rem; }
  .kd .kd-tree-row { height: 2.75rem; font-size: 0.9375rem; }
  .kd .kd-storage { padding: 1rem 0.75rem 0; }
  .kd .kd-files[data-sheet="open"] .kd-scrim { display: block; position: fixed; inset: 0; z-index: 59; background: rgba(22, 25, 28, 0.36); }

  .kd .kd-main { padding: 0 0 8rem; }
  .kd .kd-bar { position: static; min-height: 3rem; }
  .kd .kd-summary { font-size: 0.75rem; gap: 0.75rem; }
  .kd .kd-summary-bytes { display: none; }
  .kd .kd-seg-btn { min-width: 2.5rem; height: 2.25rem; }
  .kd .kd-bar-sel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    gap: 0;
    padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom));
    background: var(--kd-surface);
    border-top: 1px solid var(--kd-line-strong);
  }
  .kd .kd-sel-count { padding-left: 0; font-size: 0.875rem; }
  .kd .kd-sel-count .kd-num { font-size: 1rem; }
  .kd .kd-sel-acts { gap: 0; }
  .kd .kd-sel-acts .kd-btn { flex-direction: column; gap: 0.25rem; min-width: 3.75rem; min-height: 3.25rem; padding: 0 0.25rem; font-size: 0.6875rem; }
  .kd .kd-sel-acts .kd-btn .kd-i { width: 1.25rem; height: 1.25rem; }

  .kd .kd-items-grid { gap: 1rem; }
  .kd .kd-group, .kd .kd-skeleton { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.625rem; }
  .kd .kd-group-folders { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .kd .kd-tile { height: 3.25rem; gap: 0.625rem; padding-left: 0.75rem; grid-template-columns: 1.375rem minmax(0, 1fr); }
  .kd .kd-tile { padding-right: 2.75rem; }
  .kd .kd-tile .kd-more { width: 2.75rem; height: 2.75rem; right: 0; margin-top: -1.375rem; }
  .kd .kd-card .kd-more { width: 2.25rem; height: 2.25rem; }
  .kd .kd-card-foot { padding: 0.5rem 0.625rem 0.625rem; }
  .kd .kd-listhead { display: none !important; }
  .kd .kd-row { grid-template-columns: 2.5rem minmax(0, 1fr) 2.75rem; min-height: 3.75rem; padding: 0; column-gap: 0.75rem; }
  .kd .kd-row :is(.kd-cell:not(.kd-col-name), .kd-col-fill) { display: none; }
  .kd .kd-row .kd-cell.kd-col-name { padding: 0; }
  .kd .kd-row-sub { display: flex; flex-wrap: wrap; column-gap: 0.75rem; row-gap: 0.125rem; margin-top: 0.1875rem; font-size: 0.6875rem; color: var(--kd-ink-2); min-width: 0; }
  .kd .kd-row-sub > span { white-space: nowrap; }
  .kd .kd-row-date { font-family: var(--kd-ui); }
  .kd .kd-row-where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 100%; font-family: var(--kd-ui); }
  .kd .kd-row { padding-block: 0.5rem; }
  .kd .kd-cols-btn { width: 2.75rem; height: 2.75rem; padding: 0; justify-content: center; }
  .kd .kd-cols-btn > span:last-child { display: none; }
  .kd .kd-colsmenu.kd-sheet .kd-popover-item { min-height: 3rem; font-size: 1rem; gap: 1rem; }
  .kd .kd-colsmenu.kd-sheet .kd-popover-item input { width: 1.25rem; height: 1.25rem; }
  .kd .kd-row .kd-more { width: 2.75rem; height: 2.75rem; }
  .kd .kd-empty { padding-top: 2rem; }

  .kd .kd-fab {
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 30;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 3.25rem;
    padding: 0 1.25rem 0 1rem;
    border: 0;
    border-radius: var(--kd-radius);
    background: var(--kd-accent);
    color: var(--kd-on-accent);
    font: 600 0.9375rem/1 var(--kd-ui);
    cursor: pointer;
  }
  .kd .kd-fab .kd-i { width: 1.25rem; height: 1.25rem; }
  .kd.kd-view:has(.kd-files[data-selecting="true"]) .kd-fab, .kd.kd-view:has(#files-empty:not([hidden])) .kd-fab { display: none; }
  .kd.kd-view:has(.kd-transfers.is-tray:not([hidden])) .kd-fab { bottom: calc(5.25rem + env(safe-area-inset-bottom)); }
  .kd.kd-view:has(.kd-transfers.is-tray:not([hidden]):not(.is-collapsed)) .kd-fab { display: none; }
  .kd .kd-transfers.is-tray { right: 0.5rem; left: 0.5rem; bottom: calc(0.5rem + env(safe-area-inset-bottom)); width: auto; max-height: 60vh; }
  .kd.kd-view:has(.kd-files[data-selecting="true"]) .kd-transfers.is-tray { display: none; }
  .kd .kd-tt-head { min-height: 3.5rem; }
  .kd .kd-tt-btn { width: 2.75rem; height: 2.75rem; }

  .kd .kd-page { padding: 1.25rem var(--kd-pad) 4rem; }
  .kd .kd-page-title { font-size: 1.5rem; }
  .kd .kd-ledger-head { display: none !important; }
  .kd .kd-links-row, .kd .kd-shared-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name acts" "who acts" "meta acts"; row-gap: 0.25rem; padding: 0.75rem 0.25rem 0.75rem 0.875rem; }
  .kd .kd-links-name { grid-area: name; }
  .kd .kd-links-who, .kd .kd-shared-what { grid-area: who; font-size: 0.8125rem; padding-left: 2rem; }
  .kd .kd-links-who .kd-links-ico { display: none; }
  .kd .kd-links-row > .kd-links-exp { grid-area: meta; padding-left: 2rem; }
  .kd .kd-phone-label { display: inline; }
  .kd .kd-links-row > .kd-links-views, .kd .kd-shared-when { display: none; }
  .kd .kd-links-row > .kd-state { grid-area: meta; justify-self: end; margin-right: 0.5rem; font-size: 0.75rem; }
  .kd .kd-links-acts { grid-area: acts; }
  .kd .kd-links-acts > .kd-btn { display: none; }
  .kd .kd-links-acts .kd-more, .kd .kd-shared-more { display: grid; width: 2.75rem; height: 2.75rem; }
  .kd .kd-limits { grid-template-columns: 1fr; gap: 0.75rem; }
  .kd .kd-pick-row { min-height: 2.75rem; }
  .kd .kd-input { min-height: 2.75rem; font-size: 1rem; }
  .kd .kd-link-row { flex-direction: column; }
  .kd .kd-dialog-foot .kd-btn { min-height: 2.75rem; }
  .kd .kd-viewer-stage { padding: 0 0 1rem; }
  .kd .kd-viewer-nav { display: none; }
  .kd .kd-vbtn > span:last-child { display: none; }
  .kd .kd-vbtn { width: 2.75rem; height: 2.75rem; padding: 0; justify-content: center; }
  .kd .kd-viewer-bar { gap: 0.25rem; padding: 0.25rem 0.5rem; }
  .kd .kd-viewer-meta { gap: 0.75rem; }
  .kd .kd-pub-head { min-height: 4rem; }
  .kd .kd-pub-hero { padding-top: 2.5rem; padding-bottom: 3rem; gap: 2.5rem; }
  .kd .kd-pub-title { font-size: 2.375rem; }
  .kd .kd-pub-lede { font-size: 1rem; }
  .kd .kd-pub-acts .kd-btn-lg { width: 100%; }
  .kd .kd-sample-rows li { padding: 0 1rem; }
  .kd.kd-public { --kd-pub-pad: 1.25rem; }
  .kd .kd-sample-head, .kd .kd-sample-transfer { padding-left: 1rem; padding-right: 1rem; }
}

@media (pointer: coarse) {
  .kd .kd-more { opacity: 1; }
  .kd .kd-item:not(.is-selected):hover .kd-check { opacity: 0; }
  .kd .kd-tile:not(.is-selected):hover .kd-tile-ico, .kd .kd-row:not(.is-selected):hover .kd-row-ico { visibility: visible; }
  .kd .kd-files[data-selecting="true"] .kd-item .kd-check { opacity: 1; }
  .kd .kd-files[data-selecting="true"] :is(.kd-tile-ico, .kd-row-ico) { visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .kd *, .kd *::before, .kd *::after { transition: none !important; animation: none !important; }
}

/* --- the dark scheme: what the tokens alone do not turn ------------------------------------------------------------------------
 * The mixes that lean on black lean on white at night (a hover darker than the surface would vanish), a selected tile keeps its
 * tint, the viewer and the scrim were dark already, a PDF stays a white page. */
:root[data-theme="dark"] .kd {
  --kd-accent-strong: color-mix(in srgb, var(--kd-accent) 82%, #fff);
  --kd-accent-faint: color-mix(in srgb, var(--kd-accent) 14%, var(--kd-surface));
  --kd-ink-soft: color-mix(in srgb, var(--kd-ink) 80%, var(--kd-bg));
  --kd-line-strong: color-mix(in srgb, var(--kd-ink) 24%, var(--kd-line));
  --kd-hover: color-mix(in srgb, var(--kd-ink) 8%, transparent);
  -webkit-font-smoothing: auto;
}
:root[data-theme="dark"] .kd .kd-btn-danger { color: #121416; }
:root[data-theme="dark"] .kd .kd-btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--kd-danger) 82%, #fff); }
:root[data-theme="dark"] .kd .kd-btn-quiet.kd-danger-text:hover:not(:disabled) { background: color-mix(in srgb, var(--kd-danger) 14%, var(--kd-surface)); }
:root[data-theme="dark"] .kd .kd-thumb-img { background: var(--kd-surface-2); }
:root[data-theme="dark"] .kd .kd-scrim-layer, :root[data-theme="dark"] .kd .kd-files[data-sheet="open"] .kd-scrim { background: rgba(0, 0, 0, 0.55); }
:root[data-theme="dark"] .kd .kd-band { background: color-mix(in srgb, var(--kd-accent) 18%, transparent); }
:root[data-theme="dark"] .kd :is(.kd-suggest, .kd-filters, .kd-popover) { box-shadow: 0 14px 36px -10px rgb(0 0 0 / 0.7); }
:root[data-theme="dark"] .kd mark.kd-hl { background: color-mix(in srgb, var(--kd-accent) 26%, transparent); }
