/* OAuth login and real-data controls */
.auth-screen { background: #0d1729; }
.auth-screen .sidebar, .auth-screen .topbar { display:none; }
.auth-screen .main-shell { width:100%; margin-left:0; }
.auth-screen .content { max-width:none; min-height:100vh; padding:0; }
.auth-page { min-height:100vh; min-height:100dvh; position:relative; display:grid; place-items:center; overflow:hidden; padding:calc(30px + env(safe-area-inset-top)) 18px calc(30px + env(safe-area-inset-bottom)); box-sizing:border-box; color:#f6f3e7; background:radial-gradient(circle at 13% 12%,rgba(115,128,255,.18),transparent 29%),radial-gradient(circle at 88% 82%,rgba(51,199,197,.11),transparent 25%),#0d1729; }
.auth-grid { position:absolute; inset:0; opacity:.28; background-image:linear-gradient(rgba(164,184,215,.1) 1px,transparent 1px),linear-gradient(90deg,rgba(164,184,215,.1) 1px,transparent 1px); background-size:82px 82px; mask-image:linear-gradient(to bottom,transparent,#000 22%,#000 78%,transparent); }
.auth-card { position:relative; width:min(490px,100%); padding:31px 32px 29px; border:1px solid rgba(156,175,224,.27); border-radius:22px; background:rgba(10,19,35,.76); box-shadow:0 28px 90px rgba(0,0,0,.34); backdrop-filter:blur(12px); }
.auth-brand { display:flex; align-items:center; gap:11px; margin-bottom:41px; }
.auth-head-actions { display:flex; align-items:center; gap:7px; margin-left:auto; flex:0 0 auto; }
.auth-brand .auth-theme-button { position:static; margin-left:0; flex:0 0 auto; }
.auth-head-actions .project-link { margin:0; padding:0; width:42px; height:42px; display:grid; place-items:center; border-radius:12px; }
.auth-head-actions .project-github-icon { width:21px; height:21px; }
.auth-brand .brand-mark { width:42px; height:42px; border-radius:13px; font-size:22px; }
.auth-brand strong { display:block; color:#fff; font-size:14px; letter-spacing:.14em; }
.auth-brand small { display:block; margin-top:5px; color:#7f90aa; font-size:9px; letter-spacing:.18em; }
.auth-kicker { display:inline-flex; padding:10px 13px; margin-bottom:18px; color:#9ca8ff; border:1px solid #4e5ca7; border-radius:11px; font-size:10px; font-weight:800; letter-spacing:.15em; }
.auth-card h2 { margin:0 0 14px; color:#fff; font-size:30px; letter-spacing:-.04em; }
.auth-card p { margin:0 0 27px; color:#b4bfd3; font-size:13px; line-height:1.8; }
.auth-card .btn-github { width:100%; height:49px; color:#fff; border:0; border-bottom:0; border-radius:12px; background:linear-gradient(135deg,#6671fc,#5860df); box-shadow:0 13px 27px rgba(93,107,235,.2); text-decoration:none; font-size:13px; }
@media(hover:hover){.auth-card .btn-github:hover { color:#fff; background:linear-gradient(135deg,#6671fc,#5860df); }}
.auth-card .btn-github.disabled-link { opacity:.5; pointer-events:auto; }
.github-logo { width:22px; height:22px; display:grid; place-items:center; color:#182334; border:2px solid currentColor; border-radius:50%; font-size:9px; }
.auth-note { display:block; margin-top:17px; color:#74839d; font-size:10px; line-height:1.7; }
.tile-actions { display:flex; gap:7px; padding-top:11px; margin-top:13px; border-top:1px solid #f0f2f6; }
.asset-card { position:relative; }
.asset-card.selected { outline:2px solid var(--ui-line-focus); }
.asset-select { flex:0 0 auto; width:21px; height:21px; display:grid; place-items:center; padding:0; color:#8794a9; border:1px solid rgba(196,204,222,.9); border-radius:6px; background:var(--surface); box-shadow:0 3px 9px rgba(30,47,83,.08); font-size:11px; font-weight:800; }
.asset-name-row { display:flex; align-items:center; gap:6px; min-width:0; }
.asset-name-row b { min-width:0; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.select-counter { color:var(--primary); font-size:10px; font-weight:700; }
.connection-badge { display:flex; align-items:center; gap:7px; color:#49a77b; font-size:10px; font-weight:700; }
.account-panel { display:flex; align-items:center; gap:10px; padding:13px; margin:4px 0 16px; border-radius:11px; background:#f4f6fb; }
.account-panel > div:last-child { display:grid; gap:4px; }
.account-panel b { color:var(--ink); font-size:11px; }
.account-panel small { color:var(--muted); font-size:10px; }
.account-login { display:block; margin-top:3px; color:#71829e; font-size:10px; font-weight:400; }
.user-avatar img { width:100%; height:100%; object-fit:cover; border-radius:inherit; display:block; }
.account-modal-head { display:flex; align-items:center; gap:11px; }
.account-modal-head img { width:38px; height:38px; object-fit:cover; border-radius:12px; }
.account-modal-head h2 { margin:0; }
.account-modal-head p { margin:4px 0 0; }
.asset-detail-preview { min-height:220px; display:grid; place-items:center; overflow:hidden; border-radius:14px; background:linear-gradient(135deg,#f4f6ff,#eaf8f5); }
.asset-detail-preview img { width:155px; height:155px; object-fit:contain; border-radius:27px; box-shadow:0 18px 35px rgba(34,54,100,.14); }
.row-actions { display:flex; justify-content:flex-end; gap:5px; }
.row-actions .icon-btn { width:27px; height:27px; font-size:13px; }
body.dark .tile-actions { border-color:var(--line); }
body.dark .account-panel { background:#202e47; }
body.dark .account-panel b { color:var(--ink); }
@media (max-width:700px) {
  .auth-card { padding:25px 21px; }
  .auth-brand { margin-bottom:30px; }
  .auth-card h2 { font-size:25px; }
  .row-actions .icon-btn { width:25px; height:25px; }
}

.auth-card .btn-github.preview-login { opacity: 1; cursor: pointer; }
.auth-card .btn-github.preview-login:active { transform: translateY(1px); }

.repo-switcher { position:relative; text-align:left; cursor:pointer; }
.repo-switcher:focus-visible { outline:2px solid var(--ui-line-focus); outline-offset:2px; }
.repo-label { color:#93a1bd; font-size:9px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
.repo-status-dot { width:9px; height:9px; display:inline-block; margin:0 0 1px 7px; border-radius:50%; background:#ff4d5f; box-shadow:0 0 0 4px rgba(255,77,95,.12),0 0 12px rgba(255,77,95,.3); vertical-align:middle; transition:background .2s,box-shadow .2s; }
.repo-status-dot.connected { background:#35d48a !important; box-shadow:0 0 0 4px rgba(53,212,138,.14),0 0 12px rgba(53,212,138,.38) !important; }
.repo-open-icon { width:17px; height:17px; flex:0 0 17px; fill:none; stroke:#aebaff; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; opacity:.8; }
@media(hover:hover){.repo-switcher:hover .repo-open-icon { opacity:1; transform:translate(1px,-1px); }}
.repo-quick-list { display:flex; flex-wrap:wrap; gap:7px; margin:0 0 12px; }
.repo-quick { max-width:100%; overflow:hidden; padding:8px 10px; color:#7c89a0; border:1px solid var(--line); border-radius:8px; background:#fbfcfe; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.settings-grid > .settings-card:first-child > .btn { display:inline-flex; margin:2px 6px 14px 0; vertical-align:middle; }
.settings-grid > .settings-card:first-child > form { clear:both; }
@media(max-width:700px){ .settings-grid > .settings-card:first-child > .btn { margin-right:4px; margin-bottom:12px; padding-left:10px; padding-right:10px; font-size:10px; } }
 .repo-quick.active { color:var(--primary); border-color:#bfc6fd;  }
@media(hover:hover){.repo-quick:not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):hover{ color:var(--primary); border-color:#bfc6fd;  }}
body.dark .repo-quick { background:#202e47; border-color:var(--line); color:#b7c2d3; }

.token-login-link { display:block; margin:15px auto 0; padding:6px 10px; color:#8f9db4; background:transparent; font-size:10px; text-decoration:underline; cursor:pointer; }
@media(hover:hover){.token-login-link:hover { color:#b6c0ff; }}

.admin-code { padding:14px; overflow:auto; color:#cbd6ea; border-radius:10px; background:#111d31; font:11px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace; white-space:pre-wrap; }

.policy-toggle { display:flex; align-items:center; gap:9px; color:var(--ink); font-size:13px; font-weight:500; line-height:1.4; cursor:pointer; -webkit-tap-highlight-color:transparent; }
/* Match the site's 22px SVG selection controls while retaining native semantics. */
.policy-toggle input[type="checkbox"] { -webkit-appearance:none; appearance:none; position:relative; flex:0 0 22px; width:22px; height:22px; margin:0; padding:0; border:1.5px solid var(--line); border-radius:6px; background:var(--surface); cursor:pointer; }
.policy-toggle input[type="checkbox"]:checked { border-color:var(--primary); background-color:var(--primary); background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 4 4L19 6' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-position:center; background-repeat:no-repeat; background-size:16px 16px; }
.policy-toggle input[type="checkbox"]:disabled { cursor:not-allowed; }
.policy-toggle:has(input:disabled),.policy-toggle input:disabled { cursor:not-allowed; }
.policy-toggle:has(input:disabled) { opacity:.5; }
#adminPolicyForm>.field-help { font-size:9px!important; line-height:1.5!important; -webkit-text-size-adjust:100%; text-size-adjust:100%; }
.policy-description { margin:8px 0 16px; color:var(--muted); font-size:12px; line-height:1.6; -webkit-text-size-adjust:100%; text-size-adjust:100%; }

.remember-token { display:flex; align-items:center; gap:8px; margin-top:12px; color:#7f8da4; font-size:10px; }
.remember-token input { width:16px; height:16px; margin:0; accent-color:var(--primary); cursor:pointer; }
.remember-token span { cursor:default; user-select:none; }

.token-input-wrap { position:relative; display:flex; align-items:center; }
.token-input-wrap input { width:100%; padding-right:52px; text-overflow:ellipsis; white-space:nowrap; }
/* While editing, show the real caret at the end instead of the overflow ellipsis. */
.token-input-wrap input:focus { text-overflow:clip; }
.token-eye { position:absolute; right:9px; width:30px; height:30px; display:grid; place-items:center; padding:0; color:#8b98aa; border:0; border-radius:8px; outline:0; background:transparent; box-shadow:none; -webkit-appearance:none; -webkit-tap-highlight-color:transparent; font-size:16px; cursor:pointer; }
 .token-eye:focus, .token-eye:active { color:var(--primary); border:0; outline:0; background:transparent; box-shadow:none; }
@media(hover:hover){.token-eye:hover{ color:var(--primary); border:0; outline:0; background:transparent; box-shadow:none; }}

.content > .stat-grid { margin-bottom:24px; }
.overview-assets-section { margin-top:24px; }
.quick-assets-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:14px; padding:16px; }
.quick-asset { min-width:0; cursor:pointer; }
.quick-asset-image { position:relative; height:108px; display:grid; place-items:center; overflow:hidden; border-radius:11px; background:#f2f5fb; }
.quick-asset-image img { width:68px; height:68px; object-fit:contain; border-radius:14px; }
.quick-asset b,.quick-asset small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.quick-asset b { margin-top:9px; font-size:10px; }
.quick-asset small { margin-top:4px; color:var(--muted); font-size:9px; }
.quick-asset-name-row { display:flex; align-items:center; gap:5px; min-width:0; margin-top:9px; }
.quick-asset-name-row b { flex:1; min-width:0; margin-top:0; }
.quick-empty { padding:0; }
@media(max-width:700px){.quick-assets-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.quick-asset-image{height:90px}.quick-asset-image img{width:54px;height:54px}}

.modal-back-link { display:inline-block; margin-bottom:4px; font-size:10px; }
.quick-asset-image { cursor:pointer; }
.quick-asset-name-row b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.top-actions .appearance-button, .top-actions .github-repo-link { display:inline-grid!important; place-items:center; width:40px; height:36px; border:1px solid var(--line); border-radius:18px; background:var(--surface); color:var(--ink); font-size:20px; }
.top-actions .github-repo-link { font-size:17px; }
.choice-menu { display:grid; gap:12px; }.choice-menu .btn { min-height:44px; justify-content:space-between; }
.page-back { margin-bottom:16px; }.user-chip button.more { background:transparent; color:#9aa9c0; min-width:40px; min-height:40px; cursor:pointer; }
body.dark .quick-asset-image {background:#24334b}body.dark .modal-field input,body.dark .modal-field select{background:#202e47;color:#edf1fb;border-color:#3b4d69}
body.dark .json-reference-thumb,body.dark .library-preview-tile {background:#24334b}

.top-avatar { border:0; cursor:pointer; }
@media(hover:hover){.top-avatar:hover { transform:translateY(-1px); filter:brightness(1.06); }}

.account-repo-path { padding:10px 12px; color:var(--muted); border:1px solid var(--line); border-radius:9px; background:var(--canvas); font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.appearance-button { font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight:500; line-height:1; }

.project-link { display:flex; align-items:center; justify-content:center; gap:8px; margin:14px 0 2px; padding:9px; color:#8d9bb1; border:1px solid rgba(141,155,177,.3); border-radius:9px; font-size:10px; text-decoration:none; }
@media(hover:hover){.project-link:hover { color:#b7c2ff; border-color:#7885ff;  }}
.project-link span { font-size:17px; line-height:1; }
.project-github-icon { width:18px; height:18px; display:block; fill:currentColor; }

.theme-sun-icon { width:14px; height:14px; display:block; position:relative; border:2px solid currentColor; border-radius:50%; }
.theme-sun-icon::before, .theme-sun-icon::after { content:""; position:absolute; inset:-5px; background:conic-gradient(from 0deg, currentColor 0 8deg, transparent 8deg 37deg, currentColor 37deg 45deg, transparent 45deg 82deg, currentColor 82deg 90deg, transparent 90deg 127deg, currentColor 127deg 135deg, transparent 135deg 172deg, currentColor 172deg 180deg, transparent 180deg 217deg, currentColor 217deg 225deg, transparent 225deg 262deg, currentColor 262deg 270deg, transparent 270deg 307deg, currentColor 307deg 315deg, transparent 315deg 352deg, currentColor 352deg 360deg); mask:radial-gradient(circle,transparent 0 57%,#000 59% 67%,transparent 69%); }
.theme-sun-icon::after { transform:rotate(22.5deg); }
.theme-icon, .github-repo-link svg { width:19px; height:19px; display:block; fill:currentColor; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.github-repo-link svg { width:20px; height:20px; stroke:none; }
.first-use-guide { margin-top:18px; padding:13px 14px; border:1px solid rgba(141,155,177,.24); border-radius:10px; background:rgba(255,255,255,.055); color:#b4bfd3; font-size:11px; line-height:1.65; }
.first-use-guide strong { display:block; color:#eef2ff; margin-bottom:4px; }
.first-use-guide p { margin:0 0 3px; color:#b4bfd3; font-size:11px; line-height:1.65; }
.first-use-guide small { display:block; color:#8998b0; font-size:10px; line-height:1.6; }
.first-use-guide b { color:#d9deff; }
.first-use-guide details { margin-top:9px; }
.first-use-guide summary { color:#bfc8ff; cursor:pointer; font-weight:700; }
.first-use-guide ol { margin:7px 0 0 18px; padding:0; color:#9eabc2; }
.first-use-guide li { margin:3px 0; }

/* Mobile Safari safe-area full-bleed auth background */
.auth-screen { min-height:100vh; min-height:100dvh; background:#0d1729; }
.auth-screen .main-shell, .auth-screen .content { min-height:100vh; min-height:100dvh; }
@media (max-width:700px){
  .auth-page { min-height:100svh; min-height:100dvh; width:100%; padding-top:max(22px, env(safe-area-inset-top)); padding-bottom:max(22px, env(safe-area-inset-bottom)); }
  .auth-card { margin:0; }
}
body:not(.dark) .auth-screen { background:#f7f9ff; }

.theme-glyph { width:22px; height:22px; display:inline-grid; place-items:center; color:currentColor; font:500 22px/1 ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.auth-card .btn-github:not(:disabled) { opacity:1; filter:none; color:#fff; background:linear-gradient(135deg,#6671fc,#5860df); }
/* Consistent navigation and topbar controls */
.main-nav .nav-icon{width:20px;height:20px;display:inline-grid;place-items:center;font-size:17px;line-height:1;flex:0 0 20px}
.main-nav .nav-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.action-icon{display:inline-block;width:16px;text-align:center;font-size:14px;line-height:1}
.repo-meta b{overflow:visible;white-space:normal;display:flex;align-items:center}
.repo-status-dot{width:9px;height:9px;min-width:9px;flex:0 0 9px;overflow:visible}
.top-actions .appearance-button,.top-actions .github-repo-link{border-radius:10px}

.token-guide-button { display:inline-flex; align-items:center; gap:5px; padding:3px 0; margin:18px 0 12px; color:#4f5bd7; border:0; border-radius:0; background:transparent; text-align:left; font-size:11px; font-weight:700; cursor:pointer; }
.token-guide-arrow { width:14px; height:14px; display:inline-grid; place-items:center; flex:0 0 14px; font-size:17px; line-height:1; transform:rotate(-90deg); }
@media(hover:hover){.token-guide-button:hover { color:#3546c5; border-color:transparent; background:transparent; }}
.token-guide-body { color:var(--ink); font-size:12px; line-height:1.8; }
.token-guide-body ol { margin:0; padding-left:20px; }
body.dark .token-guide-button { color:#c4caff; border-color:transparent; background:transparent; }
@media(hover:hover){body.dark .token-guide-button:hover { color:#e0e3ff; background:transparent; }}
body.dark .token-guide-body { color:#e8edf7; }

/* Keep dashboard sections visually separated on mobile */
.dashboard-columns { margin-top:28px; grid-template-columns:minmax(0,1fr); }
.dashboard-columns > section + section { margin-top:0; }
.overview-assets-section + .dashboard-columns { margin-top:24px; }

.token-guide-button { -webkit-tap-highlight-color:transparent; }

/* Upload modal controls stay consistent across themes and taps */
.modal button,.modal select { -webkit-tap-highlight-color:transparent; }
.modal button:active,.modal button:focus { outline:0; }
.preview-file img { background:linear-gradient(135deg,#f4f6ff,#eef8f7); }
body.dark .preview-file { background:#202e47; color:#edf1fb; }
body.dark .preview-file img { background:linear-gradient(135deg,#2b3a55,#243c4a); }
body.dark .modal-actions { border-top-color:#34445f; }
body.dark select { color-scheme:dark; }

/* Detail previews and icon actions follow the selected theme */
body.dark .asset-detail-preview { background:linear-gradient(135deg,#253650,#203d49); }
body.dark .table-icon { background:#273751; }
/* JSON workspace only: compact library picker and one-row references. */
.json-workspace { padding:16px 20px; margin-bottom:18px; }
.json-workspace-top { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.library-picker { display:flex; min-width:0; flex:1; align-items:center; gap:10px; padding:0; border:0; color:var(--ink); text-align:left; background:transparent; cursor:pointer; }
.library-picker .library-logo { flex:0 0 auto; }
.library-picker-copy { display:grid; min-width:0; flex:0 1 auto; gap:2px; }
.library-picker-copy small,.library-picker-copy em { overflow:hidden; color:var(--muted); font-size:10px; font-style:normal; text-overflow:ellipsis; white-space:nowrap; }
.library-picker-copy b { overflow:hidden; font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.library-picker-arrow { flex:0 0 auto; margin-left:6px; color:var(--muted); font-size:15px; line-height:1; }
.json-workspace-actions { display:flex; flex-wrap:nowrap; justify-content:flex-end; gap:8px; }
.json-workspace-actions .btn { flex:1 1 0; min-width:0; text-align:center; }
.json-delete-library { margin-left:auto; color:var(--ui-danger-ink); }
.json-references .section-row { margin-bottom:12px; }
.json-reference-toolbar { margin-bottom:18px; }
.json-reference-list { overflow:hidden; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
.json-reference-row { display:flex; align-items:center; gap:12px; min-width:0; padding:10px 13px; border-bottom:1px solid var(--line); }
.json-reference-row:last-child { border-bottom:0; }
.json-reference-row > img { width:42px; height:42px; flex:0 0 auto; padding:5px; object-fit:contain; border-radius:9px; background:#f4f6ff; }
.json-reference-row { cursor:pointer; }
.json-icon-detail-preview { width:100%; min-height:220px; display:grid; place-items:center; padding:18px; border:1px solid var(--line); border-radius:12px; background:#f4f6ff; }
.json-icon-detail-preview img { width:100%; height:220px; object-fit:contain; }
body.dark .json-icon-detail-preview { border-color:#3b4d69; background:#24334b; }
.json-reference-copy { display:grid; min-width:0; gap:4px; flex:1; }
.json-reference-copy b,.json-reference-copy small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.json-reference-copy b { font-size:12px; }.json-reference-copy small { color:var(--muted); font-size:9px; }
.json-reference-status { display:inline-flex; align-items:center; gap:5px; color:var(--muted); font-size:9px; white-space:nowrap; }
.json-reference-actions { display:flex; gap:6px; }.json-reference-actions .icon-btn { width:29px; height:29px; font-size:13px; }
.json-library-summary { margin:12px 0 0; padding:0; border:0; border-radius:0; background:transparent; color:var(--muted); font-size:10px; line-height:1.6; overflow-wrap:anywhere; }
.library-picker-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:9px; }
.library-picker-heading h3 { margin:0; font-size:11px; font-weight:500; }
.library-picker-list { display:grid; gap:7px; }
.library-picker-option { display:flex; align-items:center; gap:10px; width:100%; padding:10px; color:var(--ink); border:1px solid var(--line); border-radius:10px; text-align:left; background:var(--canvas); cursor:pointer; }
.library-picker-option.selected { border-color:var(--primary); }.library-picker-option > span:nth-child(2) { display:grid; min-width:0; gap:4px; flex:1; }.library-picker-option b,.library-picker-option small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.library-picker-option b { font-size:12px; }.library-picker-option small { color:var(--muted); font-size:9px; }.library-picker-option em { padding:3px 6px; color:var(--primary); border-radius:6px; background:#e8ebff; font-size:9px; font-style:normal; }.library-picker-option i { color:var(--muted); font-size:18px; font-style:normal; }
.library-picker-create { width:100%; margin-top:14px; padding:11px; color:var(--primary); border:1px dashed #aeb7f7; border-radius:10px; background:transparent; font-weight:700; cursor:pointer; }
body.dark .json-reference-list,.dark .library-picker-option { border-color:#3b4d69; background:#202e47; } body.dark .library-picker-option.selected { border-color:#7785e8; } body.dark .json-reference-row > img { background:#24334b; }
@media(max-width:700px) { .json-workspace { padding:13px; }.json-workspace-top { align-items:stretch; flex-direction:column; gap:12px; }.json-workspace-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }.json-workspace-actions .btn { min-width:0; padding:7px 4px; font-size:9px; }.json-reference-row { gap:8px; padding:9px; }.json-reference-row > img { width:36px; height:36px; }.json-reference-status { display:none; }.json-reference-actions { gap:3px; }.json-reference-actions .icon-btn { width:27px; height:27px; }.library-picker-copy em { max-width:220px; } }

/* Prevent iOS native pressed highlight on controls */
button,.btn,.icon-btn,.text-link,.nav-item,.asset-select,.asset-copy,.quick-copy,input,select,textarea { -webkit-appearance:none; appearance:none; -webkit-tap-highlight-color:rgba(0,0,0,0); touch-action:manipulation; }
/* Non-button click targets: remove native gray flash only; preserve appearance and gestures. */
.drop-zone,.repo-switcher,.asset-card,.library-list-row,.library-empty-row { -webkit-tap-highlight-color:transparent; }

.remember-token input { -webkit-appearance:none; appearance:none; position:relative; width:18px; height:18px; margin:0; border:1px solid #aeb8c8; border-radius:5px; background:#fff; vertical-align:middle; }
.remember-token input:checked { border-color:var(--primary); background:var(--primary); }
.remember-token input:checked::after { content:""; position:absolute; left:5px; top:2px; width:5px; height:9px; border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg); }
body.dark .remember-token input { border-color:#536681; background:#202e47; }
body.dark .remember-token input:checked { border-color:#6672d8; background:#5260bf; box-shadow:none; }
body.dark .remember-token input:checked::after { border-color:#dfe3f6; }

body.dark .asset-preview { background:#24334b; }
body.dark .library-detail-image { background:#24334b; }

/* Unified JSON-library workspace and resource gallery parity. */
.asset-card { padding:9px; overflow:hidden; cursor:pointer; }
.asset-preview { height:128px; background:linear-gradient(135deg,#f4f6ff,#eef8f7); }
.asset-preview img { width:74px; height:74px; object-fit:contain; background:transparent; }
.asset-details { padding:11px 3px 2px; }
.asset-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:8px; }
body.dark .asset-preview { background:#24334b; }
.json-workspace { padding:20px; margin-bottom:18px; }
.json-workspace-top { display:flex; align-items:end; justify-content:space-between; gap:16px; }
.library-selector { display:grid; gap:6px; min-width:min(100%,330px); color:var(--muted); font-size:10px; font-weight:700; }
.library-selector select { width:100%; min-height:38px; padding:0 32px 0 11px; color:var(--ink); border:1px solid var(--line); border-radius:9px; background:var(--canvas); font:inherit; font-size:12px; }
.json-workspace-actions { display:flex; flex-wrap:nowrap; justify-content:flex-end; gap:8px; }
.json-workspace-actions .btn { flex:1 1 0; min-width:0; text-align:center; }
.json-delete-library { margin-left:auto; color:var(--ui-danger-ink); }
.json-references .section-row { margin-bottom:12px; }
.json-reference-toolbar { margin-bottom:18px; }
body.dark .library-selector select { color:var(--ink); border-color:#3b4d69; background:#202e47; }
@media(max-width:700px) {
  .asset-card { padding:7px; }
  .asset-preview { height:92px; }
  .asset-preview img { width:58px; height:58px; }
  .asset-details { padding:9px 2px 1px; }
  .asset-meta { gap:4px; margin-top:6px; }
  .json-workspace { padding:14px; }
  .json-workspace-top { align-items:stretch; flex-direction:column; gap:13px; }
  .library-selector { min-width:0; }
  .json-workspace-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); justify-content:stretch; gap:6px; }
  .json-workspace-actions .btn { min-width:0; padding-left:6px; padding-right:6px; font-size:9px; }
  .json-delete-library { flex:0 0 auto; }
}

.library-picker-row { display:flex; align-items:stretch; gap:7px; }
.library-picker-row .library-picker-option { flex:1; }
.library-picker-delete { width:auto; height:auto; flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; padding:6px 8px; color:var(--ui-danger-ink); border:0; border-radius:8px; background:transparent; font-size:12px; font-weight:600; white-space:nowrap; cursor:pointer; transition:background .12s,color .12s; }
@media(hover:hover){.library-picker-delete:hover { color:var(--ui-danger-ink); background:var(--ui-danger-bg); }}
.json-reference-copy small { color:var(--muted); }
body.dark .library-picker-delete { color:var(--ui-danger-ink); border:0; background:transparent; }

/* Keep login header actions visually balanced */
.auth-head-actions > .auth-theme-button,
.auth-head-actions > .project-link { width:42px; height:42px; display:grid; place-items:center; margin:0; padding:0; 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); }
@media(hover:hover){.auth-head-actions > .project-link:hover { color:#fff; border-color:#aab8ff;  }}
.auth-card form > .auth-note:last-child { margin-top:22px; color:#8b9ab3; }
body:not(.dark) .auth-head-actions > .auth-theme-button,
body:not(.dark) .auth-head-actions > .project-link { color:#273a59; border-color:#c7d2e6; background:rgba(255,255,255,.92); box-shadow:0 8px 24px rgba(52,70,118,.16); }
body:not(.dark) .auth-card form > .auth-note:last-child { color:#53647c; }

/* Login-card controls match the dark workspace theme control. */
body.dark .auth-head-actions > .auth-theme-button,
body.dark .auth-head-actions > .project-link { color:#edf1fb; border:1px solid #28364d; background:#17243a; box-shadow:none; }
@media(hover:hover){body.dark .auth-head-actions > .project-link:hover { color:#fff; border-color:#586bd8;  }}

.section-actions { display:flex; align-items:center; gap:8px; }
.reference-select { width:21px; height:21px; flex:0 0 21px; padding:0; border:1px solid #c4ccde; border-radius:6px; background:var(--surface); color:#fff; cursor:pointer; }
.json-reference-row.selected { color:var(--ui-selection-ink); }

/* Short-lived copy feedback and compact mobile actions. */
.btn.btn-danger { color:var(--ui-danger-ink) !important; border-color:var(--ui-danger-line) !important; background:var(--ui-danger-bg) !important; }
.section-actions .btn.btn-danger { color:var(--ui-danger-ink) !important; border-color:var(--ui-danger-line) !important; background:var(--ui-danger-bg) !important; }
.json-reference-actions { display:flex !important; flex:0 0 auto; align-items:center; flex-wrap:nowrap !important; white-space:nowrap; }
.json-reference-actions .icon-btn { flex:0 0 29px; }
@media(max-width:700px) {
  .json-reference-actions { gap:4px !important; }
  .json-reference-actions .icon-btn { width:29px !important; height:29px !important; }
  .section-actions { flex-wrap:nowrap; gap:6px; }
  .section-actions .btn { white-space:nowrap; }
  .section-actions .btn.btn-danger { color:var(--ui-danger-ink) !important; border-color:var(--ui-danger-line) !important; background:var(--ui-danger-bg) !important; }
  body.dark .btn.btn-danger, body.dark .section-actions .btn.btn-danger { color:var(--ui-danger-ink) !important; border-color:var(--ui-danger-line) !important; background:var(--ui-danger-bg) !important; }
}
/* Final compact controls: one-row actions. */
.json-reference-actions { display:flex !important; flex-direction:row !important; flex-wrap:nowrap !important; align-items:center; }
.section-actions { display:flex !important; flex-direction:row !important; flex-wrap:nowrap !important; align-items:center; gap:6px; }
.section-actions .btn { white-space:nowrap; }
@media(max-width:700px){
 .json-reference-row { gap:6px !important; padding-left:7px !important; padding-right:7px !important; }
 .json-reference-actions .icon-btn { width:27px !important; height:27px !important; }
 .section-actions { gap:4px !important; }
 .section-actions .select-counter { font-size:9px; white-space:nowrap; }
}
/* Scoped responsive layout fixes */
.repo-settings-actions,.repo-actions,.repository-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px;margin-bottom:14px}
.json-reference-actions [data-action="delete-icon"]{color:var(--ui-danger-ink)!important}
.assets-toolbar,.json-reference-toolbar{gap:8px;align-items:center}
.sort-control{position:relative;display:grid;grid-template-columns:auto auto;align-items:center;gap:7px;flex:0 0 auto;justify-self:start;width:max-content;max-width:100%;color:var(--muted);font-size:10px;font-weight:500;white-space:nowrap}
.sort-trigger{position:relative;min-height:34px;display:flex;align-items:center;gap:7px;padding:0 32px 0 11px;color:var(--ink);border:1px solid var(--line);border-radius:9px;background:var(--surface);font:inherit;font-size:11px;font-weight:500;white-space:nowrap;cursor:pointer}
.sort-trigger b{position:absolute;right:10px;top:50%;color:var(--muted);font-size:12px;line-height:1;transform:translateY(-50%);transition:transform .16s ease}
.sort-control.open .sort-trigger{box-shadow:none}
.sort-control.open .sort-trigger b{transform:translateY(-50%) rotate(180deg)}
.sort-menu{position:absolute;z-index:35;top:calc(100% + 7px);left:0;grid-column:2;display:none;width:max-content;min-width:148px;padding:6px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:0 16px 36px rgba(31,45,75,.16)}
.sort-menu.floating-menu{position:fixed;z-index:1200;display:grid;gap:2px;min-width:0;width:134px;box-sizing:border-box;overflow:auto;overscroll-behavior:contain;white-space:normal}
.sort-menu.floating-menu:focus-visible,.sort-menu.floating-menu button:focus-visible{box-shadow:none;outline:2px solid var(--muted);outline-offset:-2px}
.sort-option{width:100%;min-height:36px;display:grid;grid-template-columns:18px 1fr;align-items:center;gap:6px;padding:0 10px;color:var(--ink);border:0;border-radius:8px;background:transparent;text-align:left;font-size:11px;font-weight:500;cursor:pointer}
.sort-option span{color:var(--primary);font-weight:900}.sort-option.active{color:var(--primary)}
body.dark .sort-trigger,body.dark .sort-menu{color:var(--ink);border-color:#3b4d69;background:#202e47}body.dark .sort-option.active{color:var(--ui-selection-ink)}


.asset-bulk-actions{display:flex;gap:8px;align-items:center}
.modal-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
@media(max-width:700px){
 .json-workspace-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;width:100%;gap:6px!important;}
 .json-workspace-actions .btn{width:100%;padding-left:6px!important;padding-right:6px!important;}
 .assets-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto auto;}
 .assets-toolbar .inner-search{grid-column:1/-1}
 .assets-toolbar .toolbar-spacer{display:none}
 .assets-toolbar > [data-action="refresh"]{grid-column:auto}
 .json-reference-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;}
 .json-reference-toolbar .inner-search{grid-column:1/-1}
 .json-reference-toolbar .toolbar-spacer{display:none}
 .sort-control>span{display:none}
 .sort-control{grid-template-columns:auto}
 .sort-menu{grid-column:1}
 .sort-trigger{min-height:34px;padding:0 30px 0 10px}
 .asset-bulk-actions{grid-column:1/-1;display:flex;flex-wrap:wrap}
 .modal-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
 .modal-actions .btn{min-width:0;width:100%;white-space:nowrap;word-break:keep-all;overflow-wrap:normal}
}

/* Shared asset/JSON detail presentation. */
.detail-readonly { min-width:0; }
.detail-readonly b { display:block; margin-bottom:5px; color:#768196; font-size:10px; }
.detail-readonly p { margin:0; color:var(--ink); font:10px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace; overflow-wrap:anywhere; word-break:break-word; white-space:normal; }
.asset-detail-preview,.json-icon-detail-preview { width:min(100%,260px); aspect-ratio:1/1; min-height:0; height:auto; justify-self:center; padding:14px; box-sizing:border-box; }
.asset-detail-preview img,.json-icon-detail-preview img { width:100%; height:100%; max-width:100%; max-height:100%; object-fit:contain; border-radius:0; box-shadow:none; }
.modal:has(.asset-detail-actions),.modal:has(.icon-detail-actions),.modal:has(#bulkForm) { max-height:calc(100dvh - 32px); overflow-y:auto; overscroll-behavior:contain; }
.asset-detail-actions { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:7px!important; }
#bulkForm select { width:100%; min-width:0; max-width:100%; }
.icon-detail-actions { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:8px!important; }
.asset-detail-actions .btn,.icon-detail-actions .btn { width:100%; min-width:0; padding:0 7px; white-space:nowrap; }
.json-reference-actions [data-action="delete-icon"] { color:var(--ui-danger-ink)!important; border-color:var(--ui-danger-line)!important; background:var(--ui-danger-bg)!important; }
body.dark .json-reference-actions [data-action="delete-icon"] { color:var(--ui-danger-ink)!important; border-color:var(--ui-danger-line)!important; background:var(--ui-danger-bg)!important; }
@media(max-width:700px){
 .modal:has(.asset-detail-actions),.modal:has(.icon-detail-actions) { padding:18px; }
 .modal:has(.asset-detail-actions) .modal-head,.modal:has(.icon-detail-actions) .modal-head { margin-bottom:12px; }
 .modal:has(.asset-detail-actions) .modal-body,.modal:has(.icon-detail-actions) .modal-body { gap:10px; }
 .asset-detail-preview,.json-icon-detail-preview { width:min(100%,220px); padding:10px; }
 .asset-detail-actions,.icon-detail-actions { margin-top:12px!important; padding-top:12px!important; }
 .asset-detail-actions .btn,.icon-detail-actions .btn { height:36px; font-size:9px; }
}

/* Keep preview backplates, but never round the image itself. */
.quick-asset-image img,.asset-preview img,.json-reference-row>img,.cover-stack img,.table-icon img,.asset-detail-preview img,.json-icon-detail-preview img { border-radius:0!important; }
.quick-asset-image img,.asset-preview img,.json-reference-row>img,.table-icon img,.asset-detail-preview img,.json-icon-detail-preview img { object-fit:contain!important; }

/* JSON 引用缩略图与总览库封面。总览只展示，整行点击后进入库内操作。 */
.json-reference-thumb { width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; padding:5px; box-sizing:border-box; overflow:hidden; border-radius:9px; background:#f4f6ff; }
.json-reference-thumb img { width:100%; height:100%; object-fit:contain; border-radius:0!important; }
.library-list-row { display:grid; grid-template-columns:168px minmax(0,1fr) auto 34px; align-items:center; gap:13px; min-height:92px; padding:14px 16px; border-top:1px solid var(--line); position:relative; cursor:pointer; }
.library-empty-row { display:grid; grid-template-columns:52px minmax(0,1fr) 34px; align-items:center; gap:13px; min-height:86px; padding:14px 16px; border-top:1px solid var(--line); cursor:pointer; }
.library-empty-row .empty-icon { width:52px; height:52px; display:grid; place-items:center; color:#6875e4; border-radius:14px; background:#eef0ff; font-size:22px; }
.library-empty-row b,.library-empty-row small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.library-empty-row b { font-size:13px; }
.library-empty-row small { margin-top:5px; color:var(--muted); font-size:10px; }
.library-empty-row .tile-arrow { display:grid; place-items:center; width:34px; height:34px; color:#8b96aa; border-radius:10px; background:#f5f6fa; font-size:20px; }

.library-preview-strip { display:flex; align-items:center; gap:6px; width:168px; height:56px; overflow:hidden; }
.library-preview-tile,.library-row-icon { display:grid; place-items:center; flex:0 0 52px; width:52px; height:52px; overflow:hidden; border:1px solid transparent; border-radius:10px; background:#f4f6fb; }
/* Match reference image/backplate ratios (32/42 desktop, 26/36 mobile), including the 1px border. */
.library-preview-tile { padding:5.190476px; }
.library-preview-tile img { display:block; width:100%; height:100%; padding:0; box-sizing:border-box; object-fit:contain; border-radius:0; }
@media(max-width:700px){ .library-preview-tile { padding:2.888889px; } }
.json-references > .section-row { gap:12px; }
.json-references > .section-row > h3 { flex:0 0 auto; white-space:nowrap; }
.json-references .section-actions[data-role="icons-selection-toolbar"] { width:auto; min-width:0; margin-left:auto; justify-content:flex-end; flex-wrap:wrap!important; }
.library-preview-tile.broken::before { content:'?'; color:#7d8ba5; font-size:14px; font-weight:700; }
.library-row-icon { height:52px; color:#fff; border:0; border-radius:12px; background:linear-gradient(135deg,#6672ff,#8d64e8); box-shadow:0 7px 14px rgba(102,114,255,.18); font-size:18px; }
.list-info { min-width:0; overflow:hidden; display:grid; gap:4px; }
.list-info b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.list-info small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:10px; }
.list-meta { min-width:46px; text-align:right; display:grid; gap:3px; }
.list-meta strong { font-size:12px; }
.list-meta span { color:var(--muted); font-size:9px; }
.library-list-row .tile-arrow { display:grid; place-items:center; width:34px; height:34px; color:#8b96aa; border-radius:10px; background:#f5f6fa; font-size:20px; }
body.dark .library-row-icon { color:#edf1ff; background:linear-gradient(135deg,#5966c8,#7659b5); }
body.dark .library-preview-tile { border-color:transparent; background:#24334b; }
body.dark .library-empty-row .empty-icon { color:#b3bcff; background:#29385c; }
body.dark .library-empty-row .tile-arrow { color:#b6c1d5; background:#263650; }
body.dark .library-list-row .tile-arrow { background:#263650; color:#b6c1d5; }
@media(max-width:700px){ .library-list-row { grid-template-columns:96px minmax(0,1fr) auto 30px; gap:9px; padding:12px 13px; } .library-preview-strip { width:96px; gap:4px; } .library-preview-tile { flex-basis:28px; width:28px; height:28px; } .library-row-icon { width:36px; height:36px; } .library-list-row .tile-arrow,.library-empty-row .tile-arrow { width:30px; height:30px; } .library-empty-row { grid-template-columns:40px minmax(0,1fr) 30px; gap:10px; padding:13px; } .library-empty-row .empty-icon { width:40px; height:40px; font-size:18px; } }
@media(max-width:700px){ .json-reference-thumb { width:36px; height:36px; flex-basis:36px; } }

/* Center a lone modal action instead of leaving it in the first column. */
.modal-actions:has(> :only-child) { display:flex!important; justify-content:center!important; align-items:center; }
.modal-actions:has(> :only-child) > :only-child { width:auto!important; min-width:180px; }
.group-name-label { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:7px; }
.group-name-label label { margin:0; }
.group-delete-link { flex:0 0 auto; padding:4px 6px; color:var(--ui-danger-ink); font-size:12px; font-weight:600; border-radius:8px; transition:background .12s,color .12s; }
@media(hover:hover){.group-delete-link:hover { color:var(--ui-danger-ink); background:var(--ui-danger-bg); }}
.groupManageForm .modal-actions { display:grid!important; grid-template-columns:1fr 1fr; gap:10px; }
.groupManageForm .modal-actions .btn { width:100%; min-width:0; }

/* Login description is a compact heading-like phrase. */
.auth-card > p { font-size:16px; font-weight:700; line-height:1.5; letter-spacing:-.02em; color:#253653; }
body.dark .auth-card > p { color:#f1f4ff; }

/* Keep the product identity present but visually secondary on login. */
.auth-brand .brand-mark { background:linear-gradient(135deg,#5b61c7,#7660b7); box-shadow:0 5px 14px rgba(77,85,170,.18); }
.auth-brand strong { font-size:13px; letter-spacing:.11em; opacity:.88; }
.auth-brand small { color:#8995aa; opacity:.82; letter-spacing:.14em; }
body:not(.dark) .auth-brand strong { color:#263653; }
body:not(.dark) .auth-brand small { color:#8490a5; }

/* Final login hierarchy: brand leads, description stays secondary. */
.auth-brand .brand-mark { background:linear-gradient(135deg,#6672ff,#a47aff); box-shadow:0 7px 18px rgba(102,114,255,.3); }
.auth-brand { margin-bottom:26px; }
.auth-brand strong { opacity:1; }
@font-face { font-family:BrandInter; src:url('./fonts/inter-latin-600-normal.woff2') format('woff2'); font-style:normal; font-weight:600; font-display:swap; }
body .auth-brand strong,body .brand-copy strong { display:flex; align-items:center; gap:10px; font-family:BrandInter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:22px; font-weight:600; letter-spacing:-.025em; white-space:nowrap; }
body .brand-copy strong { font-size:20px; }
body .auth-brand strong::before { content:''; display:block; flex:0 0 3px; width:3px; height:20px; border-radius:2px; background:#6672e8; }
body .brand-copy { display:flex; align-items:center; gap:8px; }
body .brand-copy .brand-logo { width:29px; height:29px; flex:0 0 29px; display:block; }
@media(max-width:360px){ .auth-brand { gap:6px; } .auth-head-actions { gap:4px; } .auth-head-actions > .auth-theme-button,.auth-head-actions > .project-link { width:34px; height:38px; } body .auth-brand strong { gap:8px; font-size:20px; } }

body:not(.dark) .auth-brand strong,body:not(.dark) .brand-copy strong { color:#344578; }
body.dark .auth-brand strong,body.dark .brand-copy strong { color:#d8e3ff; }
.auth-brand small { color:#7f90aa; opacity:1; letter-spacing:.18em; }
.auth-card > p { font-size:13px; font-weight:500; line-height:1.8; letter-spacing:0; color:#42536d; }
body.dark .auth-card > p { color:#b4bfd3; }

/* Unified interaction feedback: hover only on hover-capable pointers; press never reflows. */
:where(button,.btn,.icon-btn,.text-link,.nav-item,.repo-quick,.library-picker,.library-picker-option,.library-picker-create,.quick-asset,.json-reference-row,.asset-select,.asset-copy,.quick-copy,.modal-close,.top-icon,.project-link,.token-eye,.token-guide-button) { -webkit-tap-highlight-color: transparent; }
@media (hover:hover) and (pointer:fine) {
  :where(button,.btn,.icon-btn,.text-link,.nav-item,.repo-quick,.library-picker,.library-picker-option,.library-picker-create,.quick-asset,.asset-select,.asset-copy,.quick-copy,.modal-close,.top-icon,.project-link,.token-eye,.token-guide-button):not(:disabled):not(.active):hover:not(:where(:has(button:hover,a:hover))) { filter:brightness(.985); }
  body.dark :where(button,.btn,.icon-btn,.text-link,.nav-item,.repo-quick,.library-picker,.library-picker-option,.library-picker-create,.quick-asset,.asset-select,.asset-copy,.quick-copy,.modal-close,.top-icon,.project-link,.token-eye,.token-guide-button):not(:disabled):not(.active):hover:not(:where(:has(button:hover,a:hover))) { filter:brightness(1.1); }
}
:where(button,.btn,.icon-btn,.text-link,.nav-item,.repo-quick,.library-picker,.library-picker-option,.library-picker-create,.quick-asset,.asset-select,.asset-copy,.quick-copy,.modal-close,.top-icon,.project-link,.token-eye,.token-guide-button):not(:disabled):active:not(:where(:has(button:active,a:active))) { filter:none; box-shadow:none; transform:none; }
body.dark :where(button,.btn,.icon-btn,.text-link,.nav-item,.repo-quick,.library-picker,.library-picker-option,.library-picker-create,.quick-asset,.asset-select,.asset-copy,.quick-copy,.modal-close,.top-icon,.project-link,.token-eye,.token-guide-button):not(:disabled):active:not(:where(:has(button:active,a:active))) { filter:none; box-shadow:none; }
/* Nested actions are excluded from ancestor hover/press rules; preserve each card's resting shadow. */
:where(button,.btn,.icon-btn,.text-link,.nav-item,.repo-quick,.library-picker,.library-picker-option,.library-picker-create,.asset-select,.asset-copy,.quick-copy,.modal-close,.top-icon,.project-link,.token-eye,.token-guide-button):focus-visible { outline:2px solid var(--ui-line-focus); outline-offset:2px; box-shadow:0 0 0 4px color-mix(in srgb,var(--ui-line-focus) 55%,transparent); }
:where(input,select,textarea):focus-visible { outline:2px solid var(--ui-line-focus); outline-offset:1px; }
/* Do not neutralize press/focus feedback on copy controls. */
[data-action="copy"] { transition:filter .12s ease,box-shadow .12s ease; }
/* Shared gallery density and backplate palette. */
@media(min-width:701px){ .asset-grid { grid-template-columns:repeat(6,minmax(0,1fr)); } }
body:not(.dark) .asset-preview,body:not(.dark) .quick-asset-image { background:#f2f5fb; }
body.dark .asset-preview,body.dark .quick-asset-image { background:#24334b; }
/* Long Raw URLs remain left-aligned, dense, and safely breakable, with even side padding. */
.detail-readonly { width:100%; box-sizing:border-box; }
.detail-readonly + .detail-readonly { margin-top:12px; }
.detail-readonly p { margin:0; text-align:left; font-size:clamp(9px,2.6vw,10px); letter-spacing:-.02em; line-height:1.5; overflow-wrap:anywhere; word-break:normal; hyphens:none; color:var(--ink); }
.detail-readonly .detail-url { word-break:break-all; }
.detail-link { display:block; width:100%; text-align:left; color:inherit; text-decoration:underline; text-decoration-color:var(--ui-line-focus,#cfd5fd); text-underline-offset:2px; overflow-wrap:anywhere; word-break:break-all; }
.detail-link:focus-visible { outline:2px solid var(--ui-line-focus,#cfd5fd); outline-offset:2px; border-radius:2px; }
@media (hover:hover) and (pointer:fine) { .detail-link:hover { color:#6875e4; } }
.image-save-note p + p { margin-top:5px; }
.image-save-note [data-image-save-status]:empty { display:none; }
.icon-detail-actions > .btn:last-child { grid-column:1/-1; }
.detail-readonly b { display:block; margin-bottom:5px; text-align:left; color:#768196; font-size:10px; }
/* Library cards open the management picker; no directional arrow or external row actions. */
.library-list-row,.library-empty-row { cursor:pointer; }
.library-picker-row { display:flex; align-items:center; gap:8px; }
.library-picker-row .library-picker-option { flex:1; }
.library-picker-actions { display:flex; flex:0 0 auto; gap:4px; }
.library-picker-actions .icon-btn { width:auto; min-width:42px; padding:0 8px; font-size:10px; }
/* release135: approved login only; existing button feedback and all internal styles frozen. */
.auth-page { padding:24px 18px; color:var(--ink); background:radial-gradient(circle at 13% 12%,rgba(101,112,255,.12),transparent 32%),radial-gradient(circle at 88% 82%,rgba(38,171,169,.07),transparent 28%),#f5f6fc; }
body.dark .auth-page { background:radial-gradient(circle at 13% 12%,rgba(101,112,255,.12),transparent 32%),radial-gradient(circle at 88% 82%,rgba(38,171,169,.07),transparent 28%),#111827; }
.auth-page .auth-card { box-sizing:border-box; width:min(100%,420px); padding:30px 34px 32px; background:#fff; border:1px solid #e1e4ef; border-radius:22px; box-shadow:0 18px 55px #4b4a8615; backdrop-filter:none; }
body.dark .auth-page .auth-card { background:#192235; border-color:#34415a; box-shadow:0 20px 60px #05081566; }
.auth-page .auth-brand { justify-content:space-between; gap:8px; margin-bottom:43px; }
.auth-page .auth-brand-label { display:flex; align-items:center; gap:10px; min-width:0; }
.auth-page .auth-login-logo { width:34px; height:34px; flex:none; }
.auth-page .auth-brand strong { color:#202738; font-size:15px; letter-spacing:-.35px; white-space:nowrap; }
body.dark .auth-page .auth-brand strong { color:#edf1fb; }
.auth-page .auth-head-actions { gap:7px; }
.auth-page .auth-head-actions :is(.auth-theme-button,.project-link) { box-sizing:border-box; display:grid; place-items:center; width:44px; min-width:44px; height:44px; margin:0; padding:0; border:1px solid #e1e4ef; border-radius:11px; background:#fff; color:#70798d; font-size:17px; }
body.dark .auth-page .auth-head-actions :is(.auth-theme-button,.project-link) { border-color:#34415a; background:#192235; color:#aab3c4; }
.auth-page .project-github-icon { width:18px; height:18px; }
.auth-page .auth-login-heading { font-size:27px; line-height:1.18; letter-spacing:-.8px; margin:0 0 12px; color:#202738; }
body.dark .auth-page .auth-login-heading { color:#edf1fb; }
.auth-page .auth-card .auth-login-intro { font-size:14px; line-height:1.65; color:#70798d; margin:0 0 28px; }
body.dark .auth-page .auth-card .auth-login-intro { color:#aab3c4; }
.auth-page .auth-card .auth-login-message { margin:0 0 18px; color:var(--ink); overflow-wrap:anywhere; }
.auth-page .auth-card .btn-github { height:48px; font-size:15px; font-weight:700; border-bottom:0; }
@media(max-width:450px) {
 .auth-page { padding:16px; }
 .auth-page .auth-card { padding:24px 22px 26px; border-radius:19px; }
 .auth-page .auth-brand { margin-bottom:36px; }
}
@media(max-width:350px) {
 .auth-page .auth-card { padding:21px 17px 22px; }
 .auth-page .auth-brand-label { gap:7px; }
 .auth-page .auth-brand strong { font-size:13px; }
 .auth-page .auth-login-logo { width:29px; height:29px; }
 .auth-page .auth-head-actions { gap:4px; }
 .auth-page .auth-brand { margin-bottom:32px; }
 .auth-page .auth-card .auth-login-intro { margin-bottom:23px; }
}
body:not(.dark) .auth-page { color:#202738; background:radial-gradient(circle at 13% 12%,rgba(101,112,255,.12),transparent 32%),radial-gradient(circle at 88% 82%,rgba(38,171,169,.07),transparent 28%),#f5f6fc; }
body:not(.dark) .auth-page .auth-card { background:#fff; border-color:#e1e4ef; box-shadow:0 18px 55px #4b4a8615; }
.auth-page .auth-brand strong::before { content:none; display:none; }

/* Release136: approved login-only visual refinements. */
.auth-page .auth-card { width:min(100%,480px); }
@media(max-width:700px){ .auth-page { padding-inline:12px; } }
.auth-page .auth-card .btn-github { display:flex; align-items:center; justify-content:center; gap:8px; }
.auth-page .auth-card .btn-github .oauth-github-icon { width:20px; height:20px; flex:0 0 20px; fill:currentColor; stroke:none; }
body .auth-page .auth-head-actions :is(.auth-theme-button,.project-link) { width:34px; min-width:34px; height:34px; min-height:34px; border:1px solid #e8ecf3; border-radius:10px; background:#fff; color:#162033; }
body.dark .auth-page .auth-head-actions :is(.auth-theme-button,.project-link) { background:#1b293f; color:#e4eaf5; border-color:#34435b; }
body .auth-page .auth-head-actions .auth-theme-button { font-size:20px; }
body .auth-page .auth-head-actions .project-link { font-size:17px; }
body .auth-page .auth-head-actions svg { width:18px; height:18px; }
body.auth-screen #modalRoot .modal-actions a.btn[href="https://github.com/settings/applications/new"] { text-decoration:none; }

.auth-page .auth-card .btn-github, .auth-page .auth-card .btn-github:is(:hover,:active,:focus,:focus-visible) { box-shadow:none; }

/* Release143: approved larger login composition only. */
.auth-page .auth-login-heading { font-size:34px; line-height:1.2; margin-bottom:16px; }
.auth-page .auth-card .auth-login-intro { font-size:16px; line-height:1.65; margin-bottom:30px; }
.auth-page .auth-card .btn-github { height:54px; font-size:17px; }
.auth-page .auth-card .btn-github .oauth-github-icon { width:22px; height:22px; flex-basis:22px; }.auth-page .auth-card { padding-block:30px; }
@media(max-width:350px){ .auth-page .auth-login-heading { font-size:30px; } .auth-page .auth-card .auth-login-intro { font-size:15px; } }
