:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-muted: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --primary: #0f766e;
  --primary-hover: #0d625c;
  --primary-soft: #e6f6f3;
  --primary-ring: rgba(15, 118, 110, 0.24);

  --danger: #be123c;
  --danger-hover: #9f1239;
  --danger-soft: #fff1f2;
  --danger-border: #fecdd3;

  --warning-bg: #fffbeb;
  --warning-text: #92400e;
  --warning-border: #fde68a;

  --info-bg: #eff6ff;
  --info-text: #1e40af;
  --info-border: #bfdbfe;

  --success-bg: #ecfdf5;
  --success-text: #065f46;
  --success-border: #a7f3d0;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
  --transition: 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
  color: var(--text);
  letter-spacing: -0.015em;
}

h1 {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 650;
}

h3 {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 650;
}

p {
  margin: 6px 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
}

/* Top Navigation Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #0f172a;
  color: #f8fafc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.logo {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(20, 184, 166, 0.32);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.16);
  color: #5eead4;
  border: 1px solid rgba(94, 234, 212, 0.28);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.nav-pill:hover {
  background: rgba(20, 184, 166, 0.26);
  border-color: rgba(94, 234, 212, 0.45);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #14b8a6;
  color: #042f2e;
  font-size: 11px;
  font-weight: 700;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #0f766e;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.account-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
}

.role-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
}

.btn-ghost-nav {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.btn-ghost-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
}

/* Main Container */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* Layout Helpers */
.headline, .row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.headline {
  justify-content: space-between;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.wide {
  grid-column: 1 / -1;
}

.grow {
  flex: 1 1 auto;
}

/* Status & Alerts */
.notice, .alert {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 14px;
  border: 1px solid transparent;
}

.notice, .alert-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
  border-color: var(--warning-border);
}

.alert-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}

.alert-info {
  background: var(--info-bg);
  color: var(--info-text);
  border-color: var(--info-border);
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin-bottom: 16px;
}

/* Login View */
.login-wrap {
  min-height: calc(100vh - 110px);
  display: grid;
  place-items: center;
  padding: 16px 0;
}

.login {
  width: min(420px, 100%);
  padding: 28px;
}

.login-brand {
  margin-bottom: 20px;
}

.login-brand h1 {
  margin-bottom: 6px;
}

/* Forms & Inputs */
input, button, select, textarea {
  font: inherit;
}

label {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

label > span {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.char-count, .field-sub {
  font-size: 12px;
  font-weight: 450;
  color: var(--text-muted);
}

input:not([type="checkbox"]):not([type="file"]),
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input:not([type="checkbox"]):not([type="file"]):hover,
select:hover,
textarea:hover {
  border-color: #94a3b8;
}

input:not([type="checkbox"]):not([type="file"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-muted);
  color: var(--text-muted);
  cursor: not-allowed;
}

textarea {
  resize: vertical;
  min-height: 76px;
}

.input-password {
  position: relative;
  display: flex;
  align-items: center;
}

.input-password input:not([type="checkbox"]):not([type="file"]) {
  padding-right: 56px;
}

.btn-eye {
  position: absolute;
  right: 6px;
  background: transparent;
  color: var(--text-muted);
  border: 0;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}

.btn-eye:hover {
  color: var(--text);
  background: var(--surface-muted);
}

label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

label.check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.consent-box {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: var(--warning-text);
  font-size: 13px;
}

.field-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.field-hint.ok {
  color: var(--success-text);
}

.field-hint.err {
  color: var(--danger);
}

/* Buttons */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.3;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform 0.08s ease;
}

button:active:not(:disabled) {
  transform: translateY(0.5px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button[aria-busy="true"] {
  cursor: wait;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary, .light {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled), .light:hover:not(:disabled) {
  background: var(--surface-subtle);
  border-color: #94a3b8;
}

.btn-soft-primary {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(15, 118, 110, 0.22);
}

.btn-soft-primary:hover:not(:disabled) {
  background: #d3f1eb;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
}

.btn-danger-ghost, .danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-danger-ghost:hover:not(:disabled), .danger:hover:not(:disabled) {
  background: #ffe4e6;
}

.btn-text-danger {
  background: transparent;
  color: var(--danger);
  padding: 3px 6px;
  font-size: 12.5px;
}

.btn-text-danger:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
}

.btn-icon:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 10px 16px;
  font-size: 14.5px;
}

.btn-block {
  width: 100%;
}

.btn-link-primary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 550;
  text-decoration: none;
  transition: background var(--transition);
}

.btn-link-primary:hover {
  background: var(--primary-hover);
  text-decoration: none;
}

.btn-link-soft {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--info-bg);
  color: var(--info-text);
  border: 1px solid var(--info-border);
  font-size: 12.5px;
  font-weight: 550;
  text-decoration: none;
}

.btn-link-soft:hover {
  background: #dbeafe;
  text-decoration: none;
}

/* Segmented Controls */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.segmented-sm {
  display: inline-grid;
  grid-template-columns: auto auto;
  padding: 3px;
}

.seg-btn {
  padding: 6px 10px;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  border: 0;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}

.segmented-sm .seg-btn {
  padding: 4px 10px;
  font-size: 12.5px;
}

.seg-btn:hover:not(:disabled):not(.on) {
  color: var(--text);
}

.seg-btn.on {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.seg-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.07);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}

.seg-btn.on .seg-count {
  background: var(--primary-soft);
  color: var(--primary);
}

/* Workspace Columns */
.columns {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  position: sticky;
  top: 72px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input[type="search"] {
  padding: 8px 30px 8px 34px;
  font-size: 13.5px;
}

.icon-clear {
  position: absolute;
  right: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 14px;
}

.icon-clear:hover {
  background: var(--border);
  color: var(--text);
}

.group-list {
  display: grid;
  gap: 4px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 2px;
}

.group-item {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  font-weight: 500;
  box-shadow: none;
  overflow-wrap: anywhere;
  position: relative;
}

.group-item:hover:not(:disabled) {
  background: var(--surface-subtle);
  color: var(--text);
  border-color: var(--border);
}

.group-item.on {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(15, 118, 110, 0.22);
  font-weight: 650;
}

.group-empty {
  padding: 18px 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.sidebar-footer {
  padding-top: 4px;
}

.verify-card {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.verify-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.verify-card p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 4px 0 10px;
}

.verify-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Detail Panel */
.detail-panel {
  min-height: 480px;
}

.empty-state {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--text-muted);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--surface-muted);
  color: var(--text-muted);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.detail-title-wrap {
  min-width: 0;
  flex: 1 1 240px;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.group-note {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.group-note:empty {
  display: none;
}

.detail-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Pills & Badges */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}

.pill-virtual {
  background: var(--primary-soft);
  color: var(--primary);
}

.pill-human {
  background: #ede9fe;
  color: #5b21b6;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-active {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.status-pending {
  background: var(--warning-bg);
  color: var(--warning-text);
  border: 1px solid var(--warning-border);
}

.status-failed {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.status-neutral {
  background: var(--surface-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.82); }
}

/* Composer Card (Add Asset) */
.composer-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.asset-form-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.composer-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 112px;
  padding: 18px 16px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  margin-bottom: 8px;
  transition: border-color var(--transition), background var(--transition);
}

.file-drop:hover {
  border-color: var(--primary);
  background: #f9fefd;
}

.file-drop.dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.file-drop.has-file {
  border-style: solid;
  border-color: rgba(15, 118, 110, 0.45);
  background: #f5fbfa;
}

.upload-icon {
  color: var(--primary);
}

.file-drop-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.file-info {
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.upload-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.upload-meta-row p {
  margin: 0;
}

.progress-wrap {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin-bottom: 6px;
}

.progress-pct {
  font-weight: 650;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

#uploadProgress {
  width: 100%;
  height: 7px;
  accent-color: var(--primary);
  display: block;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* Assets Toolbar & Filter Pills */
.assets-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-secondary);
  border: 1px solid transparent;
  font-size: 12.5px;
  font-weight: 550;
}

.filter-pill:hover {
  background: var(--border);
  color: var(--text);
}

.filter-pill.on {
  background: var(--text);
  color: #ffffff;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--warning-bg);
  color: var(--warning-text);
  font-size: 12px;
  font-weight: 550;
}

.pager-text {
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.asset-reference-hint {
  margin: 4px 0 12px;
  font-size: 12.5px;
}

/* Asset Cards */
.asset-list {
  display: grid;
  gap: 10px;
}

.asset-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.asset-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.asset-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1 1 320px;
}

.media-badge {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
}

.media-image {
  background: #e0f2fe;
  color: #0369a1;
}

.media-video {
  background: #ede9fe;
  color: #6d28d9;
}

.media-audio {
  background: #fef3c7;
  color: #b45309;
}

.media-other {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.asset-info {
  min-width: 0;
  flex: 1 1 auto;
}

.asset-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.asset-title {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
  overflow-wrap: anywhere;
}

.asset-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.asset-id-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--text-secondary);
  max-width: 100%;
  overflow-wrap: anywhere;
}

.asset-id-chip code {
  user-select: all;
}

.asset-uri {
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.asset-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
  flex-shrink: 0;
}

.list-empty {
  padding: 28px 16px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13.5px;
}

/* Video Generation Section */
.tasks {
  margin-top: 20px;
  scroll-margin-top: 72px;
}

.section-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.section-hint {
  margin: 0 0 16px;
}

.video-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 20px;
  align-items: start;
}

.video-composer {
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.draft-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.capability-hint {
  margin: -4px 0 12px;
  font-size: 12.5px;
}

.capability-hint:empty {
  display: none;
}

/* Accordions */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin: 0 0 12px;
  overflow: hidden;
}

.accordion > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.accordion > summary::-webkit-details-marker {
  display: none;
}

.accordion > summary::after {
  content: '▾';
  color: var(--text-muted);
  font-size: 12px;
  margin-left: auto;
  transition: transform var(--transition);
}

.accordion[open] > summary {
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}

.accordion[open] > summary::after {
  transform: rotate(180deg);
}

.summary-badge {
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 650;
}

.accordion-body {
  padding: 14px;
}

.ref-entry {
  padding: 11px 12px;
  margin: 0 0 10px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
}

.ref-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ref-entry-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ref-entry label {
  margin: 6px 0 0;
}

.charge-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  margin-top: 14px;
}

.charge-bar label.check {
  margin: 0;
  color: var(--warning-text);
  font-size: 13px;
  font-weight: 600;
}

/* Video Task Column */
.video-tasks-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tasks-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.expiry-hint {
  margin: 0 0 4px;
  font-size: 12.5px;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-card {
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.task-model {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  overflow-wrap: anywhere;
}

.task-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.task-error {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  font-size: 12.5px;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Modal Overlays (Users & Password Panels) */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.modal-static {
  position: static;
  inset: auto;
  background: transparent;
  backdrop-filter: none;
  padding: 24px 0;
  min-height: calc(100vh - 140px);
}

.modal-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.16s ease-out;
}

.modal-lg {
  width: min(680px, 100%);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header, .dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-header p {
  margin: 4px 0 0;
}

.modal-body, .dialog-body {
  padding: 18px 20px;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.inline-form label {
  margin: 0;
}

.onetime-card {
  margin-bottom: 16px;
}

.onetime-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.onetime-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--warning-border);
}

#oneTimePassword {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  overflow-wrap: anywhere;
  user-select: all;
}

.record-list {
  display: grid;
  gap: 8px;
  max-height: 44vh;
  overflow-y: auto;
}

.record {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  overflow-wrap: anywhere;
}

.record > div:first-child {
  min-width: 0;
}

.pager-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Native <dialog> Modals */
dialog.studio-dialog {
  width: min(440px, 94vw);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}

dialog.studio-dialog::backdrop {
  background: rgba(15, 23, 42, 0.54);
  backdrop-filter: blur(3px);
}

dialog.studio-dialog[open] {
  animation: modalIn 0.16s ease-out;
}

.confirm-message {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(460px, calc(100vw - 32px));
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: #0f172a;
  color: #f8fafc;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  animation: toastIn 0.18s ease-out;
}

.toast.toast-success {
  background: #064e3b;
  border-color: rgba(167, 243, 208, 0.28);
}

.toast.toast-error {
  background: #881337;
  border-color: rgba(254, 205, 211, 0.28);
}

.toast.toast-warning {
  background: #78350f;
  border-color: rgba(253, 230, 138, 0.28);
}

.toast-close {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 16px;
  flex-shrink: 0;
}

.toast-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Breakpoints */
@media (max-width: 980px) {
  .video-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .columns {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .group-list {
    max-height: 240px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 14px 12px;
  }

  .panel {
    padding: 15px;
  }

  .topbar-inner {
    padding: 10px 14px;
  }

  .asset-card {
    flex-direction: column;
    align-items: stretch;
  }

  .asset-actions {
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

.canvas-entry{position:fixed;bottom:1rem;right:1rem;z-index:12}
