/* Samme farger som Homer */
:root {
  --bg: #f5f5f5; --card: #fff; --text: #363636; --muted: #6b6b76; --line: #e4e1ea;
  --accent: #5A3E77; --accent-2: #472F61; --accent-text: #fff; --danger: #d92d20;
  --shadow: 0 2px 6px rgba(0,0,0,.08), 0 8px 24px rgba(71,47,97,.10);
  --glow: 0 6px 28px rgba(90,62,119,.35);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #131313; --card: #1e1e1e; --text: #eaeaea; --muted: #a5a0b0; --line: #2e2a36; --accent: #7b58a0; --accent-2: #472F61; --shadow: 0 2px 8px rgba(0,0,0,.5); --glow: 0 6px 28px rgba(123,88,160,.45); }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1100px; margin: 0 auto; padding: 28px 20px 8px; }
header.top h1 { margin: 0; font-size: 1.6rem; }
.badge { font-size: .75rem; background: var(--accent); color: var(--accent-text); padding: 2px 8px; border-radius: 99px; margin-left: 8px; vertical-align: middle; }
main { max-width: 1100px; margin: 0 auto; padding: 16px 20px 60px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 20px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tile-link { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; aspect-ratio: 1; background: var(--card); border-radius: 22px; box-shadow: var(--shadow); text-decoration: none; transition: transform .12s; padding: 18px; }
.tile-link:hover, .tile-link:focus-visible { transform: translateY(-3px); outline: 2px solid var(--accent); }
.logo { width: 100%; height: 100%; object-fit: contain; }
.logo-fallback { display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--accent-text); border-radius: 18px; font-size: 3rem; font-weight: 700; max-width: 96px; max-height: 96px; }
.tile-name { font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.tile-info { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: .9rem; padding: 2px 8px; border-radius: 8px; }
.tile-info:hover { background: var(--line); }
.tag { font-size: .7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 6px; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

dialog { border: 0; border-radius: 18px; padding: 0; width: min(680px, 94vw); max-height: 88vh; background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10,12,20,.55); }
.dlg-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.dlg-head .logo, .dlg-head .logo-fallback { width: 44px; height: 44px; font-size: 1.4rem; }
.dlg-head h2 { margin: 0; font-size: 1.2rem; flex: 1; }
.dlg-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.dlg-body { padding: 18px 22px 24px; overflow: auto; max-height: calc(88vh - 150px); }
.tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; color: var(--muted); cursor: pointer; }
.tab[aria-selected="true"] { color: var(--text); border-color: var(--accent); font-weight: 600; }
details.faq { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
details.faq .md { padding-bottom: 12px; }
.md h3, .md h4, .md h5 { margin: 1.2em 0 .4em; }
.md p { margin: .5em 0; }
.md code { background: var(--line); padding: 1px 5px; border-radius: 5px; font-size: .9em; }
.notes { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.5); border-radius: 12px; padding: 4px 14px; }

button, .btn { font: inherit; cursor: pointer; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-text); border: 0; border-radius: 10px; padding: 9px 16px; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.x { background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); }

/* admin */
.panel { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border: 0; }
.row .logo, .row .logo-fallback { width: 40px; height: 40px; font-size: 1.2rem; flex: none; border-radius: 10px; }
.row .grow { flex: 1; min-width: 0; }
.row .grow small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
label { display: block; font-weight: 600; margin: 14px 0 4px; }
input[type=text], input[type=url], input[type=password], textarea, select { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); }
textarea { min-height: 140px; resize: vertical; font-family: ui-monospace, monospace; font-size: .92rem; }
.hint { color: var(--muted); font-size: .85rem; font-weight: 400; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.faq-item textarea { min-height: 70px; margin-top: 6px; }
.actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.err { color: var(--danger); min-height: 1.4em; }
.login { max-width: 360px; margin: 14vh auto; }
.logo-edit { display: flex; align-items: center; gap: 14px; }
.logo-edit .logo, .logo-edit .logo-fallback { width: 72px; height: 72px; flex: none; }

/* ---- design ---- */
body { background: var(--bg); }
header.top { display: block; background: linear-gradient(135deg, #5A3E77 0%, #472F61 100%); color: #fff; max-width: none; margin: 0; padding: 0; box-shadow: 0 4px 20px rgba(71,47,97,.35); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1100px; margin: 0 auto; padding: 18px 20px; }
.brand { display: flex; align-items: center; gap: 16px; color: #fff; text-decoration: none; }
.brand img { width: 64px; height: 64px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.35)); }
.brand h1 { margin: 0; font-size: 2rem; letter-spacing: .5px; color: #fff; }
.topnav { display: flex; gap: 8px; align-items: center; }
.pill-label { opacity: .85; font-size: .9rem; }
header.top .btn.ghost { color: #fff; border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.08); }
header.top .btn.ghost:hover { background: rgba(255,255,255,.2); }
header.top .badge { background: rgba(255,255,255,.2); }
main { padding-top: 32px; }
.grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 26px; }
.tile-link { border-radius: 24px; border: 1px solid var(--line); padding: 26px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile-link:hover, .tile-link:focus-visible { transform: translateY(-5px); box-shadow: var(--glow); border-color: var(--accent); outline: none; }
.tile-name { font-size: 1.05rem; }
.tile-info { background: var(--accent); color: #fff; border-radius: 99px; padding: 3px 16px; font-size: .85rem; }
.tile-info:hover { background: var(--accent-2); }
.logo-fallback { background: linear-gradient(135deg, #5A3E77, #472F61); }
.btn:hover { background: var(--accent-2); }
.btn.ghost:hover { background: var(--line); }
.tab[aria-selected="true"] { border-color: var(--accent); }
.dlg-head { background: linear-gradient(135deg, #5A3E77, #472F61); color: #fff; border: 0; }
.dlg-head p { color: rgba(255,255,255,.8); }
.dlg-head .x { color: #fff; }
.dlg-head .btn { background: rgba(255,255,255,.2); }
dialog { overflow: hidden; }
.foot { text-align: center; padding: 10px 0 30px; font-size: .8rem; }
.foot a { color: var(--muted); text-decoration: none; opacity: .6; }
.foot a:hover { opacity: 1; }
@media (max-width: 520px) { .brand h1 { font-size: 1.4rem; } .brand img { width: 46px; height: 46px; } .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
