:root {
  color-scheme: light;
  --page: #f5f6fc;
  --panel: #fff;
  --ink: #1d2033;
  --muted: #545d74;
  --line: #dce0ef;
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --tint: #eeedff;
  --error: #9d2434;
  font-family: system-ui, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  line-height: 1.5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.12; letter-spacing: -.045em; }
h2 { font-size: 1.1rem; line-height: 1.3; }

.shell { width: min(100% - 2rem, 74rem); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); background: var(--panel); }
.topbar-inner { display: flex; min-height: 4.5rem; align-items: center; justify-content: space-between; gap: 1rem; }
.wordmark { display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; color: var(--ink); font-size: 1.18rem; font-weight: 750; letter-spacing: -.04em; text-decoration: none; }
.wordmark-mark { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: .55rem; background: var(--accent); color: white; font-weight: 800; }
.muted, .empty, .role-label { color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); }
.clean-list { list-style: none; margin: 0; padding: 0; }
.notice { margin-block: 1rem; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--tint); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

button, input, select { font: inherit; }
button { min-height: 44px; padding: .55rem 1rem; border: 1px solid transparent; border-radius: .55rem; color: white; background: var(--accent); font-weight: 650; cursor: pointer; transition: background-color .15s ease, color .15s ease; }
button:hover { background: var(--accent-hover); }
button:disabled { opacity: .58; cursor: wait; }
.quiet { background: var(--tint); color: var(--accent); }
.quiet:hover { background: #e1deff; }
.signin { width: min(100%, 29rem); margin: clamp(2rem, 13vh, 8rem) auto; padding: clamp(1.25rem, 5vw, 2.5rem); }
.signin h1 { font-size: clamp(1.85rem, 4vw, 2.5rem); }
.signin > p { margin-top: .65rem; }
.signin form { display: grid; gap: .45rem; margin-top: 1.75rem; }
.signin label { font-weight: 600; }
.signin input { min-width: 0; min-height: 46px; margin-bottom: .55rem; padding: .5rem .75rem; border: 1px solid #9aa3bd; border-radius: .55rem; color: var(--ink); background: #fff; }
.signin form button { margin-top: .45rem; }
.error { color: var(--error); }

.page-heading { padding-block: 2.5rem 1.75rem; }
.page-heading p { margin-top: .55rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 21rem); gap: 1.25rem; }
.projects-heading { margin: .2rem 0 1rem; }
.drive-guest {
  --ink: #0b1220;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --tint: #eaf2ff;
}
.drive-guest .quiet:hover {
  background: #dceaff;
}
#account-drive { margin-inline-start: auto; }
:root:has(.drive-active) { color-scheme: dark; background: #101112; }
.drive-active {
  color-scheme: dark;
  --page: #101112;
  --panel: #1b1c1e;
  --ink: #f5f5f6;
  --muted: #b6b8bc;
  --line: #343638;
  --accent: #ff983d;
  --accent-hover: #ffae64;
  --tint: #27292c;
  --error: #ff9b97;
  background: var(--page);
  color: var(--ink);
}
.drive-active .topbar { position: sticky; top: 0; z-index: 16; background: #141516; }
html:has(.drive-active) { scroll-padding-top: calc(4.5rem + 1px); }
.drive-active .wordmark { display: none; }
.drive-active .shell { width: 100%; }
.drive-active .notice { margin-inline: 1rem; }
.drive-active button { color: #151311; }
.drive-active .quiet { color: var(--ink); background: transparent; }
.drive-active .quiet:hover { background: var(--tint); }
.drive-active button:disabled { cursor: default; opacity: .45; }
.drive-header {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: clamp(1rem, 4vw, 4rem); width: 100%; padding: .65rem clamp(1rem, 2.8vw, 2.75rem);
}
.drive-skip {
  position: absolute; z-index: 20; top: .6rem; left: .8rem; padding: .65rem;
  background: var(--panel); border-radius: .4rem; transform: translateY(-160%);
}
.drive-skip:focus { transform: none; }
.drive-brand { display: block; width: 11rem; height: 3.05rem; overflow: hidden; }
.drive-brand img { display: block; width: 100%; height: 100%; object-fit: contain; transform: scale(1.22); }
.drive-search { position: relative; width: 100%; }
.drive-search input {
  width: 100%; min-width: 0; min-height: 46px; padding: .55rem .8rem .55rem 2.6rem;
  color: var(--ink); background: #232426; border: 1px solid #414346; border-radius: .7rem;
}
.drive-search input::placeholder { color: var(--muted); }
.drive-search-icon {
  position: absolute; left: 1rem; top: 50%; width: .9rem; height: .9rem; transform: translateY(-60%);
  border: 2px solid var(--muted); border-radius: 50%; pointer-events: none;
}
.drive-search-icon::after {
  position: absolute; content: ""; width: .4rem; height: 2px; background: var(--muted);
  left: .62rem; top: .63rem; transform: rotate(48deg); border-radius: 1px;
}
.drive-active .drive-account {
  justify-self: end; width: 44px; min-width: 44px; padding: 0;
  border-radius: 50%; border: 1px solid #4c4947; background: #38312a; color: #ffe2c8;
}
.catalog {
  display: grid; grid-template-columns: minmax(12rem, 15.75rem) minmax(0, 1fr);
  min-height: calc(100vh - 4.5rem);
}
.drive-sidebar {
  display: flex; flex-direction: column; gap: 1.25rem; align-items: stretch;
  position: sticky; top: calc(4.5rem + 1px); align-self: start; height: calc(100dvh - 4.5rem - 1px); z-index: 10;
  padding: 1.5rem clamp(.8rem, 1.6vw, 1.4rem); background: #141516; border-inline-end: 1px solid #252729;
}
.drive-add { position: relative; flex: none; }
.drive-add summary, .drive-shortcuts summary { list-style: none; cursor: pointer; }
.drive-add summary::-webkit-details-marker, .drive-shortcuts summary::-webkit-details-marker { display: none; }
.drive-add summary {
  display: flex; align-items: center; gap: .42rem; min-height: 36px; padding: .35rem .65rem;
  background: linear-gradient(165deg, #ffad61, #ee8a34); color: #18130e; border: 1px solid #ffc084;
  border-radius: .55rem; font-weight: 700; font-size: .88rem;
}
.drive-add summary:hover { background: #ffb877; }
.drive-add summary span { font-size: 1.45rem; font-weight: 450; line-height: 1; }
.drive-add-choices, .catalog-context {
  z-index: 10; min-width: min(14rem, calc(100vw - 1rem)); display: grid; gap: .15rem; padding: .3rem;
  background: #242527; border: 1px solid #47494b; border-radius: .65rem; box-shadow: 0 12px 28px #0008;
}
.drive-add-choices { position: absolute; top: calc(100% + .4rem); inset-inline-start: 0; }
.drive-add-choices button, .catalog-context button { text-align: start; }
.catalog-tabs { display: grid; gap: .3rem; }
.catalog-tabs .quiet { display: flex; gap: .8rem; align-items: center; padding: .65rem .75rem; color: var(--muted); }
.catalog-tabs [aria-pressed="true"] { color: var(--ink); background: #282a2c; }
.catalog-tabs [aria-pressed="true"] :is(.drive-nav-icon, .catalog-action-icon) { color: var(--accent); }
.drive-nav-icon { position: relative; display: inline-block; flex: 0 0 1.1rem; height: .9rem; color: currentColor; }
.drive-nav-folder { border: 1.7px solid currentColor; border-radius: 3px; }
.drive-nav-folder::before { position: absolute; top: -.31rem; left: -.1rem; width: .53rem; height: .29rem; content: ""; border: 1.7px solid currentColor; border-bottom: 0; border-radius: 3px 3px 0 0; }
.drive-nav-device { border: 1.7px solid currentColor; border-radius: 3px; }
.drive-nav-device::after { content: ""; position: absolute; left: .28rem; right: .28rem; bottom: -.25rem; border-bottom: 1.7px solid currentColor; }
.drive-device-label { min-width: 0; max-width: 100%; color: var(--muted); font-size: .9rem; }
.drive-device-label select { max-width: min(17rem, 75vw); }
.catalog select, #catalog-dialog input, #catalog-dialog select {
  min-height: 44px; min-width: 0; max-width: 100%; padding: .45rem .65rem; border: 1px solid var(--line);
  border-radius: .55rem; background: var(--panel); color: var(--ink);
}
.drive-shortcuts { position: relative; margin-block-start: auto; border-top: 1px solid var(--line); padding-block-start: .7rem; min-width: 0; }
.drive-shortcuts summary { color: var(--muted); min-height: 44px; display: flex; align-items: center; font-size: .89rem; }
.drive-shortcuts summary:hover { color: var(--ink); }
.drive-shortcuts dl {
  position: absolute; inset-inline: 0; bottom: calc(100% + .45rem); z-index: 7;
  margin: 0; padding: .65rem; color: var(--muted); font-size: .79rem;
  border: 1px solid var(--line); border-radius: .65rem; background: var(--panel);
}
.drive-shortcuts dl div { display: flex; justify-content: space-between; gap: .3rem; flex-wrap: wrap; margin-block: .25rem; }
.drive-shortcuts dd { margin: 0; white-space: nowrap; }
.drive-main { min-width: 0; padding: clamp(1.1rem, 2.7vw, 2.7rem); }
.drive-view-controls, .catalog-actions, .catalog-location, .drive-selection, .drive-history {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
}
.catalog-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; }
.catalog-heading-title { display: flex; align-items: baseline; gap: .7rem; min-width: 0; }
.catalog-heading-title:has(#catalog-file-search:not([hidden])) { flex-wrap: wrap; align-items: center; }
#catalog-file-search { flex: 1 1 16rem; min-width: 0; max-width: 32rem; }
.catalog-heading h1 { min-width: 0; font-size: clamp(1.9rem, 3vw, 2.65rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-summary { flex: none; font-size: clamp(1.05rem, 1.4vw, 1.3rem); font-weight: 650; white-space: nowrap; }
.catalog-summary:empty { display: none; }
@media (max-width: 74rem) { .catalog-heading { grid-template-columns: minmax(0, 1fr); } }
.catalog-action-icon {
  width: 1.05rem; height: 1.05rem; flex: none; pointer-events: none;
  fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.drive-selection button, .drive-add-choices button, .catalog-context button,
#catalog-previews, .drive-device-label, .drive-sort {
  display: inline-flex; align-items: center; gap: .42rem;
}
.drive-device-label select { min-width: 0; }
.drive-view-toggle { display: flex; align-items: center; padding-inline-end: .35rem; border-inline-end: 1px solid var(--line); }
.drive-view-toggle button, .catalog-refresh, .drive-history button {
  display: grid; place-items: center; min-width: 42px; padding-inline: .45rem; font-size: 1.15rem;
}
.drive-view-toggle [aria-pressed="true"] { color: var(--accent); background: #30271f; }
.drive-grid-icon {
  position: relative; width: .48rem; height: .48rem; margin: 0 .53rem .53rem 0; border: 1.6px solid currentColor; border-radius: 2px;
  box-shadow: .53rem 0 0 -1px var(--panel), 0 .53rem 0 -1px var(--panel), .53rem .53rem 0 -1px var(--panel),
    .53rem 0 0 0 currentColor, 0 .53rem 0 0 currentColor, .53rem .53rem 0 0 currentColor;
}
.drive-list-icon { width: 1rem; height: 2px; border-radius: 1px; background: currentColor; box-shadow: 0 -.32rem currentColor, 0 .32rem currentColor; }
.catalog-path { display: flex; gap: .55rem; align-items: center; margin-block: .85rem .35rem; }
.catalog-location {
  min-width: 0;
  flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-height: 42px;
  gap: .15rem;
}
.catalog-location button {
  display: inline-flex; align-items: center; flex: none; gap: .35rem;
  padding-inline: .55rem; color: var(--muted); white-space: nowrap;
}
.catalog-location button[aria-current] { color: var(--ink); }
.catalog-actions {
  display: flex; flex-wrap: nowrap; gap: .45rem; align-items: center; min-height: 56px;
  overflow-x: auto; scrollbar-width: thin; margin-bottom: .65rem; padding-block: 4px;
}
.drive-history { flex-wrap: nowrap; margin-inline-start: auto; }
.drive-selection { flex: none; flex-wrap: nowrap; gap: .4rem; }
.drive-selection > span { color: var(--accent); width: 7rem; padding-inline: .4rem; font-size: .9rem; white-space: nowrap; }
.drive-selection button { padding-inline: .6rem; font-size: .875rem; white-space: nowrap; }
.catalog-status {
  position: fixed; inset-inline-end: clamp(.75rem, 3vw, 2rem); bottom: clamp(.75rem, 3vw, 2rem); z-index: 15;
  max-width: min(24rem, calc(100vw - 1.5rem)); padding: .58rem .8rem; color: var(--ink);
  background: #292a2d; border: 1px solid #4b4d51; border-radius: .65rem; box-shadow: 0 6px 20px #0006;
  font-size: .85rem; overflow-wrap: anywhere; animation: catalog-toast-in 170ms ease-out both;
}
@keyframes catalog-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .catalog-status { animation: none; } }
.catalog-surface { min-height: clamp(15rem, 35vh, 30rem); user-select: none; }
.catalog-marquee {
  position: fixed; z-index: 12; pointer-events: none; border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.catalog-device-mark { display: inline-block; margin-inline-end: .45rem; vertical-align: baseline; color: var(--muted); }
.catalog-device-mark.drive-nav-device { width: .85rem; height: .64rem; }
.catalog-danger, .drive-active .catalog-danger { color: var(--error); }
.catalog-rows { min-width: 0; }
#catalog-entries[data-view="grid"] {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.2rem), 1fr));
  gap: clamp(.75rem, 1.6vw, 1.35rem); align-items: start; position: relative; padding-inline: 1.5%;
}
#catalog-files { margin-block-start: 1.4rem; }
.catalog-row {
  position: relative; min-width: 0; border-radius: .85rem; overflow-wrap: anywhere;
  border: 1px solid #313335; background: #1a1c1d;
}
#catalog-entries .catalog-row:hover { border-color: #585a5c; }
#catalog-entries .catalog-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.catalog-drop-target { outline: 2px solid var(--accent); outline-offset: -2px; background: #3c2d22 !important; }
.drive-group { grid-column: 1 / -1; color: var(--ink); font-weight: 720; font-size: 1.17rem; }
.drive-group:not(:first-child) { padding-block-start: .85rem; }
.drive-entry-art {
  display: grid; position: relative; place-content: center; min-height: clamp(6.48rem, 9.6vw, 10.6rem); overflow: hidden;
  border-radius: .8rem .8rem 0 0; background: radial-gradient(ellipse at 44% 30%, #313c47 0, #242d35 37%, #181c22 74%);
}
.drive-preview { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; }
.catalog-native-drop { outline: 2px dashed var(--drive-accent, #f97316); outline-offset: -3px; }
.drive-entry-art[data-type="video"] { background: radial-gradient(ellipse at 40% 23%, #344a57, #24323e 40%, #1b2027 78%); }
.drive-entry-art[data-type="image"] { background: radial-gradient(ellipse at 37% 24%, #483c55, #31293e 43%, #201e26 78%); }
.drive-entry-art[data-type="audio"] { background: radial-gradient(ellipse at 39% 23%, #34534d, #263b38 43%, #1c2524 78%); }
.drive-entry-art[data-type="pdf"] { background: radial-gradient(ellipse at 39% 23%, #554036, #382b29 43%, #272022 78%); }
[data-kind="folder"] .drive-entry-art {
  background: radial-gradient(ellipse at 35% 48%, #42372b 0, #282620 38%, #1d1e20 76%);
}
[data-kind="folder"] .drive-entry-art::before {
  position: absolute; content: ""; top: 25%; left: 31%; width: 35%; height: 39%; border: 1px solid #b9895e70;
  border-radius: .4rem; transform: rotate(-12deg); background: linear-gradient(150deg, #816045, #423a37);
}
[data-kind="folder"] .drive-entry-art::after {
  position: absolute; content: ""; left: 23%; bottom: 20%; width: 54%; height: 50%;
  border-radius: .45rem; background: linear-gradient(152deg, #746656, #484645 62%, #35373a);
  clip-path: polygon(0 14%, 43% 14%, 52% 35%, 100% 35%, 100% 100%, 0 100%);
}
.drive-extension {
  position: relative; display: grid; place-items: end center; min-width: 3.35rem; height: 4.35rem; padding: .4rem;
  color: #e2e8ef; background: #495564; font: 700 .73rem/1.4 ui-monospace, Consolas, monospace;
  border-radius: .24rem; clip-path: polygon(0 0, 70% 0, 100% 23%, 100% 100%, 0 100%);
}
.drive-extension::after { content: ""; position: absolute; right: 0; top: 0; width: 30%; height: 23%; background: #8393a5; }
.drive-entry-info { display: grid; min-width: 0; gap: .2rem; padding: .75rem 3rem .8rem .8rem; }
.catalog-entry-name { min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-active button.catalog-entry-name {
  display: block; padding: 0; min-height: 32px; text-align: start; background: transparent; color: var(--ink); border: 0;
}
.drive-active button.catalog-entry-name:hover { text-decoration: underline; }
.drive-entry-meta { font-size: .81rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-entry-menu { position: absolute; right: .35rem; bottom: .55rem; width: 38px; padding: 0; font-size: 1.2rem; }
.catalog-entry-select {
  position: absolute; top: .65rem; left: .65rem; width: 21px; height: 21px; margin: 0; z-index: 1;
  accent-color: var(--accent); cursor: pointer;
}
.catalog-rows[data-view="list"] .catalog-row {
  display: grid; grid-template-columns: 26px 2.65rem minmax(0, 1fr) 2.65rem; align-items: center;
  gap: .6rem; min-height: 58px; margin-block: .35rem; padding-inline: .5rem;
}
.catalog-rows[data-view="list"] .catalog-entry-select { position: static; grid-column: 1; grid-row: 1; justify-self: center; }
.catalog-rows[data-view="list"] .drive-entry-art { grid-column: 2; grid-row: 1; min-height: 36px; border-radius: .35rem; }
.catalog-rows[data-view="list"] .drive-extension { height: 1.55rem; min-width: 1.24rem; padding: .15rem; font-size: .48rem; }
.catalog-rows[data-view="list"] .drive-entry-info { grid-column: 3; padding: .3rem 0; }
.catalog-rows[data-view="list"] .drive-entry-menu { position: static; grid-column: 4; }
.catalog-rows[data-view="list"] .drive-group { padding-block: .65rem .1rem; }
.catalog-context { position: fixed; max-height: calc(100vh - 1rem); overflow-y: auto; }
.catalog-link-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center;
  gap: .8rem; min-height: 58px; padding: .45rem .7rem; margin-top: .6rem;
}
.catalog-link-row.catalog-selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.catalog-link-select { margin: 0; width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.catalog-link-info { display: grid; gap: .3rem; min-width: 0; }
.catalog-link-badges, .drive-link-filters, .share-password-form {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
}
.catalog-link-badges span { background: var(--tint); border-radius: .36rem; color: var(--muted); padding: .18rem .4rem; font-size: .78rem; }
.drive-link-filters { margin-block: 1.1rem .7rem; }
.drive-link-filters .drive-search { flex: 1 1 15rem; }
.drive-link-filters select { max-width: 100%; }
.share-password-form { align-items: end; margin-block: .75rem; }
.link-policy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.share-password-form label { display: grid; gap: .28rem; font-size: .9rem; }
.link-policy-card {
  min-width: 0; padding: .72rem; border: 1px solid var(--line);
  border-radius: .65rem; background: color-mix(in srgb, var(--panel) 94%, var(--ink));
}
.link-policy-toggle {
  display: flex; min-height: 32px; align-items: center; justify-content: space-between;
  gap: .5rem; margin-bottom: .45rem; font-size: .91rem; font-weight: 650; cursor: pointer;
}
#catalog-dialog input[role="switch"] {
  appearance: none; display: grid; align-items: center; position: relative; width: 42px; min-height: 24px;
  height: 24px; flex: none; padding: 0; margin: 0; border-radius: 20px; background: var(--tint); cursor: pointer;
}
#catalog-dialog input[role="switch"]::before {
  content: ""; position: absolute; inset-inline-start: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--muted); transition: transform 140ms ease;
}
#catalog-dialog input[role="switch"]:checked { background: var(--accent); border-color: var(--accent); }
#catalog-dialog input[role="switch"]:checked::before { background: #181818; transform: translateX(18px); }
.link-policy-slot { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 44px; }
.link-policy-slot-tall { min-height: calc(88px + .35rem); }
.link-policy-slot > * { grid-area: 1 / 1; align-self: start; min-width: 0; }
.link-policy-summary { display: flex; min-height: 44px; align-items: center; padding-inline: .25rem; font-size: .85rem; }
.link-policy-time, .link-policy-period { display: grid; gap: .35rem; }
.link-policy-period { grid-template-columns: minmax(0, .75fr) minmax(0, 1fr); }
.link-policy-slot :is(input, select) { width: 100%; }
.catalog-recipient { position: relative; }
.catalog-recipient-results {
  position: absolute; z-index: 3; inset-inline: 0; top: calc(100% + .2rem);
  max-height: 13rem; overflow: auto; padding: .2rem;
  border: 1px solid var(--line); border-radius: .5rem; background: var(--panel);
  box-shadow: 0 8px 28px #0005;
}
.catalog-recipient-option {
  display: grid; gap: .1rem; padding: .45rem .55rem; font-size: .82rem;
  cursor: pointer; border-radius: .3rem; overflow-wrap: anywhere;
}
.catalog-recipient-option:is(:hover,[aria-selected="true"]) { background: var(--tint); }
.drive-active .catalog-preview-button {
  display: inline-flex; justify-content: center; align-items: center; gap: .36rem;
  min-height: 34px; padding: .25rem .65rem; font-size: .82rem; line-height: 1.2;
  border: 1px solid var(--line); border-radius: .5rem;
  background: color-mix(in srgb, var(--panel) 93%, var(--ink));
}
.drive-active .catalog-preview-button:hover,
.drive-active .catalog-preview-button[aria-pressed="true"] { border-color: var(--accent); background: var(--tint); }
#catalog-dialog .catalog-preview-button { justify-self: start; }
.catalog-preview-button .catalog-action-icon { width: .95rem; height: .95rem; }
@media (prefers-reduced-motion: reduce) { #catalog-dialog input[role="switch"]::before { transition: none; } }
.link-file-list li { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto; gap: .55rem; align-items: center; padding-block: .25rem; }
.link-file-art { display: grid; place-items: center; overflow: hidden; height: 2.5rem; border-radius: .3rem; background: var(--tint); font-size: .63rem; }
.link-file-art canvas { width: 100%; height: 100%; object-fit: cover; }
.drive-empty { grid-column: 1 / -1; padding: 1.4rem; border: 1px dashed var(--line); border-radius: .75rem; }
#catalog-empty { margin-top: 1.4rem; }
#catalog-older { margin-top: .85rem; }
#catalog-dialog-body { display: grid; gap: .6rem; margin-block: .8rem 1rem; overflow-wrap: anywhere; }
#catalog-dialog-body p, #catalog-dialog-body ul { margin-block: 0; }
#catalog-dialog-body ul { max-height: 12rem; overflow: auto; }
@media (max-width: 820px) {
  .drive-header { gap: .65rem; }
  .drive-brand { width: min(9rem, 100%); }
  .catalog { grid-template-columns: minmax(0, 1fr); }
  .drive-sidebar {
    display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
    height: auto; border-inline-end: 0; border-bottom: 1px solid var(--line); padding-block: .65rem;
  }
  .catalog-tabs { display: flex; flex-wrap: wrap; gap: .15rem; }
  .catalog-tabs .quiet { gap: .4rem; padding: .5rem; }
  .drive-shortcuts { border: 0; padding: 0; margin: 0; }
  .drive-shortcuts dl { inset-inline: auto 0; bottom: auto; top: 100%; width: min(16rem, 75vw); }
}
@media (max-width: 540px) {
  .drive-header { grid-template-columns: minmax(0, 1fr) auto; padding-block: .4rem .65rem; }
  .drive-brand { width: 9rem; height: 2.65rem; }
  .drive-account { grid-column: 2; grid-row: 1; }
  .drive-sidebar { gap: .25rem .5rem; }
  .catalog-heading { gap: .5rem; }
  #catalog-entries[data-view="grid"] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .drive-entry-art { min-height: 6.02rem; }
  .drive-entry-info { padding: .5rem 2rem .5rem .45rem; }
  .drive-entry-menu { width: 32px; right: .1rem; bottom: .2rem; }
  .catalog-link-row { gap: .4rem; }
  .catalog-link-row button { padding-inline: .4rem; }
  .link-policy { grid-template-columns: minmax(0, 1fr); }
}
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; align-content: start; }
.project-card { min-width: 0; padding: 1.2rem; border-top: 3px solid #a5aafa; overflow-wrap: anywhere; }
.project-link { display: block; width: 100%; margin: .25rem 0; padding: .25rem 0; text-align: start; color: var(--ink); background: none; font-size: 1.25rem; line-height: 1.3; overflow-wrap: anywhere; }
.project-link:hover { color: var(--accent); background: none; }
.role-label { font-size: .9rem; }
.sidebar { margin-bottom: 1rem; padding: 1rem 1.2rem; overflow-wrap: anywhere; }
.sidebar h2 { padding-bottom: .7rem; }
.sidebar-row { display: grid; justify-items: start; gap: .2rem; padding-block: .6rem; }
.sidebar-row + .sidebar-row { border-top: 1px solid var(--line); }
.sidebar-row button { margin-top: .3rem; }
dialog { width: min(100% - 2rem, 27rem); padding: 1.5rem; border: 1px solid var(--line); border-radius: .85rem; color: var(--ink); }
#catalog-dialog:has(.link-policy) { width: min(100% - 2rem, 38rem); background: var(--panel); }
dialog::backdrop { background: rgb(26 28 49 / 55%); }
dialog p { margin-block: .6rem 1rem; }
#pair-form { display: grid; gap: .5rem; }
#pair-form select { min-height: 44px; min-width: 0; padding: .45rem .6rem; border: 1px solid #9aa3bd; border-radius: .55rem; color: var(--ink); background: #fff; }
#pair-code { font-weight: 700; letter-spacing: .08em; }
#pair-name { overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: .5rem; }
#catalog-dialog-form { position: relative; }
#catalog-dialog.link-icon-dialog h2 { padding-inline-end: 2.5rem; }
#catalog-dialog-dismiss {
  position: absolute; inset-block-start: -.45rem; inset-inline-end: -.45rem;
  display: grid; place-items: center; width: 36px; min-height: 36px; padding: 0;
}
#catalog-dialog .dialog-actions { position: relative; justify-content: center; }
#catalog-dialog.link-icon-dialog .dialog-actions { flex-wrap: nowrap; }
#catalog-dialog.link-icon-dialog .dialog-actions button:not(.dialog-text-action) {
  display: inline-grid; place-items: center; width: 42px; min-height: 42px; padding: 0;
}
#catalog-dialog.link-icon-dialog .dialog-actions button.quiet { border: 1px solid var(--line); }
#catalog-dialog-extra { display: contents; }
#catalog-dialog-edge { position: absolute; inset-inline-end: 0; inset-block-end: 0; }
#catalog-dialog .dialog-text-action {
  display: inline-flex; align-items: center; gap: .3rem; padding-inline: .45rem; font-size: .83rem;
}
@media (max-width: 360px) {
  #catalog-dialog .dialog-actions:has(#catalog-dialog-edge button) { padding-bottom: 44px; }
}
#catalog-copy-status {
  position: absolute; top: calc(100% + .1rem); inset-inline: 0; text-align: center; font-size: .82rem; color: var(--muted);
}
#catalog-copy-fallback {
  position: absolute; inset-inline: 0; bottom: calc(100% + .5rem); display: grid; gap: .35rem; z-index: 1;
  padding: .65rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--panel); font-size: .83rem;
}
.download-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
#destination { margin-block: .5rem 1rem; overflow-wrap: anywhere; }

.guest { max-width: 52rem; padding-block: 2.5rem; }
.guest h1 { margin-bottom: 1rem; }
.guest .notice { margin-block: 0 1rem; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .25rem 1rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.file-row:last-child { border-bottom: 0; }
.file-progress { grid-column: 1; grid-row: 2; color: var(--muted); }
.file-bar, #batch-bar { width: 100%; height: .55rem; accent-color: var(--accent); }
.file-bar { grid-column: 1; grid-row: 3; }
.batch-progress { margin-bottom: 1rem; }
.file-row button { grid-column: 2; grid-row: 1 / span 2; }
#files:empty { display: none; }

@media (max-width: 680px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard-grid aside .sidebar:last-child { margin-bottom: 0; }
  .page-heading { padding-block: 1.65rem 1rem; }
  .file-row button { grid-column: 1; grid-row: auto; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
