/* assets.adjustapen.com: private asset library. Dark grey, matches the desktop AssetRepo app. */
:root {
  --bg: #1b1c1f; --panel: #232427; --panel-2: #2a2b2f; --line: #34363b; --line-2: #44464c;
  --text: #e6e7ea; --muted: #9b9ea6; --accent: #8aa4c8; --accent-bg: rgba(138, 164, 200, .16);
  --danger: #d98080; --good: #7fb88f;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--sans); }
body { min-height: 100svh; }
a { color: var(--accent); }
input, textarea, select {
  width: 100%; padding: 9px 11px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 7px; font: inherit; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; }
label > span.l { display: block; margin-bottom: 5px; font-size: 12px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: 7px;
  font: 600 13px var(--sans); cursor: pointer; transition: background .12s, border-color .12s;
}
.btn:hover { background: #313338; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #12151a; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: var(--panel); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

.mark { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 13px; background: var(--panel-2) center/60% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 6l9 5v10l-9 5-9-5V11z' fill='none' stroke='%238aa4c8' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M7 11l9 5 9-5M16 16v10' fill='none' stroke='%238aa4c8' stroke-width='2'/%3E%3C/svg%3E"); }
.mark.sm { width: 26px; height: 26px; margin: 0; border-radius: 7px; }

/* Code screen */
.gate { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: 100%; max-width: 340px; padding: 30px 26px; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.gate-card h1 { margin: 0 0 20px; font-size: 22px; }
.gate-field { display: grid; gap: 6px; text-align: left; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.gate-field input { text-align: center; letter-spacing: .12em; font-size: 16px; text-transform: uppercase; }
.gate-error { min-height: 20px; margin-bottom: 8px; color: var(--danger); font-size: 13px; }

/* Layout */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: rgba(27, 28, 31, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top input { max-width: 340px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; text-decoration: none; margin-right: 10px; }
.spacer { flex: 1; }
main { padding: 20px; max-width: 1280px; margin: 0 auto; }

.tagbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.chip { padding: 3px 10px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); border-radius: 99px; font: 12px var(--sans); cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.chip.static { cursor: default; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; transition: border-color .12s; }
.card:hover { border-color: var(--line-2); }
.thumb { aspect-ratio: 4/3; display: grid; place-items: center; background: var(--bg); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb .ph { color: var(--line-2); font-size: 34px; }
.card-body { padding: 10px 12px 12px; }
.card-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { margin-top: 2px; font-size: 12px; color: var(--muted); }
.card-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.card-tags .chip { padding: 1px 8px; font-size: 11px; cursor: default; }
.empty { padding: 60px 20px; text-align: center; color: var(--muted); }

/* Detail */
.back { background: none; border: 0; color: var(--muted); cursor: pointer; font: 13px var(--sans); padding: 0; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.head h1 { margin: 0; font-size: 24px; }
.cols { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
@media (max-width: 800px) { .cols { grid-template-columns: 1fr; } main { padding: 14px; } .top { padding: 10px 14px; flex-wrap: wrap; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.panel h3 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.field { margin-bottom: 12px; }
.hint { font-size: 12px; color: var(--muted); }
.big { aspect-ratio: 4/3; margin-bottom: 4px; border-radius: 8px; }

.file { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.file:hover, .file.sel { background: var(--panel-2); }
.file .fn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .fs { color: var(--muted); font-size: 12px; white-space: nowrap; }
.file .acts { display: flex; gap: 4px; }
.preview { margin-top: 14px; }
.preview img, .preview video { max-width: 100%; max-height: 420px; border-radius: 8px; background: var(--bg); display: block; }
.preview audio { width: 100%; }
.preview pre { margin: 0; padding: 12px; max-height: 320px; overflow: auto; background: var(--bg); border-radius: 8px; font-size: 12px; white-space: pre-wrap; }

/* Upload + codes */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: rgba(0, 0, 0, .6); }
.modal { width: 100%; max-width: 520px; max-height: 92svh; overflow: auto; padding: 22px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; }
.modal h2 { margin: 0 0 16px; font-size: 18px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.drop { padding: 24px; margin-bottom: 14px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line-2); border-radius: 10px; }
.drop.over { border-color: var(--accent); color: var(--text); background: var(--accent-bg); }
.progress { height: 6px; margin-top: 12px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.codes { display: grid; gap: 8px; margin-bottom: 14px; }
.coderow { display: flex; align-items: center; gap: 10px; padding: 9px 11px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.coderow .cl { flex: 1; min-width: 0; }
.coderow code { font: 600 14px ui-monospace, Consolas, monospace; letter-spacing: .06em; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }

#toastRoot { position: fixed; left: 50%; bottom: 22px; z-index: 30; transform: translateX(-50%); display: grid; gap: 8px; }
.toast { padding: 10px 16px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.btn { text-decoration: none; }
