:root {
  color-scheme: light;
  --ink: #20232c;
  --muted: #585e70;
  --canvas: #f7f7f5;
  --line: #dedfe4;
  --accent: #4943ae;
  --soft: #eeedff;
  --rail: #24252e;
  font: 16px/1.5 "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: .2em; }
button, input, select { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 19px; border: 0; border-radius: 9px; font-weight: 650; color: white; background: var(--accent); text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: #373189; }
:focus-visible { outline: 3px solid #98631b; outline-offset: 3px; }
.skip { position: fixed; top: -100px; left: 8px; z-index: 4; background: white; padding: 10px; }
.skip:focus { top: 8px; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { line-height: 1.15; overflow-wrap: anywhere; }
h1 { font-size: clamp(32px,3.8vw,56px); letter-spacing: -.055em; font-weight: 670; }
h2 { font-size: clamp(22px,2.2vw,30px); letter-spacing: -.038em; font-weight: 650; }
h3 { font-size: 20px; letter-spacing: -.025em; margin: 24px 0 12px; }
small { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
input,select { color: var(--ink); background: white; border: 1px solid #aaaebd; border-radius: 8px; min-height: 44px; padding: 9px 13px; min-width: 0; max-width: 100%; }
input::placeholder { color: #707588; }
label { display: grid; gap: 6px; min-width: 0; font-size: 14px; font-weight: 650; }
label input, label select { font-size: 16px; font-weight: 400; }
.workspace { display: grid; grid-template-columns: 220px minmax(0,1fr); min-height: 100vh; }
.rail { background: var(--rail); color: #fff; padding: 32px 18px 22px; }
.workspace .rail { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 11px; font-weight: 720; font-size: 29px; letter-spacing: -.06em; line-height: 1; text-decoration: none; color: inherit; margin: 0 10px; }
.brand-mark { display: inline-flex; width: 31px; height: 31px; padding: 6px; align-items: center; justify-content: space-between; background: #c4c0ff; border-radius: 7px; color: #27263d; }
.brand-mark::before,.brand-mark::after,.brand-mark i { content: ""; height: 15px; width: 4px; background: currentColor; }
.brand-mark::after { transform: rotate(-13deg); }
.rail nav { display: grid; gap: 6px; margin-top: 58px; }
.rail nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 10px 14px; color: #d3d4df; font-size: 15px; font-weight: 600; border-radius: 9px; text-decoration: none; }
.rail nav a:hover { background: #333641; }
.rail nav [aria-current] { color: #fff; background: #454451; box-shadow: inset 3px 0 #c4c0ff; }
.nav-library, .nav-settings, .nav-members { position: relative; width: 18px; height: 16px; flex: none; }
.nav-members::before, .nav-members::after { content: ""; position: absolute; left: 3px; border: 1.5px solid currentColor; }
.nav-members::before { width: 5px; height: 5px; top: 0; border-radius: 50%; left: 5px; }
.nav-members::after { width: 11px; height: 5px; bottom: 1px; border-radius: 5px 5px 2px 2px; left: 2px; }
.nav-library { border: 1.5px solid currentColor; border-radius: 3px; }
.nav-library::after { content: ""; position: absolute; top: 3px; left: 0; width: 100%; border-top: 1.5px solid currentColor; }
.nav-settings { background: linear-gradient(currentColor,currentColor) center 3px/18px 1.5px no-repeat, linear-gradient(currentColor,currentColor) center 12px/18px 1.5px no-repeat; }
.nav-settings::before,.nav-settings::after { content: ""; position: absolute; width: 4px; height: 6px; background: currentColor; border-radius: 2px; top: 1px; left: 4px; }
.nav-settings::after { top: 10px; left: 11px; }
.account { display: flex; align-items: center; gap: 11px; border-top: 1px solid #444651; margin-top: auto; padding: 18px 4px 0; min-width: 0; }
.avatar { display: grid; place-items: center; background: #464757; border-radius: 50%; width: 35px; height: 35px; flex: none; color: #e2dfff; }
.account strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.account small { color: #bbbcc9; font-size: 12px; }
.account form { margin-left: auto; }
.logout { background: transparent; padding: 6px; color: #e0dfed; font-size: 21px; }
.logout i { font-style: normal; }
main { width: 100%; min-width: 0; max-width: 1410px; margin-inline: auto; padding: clamp(24px,3.7vw,60px); }
section { margin: 20px 0; padding: clamp(18px,2.4vw,36px); border: 1px solid var(--line); background: white; border-radius: 16px; min-width: 0; }
section > h2 { margin-bottom: 20px; }
section > p { margin-block: 14px; }
section > small, form > small { margin: 12px 0; }
.row, .file, .tabs { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.grow { flex: 1 1 240px; }
.row>a { align-self: center; }
[role=alert], [role=status], .notice { margin: 16px 0; padding: 12px 16px; border-radius: 9px; background: #fff0dd; color: #75420a; }
[role=status], .notice { color: #373471; background: var(--soft); }
.guest { min-height: 100vh; background: #eeedf3; }
.guest .rail { padding: 26px max(5vw,24px); background: transparent; color: var(--ink); }
.guest main { max-width: 1250px; padding: 1.5vh clamp(18px,4vw,62px) 6vh; }
.gate { display: grid; grid-template-columns: 1.05fr 1fr; min-height: min(660px,78vh); border-radius: 22px; overflow: hidden; background: white; box-shadow: 0 18px 60px #25213c0d; }
.gate-cover,.masthead { position: relative; isolation: isolate; overflow: hidden; }
.gate-cover { background: radial-gradient(ellipse at 75% 30%, #4f4c8a, transparent 70%), #302e58; }
.archive-art { pointer-events: none; position: absolute; inset: 0; overflow: hidden; display: grid; place-items: center; }
.art-stack { position: relative; width: 62%; aspect-ratio: 1.16; transform: rotate(-11deg); }
.dossier { position: absolute; inset: 12% 2% 2%; border-radius: 5% 7% 7% 6%; transform-origin: 12% 88%; box-shadow: 2px 8px 18px #13102328, inset 0 1px #ffffff65; }
.dossier::before { content: ""; position: absolute; width: 43%; height: 16%; top: -12%; left: 0; border-radius: 14% 25% 0 0 / 35% 95% 0 0; background: inherit; }
.dossier.back { background: #9692e6; transform: translate(-2%, -9%) rotate(-18deg); }
.dossier.middle { background: #ffb585; transform: translate(0,-4%) rotate(-7deg); }
.dossier.front { background: linear-gradient(140deg,#d9d5ff,#b9b5f0); transform: rotate(7deg); }
.sticker { position: absolute; left: 11%; bottom: 18%; width: 41%; height: 25%; background: #f9f8ef; box-shadow: 0 2px 4px #27233318; }
.sticker::before,.sticker::after { content: ""; position: absolute; left: 12%; right: 12%; top: 34%; height: 5%; background: #817d8e; }
.sticker::after { top: 58%; right: 45%; }
.login { align-self: center; margin: 0; padding: clamp(32px,5vw,80px); border: 0; }
.login h1 { font-size: clamp(36px,3.7vw,56px); max-width: 10em; margin-bottom: 36px; }
.login form { display: grid; gap: 20px; }
.login input { min-height: 49px; }
.login button { margin-top: 6px; justify-content: space-between; min-height: 50px; }
.access-help { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.access-help p { margin-top: 4px; color: var(--muted); }
.masthead { display: flex; align-items: center; min-height: 210px; padding: clamp(24px,3.5vw,48px); border-radius: 17px; background: #e9e7fa; }
.mast-copy { max-width: 63%; position: relative; z-index: 1; }
.mast-copy p { margin-bottom: 11px; color: #524d77; font-size: 15px; font-weight: 600; }
.masthead .archive-art { inset: -10% -1% -38% auto; width: 37%; }
.masthead .art-stack { width: 65%; }
.search { margin: 25px 0; display: flex; flex-wrap: nowrap; align-items: center; background: #fff; border: 1px solid #c9cbd6; border-radius: 11px; padding: 5px 5px 5px 16px; }
.search::before { content: "⌕"; font-size: 27px; color: var(--muted); line-height: 1; }
.search input { flex: 1; border: 0; padding-left: 0; }
.library { border: none; background: none; padding: 0; margin-top: 30px; }
.library-heading { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.library-heading h2 { font-size: 25px; }
.library-heading span { color: var(--muted); font-variant-numeric: tabular-nums; }
.entries { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(230px,100%),1fr)); gap: 12px; }
.entry { position: relative; border-radius: 12px; border: 1px solid var(--line); background: white; min-width: 0; }
.entry:hover,.entry:focus-within { border-color: #9c97c7; }
.folder-card { padding: 23px; }
.folder-card::after { content: "↗"; position: absolute; right: 20px; top: 16px; color: #66667a; pointer-events: none; }
.folder-card .entry-name { margin-top: 17px; }
.folder-card a::after { content: ""; position: absolute; inset: 0; }
.entry-name a { color: var(--ink); font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.entry-name small { margin-top: 3px; }
.icon { display: inline-block; position: relative; }
.folder-icon { width: 40px; height: 27px; background: #aaa5e3; border-radius: 3px 4px 4px 4px; box-shadow: inset 0 4px 0 #8e87ca; }
.folder-icon::before { content: ""; position: absolute; left: 0; top: -4px; width: 18px; height: 5px; background: #8e87ca; border-radius: 4px 5px 0 0; }
.folder-card:nth-child(even) .folder-icon { background: #f3bf98; box-shadow: inset 0 4px 0 #d9a078; }
.folder-card:nth-child(even) .folder-icon::before { background: #d9a078; }
.document-row { grid-column: 1/-1; display: grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 16px 20px; }
.paper-icon { width: 18px; height: 23px; border: 2px solid #7770a7; border-radius: 3px; }
.paper-icon::after { content: ""; position: absolute; top: 6px; left: 3px; width: 8px; height: 4px; border-block: 1px solid #7770a7; }
.download { font-size: 14px; }
.reader { max-width: 850px; margin: 24px auto; }
.reader .button { margin: 20px 0 0; }
.reader section { padding: clamp(24px,5vw,70px); }
.reader section p { font: 18px/1.7 Georgia,serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; text-align: left; }
caption { text-align: left; margin: 14px 0; font-weight: 700; font-size: 18px; }
thead { background: #f1f0f7; } th,td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
tbody th { font-weight: 500; overflow-wrap: anywhere; } td { color: var(--muted); } td b { color: #176340; background: #e1f4e8; border-radius: 5px; padding: 3px 8px; white-space: nowrap; }
.tabs { align-items: center; margin-block: 15px; }
.tabs a,.jump a { display: inline-block; padding: 7px 12px; color: var(--accent); background: var(--soft); border-radius: 7px; text-decoration: none; font-weight: 600; }
.tabs [aria-current] { background: var(--accent); color: white; }
.file { justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.jump { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.jump a { background: white; border: 1px solid var(--line); }
.jump a:hover,.tabs a:hover { text-decoration: underline; }
.access-help a { font-weight: 650; }
.signup h1 { margin-bottom: 12px; }
.signup .form-intro { margin-bottom: 25px; color: var(--muted); }
.signup form { gap: 14px; }
.form-field small { margin-top: 5px; }
.login-example { font-family: "Consolas", monospace; }
.signup details { padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; }
.signup summary { cursor: pointer; font-size: 14px; font-weight: 650; color: var(--accent); }
.signup details label { margin: 12px 0 4px; }
.signup .access-help { margin-top: 20px; }
.setup { max-width: 720px; margin: clamp(4px,4vw,48px) auto; }
.setup section { padding: clamp(24px,5vw,56px); }
.setup section .folder-icon { margin-bottom: 20px; }
.setup h1 { font-size: clamp(30px,4vw,48px); }
.setup section p { color: var(--muted); max-width: 52ch; }
.setup form { display: grid; gap: 18px; margin-top: 28px; }
.setup button { width: fit-content; gap: 20px; }
.step-nav ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0; margin: 0; list-style: none; }
.step-nav li { color: var(--muted); font-size: 14px; }
.step-nav li + li::before { content: "/"; margin-right: 8px; color: #77798a; }
.step-nav [aria-current] { color: var(--accent); font-weight: 650; background: var(--soft); border-radius: 7px; padding: 5px 10px; }
.invite-code { margin: 22px 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.invite-code input { font: 16px/1.5 "Consolas", monospace; width: 100%; }
.manage-heading p { color: var(--muted); margin-top: 8px; overflow-wrap: anywhere; }
.folder-contents { padding: 14px 18px; border: 1px solid var(--line); background: var(--canvas); border-radius: 9px; }
.folder-contents summary { cursor: pointer; font-weight: 650; color: var(--accent); }
.folder-contents ul { margin-bottom: 5px; padding-left: 22px; overflow-wrap: anywhere; }
.permission-title { margin: 15px 0 24px; }
.permission-help { margin: 12px 0 16px; padding: 12px 16px; background: var(--soft); border-radius: 9px; color: #373471; }
.role-list { margin: 16px 0 0; padding: 0; list-style: none; }
.role-list li { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.member-heading, .member-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.member-heading p, .member-empty p { color: var(--muted); margin-top: 5px; }
.member-list { list-style: none; padding: 0; margin: 20px 0 0; }
.member-item { align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.member-item:target { background: var(--soft); }
.member-identity { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.member-identity .avatar { color: var(--accent); background: var(--soft); }
.member-pending { color: #75420a; }
.member-role select { width: min(230px, 100%); }
.member-empty { margin-top: 20px; padding: 20px; border: 1px dashed var(--line); border-radius: 10px; }
.button.secondary { color: var(--accent); background: white; border: 1px solid var(--line); }
.button.secondary:hover { background: var(--soft); }
.permission-table { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.permission-header, .permission-row { display: grid; grid-template-columns: minmax(0,1fr) 115px; align-items: center; gap: 12px; }
.permission-header { padding: 12px 14px; background: #f0eff7; }
.permission-nodes { list-style: none; margin: 0; padding: 0; }
.permission-nodes .permission-nodes { margin-left: 18px; border-left: 1px solid #d5d2e6; }
.permission-nodes .permission-nodes .permission-nodes .permission-nodes .permission-nodes { margin-left: 0; }
.permission-row { min-height: 48px; padding-right: 14px; border-top: 1px solid var(--line); }
.permission-row:hover { background: #faf9ff; }
.branch-toggle, .branch-name { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 47px; padding: 7px 10px 7px 12px; overflow-wrap: anywhere; text-align: left; }
.branch-toggle { justify-content: flex-start; background: transparent; color: var(--ink); border-radius: 0; }
.branch-toggle:hover { background: var(--soft); }
.branch-toggle:focus-visible { outline-offset: -3px; }
.branch-name { padding-left: 32px; }
.branch-arrow { width: 7px; height: 7px; flex: none; margin: 0 4px 0 1px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(-45deg); }
.branch-toggle[aria-expanded=true] .branch-arrow { transform: rotate(45deg); }
.permission-row .icon { flex: none; }
.permission-row .folder-icon { width: 21px; height: 15px; }
.permission-row .folder-icon::before { width: 10px; }
.permission-row .paper-icon { width: 14px; height: 17px; }
.permission-row .paper-icon::after { top: 4px; left: 2px; width: 6px; height: 3px; }
.permission-control { display: flex; align-items: center; gap: 7px; cursor: pointer; min-height: 44px; }
.permission-control input { min-height: 0; width: 19px; height: 19px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.permission-state { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.permission-state[data-state=allowed] { color: #176340; }
.permission-state[data-state=partial] { color: #75420a; }
.permission-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 14px; margin: 14px 0; position: sticky; bottom: 0; z-index: 1; background: var(--canvas); border: 1px solid var(--line); border-radius: 10px; }
.permission-footer button:disabled { background: #e4e3ec; color: #57566a; cursor: default; }
.permission-footer p { color: var(--muted); font-size: 14px; }
.permission-footer p:empty { display: none; }
.permission-footer a { margin-left: auto; }
@media (max-width: 620px) {
  .permission-nodes .permission-nodes { margin-left: 10px; }
  .permission-header, .permission-row { grid-template-columns: minmax(0,1fr) 92px; gap: 5px; }
  .permission-row { padding-right: 7px; }
  .branch-toggle, .branch-name { gap: 6px; }
  .permission-footer a { margin-left: 0; }
  .member-role { width: 100%; } .member-role select { width: 100%; }
}

@media (min-width:1100px) { .folder-card { min-height: 147px; } }
@media (max-width:850px) {
  .workspace { grid-template-columns: 1fr; }
  .workspace .rail { position: static; height: auto; flex-direction: row; align-items: center; gap: 18px; padding: 14px 20px; }
  .brand { margin: 0; }
  .rail nav { display: flex; margin: 0; }
  .rail nav a { min-height: 38px; padding: 6px 10px; }
  .account { margin: 0 0 0 auto; padding: 0; border: 0; }
  .gate { min-height: 510px; }
}
@media (max-width:620px) {
  main { padding: 20px 14px 48px; }
  .workspace .rail { gap: 12px; flex-wrap: wrap; padding: 13px 15px 9px; }
  .workspace .brand { font-size: 24px; }
  .rail nav { width: 100%; order: 2; }
  .rail nav a { flex: 1 1 0; min-width: 0; justify-content: center; gap: 5px; padding-inline: 5px; }
  .rail nav a i { display: none; }
  .account .avatar { display: none; }
  .account strong { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account small { display: none; }
  .logout { min-height: 32px; }
  .guest .rail { padding: 20px; }
  .guest main { padding: 0 14px 32px; }
  .gate { grid-template-columns: 1fr; min-height: 0; }
  .gate-cover { height: 150px; }
  .gate-cover .art-stack { width: 150px; transform: translateY(28px) rotate(-11deg); }
  .login { padding: 25px; } .login h1 { font-size: 32px; margin-bottom: 22px; }
  .gate:has(.signup) .gate-cover { height: 100px; }
  .gate:has(.signup) .art-stack { transform: translateY(12px) rotate(-11deg); }
  .signup h1 { margin-bottom: 12px; }
  .masthead { min-height: 142px; padding: 18px; }
  .mast-copy { max-width: 66%; } .mast-copy h1 { font-size: 32px; }
  .mast-copy p { font-size: 13px; }
  .masthead .archive-art { width: 35%; inset-block: 0 -18%; }
  .search { margin: 16px 0; gap: 7px; padding-left: 10px; }
  .entries { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .entries > p { grid-column: 1/-1; }
  .folder-card { padding: 18px 13px; } .folder-card::after { right: 10px; top: 10px; }
  .folder-card .entry-name { margin-top: 10px; }
  .row label { width: 100%; } .grow { flex-basis: 100%; }
  .file select { max-width: 100%; }
  .document-row { padding: 12px; gap: 8px; }
  th,td { padding: 9px; }
}
