:root { --ink: #172033; --muted: #5d6779; --line: #dfe3ea; --accent: #2457d6; --bg: #f5f7fb; color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--bg); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.portal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line); background: #fff; }
.portal-site { color: var(--ink); font-weight: 750; text-decoration: none; }
.portal-account { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--muted); font-size: 14px; }
.portal-account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-main { width: min(1100px, 100%); margin: 0 auto; padding: 28px 16px 60px; }
.portal-main h1 { margin: 0 0 18px; font-size: clamp(26px, 5vw, 36px); }
.portal-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(23, 32, 51, .05); }
.portal-card h2 { margin: 0 0 12px; font-size: 18px; }
.portal-login { max-width: 460px; margin: 10vh auto 0; text-align: center; }
.portal-button { min-height: 44px; padding: 10px 22px; border: 0; border-radius: 999px; color: #fff; background: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.portal-button:disabled { opacity: .6; cursor: wait; }
.portal-link-button { padding: 4px 6px; border: 0; color: var(--accent); background: none; font: inherit; cursor: pointer; }
.portal-grid { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.portal-grid-files-only { grid-template-columns: minmax(0, 1fr); }
.portal-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.portal-list a, .portal-file button { color: var(--accent); }
.portal-list a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; }
.portal-list a:hover, .portal-list a:focus-visible { background: #eef3ff; }
.portal-search { width: 100%; min-height: 40px; margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.portal-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); }
.portal-file span { min-width: 0; overflow-wrap: anywhere; }
.portal-file small { color: var(--muted); }
.portal-file-actions { display: flex; flex: none; gap: 4px; }
.portal-file button { min-height: 36px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
#portal-player { width: 100%; margin-bottom: 12px; }
.portal-page { margin-top: 18px; padding: 0; overflow: hidden; }
.portal-page-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.portal-page iframe { display: block; width: 100%; height: 80vh; border: 0; background: #fff; }
.portal-empty, .portal-status { color: var(--muted); }
.portal-error { color: #a51d35; }
/* File explorer: breadcrumb, folder rows, files */
.portal-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 8px; font-size: 15px; }
.portal-crumb { padding: 4px 6px; border: 0; border-radius: 6px; color: var(--accent); background: none; font: inherit; font-weight: 650; cursor: pointer; }
.portal-crumb:hover, .portal-crumb:focus-visible { background: #eef3ff; }
.portal-crumb-separator { color: var(--muted); }
.portal-crumbs strong { padding: 4px 6px; }
.portal-folder-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 6px; border: 0; border-top: 1px solid var(--line); color: var(--ink); background: none; font: inherit; text-align: left; cursor: pointer; }
.portal-folder-row:hover, .portal-folder-row:focus-visible { background: #f3f6fd; }
.portal-folder-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.portal-folder-row small { color: var(--muted); white-space: nowrap; }
.portal-folder-arrow { color: var(--muted); font-size: 22px; line-height: 1; }
.portal-file-name { display: flex; align-items: center; gap: 12px; }
.portal-icon { position: relative; flex: none; width: 28px; height: 28px; border-radius: 6px; background: #eef1f6; }
.portal-icon-folder { background: none; }
.portal-icon-folder::before { content: ""; position: absolute; inset: 8px 2px 4px; border-radius: 3px 4px 4px 4px; background: #f4c14f; }
.portal-icon-folder::after { content: ""; position: absolute; top: 5px; left: 2px; width: 11px; height: 5px; border-radius: 3px 3px 0 0; background: #e9ad2c; }
.portal-icon-pdf::after, .portal-icon-audio::after, .portal-icon-file::after { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: var(--muted); }
.portal-icon-pdf { background: #fdecee; } .portal-icon-pdf::after { content: "PDF"; color: #b4233c; }
.portal-icon-audio { background: #e8f6ef; } .portal-icon-audio::after { content: "♪"; font-size: 16px; color: #19794f; }
.portal-icon-file::after { content: "•"; }
@media (max-width: 760px) { .portal-grid { grid-template-columns: 1fr; } .portal-file { flex-wrap: wrap; } }
