/* Raccoon Asset Shop — same visual language as Raccoon Asset Studio. */
:root {
  --bg: #f7f7f2; --paper: #fff; --ink: #223d39; --muted: #7a8982; --line: #e3e8df;
  --green: #356851; --lime: #d5e9a7; --sidebar: #183b33; --danger: #ad674d; --radius: 16px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--green); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #a7bf64; outline-offset: 2px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 38px; letter-spacing: -.5px; margin: 6px 0 10px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 14px; }
h3 { font-size: 13px; margin: 0 0 10px; }
code, pre { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; }
pre { background: #f1f4ed; border-radius: 8px; padding: 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.muted { color: var(--muted); font-size: 12px; }

/* Sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 240px; background: var(--sidebar); color: #eaf0df; padding: 38px 22px; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; font-size: 31px; font-weight: 650; letter-spacing: -1px; padding: 0 10px; }
.brand small { display: block; font-size: 9px; letter-spacing: 2.5px; font-weight: 500; margin-top: 3px; color: #a6b9a8; }
.brand-icon { display: block; border: 1px solid #8da590; border-radius: 12px; width: 43px; height: 48px; line-height: 45px; text-align: center; font-family: Georgia, serif; font-size: 29px; position: relative; }
.brand-icon span { position: absolute; font: 17px "Segoe UI"; top: -8px; right: -6px; background: var(--sidebar); color: var(--lime); }
.workspace-label, .section-label { font-size: 10px; letter-spacing: 1.8px; color: #99b1a4; font-weight: 600; }
.workspace-label { margin: 48px 12px 14px; }
.section-label { margin: 30px 12px 10px; }
.nav-button { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 8px; font-size: 13px; color: #c1d1c5; text-decoration: none; margin-bottom: 4px; }
.nav-button span { font-size: 17px; width: 20px; color: #b3caac; }
.nav-button b, .theme-item b { margin-left: auto; font-size: 10px; font-weight: 400; border: 1px solid #60806a; border-radius: 5px; padding: 2px 5px; }
.nav-button.active, .nav-button:hover { background: #2d5145; color: #eef4dc; }
.theme-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; font-size: 12px; color: #c1d1c5; text-decoration: none; margin-bottom: 4px; }
.theme-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-item span::before { content: '●'; font-size: 8px; color: #c3db8c; margin-right: 10px; }
.theme-item.selected, .theme-item:hover { background: #23473d; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #3a564a; padding: 22px 8px 0; display: flex; flex-direction: column; gap: 10px; font-size: 12px; }
.account-link { display: flex; gap: 10px; align-items: center; color: #d3e2d1; text-decoration: none; word-break: break-all; }
.account-link small { display: block; color: #8da99a; font-size: 10px; margin-top: 4px; }
.status-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #b2d37b; }
.link-button { background: none; border: 0; padding: 0 0 0 16px; color: #a6b9a8; font-size: 11px; text-decoration: underline; }

/* Main */
main { margin-left: 240px; min-height: 100vh; display: flex; flex-direction: column; }
header { height: 80px; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 44px; }
.breadcrumb { font-size: 12px; color: var(--muted); }
.breadcrumb span { margin: 0 8px; }
.breadcrumb strong { color: var(--ink); font-weight: 500; }
.page { padding: 44px; flex: 1; width: 100%; max-width: 1400px; }
footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin: 0 44px; padding: 22px 0; font-size: 10px; letter-spacing: 1.2px; color: #a1ab9a; }
.page-heading { margin-bottom: 30px; }
.page-heading p { color: var(--muted); font-size: 13px; margin: 0; }
.eyebrow { font-size: 10px; letter-spacing: 2px; color: #8aa077; font-weight: 600; }

/* Controls */
.primary, .secondary, .quiet, .danger { display: inline-block; border-radius: 8px; padding: 11px 16px; font-size: 12px; font-weight: 500; text-decoration: none; border: 1px solid transparent; }
.primary { background: var(--green); color: #fff; border-color: var(--green); }
.primary span { float: right; }
.secondary { background: #e8efdc; color: #49603d; border-color: #dce5ce; }
.quiet { background: transparent; border-color: var(--line); color: #64775e; }
.quiet.selected { background: #dce9cd; border-color: #b6cba2; color: #3f5a33; }
.danger { background: #fff; border-color: #e8c6b8; color: var(--danger); }
.danger:hover { background: #f8e7df; }
.small { padding: 7px 10px; font-size: 11px; }
.full { width: 100%; text-align: left; }
button:hover { filter: brightness(.97); }
label { display: block; font-size: 12px; font-weight: 500; margin: 16px 0 7px; }
.label-hint { float: right; font-weight: 400; color: #9aa28f; font-size: 10px; }
input:not([type=checkbox]), select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; background: #fbfcf8; font-size: 13px; }
.check-label { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.field-error { display: block; color: var(--danger); font-size: 11px; margin-top: 5px; }
.notice { border: 1px solid #e2dfbd; background: #faf6e5; color: #8d8255; padding: 13px 16px; border-radius: 10px; font-size: 12px; margin-bottom: 20px; line-height: 1.6; }
.notice.error { border-color: #ebcdbf; background: #fbefe9; color: #9a5a42; }
.notice.success { border-color: #c9ddb8; background: #f0f6e7; color: #4b6a3a; }
.notice ul { margin: 0; padding-left: 18px; }
.validation-summary-valid { display: none; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.panel .primary, .panel .secondary { margin-top: 18px; }
.fineprint { font-size: 10px; line-height: 1.6; margin-top: 12px; color: #97a08f; }
.counter { font-size: 11px; font-weight: 400; border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; color: var(--muted); vertical-align: middle; }

/* Library */
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 22px; }
.library-toolbar h2 { margin: 0; }
.filters { display: flex; gap: 8px; }
.filters input { width: 240px; }
.filters select { width: 150px; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.asset-card { border: 1px solid var(--line); background: #fff; border-radius: 14px; overflow: hidden; color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.asset-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px #1f3b3010; }
.asset-card img { display: block; width: 100%; aspect-ratio: 1.15; object-fit: cover; background: #dbe4da; }
.asset-card > div { padding: 15px 17px 17px; }
.asset-card h3 { margin: 0 0 9px; }
.asset-card small { display: block; margin-top: 10px; color: #9aa28f; font-size: 10px; }
.rating-badge { display: inline-block; font-size: 9px; letter-spacing: .5px; text-transform: uppercase; border-radius: 5px; padding: 4px 7px; background: #dceddf; color: #4c815a; }
.rating-badge.great { background: #f3e3a6; color: #6f5a1c; }
.empty { text-align: center; padding: 70px 20px; border: 1px dashed #d4ddce; border-radius: var(--radius); color: var(--muted); }
.empty span { display: block; font-size: 28px; color: #9fb48a; margin-bottom: 10px; }
.empty p { font-size: 12px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 28px; font-size: 12px; color: var(--muted); }

/* Asset detail */
.back-link { display: inline-block; font-size: 12px; text-decoration: none; margin-bottom: 18px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 26px; align-items: start; }
.detail-image { display: block; width: 100%; max-height: 640px; object-fit: contain; background: #d9e2d6; border-radius: 14px; }
.view-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.view-buttons a { font-size: 11px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #687e5d; text-decoration: none; }
.view-buttons a.selected { background: #dce9cd; border-color: #b6cba2; }
.detail-title { font-size: 32px; }
.detail-meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 11px; color: #8a987e; margin: 10px 0; }
.detail-prompt { font-size: 13px; line-height: 1.6; color: #5f7058; white-space: pre-wrap; }
.download-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.download-links a:not(.primary) { background: #e7eddc; color: #60744c; border-radius: 7px; padding: 10px 13px; font-size: 12px; text-decoration: none; }
.download-links a small { opacity: .7; margin-left: 4px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 12px; margin: 18px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
details { border-top: 1px solid var(--line); padding-top: 13px; margin-top: 13px; }
summary { cursor: pointer; font-size: 12px; color: #6d805e; }
.file-list { display: flex; flex-direction: column; gap: 7px; padding: 12px 4px; font-size: 12px; }
.file-list small { color: var(--muted); }
.admin-box { margin-top: 22px; border: 1px dashed #d8c9a5; background: #fdfaf0; border-radius: 12px; padding: 16px; }
.admin-box form + form { margin-top: 12px; }
.inline-form { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.inline-form input { flex: 1; }
.inline-form .primary { margin-top: 0; }

/* Auth pages */
body.bare { min-height: 100vh; background: radial-gradient(circle at top left, #e3edd2, var(--bg) 55%); }
.auth-main { margin: 0; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 16px; }
.auth-brand { color: var(--sidebar); margin-bottom: 26px; }
.auth-brand .brand-icon { border-color: #9fb48a; }
.auth-brand .brand-icon span { background: transparent; color: var(--green); }
.auth-brand small { color: var(--muted); }
.auth-panel { width: 100%; max-width: 420px; }
.auth-panel h1 { font-size: 30px; }
.auth-panel p { color: var(--muted); font-size: 13px; line-height: 1.6; }

/* Admin */
.form-panel { margin-bottom: 30px; }
.form-row.three { display: grid; grid-template-columns: 1.2fr .6fr 1.4fr; gap: 14px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.secret-box strong { display: block; margin-bottom: 10px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: Consolas, monospace; font-size: 12px; }
.copy-row .secondary { margin: 0; white-space: nowrap; }
.table-section { margin-top: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; background: #fafbf7; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td small { color: var(--muted); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.status { display: inline-block; font-size: 9px; text-transform: uppercase; letter-spacing: .6px; background: #edf2e5; border-radius: 5px; padding: 5px 8px; color: #758962; }
.status.open { background: #dceddf; color: #4c815a; }
.status.used { background: #eef1f6; color: #5d6b85; }
.status.expired, .status.revoked { background: #f8e7df; color: var(--danger); }

@media (max-width: 1000px) {
  .sidebar { width: 200px; padding: 30px 15px; }
  .brand { font-size: 26px; }
  main { margin-left: 200px; }
  .page { padding: 30px 24px; }
  header { padding: 0 24px; }
  footer { margin: 0 24px; }
  .detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: 100%; padding: 16px; }
  .workspace-label, .section-label, .theme-list, .sidebar-bottom small { display: none; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
  .nav-button { margin: 0; padding: 9px 11px; font-size: 12px; }
  .nav-button span, .nav-button b { display: none; }
  .sidebar-bottom { flex-direction: row; justify-content: space-between; padding-top: 12px; margin-top: 12px; }
  main { margin: 0; min-height: 0; }
  header { height: 52px; padding: 0 16px; }
  .page { padding: 24px 16px; }
  footer { margin: 0 16px; flex-direction: column; gap: 6px; }
  h1 { font-size: 30px; }
  .filters { width: 100%; flex-wrap: wrap; }
  .filters input { flex: 1 1 100%; width: auto; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .two-column, .form-row.three { grid-template-columns: 1fr; }
}

/* Shared library */
.library-toolbar .filters { flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.filters .filter-check { margin: 0 4px; white-space: nowrap; font-size: 12px; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; }
.source-badge, .compat-badge { display: inline-block; font-size: 9px; letter-spacing: .5px; text-transform: uppercase; border-radius: 5px; padding: 4px 7px; }
.source-badge { background: #eef1f6; color: #5d6b85; }
.source-badge.linnea { background: #f1e4f2; color: #7b4a80; }
.source-badge.manual { background: #f3ede2; color: #7d6744; }
.compat-badge { background: var(--sidebar); color: var(--lime); }
.card-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; aspect-ratio: 1.15; background: repeating-linear-gradient(45deg, #e3eadf, #e3eadf 10px, #dbe4d6 10px, #dbe4d6 20px); color: #7e927a; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.card-placeholder span, .detail-placeholder span { font-size: 30px; color: #9fb48a; }
.detail-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; aspect-ratio: 1.3; color: #7e927a; font-size: 12px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag-list span { font-size: 11px; background: #eef3e6; color: #5d7450; border-radius: 12px; padding: 3px 9px; }
.check-errors { margin: 10px 0; padding-left: 18px; font-size: 12px; color: var(--danger); line-height: 1.6; }
.revision-list { display: flex; flex-direction: column; gap: 12px; padding: 12px 4px; font-size: 12px; }
.revision-list small { color: var(--muted); }
.revision-list ul { margin: 6px 0 0; padding-left: 16px; }
.revision-list li { display: flex; gap: 8px; flex-wrap: wrap; }
.revision-list code { color: #8a987e; }
