:root {
  font-family: Inter, system-ui, sans-serif;
  color: #241a31;
  background: #f6f3f9;
  line-height: 1.45;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.wrap { width: min(1140px, calc(100% - 32px)); margin-inline: auto; }
.top { background: #1b1227; color: #fff; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 68px; letter-spacing: .045em; }
.brand img { border-radius: 10px; }
.brand a { color: #f2dcff; margin-left: auto; letter-spacing: 0; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3.15rem); line-height: 1.1; margin: 38px 0 24px; letter-spacing: -.045em; }
h2 { margin: 0; font-size: 1.24rem; }
p { margin: 0 0 12px; }
.layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); align-items: start; }
.panel { border: 1px solid #e2d9eb; border-radius: 16px; background: #fff; padding: clamp(16px, 3vw, 24px); }
#pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#pricing h2, .wide { grid-column: 1 / -1; }
label { display: grid; gap: 5px; font-weight: 600; font-size: .88rem; }
input, select, button { font: inherit; }
input, select { width: 100%; min-height: 42px; border: 1px solid #cec2da; border-radius: 8px; background: white; padding: 7px 10px; color: inherit; }
button { cursor: pointer; min-height: 42px; border: 1px solid transparent; border-radius: 8px; background: #6226a3; color: white; padding: 7px 13px; font-weight: 650; }
button.secondary { background: #f3e9ff; border-color: #e4d5f3; color: #511b87; }
button.quiet { background: transparent; color: #65497d; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #8a4dc2; outline-offset: 2px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.results h2, .history-header { margin-bottom: 14px; }
.prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.price { border: 1px solid #e8dced; border-radius: 10px; padding: 10px; min-width: 0; overflow-wrap: anywhere; }
.price:first-child { grid-column: 1 / -1; padding: 13px; background: #f6edff; }
.price h3 { margin: 0; font-size: .96rem; }
.price strong { display: block; margin: 2px 0; color: #54208a; font-size: 1.24rem; }
.price:first-child strong { font-size: 1.8rem; }
.price small { display: block; color: #584966; }
.history { margin: 20px 0 36px; }
.history-header h2 { margin-right: auto; }
#history-platform {
  display: inline-block;
  margin-inline-start: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f3e9ff;
  color: #54208a;
  font-size: .76rem;
  vertical-align: middle;
}
#status:empty { display: none; }
#status { color: #54208a; font-weight: 650; }
#search-field { max-width: 420px; margin-bottom: 12px; }
#records { list-style: none; padding: 0; margin: 0; }
#records li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; border-top: 1px solid #eadff1; gap: 8px; padding: 10px 0; overflow-wrap: anywhere; }
#records small { display: block; color: #584966; }
.saved-prices {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 100px), 1fr));
  gap: 8px;
  margin: 3px 0 4px;
}
.saved-prices > div {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #eadff1;
  border-radius: 8px;
  background: #f9f5fd;
}
.saved-prices dt { font-size: .8rem; color: #584966; }
.saved-prices dd { margin: 2px 0 0; color: #54208a; font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 790px) { .layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 380px) { #pricing { grid-template-columns: minmax(0, 1fr); } }
dialog { width: min(420px, calc(100% - 32px)); color: inherit; }
dialog::backdrop { background: #1b122799; }
#category-form { display: grid; gap: 14px; }
#category-error { margin: 0; color: #9c2351; }
#category-error:empty { display: none; }
