/* Strata — Runic-rendered app: icons, chrome, sharing UI, public link page. Loaded after style.css. */
.ico { width: 18px; height: 18px; vertical-align: -4px; flex: none; }
.ico.small { width: 13px; height: 13px; vertical-align: -2px; }
.ico.big { width: 28px; height: 28px; vertical-align: -6px; }
.logo .ico { color: #0f72c7; }
.nav-item { text-decoration: none; }
.nav-item .ico { color: #4c6376; }
.nav-item.active .ico { color: var(--primary-color); }
.nav-sep { height: 1px; background: var(--glass-border); margin: 8px 20px; }

.user-profile { position: relative; flex-direction: column; align-items: stretch; }
.profile-row { display: flex; align-items: center; gap: 10px; width: 100%; cursor: pointer; }
.profile-text { flex: 1; min-width: 0; font-size: 14px; }
.profile-name-row { display: flex; align-items: center; gap: 6px; }
.profile-name { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rune-badge { background: #0f72c7; color: #fff; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 4px; }
.quota-display { font-size: 11px; color: #666; }
.quota-bar { background: #ddd; height: 6px; width: 100%; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.quota-bar div { background: #0078d4; height: 100%; }
.quota-bar div.hot { background: var(--color-error); }
.quota-text { margin-top: 2px; }
.icon-btn { background: none; border: none; cursor: pointer; color: #666; padding: 4px; border-radius: 6px; display: inline-flex; }
.icon-btn:hover { background: rgba(0,0,0,0.06); color: #000; }
.account-dropdown { position: absolute; bottom: 100%; left: 0; right: 0; margin-bottom: 10px; background: #fff; border: 1px solid rgba(126,159,183,0.35); border-radius: 16px; box-shadow: 0 12px 32px rgba(16,34,53,0.2); z-index: var(--z-index-dropdown); padding: 10px 0; color: #102235; }
.account-dropdown-title { padding: 4px 16px 8px; font-size: 11px; font-weight: 700; color: #6e7781; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid #f0f3f6; }
.account-list { max-height: 220px; overflow-y: auto; padding: 6px 0; }
.account-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; }
.account-row.active { background: rgba(15,114,199,0.08); }
.account-row:hover { background: rgba(15,114,199,0.05); }
.account-avatar { width: 26px; height: 26px; border-radius: 7px; background: #cad8e6; color: #102235; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.account-avatar.rune { background: linear-gradient(135deg, #0f72c7, #0b5fa7); color: #fff; }
.account-meta { min-width: 0; flex: 1; }
.account-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-active { font-size: 10px; color: #0f72c7; font-weight: 700; }
.account-kind { font-size: 10.5px; color: #6e7781; }
.account-dropdown-actions { border-top: 1px solid #f0f3f6; padding: 6px 12px 2px; display: grid; gap: 4px; }
.account-add { display: flex; align-items: center; gap: 8px; padding: 7px 10px; color: #4c6376; text-decoration: none; font-size: 12.5px; font-weight: 600; border-radius: 8px; }
.account-add.rune { color: #0f72c7; background: rgba(15,114,199,0.06); }

/* header / toolbar: flat, one line, nothing wraps */
.topbar { background: #fff; border-bottom: 1px solid #e3e8ee; padding: 12px 20px; display: flex; align-items: center; gap: 12px; border-radius: 12px 12px 0 0; min-height: 62px; box-sizing: border-box; }
.search-bar { flex: 1 1 320px; max-width: 520px; width: auto; position: relative; }
.search-bar input { width: 100%; height: 38px; padding: 0 14px 0 38px; border: 1px solid #cfd8e3; border-radius: 10px; background: #f7f9fb; box-shadow: none; font-size: 14px; box-sizing: border-box; }
.search-bar input:focus { border-color: #2f7fd6; background: #fff; outline: 2px solid rgba(47,127,214,0.18); }
.search-bar .ico { left: 12px; color: #6e7781; }
.topbar-actions { margin-left: auto; flex: none; }
.btn-glossy { white-space: nowrap; height: 38px; padding: 0 16px; border-radius: 10px; font-size: 14px; font-weight: 600; line-height: 1; text-shadow: none; box-shadow: none; background: #fff; color: #102235; border: 1px solid #cfd8e3; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.btn-glossy:hover { background: #f2f6fa; filter: none; }
.btn-glossy.green { background: #0f72c7; border-color: #0f72c7; color: #fff; }
.btn-glossy.green:hover { background: #0b5fa7; }
.btn-glossy .ico { width: 16px; height: 16px; vertical-align: 0; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.page-title { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; color: #102235; font-weight: 700; }
.section-title { font-size: 15px; margin: 0 0 6px; display: flex; align-items: center; gap: 6px; color: var(--secondary-color); }
.page-section { padding: 20px 24px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.page-section:last-child { border-bottom: none; }
main#main { overflow-y: auto; }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #444; }
.inline-field select, .share-form select, .share-form input[type="text"], .share-form input[type="password"], .share-form input[type="number"] { padding: 7px 10px; border: 1px solid #b3c6d4; border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }
.search-bar .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #888; }
.btn-glossy.danger { background: #d13438; border-color: #d13438; color: #fff; }
.btn-glossy.danger:hover { background: #b3261e; }
.btn-glossy:disabled { opacity: 0.6; cursor: wait; }
.breadcrumbs { margin-bottom: 20px; color: #666; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--secondary-color); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.crumb-sep { color: #aaa; }
.name-cell { cursor: pointer; display: flex; align-items: center; gap: 10px; }
.name-cell .file-icon { width: 20px; height: 20px; margin: 0; color: #5b6b7b; }
.name-cell .folder-icon { width: 20px; height: 20px; margin: 0; color: #fbc02d; }
.fname { overflow: hidden; text-overflow: ellipsis; }
.owner-tag, .perm-tag { font-size: 10.5px; color: #4c6376; background: #eef3f8; border-radius: 10px; padding: 1px 7px; white-space: nowrap; }
.perm-tag { background: #e3f3e8; color: #1e6b3a; }
td.empty { text-align: center; padding: 40px; color: #999; }
.row-actions { opacity: 0.55; }
tr:hover .row-actions, tr:focus-within .row-actions { opacity: 1; }
.mini-btn { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; }
.mini-btn span { font-size: 12px; }
.mini-btn.danger:hover { color: var(--color-error); }
.mini-btn.active { background: #0f72c7; color: #fff; }
.mini-btn:hover { transform: none; background: rgba(15,114,199,0.08); }
.drop-hint { display: none; }
#file-browser.dragging { outline: 3px dashed #2196F3; outline-offset: -8px; border-radius: 12px; }
#file-browser.dragging .drop-hint { display: block; text-align: center; color: #1976D2; font-weight: 600; margin-top: 10px; }

/* modals */
.modal-header-actions { display: flex; align-items: center; gap: 6px; }
.share-modal { width: 640px; }
.share-path { padding: 8px 20px 0; font-size: 12px; word-break: break-all; }
.tabs { display: flex; gap: 4px; padding: 10px 20px 0; border-bottom: 1px solid #eee; }
.tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; font: inherit; font-size: 13px; color: #555; display: inline-flex; gap: 6px; align-items: center; }
.tab.active { color: var(--primary-color); border-bottom-color: var(--primary-color); font-weight: 600; }
.tab:disabled { color: #bbb; cursor: not-allowed; }
.note { background: #fff8e1; border: 1px solid #ffe082; border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.share-form label { display: block; font-size: 13px; font-weight: 600; color: #333; margin-bottom: 8px; }
.share-form label input, .share-form label select { display: block; width: 100%; margin-top: 4px; box-sizing: border-box; font-weight: normal; }
.share-form label.check { display: flex; gap: 8px; align-items: center; font-weight: normal; }
.share-form label.check input { width: auto; margin: 0; }
.hint { font-weight: normal; color: #777; font-size: 11.5px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.form-error { color: var(--color-error); font-size: 13px; min-height: 18px; margin: 4px 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.link-result { background: #e8f5e9; border: 1px solid #a5d6a7; border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.link-result-title { font-weight: 600; color: #1e6b3a; display: flex; gap: 6px; align-items: center; }
.link-result-row { display: flex; gap: 8px; margin: 8px 0 4px; }
.link-result-row input { flex: 1; padding: 7px 10px; border: 1px solid #a5d6a7; border-radius: 6px; font: inherit; font-size: 12.5px; background: #fff; }
.subhead { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: #6e7781; }
.link-list { display: flex; flex-direction: column; gap: 6px; }
.link-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #e1e8ef; border-radius: 8px; background: rgba(255,255,255,0.7); }
.link-row.state-expired, .link-row.state-exhausted, .link-row.state-revoked, .link-row.state-locked { opacity: 0.7; }
.link-main { flex: 1; min-width: 0; }
.link-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.link-title a { color: var(--secondary-color); text-decoration: none; }
.link-meta { font-size: 12px; color: #6e7781; margin-top: 2px; word-break: break-word; }
.link-actions { display: flex; gap: 4px; flex: none; }
.state-pill { font-size: 10.5px; font-weight: 700; border-radius: 10px; padding: 1px 7px; background: #e3f3e8; color: #1e6b3a; display: inline-flex; align-items: center; gap: 3px; }
.state-pill.expired, .state-pill.revoked { background: #f1f3f5; color: #6e7781; }
.state-pill.exhausted, .state-pill.locked { background: #fff3e0; color: #9a5b00; }
.state-pill.lock { background: #e8eef7; color: #1d4e89; }
.plugin-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid #e1e8ef; border-radius: 10px; background: rgba(255,255,255,0.55); }
.plugin-card .link-row { border: none; background: transparent; padding: 4px 2px; }
.plugin-grants { display: flex; flex-direction: column; gap: 6px; padding-left: 14px; border-left: 2px solid #e1e8ef; }
.plugin-grant-form { padding: 10px 12px; border: 1px dashed #c9d6e2; border-radius: 8px; background: #f7fafc; }
.check-group { border: none; padding: 0; margin: 0 0 8px; }
.check-group legend { font-size: 13px; font-weight: 600; color: #333; padding: 0; margin-bottom: 4px; }
.policy-note { font-size: 12px; color: #6e7781; margin-top: 14px; display: flex; gap: 6px; align-items: flex-start; line-height: 1.45; }
.policy-note a { color: var(--secondary-color); }
.muted { color: #6e7781; }
.small { font-size: 12px; }
.center { text-align: center; }
.error { color: var(--color-error); }
.nowrap { white-space: nowrap; }
.audit-table, .contract-table { min-width: 0; }
.audit-table td, .contract-table td { font-size: 13px; }
.confirm-modal { width: 400px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; }
.code-row { background: #f0f0f0; padding: 10px; border-radius: 4px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.code-row code { font-family: Consolas, "Courier New", monospace; color: #005a9e; }
.steps { font-size: 13px; color: #555; padding-left: 20px; }
.preview-modal { width: 900px; height: 85vh; max-height: 85vh; }
.preview-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; margin: 0 auto; }
.preview-frame { width: 100%; height: 100%; border: none; min-height: 60vh; }
.preview-text { background: #f5f5f5; padding: 10px; overflow: auto; height: 100%; margin: 0; white-space: pre-wrap; font-size: 12.5px; }
.preview-none { padding-top: 50px; }
.preview-none .ico.big { width: 48px; height: 48px; color: #ccc; }
.preview-none .btn-glossy { display: inline-flex; margin: 10px auto 0; }

.session-banner { display: flex; align-items: center; gap: 10px; margin: 16px 20px 0; padding: 10px 14px; background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px; font-size: 13px; }
.session-banner .btn-glossy { margin-left: auto; flex: none; white-space: nowrap; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #102235; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 3000; box-shadow: var(--shadow-lg); max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: #b3261e; }

/* prose pages (sharing & privacy) */
.prose { max-width: 820px; line-height: 1.55; font-size: 14px; color: #223; }
.prose h2 { font-size: 16px; margin: 18px 0 8px; color: var(--secondary-color); }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose code { background: #f3f5f8; border-radius: 3px; padding: 1px 4px; font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }
.contract-table th, .contract-table td { padding: 8px 10px; }

/* public link landing page */
body.public { display: block; padding: 40px 16px; min-height: 100vh; box-sizing: border-box; }
.public-card { max-width: 520px; margin: 0 auto; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 28px 32px; }
.public-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--secondary-color); font-size: 18px; margin-bottom: 18px; }
.public-brand .ico { color: #0f72c7; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; color: #6e7781; margin: 0 0 4px; font-weight: 700; }
.public-filename { font-size: 20px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; word-break: break-word; }
.public-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0 0 16px; }
.public-meta div { background: #f6f9fc; border-radius: 8px; padding: 8px 10px; }
.public-meta dt { font-size: 11px; color: #6e7781; text-transform: uppercase; letter-spacing: 0.05em; }
.public-meta dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; }
.public-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.public-form input { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 9px 10px; border: 1px solid #b3c6d4; border-radius: 6px; font: inherit; }
.public-download, .public-form .btn-glossy { display: inline-flex; text-decoration: none; }
.public-foot { margin-top: 22px; border-top: 1px solid #eef1f4; padding-top: 12px; display: flex; gap: 6px; align-items: flex-start; line-height: 1.4; }
.public-foot a { color: var(--secondary-color); }

.side-nav { display: flex; flex-direction: column; }

/* phones and small tablets: compact app bar + scrollable section strip; nothing wraps */
@media (max-width: 768px) {
    body.app { flex-direction: column; height: auto; min-height: 100vh; }
    #sidebar { width: 100%; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "logo profile" "nav nav"; gap: 2px 8px; align-items: center; padding: 8px 12px 0; border-right: none; border-bottom: 1px solid #e3e8ee; background: #fff; position: sticky; top: 0; z-index: 50; box-sizing: border-box; }
    .logo { grid-area: logo; padding: 4px 0; font-size: 18px; }
    .logo .ico.big { width: 24px; height: 24px; }
    .side-nav { grid-area: nav; flex-direction: row; overflow-x: auto; gap: 6px; padding: 6px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .side-nav::-webkit-scrollbar { display: none; }
    .nav-item { flex: none; display: inline-flex; margin: 0; padding: 7px 12px; border-radius: 999px; font-size: 13px; white-space: nowrap; border: 1px solid transparent; }
    .nav-item.active { box-shadow: none; }
    .nav-sep { display: none; }
    .user-profile { grid-area: profile; margin: 0; padding: 0; border: none; flex-direction: row; }
    .profile-row { width: auto; gap: 6px; }
    .profile-text, #account-toggle-icon { display: none; }
    .account-dropdown { left: auto; right: 0; bottom: auto; top: 44px; width: min(320px, calc(100vw - 24px)); }
    #main { margin: 0; border-radius: 0; border: none; }
    .topbar { padding: 10px 12px; flex-wrap: wrap; gap: 8px; border-radius: 0; min-height: 0; }
    .search-bar { flex: 1 1 100%; max-width: none; }
    .topbar-actions { width: 100%; margin-left: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .topbar-actions .btn-glossy { justify-content: center; width: 100%; }
    .page-title { font-size: 16px; }
    .session-banner { margin: 12px; flex-wrap: wrap; }
    .session-banner .btn-glossy { margin-left: 0; width: 100%; justify-content: center; }
    #file-browser { padding: 12px; }
    .breadcrumbs { margin-bottom: 12px; }
    table { min-width: 0; }
    #file-table th:nth-child(3), #file-table td:nth-child(3) { display: none; }
    th, td { padding: 8px 6px; }
    .row-actions { opacity: 1; gap: 2px; }
    .mini-btn { padding: 6px; }
    .page-section { padding: 14px 12px; }
    .link-row { flex-wrap: wrap; }
    .link-actions { width: 100%; justify-content: flex-end; }
    .field-grid, .public-meta { grid-template-columns: 1fr; }
    .share-modal, .preview-modal { width: 100%; height: 95vh; max-height: 95vh; }
    .row-actions { opacity: 1; }
    .mini-btn span { display: none; }
    .topbar { flex-direction: column; align-items: stretch; }
}
.view-hint { margin-top: 14px; }

/* Language switcher (runic.i18n.v1): in the sidebar under the sections, and on the public link page beside the brand. */
.lang-switch { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.lang-switch a { color: #4c6376; text-decoration: none; }
.lang-switch a[aria-current="true"] { color: var(--primary-color); text-decoration: underline; }
.lang-beta { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; padding: 0 5px; border: 1px solid currentColor; border-radius: 999px; color: #6e7781; }
#sidebar .lang-switch { padding: 10px 20px 0; }
.public-brand .lang-switch { margin-left: auto; font-weight: 500; }
.lang-notice { margin: 0 0 12px; }
@media (max-width: 768px) {
    #sidebar .lang-switch { grid-column: 1 / -1; padding: 0 0 8px; justify-content: flex-end; }
}

/* v1.2: health pills, set rows, selected deep-link row, snapshot tree; fits a 390 px wide phone */
.state-pill.ok, .state-pill.complete { background: #e3f3e8; color: #1e6b3a; }
.state-pill.running { background: #e8eef7; color: #1d4e89; }
.state-pill.overdue, .state-pill.partial, .state-pill.stale, .state-pill.never { background: #fff3e0; color: #9a5b00; }
.state-pill.failing, .state-pill.failed, .state-pill.storage_full { background: #fdecea; color: #a4262c; }
.set-rows { display: grid; gap: 4px; margin: 6px 0 0; }
.set-row { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; }
.set-row .set-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
#file-list-body tr.selected { outline: 2px solid #1d4e89; outline-offset: -2px; background: #eef4fb; }
.tree-crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 8px; }
.tree-list .link-title, .link-title, .link-meta { overflow-wrap: anywhere; min-width: 0; }
.stack { display: grid; gap: 8px; }
.field { display: grid; gap: 2px; font-size: 13px; }
.field input { max-width: 100%; }
main, .page-section, .link-list, .plugin-card { min-width: 0; max-width: 100%; }
@media (max-width: 480px) {
    .link-row { flex-wrap: wrap; }
    .link-actions { flex-wrap: wrap; width: 100%; justify-content: flex-start; }
    .topbar { flex-wrap: wrap; gap: 8px; }
    .modal { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
}
