/* Appraze web. Colors are the Appraze 3.0 Palette (Palette.java): LIGHT ("Bright") default, DARK in Settings. */
:root {
  --bg: #F5F6F8; --bg-top: #FFFFFF; --glass: rgba(255,255,255,.90); --glass-border: rgba(0,0,0,.122);
  --gold-border: rgba(55,48,163,.40); --gold: #3730A3; --gold-light: #312E81; --gold-deep: #C7D2FE; --on-gold: #FFFFFF;
  --text: #1C1B1F; --text-2: #49454F; --muted: #6B6770; --buy: #15803D; --pass: #B91C1C; --review: #B45309;
  --radius: 16px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Roboto Mono", monospace;
  color-scheme: light;
}
html.dark {
  --bg: #0A0A0D; --bg-top: #17151C; --glass: rgba(22,22,28,.80); --glass-border: rgba(255,255,255,.078);
  --gold-border: rgba(165,180,252,.20); --gold: #A5B4FC; --gold-light: #C7D2FE; --gold-deep: #3730A3; --on-gold: #0A0A0D;
  --text: #F5F2E8; --text-2: #A8A29E; --muted: #6E6A63; --buy: #22C55E; --pass: #EF4444; --review: #F59E0B;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.45; color: var(--text);
  background: linear-gradient(180deg, var(--bg-top), var(--bg) 60%) fixed, var(--bg);
  min-height: 100vh; overflow-x: hidden; -webkit-text-size-adjust: 100%;
}
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--gold); color: var(--on-gold); padding: 10px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }
.shell { max-width: 720px; margin: 0 auto; padding: 24px 16px calc(96px + env(safe-area-inset-bottom)); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.top { display: flex; align-items: center; gap: 8px; }
.top h1 { flex: 1; margin: 0; font-size: 1.35rem; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.top h1:focus { outline: none; }
#header-extra:empty { display: none; }
.gear { min-width: 48px; min-height: 48px; font-size: 1.5rem; background: none; border: 0; color: var(--text-2); cursor: pointer; border-radius: 12px; }
.gear[aria-current="page"] { color: var(--gold); }
.help { color: var(--text-2); margin: 8px 0 16px; }

.card { background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 16px; margin: 12px 0;
  box-shadow: 0 6px 18px rgba(0,0,0,.06); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.card.hl { border-color: var(--gold-border); }
.section { color: var(--gold); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 4px; }
h2.section, h3.section { font-size: .8rem; }
.caption { color: var(--text-2); font-size: .9rem; margin: 8px 0 0; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.stat .v { display: block; font-size: 1.5rem; font-weight: 700; color: var(--gold); font-family: var(--mono); overflow-wrap: anywhere; }
.stat .l { display: block; font-size: .75rem; color: var(--text-2); letter-spacing: .06em; }

.rows { margin: 0; }
.row { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--glass-border); }
.row:last-child { border-bottom: 0; }
.row dt, .row .k { flex: 1; color: var(--text-2); min-width: 0; overflow-wrap: anywhere; margin: 0; }
.row dd, .row .val { margin: 0; font-family: var(--mono); font-weight: 700; text-align: right; overflow-wrap: anywhere; max-width: 60%; }
.met { color: var(--buy); }
.notmet { color: var(--pass); }
button.row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--glass-border); font: inherit; color: inherit; text-align: left; cursor: pointer; min-height: 44px; }
button.row .val { color: var(--gold); }

label.fl, .fl { display: block; color: var(--gold); font-size: .8rem; font-weight: 700; letter-spacing: .04em; margin: 12px 4px 6px; }
input[type=text], input[type=search], textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--glass);
  border: 1px solid var(--glass-border); border-radius: 12px; padding: 13px 12px; min-height: 48px;
}
textarea { min-height: 110px; resize: vertical; }
input[aria-invalid=true], textarea[aria-invalid=true] { border-color: var(--pass); }
.err { color: var(--pass); font-size: .85rem; margin: 4px 4px 0; }
.err:empty { display: none; }
::placeholder { color: var(--muted); }

.btn { display: block; width: 100%; min-height: 52px; margin-top: 12px; border-radius: 14px; font: inherit; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; cursor: pointer; padding: 12px 16px; text-align: center; text-decoration: none; }
.btn.primary { background: var(--gold); color: var(--on-gold); border: 0; }
.btn.primary:hover { background: var(--gold-light); }
.btn.secondary { background: transparent; color: var(--gold); border: 1.5px solid var(--gold-border); }
.btn.small { display: inline-block; width: auto; min-height: 44px; margin: 0; padding: 8px 14px; }
.link { background: none; border: 0; font: inherit; color: var(--gold); cursor: pointer; min-height: 44px; padding: 8px 4px; text-decoration: underline; display: block; width: 100%; text-align: center; }
.link.danger { color: var(--pass); }
.link.quiet { color: var(--text-2); }
a { color: var(--gold); }

fieldset.chips { border: 0; margin: 0; padding: 0; }
fieldset.chips legend { padding: 0; }
.chip { display: block; position: relative; margin-top: 6px; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span { display: block; min-height: 44px; padding: 10px 14px; border: 1px solid var(--glass-border); border-radius: 10px; background: var(--glass); }
.chip input:checked + span { border-color: var(--c, var(--gold)); color: var(--c, var(--gold)); font-weight: 700; }
.chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.chip.c-new { --c: var(--buy); } .chip.c-good { --c: var(--review); } .chip.c-fair { --c: var(--pass); }

.item { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.item .top-line { display: flex; gap: 8px; align-items: baseline; }
.item .nm { flex: 1; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.item .mg { font-weight: 700; color: var(--gold); font-family: var(--mono); }
.item .info { color: var(--text-2); margin-top: 4px; overflow-wrap: anywhere; }
.badge { display: inline-block; margin-top: 6px; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 8px; border: 1px solid currentColor; }
.badge.c-new { color: var(--buy); } .badge.c-good { color: var(--review); } .badge.c-fair { color: var(--pass); }

.market { display: flex; align-items: center; gap: 12px; }
.market .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.switch { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; }
.switch span { flex: 1; color: var(--text-2); }
.switch input { width: 48px; height: 28px; accent-color: var(--gold); cursor: pointer; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--glass); border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.tabs a { flex: 1; min-width: 0; min-height: 56px; display: flex; align-items: center; justify-content: center; text-decoration: none;
  color: var(--muted); font-size: .8rem; border-top: 2px solid transparent; padding: 0 2px; text-align: center; overflow-wrap: anywhere; }
.tabs a[aria-current="page"] { color: var(--gold); border-top-color: var(--gold); font-weight: 700; }

.legal { margin: 32px 0 0; color: var(--text-2); font-size: .85rem; text-align: center; }
.toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 30; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.on { opacity: 1; }

dialog { border: 1px solid var(--glass-border); border-radius: 18px; background: var(--bg-top); color: var(--text); width: min(92vw, 480px); padding: 20px; }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog h2 { margin: 0 0 8px; font-size: 1.15rem; }
.dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dialog-actions .btn { flex: 1 1 140px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 900px) {
  .shell { max-width: 820px; padding-top: 40px; }
  .tabs { justify-content: center; }
  .tabs a { flex: 0 1 150px; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
ul.plain { list-style: none; margin: 0; padding: 0; }
