:root {
    --ink: #181727;
    --muted: #716f7e;
    --paper: #f7f4ee;
    --surface: rgba(255,255,255,.86);
    --line: rgba(24,23,39,.11);
    --coral: #ff665a;
    --coral-dark: #e94e45;
    --mint: #a9ead0;
    --violet: #7770d8;
    --night: #151426;
    --shadow: 0 24px 60px rgba(32,26,47,.10);
    --radius: 26px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--paper); color: var(--ink); font: 15px/1.5 Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
:focus-visible { outline: 3px solid rgba(119,112,216,.32); outline-offset: 2px; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 50%; opacity: .42; filter: blur(3px); z-index: -1; pointer-events: none; }
.ambient-one { width: 430px; height: 430px; background: #ffd5c6; right: -150px; top: -190px; }
.ambient-two { width: 350px; height: 350px; background: #d4f4e6; left: -180px; top: 540px; }
.app-header { width: min(1240px, calc(100% - 40px)); min-height: 88px; margin: 0 auto; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: var(--night); color: var(--mint); font-size: 27px; transform: rotate(-4deg); box-shadow: 0 8px 18px rgba(21,20,38,.18); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 11px; }
.main-nav { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.main-nav a { padding: 9px 12px; border-radius: 11px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 800; }
.main-nav a:hover, .main-nav a.active { background: white; color: var(--ink); }
.header-cta, .button { min-height: 44px; padding: 11px 17px; border: 0; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; font-weight: 850; transition: .18s; }
.header-cta, .button-primary { background: var(--coral); color: white; box-shadow: 0 10px 25px rgba(255,102,90,.22); }
.header-cta:hover, .button-primary:hover { background: var(--coral-dark); transform: translateY(-2px); }
.button-dark { background: var(--night); color: white; }
.button-dark:hover { background: var(--violet); transform: translateY(-1px); }
.button-secondary { background: #ebe7ef; color: var(--ink); }
.button-secondary:hover { background: #dfdae5; }
.button-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.button-danger { background: #fff0ee; color: #b83e36; }
.button-small { min-height: 36px; padding: 7px 11px; border-radius: 10px; font-size: 12px; }
.button-full { width: 100%; }
.account-menu { display: flex; align-items: center; gap: 11px; }
.account-menu > span strong, .account-menu > span small { display: block; }
.account-menu > span strong { font-size: 12px; }
.account-menu > span small { color: var(--muted); font-size: 10px; }
.account-menu form { margin: 0; }
.auth-page { display: grid; place-items: center; padding: 24px; }
.auth-shell { width: min(470px, 100%); }
.auth-card { padding: clamp(25px, 6vw, 42px); border: 1px solid rgba(255,255,255,.92); border-radius: 32px; background: var(--surface); box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 38px; }
.auth-heading { margin-bottom: 25px; }
.auth-heading h1 { margin: 0; font-size: clamp(42px, 10vw, 62px); line-height: 1; letter-spacing: -.06em; }
.auth-heading > p:last-child { margin: 13px 0 0; color: var(--muted); }
.role-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0; padding: 0; border: 0; }
.role-choice legend { margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.role-choice label { position: relative; }
.role-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.role-choice label > span { min-height: 88px; padding: 14px; display: grid; align-content: center; border: 1px solid var(--line); border-radius: 14px; background: white; cursor: pointer; }
.role-choice strong, .role-choice small { display: block; }
.role-choice strong { font-size: 12px; }
.role-choice small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.role-choice input:checked + span { border-color: var(--violet); background: #efedff; box-shadow: inset 0 0 0 1px var(--violet); }
.role-choice input:focus-visible + span { outline: 3px solid rgba(119,112,216,.3); outline-offset: 2px; }
.auth-note { margin: 17px auto 0; color: var(--muted); font-size: 11px; text-align: center; }
.forbidden-state { margin-top: 60px; }
.pending-count { padding: 10px 14px; border-radius: 999px; background: #fff0d9; color: #94601c; font-size: 12px; font-weight: 850; }
.users-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(320px,.75fr); gap: 20px; align-items: start; }
.users-section { margin-bottom: 20px; }
.users-layout + .users-section { margin-top: 20px; }
.user-list { display: grid; gap: 10px; }
.user-row { padding: 14px; display: grid; grid-template-columns: 43px minmax(0,1fr) auto; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.user-avatar { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 14px; background: var(--night); color: var(--mint); font-size: 17px; font-weight: 900; }
.user-avatar img, .account-avatar img, .chat-user-avatar img { width:100%; height:100%; object-fit:cover; border-radius:inherit; display:block; }
.account-avatar { width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; overflow:hidden; border-radius:50%; background:var(--violet); color:white; text-decoration:none; font-weight:800; }
.chat-author { display:flex; align-items:center; gap:10px; }
.chat-author strong, .chat-author small { display:block; }
.chat-user-avatar { width:38px; height:38px; flex:0 0 38px; display:grid; place-items:center; overflow:hidden; border-radius:50%; background:var(--night); color:var(--mint); font-weight:800; }
.profile-photo-preview { width:140px; height:140px; border-radius:28px; overflow:hidden; display:grid; place-items:center; background:var(--night); color:var(--mint); font-size:44px; font-weight:900; margin-bottom:18px; }
.profile-photo-preview img { width:100%; height:100%; object-fit:cover; }
.user-main { min-width: 0; }
.user-main > strong, .user-main > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-main > small { color: var(--muted); font-size: 11px; }
.instrument-list.compact { margin: 7px 0 0; gap: 4px; }
.instrument-list.compact .instrument-chip { padding: 3px 7px; font-size: 9px; }
.user-actions { display: flex; align-items: center; gap: 6px; }
.user-actions form { margin: 0; }
.user-actions.vertical { align-items: stretch; flex-direction: column; }
.small-empty { padding: 35px 20px; }
.small-empty > span { font-size: 32px; }
.instrument-rights { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; border: 0; }
.instrument-rights legend { width: 100%; margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 800; }
.instrument-rights label { position: relative; }
.instrument-rights input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.instrument-rights span { display: inline-flex; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 11px; font-weight: 750; cursor: pointer; }
.instrument-rights input:checked + span { border-color: #5db78e; background: var(--mint); color: #205f48; }
.instrument-rights input:focus-visible + span { outline: 3px solid rgba(119,112,216,.3); outline-offset: 2px; }
.app-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto 90px; }
.flash-stack { display: grid; gap: 8px; margin: 8px 0 20px; }
.flash { padding: 13px 16px; border: 1px solid var(--line); border-radius: 15px; background: white; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 20px rgba(32,26,47,.06); font-weight: 700; }
.flash > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; font-weight: 900; }
.flash-success > span { background: #dff5e9; color: #238059; }
.flash-error > span { background: #ffe8e5; color: #b83e36; }
.flash-info > span { background: #e8e6fb; color: #5750ae; }
.hero { min-height: 390px; padding: clamp(32px, 6vw, 70px); border-radius: 38px; background: var(--night); color: white; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr); gap: 34px; align-items: center; position: relative; overflow: hidden; box-shadow: 0 35px 80px rgba(21,20,38,.18); }
.hero::before { content: "♪"; position: absolute; right: 5%; top: -100px; font-size: 420px; color: rgba(255,255,255,.035); transform: rotate(12deg); }
.hero::after { content: ""; position: absolute; right: -80px; bottom: -110px; width: 260px; height: 260px; border-radius: 50%; background: var(--coral); opacity: .15; }
.hero-copy, .hero-panel { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 9px; color: var(--coral); font-size: 12px; text-transform: uppercase; font-weight: 900; letter-spacing: .14em; }
.hero h1, .page-heading h1 { margin: 0; letter-spacing: -.06em; line-height: .98; }
.hero h1 { max-width: 760px; font-size: clamp(45px, 7vw, 76px); }
.hero-copy > p:not(.eyebrow) { max-width: 670px; margin: 20px 0 27px; color: rgba(255,255,255,.66); font-size: clamp(16px, 2vw, 20px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-panel { padding: 25px; border: 1px solid rgba(255,255,255,.13); border-radius: 27px; background: rgba(255,255,255,.07); backdrop-filter: blur(10px); }
.hero-panel h2 { margin: 0 0 8px; font-size: 21px; }
.hero-panel p { margin: 0 0 18px; color: rgba(255,255,255,.62); font-size: 13px; }
.hero-panel .button { width: 100%; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 34px; }
.stat-card { padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid rgba(255,255,255,.85); box-shadow: 0 14px 35px rgba(37,29,48,.06); }
.stat-card strong { display: block; font-size: 28px; letter-spacing: -.04em; }
.stat-card span { color: var(--muted); font-size: 12px; font-weight: 750; }
.section { margin-top: 60px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(29px, 4vw, 42px); line-height: 1.05; letter-spacing: -.045em; }
.section-heading p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); }
.toolbar { display: grid; grid-template-columns: minmax(240px, 1fr) 220px auto; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.66); margin-bottom: 20px; }
.search-field { min-height: 48px; padding: 0 14px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.search-field span { color: var(--violet); font-size: 23px; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; }
.field, .field-row { display: grid; gap: 7px; }
.field > span, .field-label { color: var(--muted); font-size: 12px; font-weight: 800; }
.field input, .field select, .field textarea, .toolbar select { width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); }
.field textarea { min-height: 110px; resize: vertical; }
.field-hint { margin: 0; color: var(--muted); font-size: 12px; }
.pieces-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; }
.piece-card { min-width: 0; padding: 22px; border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius); background: var(--surface); box-shadow: 0 14px 35px rgba(37,29,48,.07); transition: .2s; }
.piece-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.piece-top { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.piece-card h3 { margin: 0; font-size: 23px; line-height: 1.1; letter-spacing: -.035em; }
.piece-count { flex-shrink: 0; padding: 6px 9px; border-radius: 9px; background: #e8e4ed; color: var(--muted); font-size: 11px; font-weight: 850; }
.instrument-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 17px 0; }
.instrument-chip { padding: 6px 9px; border-radius: 999px; background: #eef9f4; color: #26785a; font-size: 11px; font-weight: 800; }
.parts-list { border-top: 1px solid var(--line); }
.part-row { min-height: 52px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.part-row:last-child { border-bottom: 0; }
.part-row strong { display: block; font-size: 13px; }
.part-row small { color: var(--muted); }
.part-actions { display: flex; gap: 5px; }
.part-actions a { padding: 7px 9px; border-radius: 9px; text-decoration: none; font-size: 11px; font-weight: 850; background: #efecf2; }
.part-actions a:last-child { background: var(--night); color: white; }
.empty-state { padding: 70px 25px; text-align: center; border: 1px dashed rgba(24,23,39,.18); border-radius: var(--radius); background: rgba(255,255,255,.46); }
.empty-state > span { display: block; font-size: 48px; color: var(--violet); }
.empty-state h3 { margin: 9px 0 4px; font-size: 25px; }
.empty-state p { margin: 0 auto 20px; max-width: 480px; color: var(--muted); }
.library-heading { padding: 46px 0 28px; display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.library-heading h1 { max-width: 830px; margin: 0; font-size: clamp(40px, 6vw, 68px); line-height: .98; letter-spacing: -.06em; }
.library-heading p:not(.eyebrow) { max-width: 720px; margin: 15px 0 0; color: var(--muted); font-size: 16px; }
.library-stats { min-height: 55px; padding: 9px 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.6); }
.library-stats span, .library-stats a { padding: 8px 11px; border-radius: 11px; color: var(--muted); font-size: 12px; text-decoration: none; }
.library-stats strong { color: var(--ink); font-size: 15px; }
.library-stats a { margin-left: auto; font-weight: 800; }
.library-stats a:hover { background: white; color: var(--violet); }
.library-shell { margin-top: 28px; }
.library-controls { position: sticky; z-index: 12; top: 8px; display: grid; grid-template-columns: auto minmax(260px,1fr) 210px auto; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 19px; background: rgba(247,244,238,.93); box-shadow: 0 12px 35px rgba(32,26,47,.08); backdrop-filter: blur(14px); }
.view-switch { display: flex; padding: 4px; border-radius: 13px; background: #e8e4eb; }
.view-button { min-height: 40px; padding: 7px 13px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 850; }
.view-button.active { background: white; color: var(--ink); box-shadow: 0 3px 9px rgba(32,26,47,.09); }
.library-search { min-height: 48px; }
.library-controls > select { min-height: 48px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); }
.library-controls > .button { min-height: 48px; }
.library-meta { min-height: 48px; padding: 8px 3px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.library-meta p { margin: 0; color: var(--muted); font-size: 12px; }
.library-meta strong { color: var(--ink); }
.text-button { padding: 7px 2px; border: 0; background: transparent; color: var(--violet); font-size: 12px; font-weight: 850; }
.text-button:hover { text-decoration: underline; }
.library-view { display: grid; gap: 13px; }
.library-group { overflow: hidden; border: 1px solid rgba(255,255,255,.92); border-radius: 21px; background: var(--surface); box-shadow: 0 10px 28px rgba(37,29,48,.055); }
.library-group-header { min-height: 77px; padding: 14px 17px; display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 13px; }
.library-group-title { min-width: 0; }
.library-group-title h2 { overflow: hidden; margin: 0; font-size: 20px; line-height: 1.15; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.library-group-title p { overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.group-count { padding: 6px 9px; border-radius: 9px; background: #e9e6ed; color: var(--muted); font-size: 11px; }
.group-count strong { color: var(--ink); }
.library-rows { border-top: 1px solid var(--line); }
.library-row { min-height: 60px; padding: 8px 17px; display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.library-row:last-child { border-bottom: 0; }
.library-row:hover { background: rgba(119,112,216,.045); }
.row-main { min-width: 0; }
.row-main strong, .row-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main strong { font-size: 13px; }
.row-main small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.row-actions { display: flex; gap: 6px; }
.row-actions a { padding: 7px 10px; border-radius: 9px; background: #efecf2; text-decoration: none; font-size: 11px; font-weight: 850; }
.row-actions a:last-child { background: var(--night); color: white; }
.selection-check { position: relative; width: 20px; height: 20px; display: block; }
.selection-check input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.selection-check span { width: 20px; height: 20px; display: grid; place-items: center; border: 1.5px solid rgba(24,23,39,.24); border-radius: 7px; background: white; cursor: pointer; }
.selection-check input:checked + span, .selection-check input:indeterminate + span { border-color: var(--violet); background: var(--violet); }
.selection-check input:checked + span::after { content: "✓"; color: white; font-size: 13px; font-weight: 900; }
.selection-check input:indeterminate + span::after { content: "−"; color: white; font-size: 15px; font-weight: 900; }
.selection-check input:focus-visible + span { outline: 3px solid rgba(119,112,216,.3); outline-offset: 2px; }
.selection-bar { position: fixed; z-index: 40; left: 50%; bottom: 22px; width: min(680px, calc(100% - 30px)); min-height: 66px; padding: 11px 13px 11px 19px; transform: translateX(-50%); display: flex; align-items: center; justify-content: space-between; gap: 15px; border: 1px solid rgba(255,255,255,.13); border-radius: 19px; background: rgba(21,20,38,.96); color: white; box-shadow: 0 24px 60px rgba(21,20,38,.3); backdrop-filter: blur(14px); }
.selection-bar span { color: rgba(255,255,255,.6); font-size: 12px; }
.selection-actions { display: flex; gap: 7px; }
.selection-bar .button-ghost { color: white; border-color: rgba(255,255,255,.18); }
.submit-choice { display: grid; grid-template-columns: 1.5fr 1fr; gap: 9px; }
.diffusion-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(310px,.65fr); gap: 20px; align-items: start; }
.diffusion-layout .panel + .panel { margin-top: 0; }
.diffusion-summary { position: sticky; top: 18px; }
.target-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.target-choice { position: relative; }
.target-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.target-choice > span { min-height: 132px; padding: 17px; display: block; border: 1px solid var(--line); border-radius: 16px; background: white; cursor: pointer; }
.target-choice strong, .target-choice small { display: block; }
.target-choice strong { margin-bottom: 7px; font-size: 14px; }
.target-choice small { color: var(--muted); font-size: 12px; }
.target-choice input:checked + span { border-color: var(--violet); background: #efedff; box-shadow: inset 0 0 0 1px var(--violet); }
.target-choice input:focus-visible + span { outline: 3px solid rgba(119,112,216,.3); outline-offset: 2px; }
.diffusion-recipients { margin-bottom: 0; }
.diffusion-piece-list { max-height: 430px; overflow-y: auto; margin: 18px 0; border-top: 1px solid var(--line); }
.diffusion-piece { min-height: 59px; padding: 9px 0; display: grid; grid-template-columns: 34px minmax(0,1fr); align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.diffusion-file-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: #eae7fb; color: var(--violet); font-weight: 900; }
.diffusion-piece strong, .diffusion-piece small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diffusion-piece strong { font-size: 12px; }
.diffusion-piece small { color: var(--muted); font-size: 10px; }
.diffusion-total { margin: 16px 0; padding: 13px 0; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.diffusion-total strong { color: var(--ink); font-size: 22px; }
.page-heading { padding: 36px 0 26px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.page-heading h1 { font-size: clamp(38px, 6vw, 62px); }
.page-heading p:not(.eyebrow) { margin: 12px 0 0; color: var(--muted); font-size: 16px; }
.content-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr); gap: 20px; align-items: start; }
.panel { padding: clamp(20px, 3vw, 30px); border: 1px solid rgba(255,255,255,.9); border-radius: var(--radius); background: var(--surface); box-shadow: 0 14px 35px rgba(37,29,48,.07); }
.panel + .panel { margin-top: 18px; }
.panel h2 { margin: 0 0 5px; font-size: 24px; letter-spacing: -.035em; }
.panel-intro { margin: 0 0 22px; color: var(--muted); }
.form-stack { display: grid; gap: 18px; }
.form-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.upload-choice-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; }
.drop-zone { min-height: 190px; padding: 25px; display: grid; place-items: center; text-align: center; border: 2px dashed rgba(119,112,216,.35); border-radius: 20px; background: rgba(119,112,216,.06); cursor: pointer; transition: .18s; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--violet); background: rgba(119,112,216,.11); }
.drop-zone input { position: absolute; opacity: 0; pointer-events: none; }
.drop-zone-icon { display: block; color: var(--violet); font-size: 42px; line-height: 1; }
.drop-zone strong { display: block; margin-top: 8px; font-size: 17px; }
.drop-zone small { color: var(--muted); }
.camera-zone { border-color: rgba(69,169,130,.4); background: rgba(69,169,130,.08); }
.camera-zone:hover { border-color: #45a982; background: rgba(69,169,130,.14); }
.camera-zone .drop-zone-icon { color: #27825e; }
.selected-files { display: grid; gap: 7px; margin-top: 12px; }
.selected-file { padding: 9px 11px; border-radius: 10px; display: flex; justify-content: space-between; gap: 12px; background: white; border: 1px solid var(--line); font-size: 12px; }
.selected-file span:last-child { color: var(--muted); }
.step-list { display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.step-number { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--night); color: white; font-weight: 900; }
.step h3 { margin: 0; font-size: 14px; }
.step p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.detail-hero { padding: clamp(28px,5vw,52px); border-radius: 34px; background: linear-gradient(130deg, #645dc7, #8b84e3); color: white; position: relative; overflow: hidden; }
.detail-hero::after { content: "♫"; position: absolute; right: 5%; top: -50px; font-size: 220px; opacity: .08; }
.detail-hero h1 { margin: 8px 0; font-size: clamp(38px,6vw,66px); line-height: 1; letter-spacing: -.055em; position: relative; }
.detail-hero p { margin: 0; color: rgba(255,255,255,.7); position: relative; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; position: relative; }
.badge { padding: 6px 9px; border-radius: 999px; background: rgba(255,255,255,.16); font-size: 11px; font-weight: 800; }
.workflow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; align-items: start; }
.workflow-step { display: inline-flex; align-items: center; gap: 8px; color: var(--violet); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.workflow-step span { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: #eae7fb; }
.choice-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.choice span { min-height: 72px; padding: 10px; display: grid; place-items: center; text-align: center; border: 1px solid var(--line); border-radius: 13px; background: white; font-size: 12px; font-weight: 800; cursor: pointer; }
.choice input:checked + span { border-color: var(--violet); background: #efedff; box-shadow: inset 0 0 0 1px var(--violet); }
.checkbox-list { display: flex; flex-wrap: wrap; gap: 7px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-chip span { display: inline-flex; padding: 8px 10px; border-radius: 999px; background: #efecf2; font-size: 11px; font-weight: 800; cursor: pointer; }
.check-chip input:checked + span { background: var(--mint); }
.meta-list { display: grid; gap: 13px; margin: 20px 0; }
.meta-row { display: grid; grid-template-columns: 105px 1fr; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.meta-row span { color: var(--muted); font-size: 12px; font-weight: 800; }
.history-list { display: grid; gap: 10px; }
.history-item { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.history-item strong, .history-item small { display: block; }
.history-item p { margin: 5px 0; color: var(--muted); font-size: 12px; }
.history-item small { color: var(--muted); }
.details-box { border: 1px solid var(--line); border-radius: 14px; background: white; overflow: hidden; }
.details-box + .details-box { margin-top: 9px; }
.details-box summary { padding: 13px 15px; cursor: pointer; font-weight: 850; }
.details-content { padding: 0 15px 15px; }
.table-list { width: 100%; border-collapse: collapse; }
.table-list th, .table-list td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.table-list th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.app-footer { width: min(1240px, calc(100% - 40px)); min-height: 80px; margin: 0 auto; padding: 20px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 12px; }
.app-footer nav { display: flex; flex-wrap: wrap; gap: 15px; }
.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--ink); }
@media (max-width: 900px) {
    .hero, .content-grid, .workflow-grid, .diffusion-layout, .users-layout, .upload-choice-grid { grid-template-columns: 1fr; }
    .hero { min-height: 0; }
    .main-nav { position: fixed; z-index: 30; bottom: 12px; left: 50%; transform: translateX(-50%); width: min(480px, calc(100% - 24px)); justify-content: space-around; padding: 7px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
    .main-nav a { padding: 9px 10px; }
    .header-cta { margin-left: auto; }
    .pieces-grid { grid-template-columns: 1fr; }
    .toolbar { grid-template-columns: 1fr 1fr; }
    .toolbar .search-field { grid-column: 1 / -1; }
    .app-footer { margin-bottom: 85px; }
    .library-controls { grid-template-columns: 1fr 1fr; }
    .library-search { grid-column: 1 / -1; grid-row: 1; }
    .view-switch { grid-column: 1 / -1; }
    .view-button { flex: 1; }
    .selection-bar { bottom: 92px; }
    .diffusion-summary { position: static; }
}
@media (max-width: 620px) {
    .app-header, .app-shell, .app-footer { width: min(100% - 24px, 1240px); }
    .app-header { min-height: 76px; gap: 10px; }
    .brand { gap: 8px; }
    .brand small { display: none; }
    .brand-mark { width: 41px; height: 41px; border-radius: 14px; }
    .header-cta { min-height: 40px; padding: 9px 12px; font-size: 12px; }
    .header-cta span { display: none; }
    .account-menu { margin-left: auto; gap: 6px; }
    .account-menu > span { display: none; }
    .account-menu > .button-secondary { display: none; }
    .account-menu .button-ghost { padding: 7px 9px; font-size: 11px; }
    .main-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
    .main-nav a { min-width: 0; padding: 7px 4px; font-size: 11px; text-align: center; }
    .app-shell { margin-bottom: 115px; }
    .app-footer { margin-bottom: 105px; }
    .role-choice { grid-template-columns: 1fr; }
    .user-row { grid-template-columns: 39px minmax(0,1fr); }
    .user-avatar { width: 39px; height: 39px; }
    .user-actions { grid-column: 1 / -1; flex-wrap: wrap; }
    .user-actions.vertical { flex-direction: row; }
    .hero { padding: 28px 23px; border-radius: 27px; }
    .hero h1 { font-size: 43px; }
    .hero-panel { padding: 19px; }
    .stat-grid { grid-template-columns: 1fr; gap: 8px; }
    .stat-card { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; }
    .stat-card strong { font-size: 23px; }
    .section { margin-top: 42px; }
    .section-heading, .page-heading { align-items: start; flex-direction: column; }
    .toolbar, .form-columns { grid-template-columns: 1fr; }
    .toolbar .search-field { grid-column: auto; }
    .panel { border-radius: 20px; }
    .choice-grid { grid-template-columns: 1fr; }
    .app-footer { flex-direction: column; }
    .library-heading { padding: 27px 0 20px; align-items: stretch; flex-direction: column; gap: 18px; }
    .library-heading h1 { font-size: 42px; }
    .library-heading .button { width: 100%; }
    .library-stats { justify-content: space-between; }
    .library-stats span { flex: 0 0 auto; padding-left: 7px; padding-right: 7px; }
    .library-stats a { display: none; }
    .library-controls { position: static; grid-template-columns: 1fr; }
    .library-search, .view-switch { grid-column: auto; }
    .library-meta { align-items: start; flex-direction: column; gap: 2px; }
    .library-group-header, .library-row { padding-left: 13px; padding-right: 13px; }
    .library-group-header { grid-template-columns: 22px minmax(0,1fr); }
    .group-count { display: none; }
    .library-row { grid-template-columns: 22px minmax(0,1fr) auto; gap: 9px; }
    .row-actions a { display: none; }
    .row-actions a:last-child { display: inline-flex; }
    .selection-bar { align-items: stretch; flex-direction: column; bottom: 108px; padding: 12px; }
    .selection-actions { display: flex; flex-wrap: wrap; }
    .selection-actions .button { flex: 1 1 auto; }
    .submit-choice, .target-choice-grid { grid-template-columns: 1fr; }
}
