:root {
  --ink: #18211d; --muted: #69746e; --paper: #f4f1e9; --surface: #fffef9;
  --line: #dcd9cf; --green: #1c634c; --green-dark: #154737; --red: #a33d33;
  --gold: #c89b48; --shadow: 0 18px 50px rgba(27,35,31,.12); --radius: 3px;
}
* { box-sizing: border-box }
html, body { margin: 0; min-height: 100%; background: var(--paper); color: var(--ink) }
body { font-family: "Bahnschrift", "Aptos", "Trebuchet MS", sans-serif; letter-spacing: .01em }
button, input, select { font: inherit }
button { cursor: pointer }
[hidden] { display: none !important }
svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 620px) 1fr; background: var(--surface) }
.login-card { padding: clamp(42px, 8vw, 110px); display: flex; flex-direction: column; justify-content: center; max-width: 640px }
.brand-mark { width: 52px; height: 52px; background: var(--green); color: white; display: grid; place-items: center; font-family: Georgia, serif; font-size: 29px; border-radius: 50% 50% 48% 20%; transform: rotate(-3deg) }
.brand-mark.small { width: 34px; height: 34px; font-size: 19px }
.eyebrow { margin: 38px 0 16px; color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: .19em }
.login-card h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 5vw, 68px); font-weight: 400; line-height: .99; letter-spacing: -.045em }
.login-note { color: var(--muted); margin: 24px 0 34px }
.login-card form { display: grid; gap: 18px; max-width: 390px }
label { display: grid; gap: 8px; color: #4f5954; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase }
input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); outline: none; text-transform: none; letter-spacing: normal }
select { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); outline: none }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(28,99,76,.12) }
.primary, .quiet { border: 1px solid transparent; border-radius: var(--radius); padding: 12px 18px; transition: .18s ease; display: inline-flex; align-items: center; justify-content: center; gap: 9px; text-decoration: none }
.primary { background: var(--green); color: #fff; font-weight: 700 }
.primary:hover { background: var(--green-dark); transform: translateY(-1px) }
.primary:disabled { opacity: .5; cursor: wait; transform: none }
.wide { justify-content: space-between; margin-top: 4px }
.quiet { background: transparent; color: var(--ink); border-color: var(--line) }
.quiet:hover { background: #eae7df }
.form-error { color: var(--red); min-height: 16px; margin: -5px 0; font-size: 13px }
.login-aside { position: relative; overflow: hidden; background: var(--green); color: #e8ebdc; padding: 7vw; display: flex; flex-direction: column; justify-content: flex-end }
.login-aside::before { content: ""; position: absolute; width: 42vw; height: 42vw; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; top: -15vw; right: -10vw; box-shadow: 0 0 0 8vw rgba(255,255,255,.025), 0 0 0 16vw rgba(255,255,255,.025) }
.login-aside span { position: absolute; top: 6vw; left: 7vw; opacity: .5; font-size: 12px }
.login-aside p { margin: 0; font-family: Georgia, serif; font-size: clamp(42px, 6vw, 88px); line-height: .94; letter-spacing: -.05em }

.app-view { min-height: 100vh }
.topbar { height: 72px; padding: 0 clamp(18px, 4vw, 56px); background: var(--ink); color: #f7f4ec; display: flex; align-items: center; justify-content: space-between }
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: .15em; font-size: 13px }
.top-actions { display: flex; gap: 8px; align-items: center }
.topbar .quiet { color: #fff; border-color: rgba(255,255,255,.18) }
.topbar .quiet:hover { background: rgba(255,255,255,.1) }
.topbar .quiet.active { border-color: var(--gold); color: #f1cf8c; background: rgba(200,155,72,.1) }
.icon-button { width: 42px; height: 42px; padding: 0; display: grid; place-items: center }
.compact { padding: 10px 16px }
.workspace { padding: 34px clamp(16px, 4vw, 56px) 120px; max-width: 1500px; margin: 0 auto }
.path-row { display: flex; align-items: flex-end; justify-content: space-between; min-height: 44px; gap: 20px; margin-bottom: 18px }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px }
.breadcrumbs button { border: 0; background: transparent; padding: 2px; color: var(--muted); font-family: Georgia, serif; font-size: 18px }
.breadcrumbs button:last-child { color: var(--ink); font-size: 29px }
.breadcrumbs i { color: #aaa59a; font-style: normal }
.summary { color: var(--muted); font-size: 13px; white-space: nowrap; margin: 0 0 5px }
.path-side { display: flex; align-items: center; justify-content: flex-end; gap: 16px; min-width: 0 }.path-side .text-button { padding: 3px 0 }.danger-text { color: var(--red) }
.search-box { width: min(280px, 28vw); min-width: 170px; height: 38px; padding: 0 9px; display: flex; grid-template-columns: none; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); text-transform: none; letter-spacing: normal }
.search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(28,99,76,.1) }
.search-box input { min-width: 0; border: 0; padding: 7px 0; background: transparent; box-shadow: none }
.search-box button { width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 20px }
.search-scope { height: 38px; padding: 0 11px; font-size: 12px }.search-scope.active { color: var(--green); border-color: var(--green); background: #e7eee9 }
.file-surface { position: relative; min-height: 360px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 22px rgba(35,42,38,.04) }
.table-head, .file-row { display: grid; grid-template-columns: minmax(220px, 1fr) 130px 190px 48px; align-items: center }
.table-head { padding: 12px 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em }
.file-row { min-height: 62px; padding: 5px 18px; border-bottom: 1px solid #ebe8df; animation: row-in .25s ease both }
@keyframes row-in { from { opacity: 0; transform: translateY(4px) } }
.file-row:hover { background: #f7f5ee }
.file-name { min-width: 0; border: 0; background: transparent; color: var(--ink); padding: 7px 0; display: flex; align-items: center; gap: 13px; text-align: left }
.file-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.file-icon { flex: 0 0 34px; width: 34px; height: 38px; border: 1px solid #c9c7be; display: grid; place-items: center; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; background: white }
.file-icon.folder { border: 0; background: #d8b66f; height: 27px; margin-top: 6px; position: relative; color: #6b542b }
.file-icon.folder::before { content: ""; position: absolute; width: 16px; height: 5px; top: -5px; left: 0; background: #c89b48 }
.file-icon.event { border-radius: 50%; height: 34px; border: 0; background: #dce9e3; color: var(--green); font-size: 16px }
.event-copy { min-width: 0; display: grid; gap: 3px }.event-copy strong { font-size: 14px }.event-copy small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.cell-muted { color: var(--muted); font-size: 13px }
.row-actions { display: flex; justify-content: flex-end; position: relative }
.more-button { border: 0; background: transparent; font-size: 20px; color: var(--muted); width: 38px; height: 38px }
.action-menu { position: absolute; z-index: 3; right: 8px; top: 36px; min-width: 150px; padding: 5px; background: white; border: 1px solid var(--line); box-shadow: var(--shadow) }
.action-menu button, .action-menu a { width: 100%; border: 0; background: none; color: var(--ink); display: block; padding: 9px 11px; text-align: left; text-decoration: none; font-size: 13px }
.action-menu :hover { background: var(--paper) }
.action-menu .danger { color: var(--red) }
.empty-state { text-align: center; padding: 75px 20px; color: var(--muted) }
.empty-state h2 { color: var(--ink); font-family: Georgia, serif; font-weight: 400; margin: 13px 0 6px }
.empty-state p { margin: 0; font-size: 14px }
.empty-glyph { width: 52px; height: 52px; border: 1px dashed #aaa; border-radius: 50%; display: grid; place-items: center; margin: auto; font-size: 25px }
.drop-hint { display: none; position: absolute; inset: 12px; border: 2px dashed var(--green); background: rgba(244,241,233,.94); z-index: 5; place-content: center; text-align: center; color: var(--green) }
.drop-hint strong { font-family: Georgia, serif; font-size: 28px; font-weight: 400 }
.drop-hint span { color: var(--muted); margin-top: 8px }
.file-surface.dragging .drop-hint { display: grid }

.transfer-panel { position: fixed; right: 22px; bottom: 20px; width: min(420px, calc(100vw - 32px)); max-height: 50vh; overflow: auto; background: var(--ink); color: white; box-shadow: var(--shadow); z-index: 10 }
.transfer-heading { padding: 14px 16px; display: flex; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 13px }
.text-button { border: 0; background: none; color: #c9d1cc; font-size: 12px }
.transfer { padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,.09) }
.transfer-line { display: flex; justify-content: space-between; gap: 15px; font-size: 12px }
.transfer-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.progress { height: 3px; margin-top: 10px; background: rgba(255,255,255,.15) }
.progress span { display: block; height: 100%; background: var(--gold); transition: width .2s }
.transfer.done .progress span { background: #5cb78e }
.transfer.error .progress span { background: #d86c61 }

dialog { width: min(440px, calc(100vw - 32px)); border: 0; padding: 0; background: var(--surface); box-shadow: var(--shadow); color: var(--ink) }
dialog::backdrop { background: rgba(24,33,29,.52); backdrop-filter: blur(2px) }
dialog form { padding: 22px; display: grid; gap: 20px }
.dialog-head { display: flex; align-items: center; justify-content: space-between; font-family: Georgia, serif; font-size: 25px }
.dialog-head .icon-button { border: 0; background: transparent; font-size: 26px }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px }
.dialog-note { margin: -4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45 }
.move-dialog { width: min(560px, calc(100vw - 32px)) }.folder-picker { min-height: 250px; border: 1px solid var(--line); background: white }.folder-picker-path { min-height: 47px; padding: 10px 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); background: #f7f5ee }.folder-picker-path button { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; padding: 3px 2px; background: transparent; color: var(--muted); font-size: 12px }.folder-picker-path button:last-child { color: var(--ink); font-weight: 700 }.folder-picker-path i { color: #aaa59a; font-style: normal }.folder-picker-list { display: grid; max-height: 285px; overflow: auto }.folder-picker-list button { min-width: 0; min-height: 50px; padding: 8px 13px; display: grid; grid-template-columns: 25px minmax(0,1fr) auto; align-items: center; gap: 11px; border: 0; border-bottom: 1px solid #ebe8df; background: white; color: var(--ink); text-align: left }.folder-picker-list button:hover,.folder-picker-list button:focus-visible { background: #f2f5f1; outline: none }.folder-picker-list button span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }.folder-picker-list button b { color: var(--muted); font-size: 22px; font-weight: 400 }.folder-mini { width: 24px; height: 17px; position: relative; background: var(--gold) }.folder-mini::before { content: ""; position: absolute; width: 11px; height: 4px; top: -4px; left: 0; background: #b78738 }.folder-picker-loading,.folder-picker-empty { margin: 0; padding: 48px 16px; color: var(--muted); font-size: 13px; text-align: center }
.sessions-dialog { width: min(650px, calc(100vw - 32px)) }.sessions-dialog > section { padding: 22px; display: grid; gap: 18px }.sessions-list { display: grid; border-top: 1px solid var(--line) }
.session-item { padding: 14px 2px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line) }.session-copy { min-width: 0; display: grid; gap: 4px }.session-title { display: flex; align-items: center; gap: 8px; min-width: 0 }.session-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px }.session-copy small { color: var(--muted); font-size: 12px }.session-badge { padding: 3px 6px; background: #dce9e3; color: var(--green); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em }.session-item button { padding: 7px 9px; font-size: 12px }
.overview-dialog { width: min(760px, calc(100vw - 32px)) }.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px }.overview-section { min-width: 0 }.overview-section h3 { margin: 0 0 8px; color: var(--green); font: 700 11px/1.2 "Bahnschrift", sans-serif; letter-spacing: .12em; text-transform: uppercase }.overview-item { padding: 12px 2px }.overview-item .session-title strong::before { content: "★"; margin-right: 8px; color: var(--gold) }.overview-section:last-child .overview-item .session-title strong::before { content: "↗"; color: var(--green) }.overview-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.version-actions { display: flex; gap: 6px }.version-actions button { white-space: nowrap }.version-hash { font-family: Consolas, monospace; letter-spacing: .03em }
.storage-dialog { width: min(620px, calc(100vw - 32px)) }.storage-total { display: grid; grid-template-columns: 1fr auto; align-items: end; padding: 18px; background: var(--ink); color: white }.storage-total small { grid-column: 1/-1; color: #b7c1bb; font-size: 11px; text-transform: uppercase; letter-spacing: .12em }.storage-total strong { font: 400 38px Georgia, serif }.storage-total span { color: #b7c1bb; font-size: 12px; padding-bottom: 5px }.storage-breakdown { display: grid; gap: 15px }.storage-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; font-size: 13px }.storage-row small { color: var(--muted) }.storage-track { grid-column: 1/-1; height: 5px; background: #e8e5dc }.storage-track span { display: block; height: 100%; min-width: 2px; background: var(--green) }.storage-row:nth-child(2) .storage-track span { background: var(--red) }.storage-row:nth-child(3) .storage-track span { background: var(--gold) }.storage-row:nth-child(4) .storage-track span { background: #7e8b84 }
.account-dialog { width: min(880px, calc(100vw - 32px)) }.account-dialog > section { padding: 22px; display: grid; gap: 20px }.account-summary { display: flex; align-items: center; gap: 13px; padding: 14px 16px; background: var(--ink); color: white }.account-summary > div:last-child { min-width: 0; display: grid; gap: 3px }.account-summary strong { overflow: hidden; text-overflow: ellipsis; font: 400 23px Georgia, serif }.account-summary small { color: #b7c1bb; font-size: 12px }.account-avatar { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50% 50% 48% 20%; background: var(--green); font: 22px Georgia,serif }.account-grid { display: grid; grid-template-columns: minmax(260px,.75fr) minmax(360px,1.25fr); gap: 26px; align-items: start }.account-section { min-width: 0; display: grid; gap: 14px; padding: 0 }.account-section h3 { margin: 0; color: var(--green); font-size: 11px; letter-spacing: .12em; text-transform: uppercase }.account-section > button { justify-self: start }.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px }.section-title .quiet { padding: 7px 10px; font-size: 12px }.user-actions { display: flex; gap: 6px }.user-actions button { padding: 7px 9px; font-size: 12px }.check-line { display: flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: 9px; text-transform: none; letter-spacing: normal }.check-line input { width: 18px; height: 18px; margin: 0 }
.client-download-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 16px; border: 1px solid #cbd9d2; background: #edf4f0 }.client-download-card h3 { margin: 0 0 4px; color: var(--green); font-size: 13px }.client-download-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45 }.client-download-card .quiet { white-space: nowrap; border-color: #a9c8b8; background: var(--surface); color: var(--green); font-weight: 700 }.client-download-card .quiet:hover { border-color: var(--green); background: white }
.storage-profiles-section { grid-column: 1/-1 }.storage-profile-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }.storage-profile-dialog { width: min(620px,calc(100vw - 32px)) }.credentials-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px }.access-fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line) }.access-fieldset legend { padding: 0 5px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase }.access-fieldset > div { display: grid; gap: 9px }
.connection-status { padding: 3px 7px; border: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap }.connection-status.checking { color: #8a6416; border-color: #d8bd7c; background: #fff8e7 }.connection-status.ready { color: var(--green); border-color: #a9c8b8; background: #edf6f1 }.connection-status.failed { color: #a33c31; border-color: #ddb0aa; background: #fff0ee }.check-connection:disabled { cursor: wait }
.connection-detail:empty { display: none }.connection-detail.failed { color: #a33c31 }
.storage-profile-item .connection-detail { white-space: normal; overflow-wrap: anywhere }
.share-result { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px }.share-result button { padding: 10px 12px }.share-expired { color: var(--red) }
.preview-dialog { width: min(1120px, calc(100vw - 32px)); height: min(820px, calc(100vh - 32px)); overflow: hidden; background: #141a17 }
.preview-head { height: 58px; padding: 0 14px 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #f7f4ec; border-bottom: 1px solid rgba(255,255,255,.12) }
.preview-head > span { min-width: 0; display: flex; align-items: baseline; gap: 10px }.preview-head strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px }.preview-head small { flex: 0 0 auto; color: #aeb8b2; font-size: 11px }
.preview-head > div { display: flex; align-items: center; gap: 8px }.preview-head .quiet { color: white; padding: 8px 12px; text-decoration: none; border-color: rgba(255,255,255,.2) }.preview-head .icon-button { border: 0; background: transparent; color: white; font-size: 28px }
.preview-body { position: relative; height: calc(100% - 58px); overflow: hidden }.preview-media { width: 100%; height: 100%; display: grid; place-items: center; overflow: auto }
.preview-media img { display: block; max-width: 100%; max-height: 100%; object-fit: contain }
.preview-media video { display: block; width: 100%; height: 100%; object-fit: contain; background: #090c0b }
.preview-media iframe { width: 100%; height: 100%; border: 0; background: white }
.preview-nav { position: absolute; z-index: 2; top: 50%; width: 48px; height: 72px; transform: translateY(-50%); border: 1px solid rgba(255,255,255,.18); background: rgba(24,33,29,.7); color: white; font-size: 42px; line-height: 1; backdrop-filter: blur(4px) }.preview-nav:hover { background: rgba(28,99,76,.9) }.preview-nav.prev { left: 12px }.preview-nav.next { right: 12px }
.toast { visibility: hidden; opacity: 0; position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 10px); padding: 12px 17px; color: white; background: #303a35; box-shadow: var(--shadow); z-index: 20; font-size: 13px; transition: .2s }
.toast.show { visibility: visible; opacity: 1; transform: translate(-50%, 0) }

@media (max-width: 760px) {
  .login-view { grid-template-columns: 1fr }.login-aside { display: none }.login-card { padding: 38px 24px }.login-card h1 { font-size: 44px }
  .topbar { height: 64px; padding: 0 14px }.brand > span:last-child { display: none }.top-actions { gap: 3px }.top-actions .icon-button,.compact { width: 36px; height: 38px }.compact { font-size: 0; padding: 0 }.compact svg { margin: 0 } #eventsBtn { display: none }
  .workspace { padding: 24px 12px 100px }.path-row { align-items: flex-start; flex-direction: column; gap: 10px }.summary { align-self: flex-end }.path-side { width: 100%; justify-content: space-between; flex-wrap: wrap }.search-box { width: 100%; min-width: 0 }.path-side .summary { margin-left: auto }
  .table-head { display: none }.file-row { grid-template-columns: minmax(0, 1fr) 42px; padding: 7px 9px; min-height: 64px }.file-row > .cell-muted { display: none }
  .file-name { min-width: 0 }.file-icon { flex-basis: 32px }.transfer-panel { right: 16px; bottom: 12px }
  .preview-dialog { width: 100vw; height: 100vh; max-width: none; max-height: none }.preview-head { padding-left: 12px }.preview-head .quiet { font-size: 0; width: 38px }.preview-head .quiet::after { content: "↓"; font-size: 18px }.preview-nav { width: 42px; height: 58px }.preview-nav.prev { left: 5px }.preview-nav.next { right: 5px }
  .sessions-dialog { width: calc(100vw - 20px) }.sessions-dialog > section { padding: 17px }.session-item { grid-template-columns: minmax(0,1fr) }.session-item > button { justify-self: start }
  .overview-grid { grid-template-columns: 1fr; gap: 22px }.overview-item { grid-template-columns: minmax(0,1fr) auto }.overview-item > button { justify-self: auto }.version-actions { justify-self: start; flex-wrap: wrap }
  .share-result { grid-template-columns: 1fr }.share-result button { justify-self: start }
  .move-dialog { width: calc(100vw - 20px) }.move-dialog form { padding: 17px }.folder-picker { min-height: 220px }.folder-picker-list { max-height: 255px }
  .account-dialog { width: calc(100vw - 20px) }.account-dialog > section { padding: 17px }.account-grid { grid-template-columns: 1fr }.client-download-card { grid-template-columns: 1fr }.client-download-card .quiet { justify-self: start }.user-item { grid-template-columns: minmax(0,1fr) }.user-actions { justify-self: start; flex-wrap: wrap }
  .credentials-grid { grid-template-columns: 1fr }.storage-profile-item { grid-template-columns: minmax(0,1fr) }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important } }
