:root {
    --bg: #0d1220;
    --bg-2: #131b2e;
    --card: #1a2338;
    --card-2: #212c46;
    --border: #2a3654;
    --text: #eaf0fb;
    --text-dim: #93a3c4;
    --accent: #f39c12;
    --accent-deep: #d9860a;
    --accent-soft: #3a2c12;
    --green: #37b26b;
    --red: #e05a5a;
    --radius: 16px;
    --radius-sm: 10px;
    --grad-accent: linear-gradient(135deg, #ffb43f 0%, #f0870f 100%);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
.screen { min-height: 100vh; }

#screen-auth { display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 70% -10%, rgba(243,156,18,0.14), transparent 60%), var(--bg); padding: 20px; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); padding: 40px; width: 100%; max-width: 400px; animation: rise .4s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-badge { display: inline-flex; align-items: center; justify-content: center; }
.auth-badge img {
    height: 88px; width: auto; max-width: 220px; object-fit: contain; display: block;
    transform-origin: center; animation: logo-pulse 2.8s ease-in-out infinite;
}
@keyframes logo-pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 2px 4px rgba(0,0,0,.3)); }
    50%      { transform: scale(1.06); filter: drop-shadow(0 6px 16px rgba(243,156,18,.4)); }
}
@media (prefers-reduced-motion: reduce) {
    .auth-badge img { animation: none; }
}
.auth-logo h1 { font-size: 24px; margin-top: 12px; letter-spacing: -.01em; }
.auth-sub { color: var(--text-dim); font-size: 12px; margin-top: 4px; }
form h2 { font-size: 16px; margin-bottom: 8px; }
.form-error { color: var(--red); font-size: 13px; margin-top: 14px; text-align: center; }
.card-note { color: var(--text-dim); font-size: 12px; margin-bottom: 14px; }

label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number] {
    display: block; width: 100%; margin-top: 6px; padding: 11px 13px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font: inherit; font-weight: 400; background: #0f1626; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(243,156,18,.15); }
input[type=search] { width: auto; margin: 0; }
select {
    padding: 11px 13px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font: inherit; font-weight: 400; background: #0f1626; color: var(--text);
    cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(243,156,18,.15); }
select option { background: #0f1626; color: var(--text); }
label select { display: block; width: 100%; margin-top: 6px; }
textarea {
    display: block; width: 100%; margin-top: 6px; padding: 11px 13px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font: inherit; font-weight: 400; background: #0f1626; color: var(--text);
    resize: vertical; min-height: 64px; transition: border-color .15s, box-shadow .15s;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(243,156,18,.15); }
.checkbox-inline { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.checkbox-inline input { width: auto; accent-color: var(--accent); }
.form-section-label { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin: 16px 0 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 18px; border: none; border-radius: var(--radius-sm); font: inherit; font-weight: 600; cursor: pointer; transition: transform .15s var(--ease), filter .15s, background .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad-accent); color: #1a1200; box-shadow: 0 4px 16px rgba(243,156,18,.3); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--card-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #283350; }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-danger { background: var(--red); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 12px; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 30px; border-bottom: 1px solid var(--border); background: var(--bg-2); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.brand-badge { display: inline-flex; align-items: center; justify-content: center; }
.brand-badge img { height: 34px; width: auto; object-fit: contain; display: block; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.home-main { max-width: 1000px; margin: 0 auto; padding: 44px 24px; }
.home-greeting { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.home-sub { color: var(--text-dim); margin: 6px 0 30px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.tile { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; transition: transform .18s var(--ease), border-color .18s, box-shadow .18s; }
.tile:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.tile-icon { line-height: 0; color: var(--accent); }
.tile-icon svg { width: 34px; height: 34px; }
.tile-name { font-size: 17px; font-weight: 700; }
.tile-desc { color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.tile-version { color: var(--text-dim); font-size: 11px; font-weight: 700; letter-spacing: 0.4px; opacity: 0.85; }
.tile-open { margin-top: 6px; color: var(--accent); font-size: 13px; font-weight: 700; }
.empty-tiles { color: var(--text-dim); background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; grid-column: 1 / -1; }

.admin-main { max-width: 1000px; margin: 0 auto; padding: 30px 24px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card h3 { font-size: 15px; }
.user-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; margin-bottom: 12px; background: var(--card-2); }
.user-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-title { font-weight: 700; }
.user-mail { color: var(--text-dim); font-size: 12px; }
.user-sub { color: var(--text-dim); font-size: 12px; }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; background: var(--card); border: 1px solid var(--border); color: var(--text-dim); }
.pill.admin { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.actief { color: var(--green); }
.pill.inactief { color: var(--red); }
.user-tools-row { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tool-access-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.tool-check { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-weight: 400; margin: 0; }
.tool-check input { width: auto; accent-color: var(--accent); }
.muted { color: var(--text-dim); font-size: 12px; }
.tool-check .muted { color: var(--text-dim); font-size: 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 12px; }
.audit-wrap { max-height: 420px; overflow-y: auto; }
.audit-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.audit-controls select, .audit-clearbar select { padding: 7px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: #0f1626; color: var(--text); font: inherit; }
.audit-clearbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.audit-sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.audit-size-chip { font-size: 12px; color: var(--text-dim); background: #0f1626; border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
.audit-size-chip strong { color: var(--text); font-weight: 700; }
.audit-size-chip.total { border-color: var(--accent); color: var(--text); }
.audit-size-chip.warn { border-color: var(--red); }
.audit-clearbar .muted { color: var(--text-dim); font-size: 12px; }
.empty { color: var(--text-dim); text-align: center; padding: 24px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(4, 8, 16, .65); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); width: 100%; max-width: 480px; max-height: 90vh; display: none; flex-direction: column; overflow: hidden; animation: rise .2s var(--ease); }
.modal.open { display: flex; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 15px; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 22px; cursor: pointer; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }

#toast-container { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--card-2); border: 1px solid var(--border); color: var(--text); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; animation: rise .2s var(--ease); }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

button.tile { font: inherit; text-align: left; width: 100%; cursor: pointer; }
.tile-admin .tile-icon { color: var(--accent); }

.user-chip { display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 5px 14px 5px 6px; color: var(--text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: border-color .15s; }
.user-chip:hover { border-color: var(--accent); }
.chip-avatar, .account-avatar, .user-avatar { object-fit: cover; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.chip-avatar { width: 28px; height: 28px; font-size: 15px; }
.account-avatar { width: 84px; height: 84px; font-size: 30px; }
.user-avatar { width: 40px; height: 40px; font-size: 15px; }
.avatar-fallback { background: var(--grad-accent); color: #1a1200; font-weight: 800; }

.tile-locked { position: relative; cursor: not-allowed; opacity: .6; }
.tile-locked:hover { transform: none; border-color: var(--border); box-shadow: none; }
.tile-lock { position: absolute; top: 16px; right: 18px; line-height: 0; color: var(--text-dim); }
.tile-lock svg { width: 18px; height: 18px; }

.tile-soon { position: relative; cursor: default; opacity: .72; border-style: dashed; }
.tile-soon:hover { transform: none; border-color: var(--border); box-shadow: none; }
.tile-soon-badge { position: absolute; top: 14px; right: 14px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: 20px; }
.tile-soon-note { color: var(--text-dim); }

.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; }
.brand-badge-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--grad-accent); color: #fff; }
.brand-badge-icon svg { width: 19px; height: 19px; }
.tool-check svg { width: 16px; height: 16px; color: var(--accent); vertical-align: -.15em; }

.account-photo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.account-photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.account-info { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 14px; margin-bottom: 16px; }
.account-info-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.account-info-row:last-child { border-bottom: none; }
.account-info-label { color: var(--text-dim); font-size: 12px; font-weight: 600; }
.account-info-value { font-size: 13px; font-weight: 600; word-break: break-word; text-align: right; }
#account-pw-sso { font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.form-section-label { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin: 20px 0 10px; border-top: 1px solid var(--border); padding-top: 16px; }
.user-ident { display: flex; align-items: center; gap: 12px; }

.tile-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red, #dc2626); color: #fff; font-size: 12px; font-weight: 800; vertical-align: middle; }
.tile-request { margin-top: 6px; align-self: flex-start; }
.tile-pending { color: var(--accent); font-weight: 700; }
.tile-denied { display: block; color: var(--red, #dc2626); font-size: 12px; font-weight: 600; margin: 4px 0; }
.tile-denied-x { border: none; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 12px; padding: 1px 5px; border-radius: 999px; }
.tile-denied-x:hover { background: var(--red, #dc2626); color: #fff; }
.request-del { border: none; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 999px; }
.request-del:hover { background: var(--red, #dc2626); color: #fff; }
.req-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--red, #dc2626); color: #fff; font-size: 12px; font-weight: 800; }
.request-item { background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; }
.request-item.done { opacity: .8; }
.request-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.request-date { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.request-msg { margin-top: 8px; padding: 8px 12px; background: var(--bg-2); border-radius: var(--radius-sm); font-size: 13px; color: var(--text); }
.request-note { margin-top: 10px; min-height: 48px; }
.request-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.ipban-add { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ipban-add input, .ipban-add select { padding: 8px 11px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: #0f1626; color: var(--text); font: inherit; }
.ipban-add input { flex: 1 1 150px; min-width: 130px; }
.ipban-add input#ipban-reason { flex: 2 1 200px; }
.backup-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
#backup-reminder-days { display: inline-block; width: 70px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: #0f1626; color: var(--text); font: inherit; margin: 0 6px; }
#backup-reminder { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.request-history-head { color: var(--text-dim); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin: 16px 0 8px; }
.request-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.request-status.approved { background: rgba(34,197,94,.15); color: #22c55e; }
.request-status.denied { background: rgba(220,38,38,.15); color: #f87171; }
.request-status.warn { background: rgba(243,156,18,.15); color: #f39c12; }

.date-row { display: flex; gap: 12px; }
.date-row label { flex: 1; }
.org-columns { display: flex; gap: 24px; flex-wrap: wrap; }
.org-col { flex: 1; min-width: 220px; }
.category-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.category-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--card-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 6px 5px 13px; font-size: 13px; font-weight: 600; }
.category-chip button { border: none; background: transparent; color: var(--text-dim); cursor: pointer; font-size: 13px; line-height: 1; padding: 3px 6px; border-radius: 999px; }
.category-chip button:hover { background: var(--red, #dc2626); color: #fff; }
.member-add-row { display: flex; gap: 8px; }
.member-add-row input { flex: 1; margin-top: 0; }

@media (max-width: 640px) { .topbar { padding: 12px 16px; } .home-main, .admin-main { padding: 24px 16px; } }

.pwa-block { margin-bottom: 16px; }
.pwa-block h4 { margin: 0 0 8px; font-size: 14px; }
.pwa-steps { margin: 0; padding: 12px 12px 12px 30px; background: var(--bg-2); border-radius: var(--radius-sm); line-height: 2; font-size: 13px; }
.pwa-key { border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; }
.pwa-tip { padding: 10px 12px; background: var(--accent-soft, rgba(243, 156, 18, .12)); border-left: 3px solid var(--accent); border-radius: 6px; font-size: 13px; }

@media (max-width: 760px) {
    .topbar { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
    .topbar-right { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
    .brand { font-size: 14px; }
    #home-user { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .home-main { padding: 22px 14px; }
    .admin-main { padding: 18px 12px; }
    .tiles { grid-template-columns: 1fr; }
    .modal-overlay { padding: 8px; align-items: flex-start; }
    .modal { max-width: 100%; max-height: 95vh; margin-top: 4px; }
    .modal-body { padding: 16px; }
    input, select, textarea { font-size: 16px !important; }
    .btn { min-height: 40px; }
    .request-head { flex-direction: column; align-items: flex-start; gap: 4px; }
    .user-head { flex-direction: column; align-items: flex-start; }
    .admin-main table { display: block; overflow-x: auto; }
    .audit-controls { flex-direction: column; align-items: stretch; }
    .audit-controls input, .audit-controls select { width: 100%; }
    .tool-access-grid { grid-template-columns: 1fr; }
}

.auth-badge img, .brand-badge img { cursor: default; user-select: none; -webkit-user-drag: none; }
.auth-badge img.mega-pulse, .brand-badge img.mega-pulse { animation: mega-pulse .65s var(--ease); }
.logo-count { margin-top: 6px; font-size: 12px; font-weight: 800; color: var(--accent); letter-spacing: .04em; animation: rise .25s var(--ease); }
.brand-count { margin-top: 0; }
.egg-msg { font-size: 18px; font-weight: 800; text-align: center; padding: 18px 6px; line-height: 1.5; }
@keyframes mega-pulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.38) rotate(-5deg); filter: drop-shadow(0 12px 34px rgba(243, 156, 18, .7)); }
    60% { transform: scale(.93) rotate(4deg); }
    80% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.storage-disk-bar { height: 14px; background: #0f1626; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.storage-disk-fill { height: 100%; background: var(--grad-accent); border-radius: 999px; transition: width .4s var(--ease); }
.storage-disk-fill.warn { background: var(--red); }
.storage-app-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.storage-app-name { width: 110px; flex: none; font-weight: 600; }
.storage-app-bar { flex: 1; height: 9px; background: #0f1626; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.storage-app-fill { height: 100%; background: var(--accent); opacity: .8; border-radius: 999px; }
.storage-app-size { width: 76px; flex: none; text-align: right; color: var(--text-dim); font-size: 12px; }
.storage-total { margin-top: 8px; font-size: 12px; }

.modal-header.danger { background: rgba(224, 90, 90, .12); }
#confirm-text { line-height: 1.6; }

html, body { touch-action: manipulation; }
.auth-pwa-btn { margin-top: 14px; }

.storage-full-banner { background: var(--red); color: #fff; text-align: center; padding: 10px 16px; font-size: 13px; font-weight: 700; position: sticky; top: 0; z-index: 50; }
.storage-limits-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.storage-limits-row label { flex: 1; min-width: 130px; margin-bottom: 0; }

@media (max-width: 760px) {
    .topbar-right { width: 100%; }
    .topbar-right .btn, .topbar-right .user-chip { flex: 1 1 auto; justify-content: center; }
}

.ideas-row { text-align: center; margin-top: 36px; }
.ideas-btn { opacity: .6; }
.ideas-btn:hover { opacity: 1; }

.shred-stage { max-width: 360px; margin: 0 auto; }
.shred-paper-zone { position: relative; height: 195px; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; z-index: 1; }
.shred-paper {
    width: min(300px, 92%); background: #fdfdf6; border-radius: 4px 4px 0 0;
    box-shadow: 0 4px 18px rgba(0,0,0,.45);
    padding: 10px 14px 12px; color: #1c2530;
    background-image: repeating-linear-gradient(transparent, transparent 27px, #dbe4f0 27px, #dbe4f0 28px);
    transition: transform 1.4s cubic-bezier(.55, 0, .85, .4);
}
.shred-paper.shredding { transform: translateY(210px); }
.shred-paper textarea {
    width: 100%; border: none; background: transparent; resize: none; font: inherit; font-size: 14px;
    color: #1c2530; line-height: 28px; padding: 0; margin: 0; min-height: 140px; border-radius: 0;
}
.shred-paper textarea:focus { outline: none; border: none; box-shadow: none; }
.shred-paper textarea::placeholder { color: #9aa5b8; }

.shredder-body {
    position: relative; margin: 0 auto; width: min(340px, 100%);
    background: linear-gradient(#2a3550, #1a2338); border: 1px solid #3a4666;
    border-radius: 10px; padding: 13px 16px 15px; z-index: 2;
    box-shadow: 0 10px 24px rgba(0,0,0,.4);
}
.shredder-slot { height: 7px; background: #05080f; border-radius: 4px; box-shadow: inset 0 2px 5px rgba(0,0,0,.9), 0 0 0 1px #3a4666; margin-bottom: 10px; }
.shredder-face { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shredder-led { width: 9px; height: 9px; border-radius: 50%; background: #3fae5a; box-shadow: 0 0 6px #3fae5a; flex-shrink: 0; }
.shredder-label { font-size: 12px; font-weight: 800; letter-spacing: 2px; color: #dfe6f5; }
.shredder-sub { font-size: 10px; color: var(--text-dim); margin-left: auto; font-style: italic; }
.shredder-body.working { animation: shredShake .14s linear infinite; }
.shredder-body.working .shredder-led { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: ledBlink .3s linear infinite; }
@keyframes shredShake {
    0% { transform: translate(.6px, 0); } 25% { transform: translate(-.6px, .5px); }
    50% { transform: translate(.6px, -.5px); } 75% { transform: translate(-.6px, 0); } 100% { transform: translate(.6px, 0); }
}
@keyframes ledBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .3; } }

.shred-out { height: 96px; overflow: hidden; display: flex; justify-content: center; }
.shred-strips { display: flex; gap: 3px; align-items: flex-start; padding-top: 2px; }
.shred-strips span {
    width: 13px; height: 0; background: #fdfdf6; border-radius: 0 0 2px 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,.35); transform-origin: top;
}
.shred-strips span:nth-child(odd) { transform: rotate(-2deg); }
.shred-strips span:nth-child(3n) { transform: rotate(2.5deg); }
.shred-strips.falling span { animation: stripFall 1.5s cubic-bezier(.3,.6,.6,1) forwards; }
.shred-strips.falling span:nth-child(2n) { animation-delay: .1s; }
.shred-strips.falling span:nth-child(3n) { animation-delay: .22s; }
.shred-strips.falling span:nth-child(5n) { animation-delay: .32s; }
@keyframes stripFall { from { height: 0; } to { height: 88px; } }

.shred-done { text-align: center; padding: 26px 10px; }
.shred-done-big { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.shred-done p { font-size: 13px; }
.shred-done-small { color: var(--text-dim); font-size: 11px; margin-top: 10px; }

.idea-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 8px; background: #0f1626; min-width: 0; overflow-wrap: anywhere; }
.idea-row.unseen { border-color: var(--accent); }
.idea-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; flex-wrap: wrap; }
.idea-meta strong { color: var(--text); }
.idea-meta .idea-del { margin-left: auto; }
.idea-text { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }

.tile-maint { opacity: .65; cursor: not-allowed; border-style: dashed; }
.tile-maint-note { color: var(--accent); }
.tile-maint-chip { font-size: 11px; background: var(--red); color: #fff; border-radius: 999px; padding: 3px 10px; font-weight: 700; align-self: flex-start; }
.maint-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 8px; background: #0f1626; flex-wrap: wrap; }
.maint-info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.maint-row .maint-toggle { margin-left: auto; }
.maint-row.active { border-color: var(--red); }
.maint-pill { background: var(--red); color: #fff; }
.ok-pill { background: rgba(55,178,107,.15); color: var(--green); }

body { overscroll-behavior-y: contain; }
.ptr-indicator {
    position: fixed; top: 0; left: 50%; z-index: 500;
    width: 44px; height: 44px; margin-left: -22px; border-radius: 50%;
    background: var(--card-2); border: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-dim);
    transform: translateY(-64px) scale(.5); opacity: 0; pointer-events: none;
}
.ptr-indicator.settle { transition: transform .3s cubic-bezier(0.22, 1, 0.36, 1), opacity .2s; }
.ptr-indicator.ready { color: var(--accent); }
.ptr-svg { width: 26px; height: 26px; display: block; }
.ptr-circle { stroke-dasharray: 94.25; stroke-dashoffset: 94.25; }
.ptr-indicator.spin { color: var(--accent); }
.ptr-indicator.spin .ptr-svg { transform: none !important; animation: ptrSpin .8s linear infinite; }
.ptr-indicator.spin .ptr-circle { stroke-dashoffset: 20.7 !important; }
@keyframes ptrSpin { to { transform: rotate(360deg); } }

.update-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.update-actions { margin: 4px 0 16px; }
.update-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; background: #0f1626; }
.update-item:last-child { margin-bottom: 0; }
.update-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.update-head strong { color: var(--text); font-size: 14px; }
.update-version { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.update-date { margin-left: auto; color: var(--text-dim); font-size: 11px; }
.update-text { font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 520px) { .update-grid { grid-template-columns: 1fr; } }

.audit-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.audit-filters select { padding: 7px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: #0f1626; color: var(--text); font: inherit; max-width: 230px; }
.audit-range { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font: inherit; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); background: #0f1626; color: var(--text-dim); cursor: pointer; }
.chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.audit-summary { margin-left: auto; }
.audit-table td { vertical-align: top; }
.audit-time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.audit-actor, .audit-action { white-space: nowrap; }
.audit-detail { overflow-wrap: anywhere; color: var(--text); }
.audit-day td { background: var(--bg-2); color: var(--text-dim); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 6px 10px; }
.audit-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: #f39c12; vertical-align: middle; }
.cat-add .audit-dot { background: #22c55e; }
.cat-del .audit-dot { background: #f87171; }
.cat-auth .audit-dot { background: #60a5fa; }
.cat-sec .audit-dot { background: #a78bfa; }
.cat-read .audit-dot { background: #94a3b8; }
.audit-more { display: flex; justify-content: center; margin-top: 12px; }
.audit-id { font-family: ui-monospace, Consolas, monospace; font-size: 11px; color: var(--text-dim); background: #0f1626; border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.noise-box { margin-top: 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.noise-box summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--text-dim); }
.noise-box .card-note { margin: 10px 0; }
.noise-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--border); font-size: 12px; }
.noise-row strong { color: var(--text); }
.noise-samples { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.noise-samples code { font-size: 11px; background: #0f1626; border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; color: var(--text-dim); }

.notif-actions { margin-top: 10px; display: flex; justify-content: flex-end; }

.tile-badge-task { background: var(--accent); color: #1a1200; }
.tile-tasks { font-size: 12px; font-weight: 700; color: var(--accent); align-self: flex-start; }
.tile-tasks.late { color: var(--red); }
