:root {
  --navy: #0b1629;
  --navy-2: #101f37;
  --ink: #162033;
  --muted: #7d899d;
  --muted-2: #a8b2c3;
  --line: #e8ecf3;
  --surface: #ffffff;
  --canvas: #f6f8fc;
  --primary: #5965f2;
  --primary-dark: #4652df;
  --violet: #8b70ee;
  --cyan: #36c4c7;
  --orange: #ffab61;
  --green: #48c990;
  --danger: #ee697d;
  --shadow: 0 16px 42px rgba(31, 47, 82, .08);
  --shadow-soft: 0 8px 24px rgba(31, 47, 82, .06);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 258px; padding: 26px 18px 20px;
  color: #c5d0e1; background: linear-gradient(170deg, #0b1629 0%, #0d1b30 72%, #101d35 100%);
  display: flex; flex-direction: column; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 30px; }
.brand-mark { width: 35px; height: 35px; border-radius: 11px; color: white; display: grid; place-items: center; background: linear-gradient(135deg, #6672ff, #a47aff); box-shadow: 0 7px 18px rgba(102,114,255,.3); font-size: 19px; }
.brand-copy { display: grid; line-height: 1.1; letter-spacing: .02em; }
.brand-copy strong { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; font-weight: 600; color: #fff; letter-spacing: 0; white-space: nowrap; }
.brand-copy span { font-size: 11px; color: #7f90aa; margin-top: 5px; }
.repo-switcher { width: 100%; color: #dae2ee; padding: 11px; border: 1px solid rgba(183,202,231,.15); border-radius: 14px; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.065); text-align: left; transition: .2s; }
@media(hover:hover){.repo-switcher:hover { border-color: rgba(183,202,231,.28); }}
.repo-avatar, .user-avatar, .top-avatar { display: grid; place-items: center; border-radius: 11px; font-weight: 700; }
.repo-avatar { width: 30px; height: 30px; color: #fff; background: linear-gradient(135deg, #ffad67, #ff7c88); font-size: 13px; }
.repo-meta { flex: 1; display: grid; gap: 4px; min-width: 0; }
.repo-meta b { color: #f6f8fe; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-meta small { color: #7f90aa; font-size: 10px; }
.chevron { color: #8392a8; font-size: 18px; transform: translateY(-2px); }
.main-nav { margin-top: 29px; }
.nav-label { padding: 0 12px 9px; color: #60718e; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.nav-label-gap { margin-top: 27px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 11px 12px; margin: 3px 0; color: #91a1ba; background: transparent; border-radius: 11px; text-align: left; transition: .2s; font-size: 13px; }
@media(hover:hover){.nav-item:hover { color: #e8edfa; }}
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(96,110,255,.9), rgba(99,100,230,.68)); box-shadow: 0 8px 18px rgba(61,72,196,.25); }
.nav-icon { width: 17px; text-align: center; font-size: 18px; line-height: 1; opacity: .9; }
.nav-count { margin-left: auto; font-style: normal; color: #7587a5; font-size: 11px; }
.nav-item.active .nav-count { color: #dfe3ff; }
.sidebar-bottom { margin-top: auto; }
.storage-card { padding: 14px; border: 1px solid rgba(171,193,223,.14); border-radius: 15px; background: rgba(255,255,255,.055); }
.storage-top { color: #7f90aa; font-size: 10px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.status-dot { width: 7px; height: 7px; background: #4dd59d; border-radius: 50%; box-shadow: 0 0 0 4px rgba(77,213,157,.11); }
.storage-card strong { display: block; color: #e8edf7; font-size: 12px; margin-bottom: 11px; }
.storage-progress { height: 5px; border-radius: 10px; background: rgba(255,255,255,.1); overflow: hidden; }
.storage-progress span { height: 100%; display: block; border-radius: 10px; background: linear-gradient(90deg, #5c6bff, #49cbd1); }
.storage-card small { display: block; color: #71829e; font-size: 10px; margin-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 20px 8px 0; }
.user-avatar { width: 30px; height: 30px; color: #2d3c58; background: #f3c587; font-size: 12px; }
.user-chip div:nth-child(2) { display: grid; gap: 3px; flex: 1; }
.user-chip b { color: #dce4f1; font-size: 11px; }
.user-chip small { color: #71829e; font-size: 10px; }
.more { color: #73849e; font-size: 11px; letter-spacing: 2px; }

.main-shell { min-width: 0; width: calc(100% - 258px); margin-left: 258px; }
.topbar { height: 94px; padding: 0 46px; display: flex; align-items: center; justify-content: space-between; background: rgba(246,248,252,.83); border-bottom: 1px solid rgba(227,232,242,.7); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 10; }
.top-title { display: grid; gap: 5px; }
.eyebrow { color: var(--primary); font-weight: 700; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.top-title h1 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.global-search { height: 38px; width: 260px; display: flex; align-items: center; gap: 8px; padding: 0 10px; color: #9ca6b7; border: 1px solid #e3e8f1; border-radius: 10px; background: rgba(255,255,255,.76); }
.global-search span { font-size: 22px; line-height: 1; transform: rotate(-18deg); }
.global-search input { width: 100%; min-width: 0; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 11px; }
.global-search input::placeholder { color: #a9b1c0; }
kbd { padding: 3px 5px; border: 1px solid #e5e9f0; border-radius: 5px; color: #a0a9b8; font-size: 9px; white-space: nowrap; background: #fff; }
.top-icon, .mobile-menu { width: 34px; height: 34px; color: #77849a; border-radius: 9px; background: transparent; font-size: 18px; position: relative; }
@media(hover:hover){.top-icon:hover { color: var(--primary); }}
.notification i { position: absolute; top: 6px; right: 7px; width: 5px; height: 5px; background: var(--danger); border-radius: 50%; border: 1px solid var(--canvas); }
.top-avatar { width: 32px; height: 32px; background: linear-gradient(140deg,#6572ff,#9b74ea); color: #fff; font-size: 12px; box-shadow: 0 5px 13px rgba(93,103,234,.2); }
.mobile-menu { display: none; }
.content { max-width: 1480px; padding: 38px 46px 70px; margin: 0 auto; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 29px; }
.page-heading h2 { margin: 0 0 7px; font-size: 27px; letter-spacing: -.04em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.heading-actions { display: flex; align-items: center; gap: 9px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; color: #5e6b80; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 11px; font-weight: 600; transition: .2s; box-shadow: 0 3px 8px rgba(33,49,78,.02); }
@media(hover:hover){.btn:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):hover { color: var(--primary); border-color: #cfd5fd; transform: translateY(-1px); }}
.btn-primary { color: #fff; border-color: var(--primary); background: linear-gradient(135deg, #6671fc, #5860df); box-shadow:none; }
@media(hover:hover){.btn-primary:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):hover { color: #fff; border-color: var(--primary-dark); background: linear-gradient(135deg, #5b67ed, #4b56d1); box-shadow:none; }}
.btn-danger { color: var(--danger); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 10px; }
.icon-btn { width: 33px; height: 33px; display: inline-grid; place-items: center; color: #8090a6; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 16px; }
@media(hover:hover){.icon-btn:hover { color: var(--primary); border-color: #cfd5fd; }}

.hero { min-height: 206px; position: relative; overflow: hidden; padding: 30px 33px; margin-bottom: 25px; border-radius: 22px; color: #fff; background: radial-gradient(circle at 84% 8%, rgba(117,139,255,.65), transparent 31%), radial-gradient(circle at 72% 120%, rgba(58,196,198,.34), transparent 35%), linear-gradient(122deg, #202b63, #363f99 62%, #4b75c7); box-shadow: 0 14px 30px rgba(50,64,173,.21); }
.hero::before { content: ""; width: 220px; height: 220px; position: absolute; right: 95px; top: -112px; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 25px rgba(255,255,255,.035), 0 0 0 51px rgba(255,255,255,.025); }
.hero-content { position: relative; z-index: 1; max-width: 570px; }
.hero .mini-label { color: #aebdff; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.hero h2 { margin: 11px 0 9px; max-width: 490px; font-size: 25px; letter-spacing: -.04em; line-height: 1.25; }
.hero p { margin: 0; color: #c5d0f5; font-size: 12px; line-height: 1.7; }
.hero-actions { margin-top: 22px; display: flex; gap: 9px; }
.hero .btn { height: 34px; color: #eef0ff; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.12); box-shadow: none; }
@media(hover:hover){.hero .btn:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):hover { color: #fff; border-color: rgba(255,255,255,.36); background: rgba(255,255,255,.2); }}
.hero .btn-primary { color: #273172; border-color: #fff; background: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { min-height: 112px; padding: 19px 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-soft); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; font-size: 16px; }
.stat-card:nth-child(1) .stat-icon { color: #5e69ea; background: #eef0ff; }
.stat-card:nth-child(2) .stat-icon { color: #d87e42; background: #fff1e6; }
.stat-card:nth-child(3) .stat-icon { color: #2ea9aa; background: #e7f8f6; }
.stat-card:nth-child(4) .stat-icon { color: #5f9b72; background: #e9f8ee; }
.stat-card strong { display: block; margin-top: 12px; font-size: 25px; letter-spacing: -.04em; }
.stat-card .trend { margin-left: 7px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 0; }
.stat-card .stat-foot { margin-top: 4px; color: #a3adbc; font-size: 10px; }

.section-row { display: flex; justify-content: space-between; align-items: center; margin: 0 0 14px; }
.section-row h3 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.text-link { display:inline-flex; align-items:center; gap:4px; padding:3px 0; color:var(--primary); border:0; background:transparent; font-size:11px; font-weight:700; text-decoration:none; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.text-link:focus,.text-link:active { color:var(--primary-dark); background:transparent; outline:0; box-shadow:none; }
@media(hover:hover){.text-link:hover{ color:var(--primary-dark); background:transparent; outline:0; box-shadow:none; }}
body.dark .text-link { color:#aeb8ff; background:transparent; }
body.dark .text-link:focus,body.dark .text-link:active { color:#d0d5ff; background:transparent; }
@media(hover:hover){body.dark .text-link:hover{ color:#d0d5ff; background:transparent; }}
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .8fr); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-soft); }
.library-card { overflow: hidden; }
.library-card-header { display: flex; justify-content: space-between; align-items: center; padding: 17px 19px 16px; border-bottom: 1px solid #f0f2f6; }
.library-title { display: flex; align-items: center; gap: 11px; }
.library-logo { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: #fff; font-weight: 700; font-size: 14px; box-shadow: 0 5px 12px rgba(95,100,210,.15); }
.library-title b { display: block; font-size: 12px; }
.library-title small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.card-menu { color: #98a4b4; font-size: 18px; letter-spacing: 2px; background: transparent; }
.library-list-row { display: flex; align-items: center; gap: 12px; padding: 14px 19px; border-bottom: 1px solid #f3f5f8; cursor: pointer; transition: .2s; }
.library-list-row:last-child { border-bottom: 0; }
@media(hover:hover){.library-list-row:hover:not(:where(:has(button:hover,a:hover))) { color:var(--ui-feedback-ink); }}
.cover-stack { display: flex; padding-left: 7px; }
.cover-stack img { width: 30px; height: 30px; object-fit: cover; margin-left: -7px; border: 2px solid rgba(255,255,255,.5); border-radius: 9px; background: #eef0f7; }
.list-info { min-width: 0; flex: 1; }
.list-info b { display: block; font-size: 11px; }
.list-info small { display: block; max-width: 280px; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.list-meta { display: grid; gap: 4px; justify-items: end; color: #909bad; font-size: 10px; }
.list-meta strong { color: var(--ink); font-size: 11px; }
.activity-card { padding: 17px 19px 9px; }
.activity-card .section-row { margin-bottom: 17px; }
.activity-item { display: flex; gap: 10px; padding: 0 0 17px; }
.activity-line { position: relative; width: 17px; flex: 0 0 17px; display: flex; justify-content: center; }
.activity-line::after { content: ""; position: absolute; top: 18px; bottom: -4px; width: 1px; background: #e9edf3; }
.activity-item:last-child .activity-line::after { display: none; }
.activity-dot { width: 9px; height: 9px; margin-top: 4px; border: 2px solid #fff; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px #9fa8fb; z-index: 1; }
/* Uniform timeline marker: color carries no status meaning. */
.activity-copy { display: grid; gap: 5px; min-width: 0; }
.activity-copy b { font-size: 11px; font-weight: 600; }
.activity-copy small { color: var(--muted); font-size: 10px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 13px 16px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.inner-search { min-width: 190px; flex: 1; height: 33px; display: flex; align-items: center; gap: 7px; padding: 0 9px; color: #a1abba; border: 1px solid #edf0f5; border-radius: 8px; background: #fafbfc; }
.inner-search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.filter-pills { display: flex; align-items: center; gap: 5px; padding: 3px; border-radius: 9px; background: #f3f5fa; }
.filter-pill { padding: 7px 10px; color: #8995a9; border-radius: 7px; background: transparent; font-size: 10px; }
.filter-pill.active { color: var(--primary); background: #fff; box-shadow: 0 2px 5px rgba(39,52,89,.07); font-weight: 700; }
.toolbar-spacer { flex: 1; }

.library-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.library-tile { padding: 20px; cursor: pointer; transition: .2s; }
@media(hover:hover){.library-tile:hover { border-color: #cfd5fd; transform: translateY(-2px); box-shadow: 0 13px 30px rgba(75,87,180,.09); }}
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tile-top .library-logo { width: 43px; height: 43px; font-size: 16px; }
.tile-arrow { width: 29px; height: 29px; display: grid; place-items: center; color: #97a2b2; border-radius: 8px; background: #f5f7fb; }
.library-tile h3 { margin: 18px 0 5px; font-size: 15px; }
.library-tile p { height: 32px; margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.5; }
.tile-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 19px; padding-top: 13px; border-top: 1px solid #f0f2f6; color: var(--muted); font-size: 10px; }
.tile-footer strong { color: var(--ink); font-size: 12px; }

.asset-groups { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 19px; }
.group-pill { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; height: 31px; padding: 0 11px; color: #7f8ca0; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 10px; }
 .group-pill.active { color: var(--primary); border-color: #cbd0fc; }
@media(hover:hover){.group-pill:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):hover{ color: var(--primary); border-color: #cbd0fc; }}
.group-pill b { color: inherit; font-size: 11px; }
.asset-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 15px; }
.asset-card { min-width: 0; overflow: hidden; padding: 9px; cursor: pointer; transition: .2s; }
@media(hover:hover){.asset-card:hover:not(:where(:has(button:hover,a:hover))) { transform: translateY(-3px); border-color: #cfd5fd; box-shadow: 0 12px 28px rgba(67,82,170,.1); }}
.asset-preview { position: relative; height: 125px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: linear-gradient(135deg, #f4f6ff, #eef8f7); }
.asset-preview img { width: 74px; height: 74px; object-fit: cover; border-radius: 17px; box-shadow: 0 9px 17px rgba(34,54,100,.12); }
.asset-select { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; display: grid; place-items: center; color: #fff; border: 1px solid rgba(255,255,255,.8); border-radius: 6px; background: rgba(19,29,54,.13); font-size: 12px; }
.asset-card.selected .asset-select { background: var(--primary); }
.asset-card.selected { border-color: #acb2ff; box-shadow: 0 0 0 2px rgba(89,101,242,.1); }
.asset-details { padding: 11px 3px 3px; }
.asset-details b { display: block; max-width: 100%; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.asset-details small { display: block; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.asset-badge { display: inline-block; margin-top: 7px; padding: 3px 6px; color: #8995a8; border-radius: 4px; background: #f4f6f9; font-size: 8px; }

.detail-header { display: flex; align-items: center; gap: 14px; padding: 21px; margin-bottom: 18px; }
.detail-header .library-logo { width: 49px; height: 49px; font-size: 18px; }
.detail-header h2 { margin: 0 0 5px; font-size: 17px; }
.detail-header p { margin: 0; color: var(--muted); font-size: 10px; }
.detail-header .detail-actions { margin-left: auto; display: flex; gap: 8px; }
.table-card { overflow: hidden; }
.table-head, .table-row { display: grid; grid-template-columns: 38px minmax(180px, 1.2fr) minmax(220px, 2fr) 105px 60px; gap: 13px; align-items: center; padding: 13px 18px; }
.table-head { color: #98a3b3; border-bottom: 1px solid var(--line); background: #fbfcfe; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.table-row { min-height: 65px; border-bottom: 1px solid #f1f3f7; cursor: pointer; transition: .15s; }
.table-row:last-child { border-bottom: 0; }
@media(hover:hover){.table-row:hover { background: #fbfcff; }}
.table-icon { width: 35px; height: 35px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #f1f4fa; }
.table-icon img { width: 28px; height: 28px; object-fit: cover; border-radius: 7px; }
.table-name b { display: block; font-size: 11px; }
.table-name small, .table-url { display: block; max-width: 100%; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.table-url { color: #8593a8; }
.table-date { color: var(--muted); font-size: 10px; }
.table-more { color: #9ca7b7; font-size: 17px; text-align: right; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); gap: 18px; align-items: start; }
.settings-card { padding: 23px; }
.settings-card h3 { margin: 0 0 5px; font-size: 14px; }
.settings-card > p { margin: 0 0 21px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-field { display: grid; gap: 7px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #758197; font-size: 10px; font-weight: 700; }
.form-field input, .form-field select, .modal-field input, .modal-field select { height: 38px; padding: 0 11px; color: var(--ink); outline: 0; border: 1px solid #e4e8f0; border-radius: 9px; background: #fbfcfe; font-size: 11px; }
.form-field input:focus, .form-field select:focus, .modal-field input:focus, .modal-field select:focus { border-color: #aeb5f8; box-shadow: 0 0 0 3px rgba(89,101,242,.08); }
.field-help { color: #9aa5b5; font-size: 9px; line-height: 1.5; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #eff2f6; }
.info-list { display: grid; gap: 0; }
.info-row { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid #f0f2f6; font-size: 11px; }
.info-row:last-child { border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row b { max-width: 190px; overflow: hidden; color: var(--ink); text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.security-note { padding: 13px; margin-top: 17px; color: #747d99; border-radius: 10px; background: #f4f5ff; font-size: 10px; line-height: 1.6; }

.empty-state { padding: 65px 20px; text-align: center; color: var(--muted); }
.empty-state .empty-icon { width: 49px; height: 49px; display: grid; place-items: center; margin: 0 auto 14px; color: var(--primary); border-radius: 15px; background: #eef0ff; font-size: 23px; }
.empty-state h3 { margin: 0 0 7px; color: var(--ink); font-size: 15px; }
.empty-state p { margin: 0 0 18px; font-size: 11px; }

.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 12px; background: rgba(13,23,42,.46); backdrop-filter: blur(7px); z-index: 50; animation: fadeIn .18s ease; }
.modal { width: min(94vw, 480px); max-width:100%; box-sizing:border-box; max-height: min(700px, 92vh); overflow: auto; padding: 25px; border: 1px solid rgba(255,255,255,.5); border-radius: 19px; background: #fff; box-shadow: 0 28px 70px rgba(14,24,49,.25); animation: modalUp .2s ease; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 21px; }
.modal-head h2 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.03em; }
.modal-head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.modal-close { width: 28px; height: 28px; color: #8d99aa; border-radius: 8px; background: #f4f6f9; font-size: 17px; }
.modal-body { display: grid; gap: 15px; }
.modal-field { display: grid; gap: 7px; }
.modal-field label { color: #768196; font-size: 10px; font-weight: 700; }
.modal-field input, .modal-field select { width: 100%; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #eff2f6; }
.drop-zone { padding: 25px 18px; color: #8794a8; border: 1px dashed #cdd4e1; border-radius: 12px; background: #fafbfe; text-align: center; cursor: pointer; transition: .2s; }
 .drop-zone.dragging { color: var(--primary); border-color: #aeb6fa; }
@media(hover:hover){.drop-zone:hover{ color: var(--primary); border-color: #aeb6fa; }}
.drop-zone strong { display: block; margin: 9px 0 5px; color: #5f6d84; font-size: 11px; }
.drop-zone small { font-size: 9px; }
.drop-icon { font-size: 25px; }
.preview-file { display: none; align-items: center; gap: 12px; padding: 10px 12px; margin-top: 10px; border-radius: 10px; background: #f2f4fa; font-size: 10px; }
.preview-file.show { display: flex; }
.preview-file img { width: 58px; height: 58px; object-fit: contain; border-radius: 10px; background:#fff; box-shadow:0 3px 10px rgba(31,47,82,.08); }
.preview-file { position: relative; padding-right: 42px; }
.preview-file span { min-width: 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.preview-clear { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; color: #5f6d84; background: #e1e6f0; font-size: 20px; line-height: 26px; cursor: pointer; }
 .preview-clear:focus-visible { color: #fff; background: #6672ff; }
@media(hover:hover){.preview-clear:hover{ color: #fff; background: #6672ff; }}
.preview-clear:focus-visible { outline: 2px solid var(--ui-line-focus); outline-offset: 2px; }
.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: grid; gap: 9px; }
.toast { min-width: 240px; padding: 12px 14px; color: #fff; border-radius: 11px; background: #16233a; box-shadow:none; font-size: 11px; animation: toastIn .22s ease; }
.toast.success { border-left: 3px solid #48c990; }
.toast.error { border-left: 3px solid var(--danger); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalUp { from { opacity: 0; transform: translateY(11px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(15px); } to { opacity: 1; transform: none; } }

.sidebar-overlay { display:none; }
@media (max-width: 1240px) {
  .content, .topbar { padding-left: 30px; padding-right: 30px; }
  .asset-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 15px 0 40px rgba(12,24,49,.15); }
  .sidebar.open { transform: none; }
  .sidebar-overlay { position:fixed; inset:0; z-index:19; display:block; padding:0; border:0; opacity:0; visibility:hidden; background:rgba(18,27,43,.28); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); transition:opacity .25s ease,visibility 0s linear .25s; }
  .sidebar.open + .sidebar-overlay { opacity:1; visibility:visible; transition:opacity .25s ease; }
  .main-shell { width: 100%; margin-left: 0; }
  .mobile-menu { display: block; }
  .topbar { gap: 15px; padding-left: 20px; padding-right: 20px; }
  .top-title { margin-right: auto; }
  .global-search { width: min(260px, 31vw); }
  .content { padding: 28px 20px 55px; }
  .dashboard-columns, .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .topbar { height: 76px; }
  .top-title h1 { font-size: 19px; }
  .top-actions { gap: 4px; }
  .global-search { display: none; }
  .top-icon { display: none; }
  .page-heading { display: block; }
  .heading-actions { margin-top: 16px; }
  .hero { padding: 25px 22px; }
  .hero h2 { font-size: 21px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { min-height: 100px; padding: 14px; }
  .stat-card strong { font-size: 21px; }
  .library-grid { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .asset-preview { height: 92px; background:#24334b; }
  .asset-preview img { width:58px; height:58px; }
  .table-head { display: none; }
  .table-row { grid-template-columns: 38px minmax(0, 1fr) 35px; gap: 9px; padding: 12px; }
  .table-url, .table-date { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .settings-card { padding: 18px; }
  .toast-root { right: 12px; left: 12px; bottom: 12px; }
  .toast { min-width: 0; }
}

/* Optional night mode */
body.dark {
  --ink: #edf1fb; --muted: #9ca8bb; --muted-2: #b9c2d2; --line: #28364d; --surface: #17243a; --canvas: #0d1729;
  --shadow: 0 16px 42px rgba(0,0,0,.18); --shadow-soft: 0 8px 24px rgba(0,0,0,.13);
}
body.dark .topbar { background: rgba(13,23,41,.84); border-color: #1c2a40; }
body.dark .global-search, body.dark .btn, body.dark .icon-btn, body.dark .toolbar, body.dark .card, body.dark .inner-search, body.dark .form-field input, body.dark .form-field select { background: var(--surface); border-color: var(--line); color: var(--ink); }
body.dark .global-search input, body.dark .inner-search input, body.dark .form-field input, body.dark .form-field select { color: var(--ink); }
body.dark .global-search kbd, body.dark kbd { color: #9ca8bb; background: #1d2b42; border-color: #32425d; }
body.dark .library-card-header, body.dark .table-head { background: #142138; border-color: var(--line); }
body.dark .library-list-row, body.dark .table-row, body.dark .tile-footer { border-color: #24334b; }
@media(hover:hover){body.dark .library-list-row:hover:not(:where(:has(button:hover,a:hover))), body.dark .table-row:hover { color:var(--ui-feedback-ink); }}
body.dark .filter-pills, body.dark .asset-badge, body.dark .tile-arrow { background: #202e47; }
body.dark .filter-pill.active { background: #2a3854; }
body.dark .group-pill { background: var(--surface); border-color: var(--line); }
body.dark .modal { background: #17243a; border-color: #32425d; }
body.dark .modal-close, body.dark .drop-zone { background: #202e47; border-color: #3b4d69; color: #b7c2d3; }
body.dark .security-note { background: #222c4b; color: #b8c0da; }
body:not(.dark) .sidebar { color:#5d6a7f; background:linear-gradient(170deg,#ffffff 0%,#f4f7fc 100%); border-right:1px solid #e3e8f1; }
body:not(.dark) .brand-copy strong { color:#162033; }
body:not(.dark) .brand-copy span, body:not(.dark) .nav-label { color:#8793a6; }
body:not(.dark) .repo-switcher { color:#34435b; border-color:#e2e7f0; background:#fff; }
body:not(.dark) .repo-meta b { color:#1b273b; }
body:not(.dark) .repo-meta small, body:not(.dark) .chevron { color:#8491a5; }
body:not(.dark) .nav-item { color:#68758a; }
@media(hover:hover){body:not(.dark) .nav-item:hover { color:#34435b;  }}
body:not(.dark) .storage-card { border-color:#e1e7f0; background:#fff; }
body:not(.dark) .storage-card strong { color:#26344b; }
body:not(.dark) .storage-card small, body:not(.dark) .user-chip small { color:#8793a6; }
body:not(.dark) .user-chip b { color:#26344b; }
.auth-theme-button { position:absolute; top:25px; right:25px; z-index:2; }
.auth-theme-button .theme-icon { width:19px; height:19px; }

.sidebar-close { display: none; }
@media (max-width: 980px) {
  .brand { position: relative; padding-right: 42px; }
  .sidebar-close { position: absolute; top: -3px; right: 1px; width: 31px; height: 31px; display: grid; place-items: center; color: #b7c4d8; border: 1px solid rgba(187,204,230,.2); border-radius: 9px; background: rgba(255,255,255,.07); font-size: 22px; line-height: 1; }
  @media(hover:hover){.sidebar-close:hover { color: #fff; }}
}

/* Light sidebar: preserve contrast for the active blue-violet navigation state. */
body:not(.dark) .nav-item.active { color:#fff; background:linear-gradient(90deg,#4758d8 0%,#6655c8 100%); box-shadow:0 8px 18px rgba(67,82,200,.28); font-weight:700; }
body:not(.dark) .nav-item.active .nav-icon, body:not(.dark) .nav-item.active .nav-count { color:#fff; opacity:1; font-weight:800; text-shadow:0 1px 1px rgba(18,25,88,.28); }
body:not(.dark) .nav-count { color:#5c6b80; font-weight:600; }
body:not(.dark) .sidebar-bottom { border-top:1px solid #dfe6f0; }
body:not(.dark) .user-chip { color:#25354d; }

/* Authentication follows the selected appearance and keeps its control outside the card. */
.auth-theme-button { width:42px; height:42px; display:grid; place-items:center; color:#dce6ff; border:1px solid rgba(179,197,239,.38); border-radius:12px; background:rgba(13,25,48,.72); box-shadow:0 8px 24px rgba(0,0,0,.18); cursor:pointer; }
@media(hover:hover){.auth-theme-button:hover { color:#fff; border-color:#aab8ff; background:rgba(47,62,112,.84); }}
.auth-theme-button:focus-visible { outline:2px solid var(--ui-line-focus); outline-offset:3px; }
body:not(.dark) .auth-screen, body:not(.dark) .auth-page { color:#1b2a43; background:radial-gradient(circle at 13% 12%,rgba(101,112,255,.17),transparent 29%),radial-gradient(circle at 88% 82%,rgba(38,171,169,.12),transparent 25%),#f4f7ff; }
body:not(.dark) .auth-grid { opacity:.38; }
body:not(.dark) .auth-card { background:rgba(255,255,255,.9); border-color:#d8e0f0; box-shadow:0 28px 70px rgba(52,70,118,.18); }
body:not(.dark) .auth-brand strong, body:not(.dark) .auth-card h2 { color:#17243b; }
body:not(.dark) .auth-brand small, body:not(.dark) .auth-note { color:#64738b; }
body:not(.dark) .auth-card p, body:not(.dark) .first-use-guide { color:#42536d; }
body:not(.dark) .first-use-guide { border-color:#d8e0ee; background:#f7f9fd; }
body:not(.dark) .first-use-guide summary, body:not(.dark) .first-use-guide b { color:#4657ba; }
body:not(.dark) .first-use-guide ol { color:#53647c; }
body:not(.dark) .auth-theme-button { color:#273a59; border-color:#c7d2e6; background:rgba(255,255,255,.92); box-shadow:0 8px 24px rgba(52,70,118,.16); }
body.auth-page, body:has(.auth-page) { min-height:100vh; min-height:100dvh; }
@media (max-width:600px) { body:has(.auth-page) { background:#0d1729; } body:not(.dark):has(.auth-page) { background:#f4f7ff; } .auth-page { min-height:100dvh; padding-top:calc(18px + env(safe-area-inset-top)); padding-bottom:calc(18px + env(safe-area-inset-bottom)); } }
@media(hover:hover){body:not(.dark) .auth-theme-button:hover { color:#263ab7; border-color:#8797df; background:#fff; }}

@media (max-width:700px){.dashboard-columns{margin-top:28px}.dashboard-columns>section+section{margin-top:26px}}

/* Keep the translucent topbar and extend its background through the safe area. */
.topbar::before { content:""; position:absolute; left:0; right:0; bottom:100%; height:env(safe-area-inset-top); background:inherit; border-bottom:inherit; pointer-events:none; }
body.dark .topbar::before { background:rgba(13,23,41,.84); border-bottom-color:#1c2a40; }

/* Settings info rows use the same quiet theme divider in both modes. */
.info-list { gap:0; padding:4px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.info-row { min-height:42px; box-sizing:border-box; padding:11px 0; border-bottom:1px solid var(--line); }
.info-row:last-child { border-bottom:0; }
.info-list > .btn { display:inline-flex; margin:10px 0; }
body.dark .info-list { border-color:#2a3952; }
body.dark .info-row { border-color:#2a3952; }
@media(max-width:700px){ .info-row { gap:12px; padding:11px 0; } .info-row b { max-width:58%; } .info-list > .btn { width:100%; justify-content:center; margin:12px 0; } }
