@charset "UTF-8";

:root {
    color-scheme: light;
    --canvas: #f5f7fa;
    --surface: #fff;
    --surface-soft: #f7f9fc;
    --border: #dfe5ee;
    --line: #e9edf3;
    --text: #172236;
    --muted: #53627a;
    --accent: #2948b8;
    --accent-hover: #223b98;
    --accent-soft: #edf1ff;
    --radius: 12px;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
h1, h2, p, ul { margin: 0; }
h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.16; letter-spacing: -.035em; }
h2 { font-size: 1.12rem; line-height: 1.3; letter-spacing: -.016em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
    outline: 2px solid #506de4;
    outline-offset: 3px;
}
[hidden] { display: none !important; }
small, .muted, .subtitle { color: var(--muted); }
pre, code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .92em; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
code { border-radius: 5px; background: #edf1f7; padding: .15em .42em; }
img { display: block; max-width: 100%; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link:focus { position: absolute; left: 1rem; top: 1rem; z-index: 2; background: var(--surface); padding: .6rem; }

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 238px minmax(0,1fr); }
.sidebar {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
    gap: 36px; padding: 25px 14px 16px; background: var(--surface); border-right: 1px solid var(--border);
}
.brand {
    display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none;
    font-size: 1.03rem; font-weight: 750; line-height: 1.2; letter-spacing: -.02em;
}
.sidebar .brand { padding: 0 9px; }
.brand small { display: block; margin-top: 4px; font-size: .72rem; font-weight: 550; letter-spacing: .005em; }
.brand-icon {
    flex: 0 0 36px; height: 36px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    gap: 3px; padding-left: 9px; border-radius: 10px; background: var(--accent);
}
.brand-icon i { height: 2px; border-radius: 3px; background: white; width: 17px; }
.brand-icon i:nth-child(2) { width: 13px; }
.brand-icon i:nth-child(3) { width: 10px; }
.sidebar nav { display: grid; gap: 4px; }
.nav-divider { width: calc(100% - 16px); height: 1px; margin: 6px auto; border: 0; background: var(--border); }
.nav-item {
    display: flex; align-items: center; min-height: 43px; gap: 10px; padding: 8px 11px;
    color: var(--muted); text-decoration: none; border-radius: 8px; font-size: .92rem; font-weight: 600;
}
.nav-item.active { color: var(--accent); background: var(--accent-soft); }
.nav-item:hover { color: var(--text); background: var(--surface-soft); }
.nav-item.active:hover { color: var(--accent); background: var(--accent-soft); }
.nav-icon { flex: 0 0 17px; width: 17px; height: 17px; position: relative; color: inherit; }
.icon-projects::before, .icon-skills::before, .icon-assets::before, .icon-exports::before {
    content: ""; display: block; position: absolute; width: 14px; height: 12px; left: 1px; top: 3px; border: 1.5px solid currentColor;
    border-radius: 3px;
}
.icon-projects::after { content: ""; position: absolute; width: 7px; height: 4px; top: 1px; left: 1px; border: 1.5px solid currentColor; border-radius: 2px 3px 0 0; border-bottom: 0; }
.icon-skills::before { height: 14px; top: 1px; width: 11px; left: 3px; }
.icon-skills::after { content: ""; position: absolute; width: 5px; height: 4px; left: 6px; top: 6px; border-block: 1px solid currentColor; }
.icon-assets::before { transform: rotate(30deg) scale(.83); width: 13px; height: 13px; top: 2px; left: 2px; }
.icon-exports::before { top: 9px; height: 6px; border-top: 0; border-radius: 0 0 3px 3px; }
.icon-exports::after { content: "↓"; position: absolute; font-weight: 600; font-size: 15px; left: 3px; top: -6px; }
.icon-payments { display: grid; place-items: center; }
.icon-payments::before { content: "€"; font-size: 15px; line-height: 1; }
.icon-users::before { content: ""; position: absolute; left: 5px; top: 1px; width: 7px; height: 7px; border: 1.5px solid currentColor; border-radius: 50%; }
.icon-users::after { content: ""; position: absolute; left: 2px; bottom: 1px; width: 13px; height: 7px; border: 1.5px solid currentColor; border-radius: 8px 8px 3px 3px; }
.account { margin-top: auto; display: flex; gap: 9px; align-items: center; padding: 14px 7px 0; border-top: 1px solid var(--line); font-size: .83rem; font-weight: 600; }
.account-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name small { display: block; font-size: .74rem; font-weight: 500; }
.account form { margin-left: auto; }
.avatar { width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; background: #e9edfa; color: var(--accent); }
.logout { border: 0; border-radius: 6px; color: var(--muted); background: transparent; min-width: 32px; min-height: 32px; }
.logout:hover { background: var(--surface-soft); }

.app-shell main { width: 100%; max-width: 1430px; min-width: 0; margin: 0 auto; padding: 38px clamp(18px, 4.2vw, 64px) 64px; }
.page-header { display: flex; gap: 16px; justify-content: space-between; align-items: center; margin-bottom: 27px; }
.page-header p { margin-top: 8px; color: var(--muted); }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: -3px 0 17px; color: var(--muted); font-size: .89rem; }
.breadcrumbs a { text-decoration: none; }
.history-link { margin-left: auto; }
.button {
    min-height: 40px; padding: 8px 14px; border: 1px solid #d6deeb; color: var(--text); background: var(--surface);
    display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
    border-radius: 8px; font-weight: 650; font-size: .88rem; white-space: nowrap;
}
.button:hover { background: #f1f4f9; color: var(--text); }
.button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.button.primary:hover { background: var(--accent-hover); color: #fff; }
.button.subtle { border-color: transparent; background: transparent; color: var(--accent); }
.button.subtle:hover { background: var(--accent-soft); }
.panel, .empty, .project-card, .asset-card, .records { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.empty { min-height: 255px; padding: 46px 24px; display: grid; justify-items: center; align-content: center; gap: 9px; text-align: center; }
.empty p { color: var(--muted); }
.empty .button { margin-top: 12px; }

.stack { display: grid; gap: 17px; }
.actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.form-panel { padding: clamp(18px, 3vw, 26px); }
form.form-panel { max-width: 620px; }
.form-panel > p, .stack p { color: var(--muted); }
label { display: grid; gap: 6px; min-width: 0; font-size: .88rem; font-weight: 650; }
input:not([type=hidden]), select, textarea {
    min-width: 0; max-width: 100%; min-height: 40px; border: 1px solid #cfd9e7;
    color: var(--text); background: var(--surface); border-radius: 8px; padding: 8px 11px;
}
input[type=file] { font-size: .84rem; font-weight: 500; }
input[type=file]::file-selector-button { font: inherit; padding: 4px 8px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 5px; margin-right: 9px; }
.search-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 17px; flex-wrap: wrap; }
.search-field { flex: 1 1 215px; max-width: 435px; }
.notice {
    padding: 12px 15px; margin-bottom: 16px; border: 1px solid #cbd8fe; border-radius: 8px;
    color: #273f7e; background: #edf2ff; overflow-wrap: anywhere;
}
.notice.success { background: #ebf7f0; color: #197347; border-color: #bde1cd; }
.notice.error { background: #fff0ed; color: #8f2921; border-color: #f1c7c1; }
.notice details { margin-top: 8px; }

.project-grid, .asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.project-card, .asset-card { display: flex; flex-direction: column; text-decoration: none; color: var(--text); overflow: hidden; }
.project-card { min-height: 168px; padding: 17px; }
.project-card:hover, .asset-card:hover { color: var(--text); border-color: #9cace1; }
.tile-icon { position: relative; display: block; width: 33px; height: 33px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.tile-icon::before, .tile-icon::after { margin-left: 8px; margin-top: 8px; }
.project-card h2, .asset-card h2 { overflow-wrap: anywhere; }
.project-card p, .card-bottom, .asset-subtitle { color: var(--muted); font-size: .83rem; }
.card-bottom { display: flex; justify-content: space-between; align-items: end; flex: 1; margin-top: 11px; }
.records { list-style: none; padding: 0; }
.records li + li { border-top: 1px solid var(--line); }
.records li a {
    display: flex; align-items: center; gap: 12px; justify-content: space-between; min-height: 59px; padding: 10px 15px;
    text-decoration: none; color: var(--text);
}
.records li a:hover { background: var(--surface-soft); border-radius: var(--radius); }
.record-main, .record-tail { display: flex; align-items: center; gap: 10px; min-width: 0; }
.record-main strong { overflow-wrap: anywhere; }
.record-tail { font-size: .85rem; }
.kind, .badge { border-radius: 5px; padding: 3px 7px; font-weight: 650; font-size: .72rem; color: #3c4d70; background: #eef2f8; white-space: nowrap; }
.kind { color: var(--accent); background: var(--accent-soft); }
.badges { display: inline-flex; gap: 4px; flex-wrap: wrap; max-width: 100%; }
.badge { white-space: normal; overflow-wrap: anywhere; }
.inline-help { margin-top: 18px; font-size: .86rem; color: var(--muted); }
.inline-help code { margin-left: 4px; }

.editor-meta { display: grid; align-items: end; grid-template-columns: minmax(150px,1fr) minmax(120px,.7fr) auto; gap: 12px; margin-bottom: 13px; padding: 13px; }
.editor-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 13px; }
.editor-pane { display: flex; flex-direction: column; min-width: 0; min-height: 460px; }
.pane-title { display: flex; align-items: center; justify-content: space-between; min-height: 51px; padding: 8px 13px; border-bottom: 1px solid var(--line); font-size: .88rem; font-weight: 700; }
.pane-title .button { min-height: 32px; padding: 5px 8px; font-size: .8rem; }
.editor-pane textarea {
    flex: 1; width: 100%; min-height: 420px; padding: 15px; resize: vertical; border: 0; border-radius: 0 0 10px 10px;
    font: 13px/1.65 "SFMono-Regular", Consolas, monospace; background: #fbfcff;
}
.editor-tabs { display: none; }
.editor-status { margin-top: 8px; color: var(--muted); min-height: 1.2rem; }
.prose { padding: 16px; overflow-wrap: anywhere; line-height: 1.6; }
.prose > * + * { margin-top: .9em; }
.prose h1 { font-size: 1.58rem; }
.prose h2 { font-size: 1.23rem; }
.prose h3 { font-size: 1.02rem; }
.prose pre { padding: 11px; border-radius: 8px; background: var(--surface-soft); }
.prose blockquote { margin-left: 0; margin-right: 0; border-left: 3px solid #b7c4eb; padding-left: 13px; }
.prose table { border-collapse: collapse; max-width: 100%; }
.prose th, .prose td { border: 1px solid var(--border); padding: 4px 7px; }
.version-view { padding: 16px; margin-bottom: 14px; }

.asset-media, .large-preview { display: grid; place-items: center; background: #f0f3f8; }
.asset-media { min-height: 128px; aspect-ratio: 2 / 1; }
.asset-media img { width: 100%; height: 100%; object-fit: contain; }
.asset-placeholder { display: grid; justify-items: center; color: var(--muted); font-size: .82rem; }
.asset-placeholder .tile-icon { margin-bottom: 5px; }
.asset-meta { display: grid; gap: 4px; padding: 13px; }
.asset-detail { display: grid; grid-template-columns: minmax(0,1.08fr) minmax(0,1fr); gap: 15px; align-items: start; }
.large-preview { min-height: 210px; padding: 16px; }
.large-preview img { max-height: 520px; object-fit: contain; }
.large-preview audio { width: 100%; max-width: 400px; }
.filename { margin: 6px 0 14px; overflow-wrap: anywhere; }
.transfer-notice { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
progress { width: 100%; height: 14px; accent-color: var(--accent); }
.pagination { display: flex; gap: 8px; margin-top: 15px; }

.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.settings-tokens { margin-top: 14px; }
.token-list { margin: 12px 0; }
.token-row { padding: 8px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.token-row + .token-row { border-top: 1px solid var(--line); }
.token-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.token { word-break: break-all; }
.user-panel { margin-bottom: 14px; }
.section-heading p { margin-top: 5px; font-size: .88rem; }
.user-empty { padding-top: 20px; }
.user-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 17px 0; }
.user-row + .user-row { border-top: 1px solid var(--line); }
.user-details { min-width: 0; }
.user-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.user-email { overflow-wrap: anywhere; font-size: .86rem; }
.user-status { border-radius: 99px; padding: 3px 8px; font-size: .73rem; font-weight: 700; white-space: nowrap; }
.status-pending { background: #fff5dc; color: #865800; }
.status-active { background: #ebf7f0; color: #197347; }
.status-blocked { background: #fff0ed; color: #8f2921; }
.user-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.user-actions select { min-height: 40px; }
.google-settings summary { cursor: pointer; list-style-position: inside; }
.google-settings summary span { display: inline-grid; vertical-align: middle; }
.google-settings summary small { font-size: .8rem; }
.google-settings-content { margin-top: 20px; }
.callback-url { overflow-wrap: anywhere; }
.google-config-form { max-width: 620px; }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.payment-number { font-size: clamp(1.3rem, 2.5vw, 1.8rem); line-height: 1.25; overflow-wrap: anywhere; }
.inline-form { align-items: end; }
.inline-form label { flex: 1 1 220px; max-width: 440px; }
.section-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.file-row-title { min-width: 0; overflow-wrap: anywhere; }
#participants .token-row a { min-width: 0; overflow-wrap: anywhere; }
.ledger-wrap { overflow-x: auto; }
.ledger { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
.ledger th, .ledger td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ledger th { background: var(--surface-soft); color: var(--muted); }
.ledger th:first-child, .ledger time { white-space: nowrap; }
.ledger th.amount, .ledger td.amount { text-align: right; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(100%, 428px); padding: 30px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 14px 32px #16223e0c; }
.login-panel .brand { margin-bottom: 27px; }
.login-form h1 { font-size: 1.55rem; }
.login-form > p { margin: 6px 0 16px; color: var(--muted); }
.google-button { width: 100%; gap: 10px; }
.google-mark { color: #4285f4; font-size: 1.16rem; font-weight: 800; }
.login-form > .login-help { margin: 9px 0 0; font-size: .8rem; text-align: center; }
.login-separator { display: flex; align-items: center; gap: 10px; margin: 22px 0; color: var(--muted); font-size: .78rem; }
.login-separator::before, .login-separator::after { content: ""; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 185px minmax(0,1fr); }
    .record-tail .badges { display: none; }
    .token-form { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .app-shell { display: block; }
    .sidebar { position: static; height: auto; gap: 15px; padding: 12px 10px 8px; border-right: 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; }
    .sidebar nav { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 3px; flex-wrap: wrap; }
    .nav-divider { flex: 0 0 100%; margin: 4px 0; }
    .nav-item { min-height: 36px; padding: 5px 7px; font-size: .81rem; gap: 5px; }
    .account { margin: 0; padding: 0; border: 0; }
    .account span:nth-child(2) { display: none; }
    .app-shell main { padding-top: 23px; }
    .page-header { align-items: start; flex-wrap: wrap; }
    .user-row { align-items: start; flex-direction: column; }
    .editor-meta { grid-template-columns: 1fr 1fr; }
    .editor-meta button { grid-column: 1 / -1; justify-self: start; }
    .editor-grid, .settings-grid, .asset-detail { grid-template-columns: 1fr; }
    .editor-tabs { display: flex; gap: 7px; margin-bottom: 8px; }
    .editor-tabs [aria-pressed=true] { background: var(--accent-soft); color: var(--accent); }
    .editor-form[data-pane=preview] [data-panel=write], .editor-form[data-pane=write] [data-panel=preview] { display: none; }
    .record-tail .muted { display: none; }
}

.upload-picker { position: relative; cursor: pointer; }
.upload-picker input {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.upload-picker:focus-within { outline: 2px solid #506de4; outline-offset: 3px; }
