:root{--bg:#f3f5f7;--panel:#fff;--text:#17202a;--muted:#68717c;--border:#d9dee5;--primary:#1565c0;--danger:#c62828;--grid:190px}
*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;color:var(--text);background:var(--bg)}button,input,select,textarea{font:inherit}.container{width:min(1500px,calc(100% - 30px));margin:18px auto}.topbar{display:flex;gap:18px;justify-content:space-between;align-items:center;padding:16px max(16px,calc((100% - 1500px)/2));background:#fff;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:30}.topbar h1{margin:0;font-size:1.45rem}.top-actions,.toolbar,.dialog-actions,.section-actions,.item-actions,.team-actions,.inline-row,.moderation-filters,.panel-heading{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.toolbar input[type=search],.panel-heading input[type=search],.moderation-filters input[type=search]{min-width:260px;flex:1;padding:10px 12px;border:1px solid var(--border);border-radius:8px}.btn{border:0;border-radius:8px;padding:9px 12px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.btn:disabled{opacity:.45;cursor:not-allowed}.btn.primary{background:var(--primary);color:#fff}.btn.secondary{background:#e9eef4;color:#17202a}.btn.danger{background:var(--danger);color:#fff}.btn.small{padding:6px 8px;font-size:.82rem}.muted{color:var(--muted);font-size:.9rem}
/* Checkbox alignment: explicit flex wins over .dialog-form label grid. */
.check,.dialog-form label.check,.check-grid label.check{display:flex!important;align-items:center!important;justify-content:flex-start;gap:8px;line-height:1.3}.check input[type=checkbox],.check input[type=radio],.dialog-form label.check input,.check-grid label.check input{width:auto!important;min-width:16px;height:16px;margin:0;flex:0 0 auto}.check span{display:inline}.check-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}.compact-check{margin:2px 0}
.section{background:#fff;border:1px solid var(--border);border-radius:12px;margin:18px 0;overflow:hidden}.section.private{border-color:#8e7cc3}.section.team-private{border-color:#3178a8}.section-header{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--border)}.section-title{display:flex;align-items:center;gap:8px;margin:0;font-size:1.15rem;flex-wrap:wrap}.privacy-badge,.owner-badge,.team-badge{font-size:.72rem;border-radius:999px;padding:3px 7px;background:#edf0f4;color:#4d5661}.privacy-badge{background:#eee8ff;color:#5c4795}.team-badge{background:#e1f1ff;color:#205f89}.collapse-btn{border:0;background:transparent;cursor:pointer;font-size:1rem}.sound-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--grid),1fr));gap:12px;padding:14px}.section.collapsed .sound-grid{display:none}.sound-card{position:relative;min-height:245px;border:1px solid var(--border);border-radius:10px;background:#fff;padding:12px;display:flex;flex-direction:column;align-items:center;gap:10px;transition:.15s}.sound-card:hover{transform:translateY(-2px);box-shadow:0 7px 20px rgba(0,0,0,.09)}.sound-title{text-align:center;margin:0;min-height:2.5em;overflow-wrap:anywhere}.sound-meta{text-align:center;font-size:.75rem;color:var(--muted)}.sound-button{width:112px;height:112px;border-radius:50%;border:0;color:#fff;font-weight:800;cursor:pointer;box-shadow:inset 0 -5px rgba(0,0,0,.12),0 4px 10px rgba(0,0,0,.15)}.favorite-button{align-self:flex-end;border:0;background:#f1f3f6;border-radius:50%;width:31px;height:31px;cursor:pointer}.favorite-button.active{background:#fff0a8}.item-actions{justify-content:center;margin-top:auto}.favorites-section{border:2px solid #ddb91c;background:#fffdf4}.empty{padding:30px;text-align:center;color:var(--muted)}body:not(.editing) .edit-only{display:none!important}.guest-only,.auth-only,.admin-only,.invite-only,.usermanager-only,.moderator-only{display:none}.dialog-form{display:grid;gap:12px;min-width:min(440px,85vw)}.dialog-form label{display:grid;gap:5px}.dialog-form input,.dialog-form select,.dialog-form textarea,.inline-row input,.team-actions input,.moderation-filters select{padding:9px;border:1px solid var(--border);border-radius:7px}.dialog-actions{justify-content:flex-end}dialog{border:0;border-radius:12px;box-shadow:0 20px 70px rgba(0,0,0,.3);padding:20px}dialog::backdrop{background:rgba(0,0,0,.45)}fieldset{border:1px solid var(--border);border-radius:8px;padding:10px}.toast{position:fixed;right:18px;bottom:18px;background:#17202a;color:white;padding:12px 15px;border-radius:8px;z-index:90}.panel{background:#fff;border:1px solid var(--border);border-radius:12px;padding:16px;margin-bottom:18px}.panel h2{margin-top:0}.panel-heading{justify-content:space-between}.inline-form{min-width:0}.profile-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{padding:8px;border-bottom:1px solid var(--border);text-align:left;font-size:.88rem;vertical-align:top}td .btn{margin:2px}.hash{font-family:ui-monospace,monospace;font-size:.72rem;word-break:break-all;max-width:280px}.playing{outline:3px solid #2e7d32}.drag-over{outline:3px dashed #1565c0}.hidden{display:none!important}.member-list{display:grid;gap:8px}.member-row{display:flex;justify-content:space-between;align-items:center;padding:8px;border-bottom:1px solid var(--border)}.team-panel{margin-top:18px}.team-actions{margin-top:12px}.team-actions input{min-width:250px}.moderation-filters{margin-bottom:14px}.moderation-filters select{background:#fff}.nav-menu{position:relative}.nav-menu summary{list-style:none}.nav-menu summary::-webkit-details-marker{display:none}.nav-menu-list{position:absolute;right:0;top:calc(100% + 8px);min-width:220px;background:#fff;border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 35px rgba(0,0,0,.18);padding:6px;display:grid;z-index:60}.nav-item{border:0;background:transparent;color:var(--text);text-decoration:none;text-align:left;padding:9px 10px;border-radius:7px;cursor:pointer;width:100%}.nav-item:hover{background:#edf2f7}
@media(max-width:800px){.topbar{position:static;align-items:flex-start;flex-direction:column}.profile-grid{grid-template-columns:1fr}.sound-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}.nav-menu-list{left:0;right:auto}.section-header{align-items:flex-start;flex-direction:column}.moderation-filters>*{width:100%}}
.statistics-only{display:none}.count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;margin-left:6px;border-radius:999px;background:#c62828;color:#fff;font-size:.72rem}.adult-badge{font-size:.72rem;border-radius:999px;padding:3px 7px;background:#4a2020;color:#fff}.info-box{padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:#f7f9fb}.stats-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}.stat-card{display:grid;gap:4px;padding:15px;border:1px solid var(--border);border-radius:10px;background:#fafbfc}.stat-card strong{font-size:1.7rem}.stat-card span{color:var(--muted)}.stats-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.message-card{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:12px;border-bottom:1px solid var(--border)}.message-card:last-child{border-bottom:0}.message-actions{display:flex;gap:7px;flex-wrap:wrap}.sound-meta .adult-badge{margin-left:4px}@media(max-width:800px){.stats-grid{grid-template-columns:1fr}.message-card{align-items:flex-start;flex-direction:column}}

/* v6 theme support */
:root{color-scheme:light;--surface:#fff;--surface-alt:#f7f9fb;--input-bg:#fff}
.count-badge[hidden]{display:none!important}
.field-title{font-weight:600;margin-bottom:6px}.team-check-grid{padding:8px;border:1px solid var(--border);border-radius:8px;background:var(--input-bg)}
html[data-theme="dark"]{color-scheme:dark;--bg:#11161d;--panel:#18202a;--surface:#18202a;--surface-alt:#202a35;--input-bg:#111923;--text:#edf2f7;--muted:#a9b3bf;--border:#34404d;--primary:#4b92e6;--danger:#d34c4c}
html[data-theme="dark"] body{background:var(--bg)!important;color:var(--text)}
html[data-theme="dark"] .topbar,html[data-theme="dark"] .section,html[data-theme="dark"] .sound-card,html[data-theme="dark"] .panel,html[data-theme="dark"] .nav-menu-list,html[data-theme="dark"] dialog{background:var(--panel);color:var(--text)}
html[data-theme="dark"] .btn.secondary{background:#2b3744;color:var(--text)}html[data-theme="dark"] .nav-item{color:var(--text)}html[data-theme="dark"] .nav-item:hover{background:#26313d}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:var(--input-bg);color:var(--text);border-color:var(--border)}
html[data-theme="dark"] .stat-card,html[data-theme="dark"] .info-box{background:var(--surface-alt)}
html[data-theme="dark"] .owner-badge{background:#2b3744;color:#dbe5ef}html[data-theme="dark"] .team-badge{background:#173a52;color:#b9e3ff}html[data-theme="dark"] .privacy-badge{background:#3b3157;color:#ddd0ff}
@media(prefers-color-scheme:dark){html:not([data-theme]){color-scheme:dark;--bg:#11161d;--panel:#18202a;--surface:#18202a;--surface-alt:#202a35;--input-bg:#111923;--text:#edf2f7;--muted:#a9b3bf;--border:#34404d;--primary:#4b92e6;--danger:#d34c4c}html:not([data-theme]) body{background:var(--bg)!important;color:var(--text)}html:not([data-theme]) .topbar,html:not([data-theme]) .section,html:not([data-theme]) .sound-card,html:not([data-theme]) .panel,html:not([data-theme]) .nav-menu-list,html:not([data-theme]) dialog{background:var(--panel);color:var(--text)}html:not([data-theme]) .btn.secondary{background:#2b3744;color:var(--text)}html:not([data-theme]) .nav-item{color:var(--text)}html:not([data-theme]) input,html:not([data-theme]) select,html:not([data-theme]) textarea{background:var(--input-bg);color:var(--text);border-color:var(--border)}}

.copy-row{display:flex;gap:8px;align-items:center}.copy-row input{flex:1;min-width:0}.invite-result{margin-top:16px;padding:14px;border:1px solid var(--border);border-radius:10px;background:var(--panel,#fff);display:grid;gap:12px}.status-badge{display:inline-flex;border-radius:999px;padding:3px 8px;font-size:.75rem;font-weight:700}.status-active{background:#e7f7ec;color:#1d6d37}.status-used{background:#e8eefb;color:#2959a8}.status-expired{background:#f1f1f1;color:#666}@media(max-width:650px){.copy-row{align-items:stretch;flex-direction:column}}
