:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-muted: #f1f3f5;
  --border: #dfe3e8;
  --border-strong: #c9cfd7;
  --text: #20252c;
  --text-muted: #68717d;
  --primary: #176b51;
  --primary-hover: #11563f;
  --primary-soft: #e8f4ef;
  --blue: #3266b1;
  --yellow: #e8aa28;
  --red: #c54e48;
  --danger: #b8423c;
  --shadow: 0 12px 36px rgba(32, 37, 44, 0.14);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; font-size: 14px; letter-spacing: 0; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; stroke-width: 1.8; flex: 0 0 auto; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand strong { display: block; font-size: 18px; line-height: 1.1; }
.brand small { display: block; color: var(--text-muted); margin-top: 4px; font-size: 12px; }
.brand-large { gap: 14px; }
.brand-large strong { font-size: 28px; }
.brand-mark { position: relative; display: block; width: 34px; height: 34px; transform: rotate(30deg); }
.brand-mark b, .brand-mark i, .brand-mark em { position: absolute; display: block; width: 10px; height: 31px; border-radius: 5px; transform-origin: 50% 50%; }
.brand-mark b { background: var(--blue); left: 12px; top: 1px; }
.brand-mark i { background: var(--yellow); left: 12px; top: 1px; transform: rotate(60deg); }
.brand-mark em { background: var(--red); left: 12px; top: 1px; transform: rotate(120deg); }
.brand-button { border: 0; background: transparent; padding: 0; }

.button { min-height: 38px; border: 1px solid transparent; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.button.primary { background: var(--primary); color: white; }
.button.primary:hover { background: var(--primary-hover); }
.button.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.button.secondary:hover { background: var(--surface-muted); }
.button.wide { width: 100%; min-height: 44px; }
.danger-button { background: var(--danger); color: #fff; }
.danger-button:hover { background: #96342f; }
.icon-button { width: 38px; height: 38px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }
.icon-button:hover { color: var(--text); background: var(--surface-muted); }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f5f7f8; }
.login-panel { width: min(390px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 22px 70px rgba(31, 39, 48, .10); padding: 34px; }
.login-actions { display: grid; gap: 10px; margin-top: 34px; }
.login-divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); margin: 26px 0 16px; font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; height: 1px; background: var(--border); flex: 1; }
.provider-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.provider-row button { height: 42px; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.phone-login { display: grid; gap: 10px; margin-top: 18px; }
.login-field { margin: 0; }
.phone-code-row { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 8px; }
.phone-code-row input { width: 100%; min-width: 0; min-height: 40px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 8px 10px; background: var(--surface); color: var(--text); outline: 0; }
.phone-code-row input:focus { border-color: #80ac9c; box-shadow: 0 0 0 3px rgba(23,107,81,.08); }
.phone-code-row .button { height: 40px; padding-left: 8px; padding-right: 8px; }
.login-hint { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.login-hint.dev { color: #6f4a12; background: #fff8e8; border: 1px solid #f0dcb0; border-radius: 6px; padding: 8px 10px; }

.account-state-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f5f7f8; }
.account-state-panel { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 22px 70px rgba(31, 39, 48, .10); padding: 38px 32px; text-align: center; }
.brand-centered { justify-content: center; }
.account-state-panel h1 { margin: 26px 0 10px; font-size: 20px; }
.account-state-panel p { margin: 0; color: var(--text-muted); line-height: 1.7; }
.account-state-actions { display: flex; justify-content: center; gap: 8px; margin-top: 26px; }

.admin-shell { min-height: 100vh; }
.admin-shell .topbar { grid-column: 1 / -1; }
.admin-content { width: min(960px, 100%); margin-inline: auto; padding: 28px 20px 60px; }
.admin-user-list { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.admin-user-row { min-height: 66px; display: grid; grid-template-columns: 36px minmax(0, 1fr) 170px auto auto; align-items: center; gap: 12px; padding: 9px 15px; border-bottom: 1px solid var(--border); }
.admin-user-row:last-child { border-bottom: 0; }
.admin-user-row strong, .admin-user-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-row small { color: var(--text-muted); margin-top: 3px; }
.admin-user-actions { display: flex; align-items: center; gap: 6px; }
.admin-user-actions .button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.admin-empty { padding: 36px; text-align: center; color: var(--text-muted); }

.bridge-view { min-height: 100vh; padding: 28px; }
.bridge-status { min-height: calc(100vh - 120px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.bridge-status h1 { font-size: 22px; margin: 18px 0 5px; }
.bridge-status p { color: var(--text-muted); margin: 0; }
.spinner { width: 20px; height: 20px; border: 2px solid #cbd3da; border-top-color: var(--primary); border-radius: 50%; animation: spin .75s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-shell { display: grid; grid-template: 64px minmax(0, 1fr) / 224px minmax(0, 1fr); min-height: 100vh; }
.app-shell.public-shell { grid-template-columns: minmax(0, 1fr); }
.public-shell .topbar { grid-column: 1; }
.public-shell .sidebar { display: none; }
.public-shell .content { grid-column: 1; width: min(1440px, 100%); margin-inline: auto; }
.public-shell .card-body { grid-template-columns: minmax(0, 1fr); padding-right: 13px; }
.topbar { grid-column: 1 / -1; background: var(--surface); border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 224px minmax(260px, 660px) minmax(260px, 1fr); align-items: center; padding: 0 18px; gap: 18px; position: sticky; top: 0; z-index: 20; }
.search-box { height: 42px; background: var(--surface-muted); border: 1px solid transparent; border-radius: 7px; display: flex; align-items: center; padding: 0 12px; gap: 10px; color: var(--text-muted); }
.search-box:focus-within { background: var(--surface); border-color: #8db7a8; box-shadow: 0 0 0 3px rgba(23,107,81,.08); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; min-width: 0; color: var(--text); }
.search-box kbd { border: 1px solid var(--border-strong); border-bottom-width: 2px; background: #fff; border-radius: 4px; padding: 1px 6px; font-size: 11px; }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.segmented { height: 38px; padding: 3px; display: flex; background: var(--surface-muted); border-radius: 7px; }
.segmented button { width: 34px; border: 0; border-radius: 5px; background: transparent; color: var(--text-muted); display: grid; place-items: center; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.09); }
.account-button { width: 42px; height: 42px; padding: 5px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text); }
.account-button:hover { background: var(--surface-muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #e6edf7; color: #315f98; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background-size: cover; background-position: center; flex: 0 0 auto; }
.avatar svg { width: 16px; height: 16px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar { grid-row: 2; background: #f1f3f4; border-right: 1px solid var(--border); padding: 18px 12px 14px; display: flex; flex-direction: column; min-height: calc(100vh - 64px); position: sticky; top: 64px; height: calc(100vh - 64px); }
.new-button { width: 100%; justify-content: flex-start; padding-left: 17px; min-height: 42px; }
.side-nav { display: grid; gap: 3px; margin-top: 20px; }
.nav-section-label { color: #7a838d; font-size: 10px; font-weight: 700; padding: 12px 11px 4px; text-transform: uppercase; }
.nav-section-label:first-child { padding-top: 0; }
.side-nav button { width: 100%; min-height: 40px; border: 0; border-radius: 6px; background: transparent; color: #4e5864; display: grid; grid-template-columns: 22px 1fr auto; align-items: center; text-align: left; gap: 9px; padding: 8px 11px; }
.side-nav button:hover { background: #e6e9eb; color: var(--text); }
.side-nav button.active { background: #dfece7; color: #125e47; font-weight: 700; }
.side-nav button b { min-width: 16px; font-size: 11px; text-align: right; }
.content { grid-column: 2; min-width: 0; padding: 27px 32px 60px; }
.content-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.content-heading { min-width: 0; }
.content-toolbar h1 { font-size: 22px; margin: 0; line-height: 1.3; }
.content-toolbar p { margin: 5px 0 0; color: var(--text-muted); }
.folder-breadcrumbs { display: flex; align-items: center; gap: 3px; min-height: 25px; margin-bottom: 5px; color: var(--text-muted); }
.folder-breadcrumbs button { max-width: 180px; border: 0; border-radius: 4px; background: transparent; color: inherit; overflow: hidden; padding: 3px 5px; text-overflow: ellipsis; white-space: nowrap; }
.folder-breadcrumbs button:hover { background: var(--surface-muted); color: var(--text); }
.folder-breadcrumbs svg { width: 13px; height: 13px; }
.toolbar-actions { display: flex; align-items: center; gap: 9px; }
.mobile-new-button { display: none; border-color: var(--border-strong); background: var(--surface); }
.select-control { height: 38px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface); padding: 0 8px 0 11px; color: var(--text-muted); }
.select-control span { font-size: 12px; }
.select-control select { border: 0; outline: 0; background: transparent; color: var(--text); }

.loading-state { min-height: 300px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-muted); }
.empty-state { min-height: 450px; border-top: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state h2 { margin: 18px 0 5px; font-size: 17px; }
.empty-state p { margin: 0 0 20px; color: var(--text-muted); }
.empty-visual { width: 86px; height: 70px; position: relative; }
.empty-visual span, .empty-visual b, .empty-visual i { position: absolute; display: block; width: 48px; height: 10px; border-radius: 5px; left: 19px; top: 30px; }
.empty-visual span { background: #6e96cf; transform: rotate(0deg); }
.empty-visual b { background: #edbd53; transform: rotate(60deg); }
.empty-visual i { background: #d36d67; transform: rotate(120deg); }

.model-list { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.list-header, .model-row { display: grid; grid-template-columns: minmax(280px, 2fr) 170px minmax(180px, 1fr) 44px; align-items: center; gap: 12px; padding: 0 15px; }
.list-header { height: 42px; color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; border-bottom: 1px solid var(--border); background: #fafbfb; }
.model-row { min-height: 62px; border-bottom: 1px solid #eceff1; cursor: pointer; transition: background .12s; }
.model-row:last-child { border-bottom: 0; }
.model-row:hover, .model-row:focus-visible { background: #eceff1; outline: none; }
.model-row.dragging { opacity: .45; }
.folder-row.drag-over { background: #dfece7; box-shadow: inset 0 0 0 2px #6c9b8a; }
.model-name-cell { display: flex; align-items: center; min-width: 0; gap: 12px; }
.model-name-cell > span:last-child { min-width: 0; }
.model-name-cell strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.model-name-cell small { color: var(--text-muted); display: block; margin-top: 3px; font-size: 11px; }
.model-name-cell .mobile-row-meta { display: none; }
.model-thumb { width: 38px; height: 38px; border-radius: 6px; background: #eef2f4; position: relative; flex: 0 0 auto; overflow: hidden; }
.model-thumb::before, .model-thumb::after { content: ""; position: absolute; width: 27px; height: 4px; border-radius: 2px; left: 6px; top: 17px; transform: rotate(32deg); background: var(--blue); box-shadow: 0 0 0 3px rgba(255,255,255,.65); }
.model-thumb::after { transform: rotate(148deg); background: var(--red); box-shadow: none; }
.model-thumb i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); left: 15px; top: 15px; z-index: 2; }
.model-thumb.has-image::before, .model-thumb.has-image::after { content: none; }
.model-thumb img { width: 100%; height: 100%; object-fit: cover; }
.folder-thumb { width: 38px; height: 31px; border-radius: 5px; background: #e7b73f; position: relative; flex: 0 0 auto; }
.folder-thumb::before { content: ""; position: absolute; left: 2px; top: -5px; width: 17px; height: 8px; border-radius: 4px 4px 0 0; background: #d9a82e; }
.folder-thumb::after { content: ""; position: absolute; inset: 7px 7px 8px; border-top: 2px solid rgba(255,255,255,.52); }
.visibility-badge { display: inline-flex; align-items: center; width: fit-content; min-height: 23px; border-radius: 4px; padding: 3px 7px; font-size: 11px; font-weight: 700; }
.visibility-badge.public { background: #e4f3ec; color: #176b51; }
.visibility-badge.unpublished { background: #e9edef; color: #58636d; }
.model-row > span { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.location-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.location-cell svg { width: 16px; height: 16px; }
.location-cell span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; justify-content: flex-end; }

.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.model-card { min-width: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.model-card:hover { border-color: #aeb8c2; box-shadow: 0 5px 18px rgba(32,37,44,.08); }
.folder-card.drag-over { border-color: #5b927e; box-shadow: 0 0 0 2px rgba(23,107,81,.18); }
.folder-card .card-preview { min-height: 118px; }
.card-preview { aspect-ratio: 16 / 10; background: #edf1f2; display: grid; place-items: center; position: relative; }
.card-preview > img { width: 100%; height: 100%; object-fit: contain; }
.card-preview .empty-visual { transform: scale(.8); }
.card-preview .visibility-badge { position: absolute; z-index: 1; left: 10px; top: 10px; }
.card-body { display: grid; grid-template-columns: 1fr 36px; gap: 7px; align-items: center; padding: 11px 8px 11px 13px; }
.card-body > div { min-width: 0; }
.card-body strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-body small { display: block; margin-top: 4px; color: var(--text-muted); }

.publication-list { border-top: 1px solid var(--border); }
.publication-row { min-height: 66px; display: grid; grid-template-columns: 1.5fr 1fr 140px 140px; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); }
.publication-row span { color: var(--text-muted); }
.status-badge { width: fit-content; border-radius: 4px; padding: 4px 8px; background: #f7efe0; color: #7b5a18; font-weight: 700; font-size: 11px; }
.status-badge.public { background: #e4f3ec; color: #176b51; }

.popover { position: fixed; z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 6px; }
.popover button { width: 100%; min-height: 36px; border: 0; border-radius: 5px; background: transparent; display: flex; align-items: center; gap: 10px; padding: 7px 9px; color: var(--text); text-align: left; }
.popover button:hover { background: var(--surface-muted); }
.popover button.danger { color: var(--danger); }
.menu-separator { height: 1px; background: var(--border); margin: 5px 3px; }
.account-menu-profile { display: flex; gap: 10px; align-items: center; padding: 9px; border-bottom: 1px solid var(--border); margin-bottom: 5px; }
.new-menu { min-width: 210px; }

.modal { width: min(520px, calc(100vw - 30px)); max-height: min(760px, calc(100vh - 30px)); padding: 0; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); color: var(--text); overflow: auto; }
.modal::backdrop { background: rgba(27, 32, 38, .42); backdrop-filter: blur(1px); }
.compact-modal { width: min(430px, calc(100vw - 30px)); }
.wide-modal { width: min(680px, calc(100vw - 30px)); }
.modal form { margin: 0; }
.modal-header { min-height: 70px; padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 17px; line-height: 1.35; }
.modal-header p { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 15px 20px; border-top: 1px solid var(--border); }
.field { display: grid; gap: 7px; margin: 18px 20px; }
.field > span { font-weight: 600; font-size: 12px; color: #505a65; }
.field input, .field select { width: 100%; min-height: 40px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 8px 10px; background: var(--surface); color: var(--text); outline: 0; }
.field input:focus, .field select:focus { border-color: #80ac9c; box-shadow: 0 0 0 3px rgba(23,107,81,.08); }
.drop-zone { margin: 18px 20px; min-height: 150px; border: 1px dashed #aeb8c2; background: #fafbfb; border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); }
.drop-zone:hover, .drop-zone.dragging { background: var(--primary-soft); border-color: #6d9c8b; }
.drop-zone input { position: absolute; opacity: 0; pointer-events: none; }
.drop-zone svg { width: 26px; height: 26px; }
.drop-zone strong { color: var(--text); }
.drop-zone span { font-size: 11px; }
.inline-status { display: flex; align-items: center; gap: 9px; margin: 0 20px 15px; color: var(--text-muted); }
.access-section { padding: 17px 20px; border-bottom: 1px solid var(--border); }
.access-section-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.access-section-heading strong, .access-section-heading small { display: block; }
.access-section-heading small { color: var(--text-muted); font-size: 11px; margin-top: 4px; }
.permission-subject-controls { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; align-items: end; gap: 8px; }
.permission-subject-controls .field, .access-section > .field { margin: 0; }
.compact-field input, .compact-field select { min-height: 38px; }
.inheritance-field { padding: 12px 0 4px; }
.permission-entry-list { display: grid; gap: 2px; margin-top: 12px; max-height: 250px; overflow: auto; }
.permission-entry-row { min-height: 50px; display: grid; grid-template-columns: 32px minmax(0, 1fr) 112px 34px; align-items: center; gap: 9px; padding: 5px 2px; border-top: 1px solid #edf0f2; }
.permission-entry-row:first-child { border-top: 0; }
.permission-entry-row .avatar { width: 30px; height: 30px; }
.permission-entry-row strong, .permission-entry-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.permission-entry-row small { color: var(--text-muted); font-size: 10px; margin-top: 3px; }
.permission-entry-row select { width: 100%; min-height: 32px; border: 1px solid var(--border-strong); border-radius: 5px; background: var(--surface); color: var(--text); padding: 4px 6px; font-size: 12px; }
.permission-role-label { justify-self: end; color: var(--text-muted); font-size: 12px; }
.permission-entry-placeholder { color: var(--text-muted); padding: 10px 0; }
.share-settings { display: grid; gap: 3px; padding: 10px 0 0; }
.share-settings .check-field, .community-settings .check-field { padding: 0; }
.community-settings { display: grid; gap: 7px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--border); }
.community-settings .field { margin: 2px 0; }
.derivative-consent { align-items: flex-start; line-height: 1.45; }
.derivative-consent input { margin-top: 2px; flex: 0 0 auto; }
.active-share-links { display: grid; gap: 6px; margin-top: 12px; }
.share-link-row { min-height: 43px; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 6px; }
.share-link-row strong, .share-link-row small { display: block; }
.share-link-row small { color: var(--text-muted); font-size: 10px; margin-top: 2px; }
.share-link-row svg { color: var(--text-muted); }
.check-field { min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 20px; }
.check-field input { width: 16px; height: 16px; accent-color: var(--primary); }
.copy-field { margin: 2px 20px 18px; height: 42px; border: 1px solid #9ab9ad; border-radius: 6px; background: var(--primary-soft); display: flex; align-items: center; padding-left: 10px; }
.copy-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #174f3d; }
.download-options { padding: 12px 20px 20px; display: grid; gap: 8px; }
.download-options > button { min-height: 68px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); display: grid; grid-template-columns: 44px 1fr 24px; align-items: center; gap: 11px; padding: 9px 12px; text-align: left; }
.download-options > button:hover { border-color: #88ac9f; background: #f8fbfa; }
.download-options strong, .download-options small { display: block; }
.download-options small { color: var(--text-muted); margin-top: 3px; }
.file-type { width: 42px; height: 42px; border-radius: 6px; display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.file-type.lite { background: #e7f1ec; color: #176b51; }
.file-type.vzome { background: #f6eddb; color: #8a6419; }
.versions-list { padding: 3px 20px 20px; }
.version-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; min-height: 67px; border-bottom: 1px solid var(--border); }
.version-row:last-child { border-bottom: 0; }
.version-number { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-muted); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.version-row strong, .version-row small { display: block; }
.version-row small { color: var(--text-muted); margin-top: 3px; }
.version-actions { display: flex; align-items: center; gap: 5px; }
.license-block { margin: 0 20px 18px; padding: 14px 0; border: 1px solid var(--border); border-radius: 7px; }
.license-block > strong { display: block; padding: 0 14px 7px; font-size: 12px; }
.license-block .check-field { padding: 0 14px; }
.publication-notice { margin: 18px 20px; color: var(--text-muted); line-height: 1.65; }
.irreversible-notice { margin: 4px 20px 18px; border-left: 3px solid #b87a19; background: #fff8e8; color: #6f4a12; display: grid; grid-template-columns: 20px 1fr; gap: 9px; padding: 12px; }
.irreversible-notice svg { width: 18px; height: 18px; margin-top: 1px; }
.irreversible-notice p { margin: 0; font-size: 12px; line-height: 1.6; }

.group-manager-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.group-manager-toolbar p { margin: 0; color: var(--text-muted); }
.group-list { padding: 4px 20px 20px; }
.group-row { min-height: 65px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.group-row > svg { color: var(--text-muted); }
.group-row strong, .group-row small { display: block; }
.group-row small { color: var(--text-muted); margin-top: 3px; }
.group-member-field { border: 0; padding: 0; margin: 2px 20px 18px; }
.group-member-field legend { padding: 0; margin-bottom: 8px; color: #505a65; font-weight: 600; font-size: 12px; }
.group-member-list { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.group-member-option { min-height: 43px; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-bottom: 1px solid #edf0f2; }
.group-member-option:last-child { border-bottom: 0; }
.group-member-option input { width: 16px; height: 16px; accent-color: var(--primary); }
.group-member-option .avatar { width: 28px; height: 28px; }

.help-shell .search-box, .help-shell #refreshBtn, .help-shell .segmented { visibility: hidden; }
.help-shell .content { padding-top: 24px; }
.help-layout { display: grid; grid-template-columns: 210px minmax(0, 820px); align-items: start; gap: 38px; }
.help-toc { position: sticky; top: 88px; display: grid; gap: 2px; max-height: calc(100vh - 112px); overflow: auto; }
.help-toc a { min-height: 34px; display: flex; align-items: center; gap: 8px; border-radius: 5px; color: var(--text-muted); padding: 7px 9px; text-decoration: none; }
.help-toc a:hover { background: var(--surface-muted); color: var(--text); }
.help-toc svg { width: 15px; height: 15px; }
.help-content { min-width: 0; }
.help-section { padding: 4px 0 30px; scroll-margin-top: 82px; border-bottom: 1px solid var(--border); }
.help-section + .help-section { padding-top: 30px; }
.help-section:last-child { border-bottom: 0; }
.help-section h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 13px; font-size: 19px; }
.help-section h2 svg { color: var(--primary); }
.help-section p { margin: 0 0 12px; color: #49535d; line-height: 1.75; }
.help-section dl { display: grid; grid-template-columns: 160px 1fr; margin: 14px 0 0; border-top: 1px solid var(--border); }
.help-section dt, .help-section dd { margin: 0; padding: 9px 6px; border-bottom: 1px solid var(--border); }
.help-section dt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--primary); }
.help-section table { width: 100%; margin: 14px 0; border-collapse: collapse; }
.help-section th, .help-section td { border: 1px solid var(--border); padding: 10px; text-align: left; vertical-align: top; line-height: 1.55; }
.help-section th { background: #f7f9f9; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); }
.toast { min-height: 45px; background: #20252c; color: white; border-radius: 7px; box-shadow: var(--shadow); padding: 11px 13px; display: flex; align-items: center; gap: 10px; animation: toast-in .16s ease-out; }
.toast.error { background: #873832; }
.toast.success { background: #175a46; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .topbar { grid-template-columns: 54px minmax(160px, 1fr) auto; padding: 0 9px; gap: 8px; }
  .topbar .brand strong, .search-box kbd { display: none; }
  .sidebar { padding: 14px 9px; }
  .new-button { width: 44px; height: 44px; padding: 0; align-self: center; }
  .new-button span, .side-nav span, .side-nav b, .nav-section-label { display: none; }
  .side-nav button { grid-template-columns: 1fr; justify-items: center; padding: 8px; }
  .content { padding: 22px 18px 50px; }
  .list-header, .model-row { grid-template-columns: minmax(220px, 1fr) 140px 44px; }
  .list-header > span:nth-child(3), .model-row > .location-cell { display: none; }
  .help-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 620px) {
  .app-shell { display: block; padding-bottom: 64px; }
  .topbar { height: 60px; position: sticky; grid-template-columns: 42px 1fr auto; }
  .topbar-actions > .icon-button, .segmented { display: none; }
  .account-button { padding: 5px; }
  .sidebar { position: fixed; z-index: 30; left: 0; bottom: 0; top: auto; width: 100%; height: 62px; min-height: 0; border: 0; border-top: 1px solid var(--border); padding: 5px 8px; background: var(--surface); }
  .new-button { display: none; }
  .side-nav { margin: 0; grid-template-columns: repeat(6, 1fr); gap: 2px; }
  .side-nav button { min-height: 51px; gap: 2px; font-size: 10px; }
  .side-nav button span { display: block; white-space: nowrap; }
  #companyNameNav { font-size: 0; }
  #companyNameNav::after { content: "团队"; font-size: 10px; }
  .content { padding: 18px 12px 42px; }
  .content-toolbar { align-items: flex-start; }
  .content-toolbar h1 { font-size: 19px; }
  .toolbar-actions .select-control { display: none; }
  .mobile-new-button { display: inline-flex; }
  .button { padding-left: 11px; padding-right: 11px; }
  .list-header { display: none; }
  .model-list { border-left: 0; border-right: 0; border-radius: 0; }
  .model-row { grid-template-columns: minmax(0, 1fr) 38px; padding: 0 3px; gap: 5px; }
  .model-row > span { display: none; }
  .model-name-cell .mobile-row-meta { display: block; }
  .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .card-preview { aspect-ratio: 1.25; }
  .modal { max-height: calc(100vh - 14px); }
  .phone-code-row { grid-template-columns: minmax(0, 1fr) 116px; }
  .admin-user-row { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .admin-user-row > span.phone-cell { display: none; }
  .admin-user-actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 4px; }
  .permission-subject-controls { grid-template-columns: minmax(0, 1fr) 110px; }
  .permission-subject-controls > button { grid-column: 1 / -1; }
  .permission-entry-row { grid-template-columns: 30px minmax(0, 1fr) 100px 32px; }
  .group-manager-toolbar { align-items: flex-start; flex-direction: column; }
  .help-shell { padding-bottom: 0; }
  .help-shell .sidebar { display: none; }
  .help-layout { display: block; }
  .help-toc { position: static; display: flex; overflow-x: auto; margin-bottom: 24px; }
  .help-toc a { flex: 0 0 auto; white-space: nowrap; }
  .help-section dl { grid-template-columns: 1fr; }
  .help-section dt { border-bottom: 0; padding-bottom: 2px; }
  .publication-row { grid-template-columns: 1fr auto; padding: 10px 2px; }
  .publication-row span:nth-child(2), .publication-row span:nth-child(4) { display: none; }
  .public-shell { padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
