@font-face { font-family: "Vazirmatn"; src: url("/static/fonts/Vazirmatn-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/static/fonts/Vazirmatn-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

/* Look and feel of the real amazon.de results page: dark navy header, a wide
   search field, a filter row, and result cards with rating, deal badge and a
   red "-X%" next to a big price. */
:root {
  --bg: #eaeded; --panel: #ffffff; --text: #0f1111; --muted: #565959;
  --link: #007185; --border: #d5d9d9;
  --nav: #131921; --nav-2: #232f3e; --gold: #febd69; --gold-2: #f3a847;
  --accent: #c2410c; --sel: #e77600; --deal: #cc0c39;
  --radius: 8px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: "Vazirmatn", Tahoma, sans-serif; line-height: 1.55; }
body.noscroll { overflow: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

/* ---- amazon header ---- */
.amz { position: sticky; top: 0; z-index: 20; background: var(--nav); color: #fff; }
.amz-top { display: grid; grid-template-columns: auto 1fr; align-items: center;
  column-gap: 10px; row-gap: 8px; padding: calc(8px + var(--safe-t)) 12px 8px; }
/* phones: logo + icons on one line, the search field full width under them */
.amz-search { grid-column: 1 / -1; order: 3; }
@media (min-width: 720px) {
  .amz-top { grid-template-columns: auto 1fr auto; }
  .amz-search { grid-column: auto; order: 0; }
}
.amz-logo { font-weight: 700; font-size: 19px; text-decoration: none; white-space: nowrap; }
.amz-logo span { color: var(--gold); }
.amz-search { flex: 1; min-width: 0; display: flex; border-radius: 6px; overflow: hidden;
  background: #fff; }
.amz-search input { flex: 1; min-width: 0; border: 0; padding: 9px 12px; font-size: 16px;
  outline: none; color: var(--text); background: transparent; }
.amz-search input:focus { box-shadow: 0 0 0 3px var(--gold-2) inset; }
.amz-search button[type="submit"] { border: 0; background: var(--gold); color: #111;
  padding: 0 16px; font-size: 17px; }
.clearq { border: 0; background: transparent; color: var(--muted); font-size: 16px;
  padding: 0 10px; cursor: pointer; }
.amz-nav { display: flex; gap: 2px; justify-content: flex-end; }
.iconbtn { display: inline-grid; place-items: center; min-width: 38px; height: 38px; border: 0;
  border-radius: 8px; background: transparent; font-size: 19px; text-decoration: none; cursor: pointer; }
.iconbtn.light { color: #fff; }
.iconbtn:active { background: rgba(255, 255, 255, .15); }
.amz-sub { display: flex; align-items: center; gap: 8px; background: var(--nav-2);
  padding: 6px 12px; }
.amz-filter { flex: none; border: 0; background: transparent; color: #fff; font-size: 14px;
  padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.amz-filter.on { background: var(--gold); color: #111; font-weight: 700; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid rgba(255, 255, 255, .35); background: transparent;
  color: #fff; border-radius: 999px; padding: 3px 12px; font-size: 13px;
  white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 700; }
.chip.deal.on { background: var(--deal); border-color: var(--deal); color: #fff; }

/* ---- filter drawer ---- */
.filters { position: sticky; top: 0; z-index: 18; background: var(--panel);
  border-bottom: 1px solid var(--border); padding: 10px 12px 12px; }
.f-row { display: flex; gap: 10px; }
.filters label { flex: 1; display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.filters input, .filters select { display: block; width: 100%; margin-top: 3px; padding: 7px 10px;
  border: 1px solid #888c8c; border-radius: 6px; font-size: 16px; background: #fff; color: var(--text); }
.f-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.f-quick button { border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 4px 12px; font-size: 13px; cursor: pointer; }
.f-quick button.on { background: var(--nav-2); color: #fff; border-color: var(--nav-2); }
.f-actions { justify-content: flex-end; align-items: center; }
.count { margin: 10px 2px 6px; font-size: 13px; color: var(--muted); }

/* ---- results grid (amazon card look) ---- */
main { padding: 4px 12px calc(110px + var(--safe-b)); max-width: 1280px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tile { position: relative; background: var(--panel); border-radius: var(--radius);
  border: 2px solid transparent; overflow: hidden; cursor: pointer; transition: box-shadow .15s; }
.tile.sel { border-color: var(--sel); box-shadow: 0 0 0 3px rgba(231, 118, 0, .25); }
.tile .ph { position: relative; aspect-ratio: 1; background: #fff; display: grid; place-items: center;
  padding: 8px; overflow: hidden; }
.tile .ph img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.tile .check { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; border: 2px solid #c7cdcd; background: rgba(255,255,255,.92);
  color: transparent; font-weight: 700; }
.tile.sel .check { background: var(--sel); border-color: var(--sel); color: #fff; }
.tile .info { padding: 8px 10px 12px; font-size: 13px; }
.tile .deal { display: inline-block; background: var(--deal); color: #fff; font-size: 11px;
  font-weight: 700; padding: 1px 7px; border-radius: 4px; margin-bottom: 4px; }
.tile .t { margin: 0 0 3px; direction: ltr; text-align: left; color: var(--link);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.9em; line-height: 1.45; }
.tile .stars { margin: 0 0 2px; direction: ltr; text-align: left; font-size: 12px; }
.tile .stars .s { color: #de7921; letter-spacing: -1px; }
.tile .stars b { color: var(--link); font-weight: 400; margin-left: 5px; }
.tile .eur { margin: 0; direction: ltr; text-align: left; display: flex; align-items: baseline; gap: 6px; }
.tile .eur .off { color: var(--deal); font-size: 14px; font-weight: 700; }
.tile .eur b { font-size: 19px; font-weight: 700; }
.tile .was { margin: 0; direction: ltr; text-align: left; font-size: 11px; color: var(--muted); }
.tile .was s { text-decoration: line-through; }
.tile .toman { margin: 3px 0 0; color: #111; font-weight: 700; font-size: 13px;
  background: #f7e9b0; display: inline-block; padding: 1px 7px; border-radius: 4px; }
.tile.noprice .toman { background: none; color: var(--muted); font-weight: 600; font-size: 12px; padding: 0; }
.tile.noprice .check { display: none; }
.tile .src { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); text-decoration: none; }
.tile.skel { aspect-ratio: .62; background: linear-gradient(90deg, #e3e6e6 25%, #f4f6f6 50%, #e3e6e6 75%);
  background-size: 200% 100%; animation: sh 1.2s infinite; cursor: default; }
@keyframes sh { to { background-position: -200% 0; } }

.hint { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.wide { display: block; width: 100%; margin-top: 14px; }
.primary, .ghost { border-radius: 8px; padding: 10px 18px; cursor: pointer; font-weight: 700; }
.primary { background: var(--gold); color: #111; border: 1px solid var(--gold-2); }
.primary:disabled { opacity: .5; }
.ghost { background: var(--panel); border: 1px solid #888c8c; color: var(--text); }
.small { padding: 7px 12px; font-size: 14px; }

/* ---- selection bar ---- */
.selbar { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b));
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 8px; border-radius: 18px;
  background: #23201b; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 640px; margin: 0 auto; }
.selbar span { flex: 1; font-size: 14px; }
.selbar .primary { padding: 11px 22px; }

/* ---- results sheet ---- */
.sheet { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto;
  padding-bottom: calc(24px + var(--safe-b)); }
.build { min-height: 70vh; width: 100%; max-width: 440px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center; }
.build-status { margin: 0; font-size: 17px; font-weight: 700; }
.build-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }
.build-actions .primary { padding: 14px 28px; font-size: 17px; }
.sheet-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: calc(8px + var(--safe-t)) 14px 8px; background: var(--panel); border-bottom: 1px solid var(--border); }
.sheet-head h2 { margin: 0; font-size: 17px; }
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
  padding: 6px 14px; max-width: 1200px; margin: 0 auto; }
.poster { background: var(--panel); border-radius: var(--radius); padding: 10px; text-align: center; }
.poster img { width: 100%; border-radius: 10px; display: block; }
.poster .row { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.poster.loading, .poster.failed { min-height: 220px; display: grid; place-items: center; align-content: center;
  gap: 10px; color: var(--muted); font-size: 13px; direction: ltr; }
.spin { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: rot 0.9s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---- settings page ---- */
.settings { max-width: 560px; padding-bottom: 40px; }
.group { background: var(--panel); border-radius: var(--radius); padding: 14px 16px 6px; margin: 14px 0; }
.group h2 { font-size: 16px; margin: 0 0 8px; }
.group label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.group input, .group select, .group textarea { display: block; width: 100%; margin-top: 4px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 16px;
  color: var(--text); background: #fff; }
.steps { padding-right: 18px; } .steps li { margin-bottom: 4px; }
code { direction: ltr; display: inline-block; background: #f3efe8; padding: 0 6px; border-radius: 6px; font-size: 12px; }

.settings .checkrow { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; }
.settings .checkrow input { width: 20px; height: 20px; margin: 0; }

/* ---- settings: one card per proxy account ---- */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sec-head h2 { margin: 0; }
.usage-total { margin: 6px 0 10px; font-size: 14px; color: var(--muted); }
.usage-total b { color: var(--text); font-size: 17px; }
.usage-list { display: grid; gap: 10px; margin-bottom: 12px; }
.acc { border: 1px solid var(--border); border-right: 4px solid var(--border);
  border-radius: 10px; padding: 10px 12px; background: #fcfcfc; }
.acc.ok { border-right-color: #1b8a5a; }
.acc.low { border-right-color: #c7811a; }
.acc.empty, .acc.warn { border-right-color: var(--deal); }
.acc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.acc-top code { direction: ltr; font-size: 11px; background: #eef1f1; color: var(--muted); }
.acc-tag { margin-right: auto; font-size: 11px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.acc.ok .acc-tag { color: #1b8a5a; border-color: #bfe3d2; }
.acc.empty .acc-tag { color: var(--deal); border-color: #f0c2cc; }
.acc-bar { height: 7px; border-radius: 999px; background: #e7eaea; overflow: hidden; margin: 8px 0 6px; }
.acc-bar span { display: block; height: 100%; background: #1b8a5a; }
.acc.low .acc-bar span { background: #c7811a; }
.acc.empty .acc-bar span { background: var(--deal); }
.acc-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* ---- settings: tabs instead of one long scroll ---- */
/* sits under the title bar, which is sticky at the very top */
.tabs { position: sticky; top: calc(54px + var(--safe-t)); z-index: 18;
  display: flex; gap: 4px; overflow-x: auto;
  padding: 8px 10px; background: var(--nav-2); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 0; background: transparent; color: #fff; opacity: .75;
  font-size: 14px; padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.tab.on { background: var(--gold); color: #111; font-weight: 700; opacity: 1; }
.settings .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
/* keep the inputs on one line even when a label wraps to two */
.settings .two label { margin-bottom: 10px; display: flex; flex-direction: column;
  justify-content: space-between; }
.savebar { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px;
  justify-content: flex-end; padding: 10px 0 calc(10px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 70%, transparent); }
.savebar .primary { padding: 12px 34px; }

/* ---- settings title bar (same dark nav as the shop header) ---- */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; background: var(--nav); color: #fff;
  padding: calc(8px + var(--safe-t)) 12px 8px; }
.bar h1 { margin: 0; font-size: 18px; font-weight: 700; }
.bar .iconbtn { color: #fff; }

/* ---- settings: folded help blocks ---- */
.settings details { border-top: 1px solid var(--border); padding: 6px 0; }
.settings details:first-of-type { border-top: 0; }
.settings summary { cursor: pointer; font-size: 16px; font-weight: 700; padding: 6px 0; }

/* ---- amazon's own filter rail ---- */
.rail { margin-top: 4px; min-width: 0; overflow-x: hidden; }
.rail h3 { margin: 0; font-size: 14px; }
.rail details { border-top: 1px solid var(--border); padding: 2px 0; }
.rail summary { cursor: pointer; font-size: 14px; font-weight: 700; padding: 8px 2px;
  direction: rtl; text-align: right; }
.rail ul { list-style: none; margin: 0 0 8px; padding: 0 2px; display: grid; gap: 2px; }
.rail li { min-width: 0; overflow: hidden; }
.rail a { display: block; max-width: 100%; padding: 4px 2px; font-size: 13px; color: var(--link);
  text-decoration: none; direction: ltr; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail a:active { background: #eef1f1; }
.rail .note { color: var(--muted); font-size: 12px; margin: 8px 2px 0; }

/* phone: the panel is a drawer, as before. wide screen: a left sidebar that
   is always open, with the results beside it */
@media (min-width: 980px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px;
    gap: 14px; max-width: 1280px; margin: 0 auto; align-items: start; }
  .layout main { grid-column: 1; grid-row: 1; padding-left: 0; padding-right: 0; max-width: none; }
  /* no inner scrollbar: it caught the wheel, so the rail scrolled inside
     its own box while the page stayed put */
  .layout #filters { grid-column: 2; grid-row: 1; position: static; border: 0;
    border-radius: var(--radius); margin-top: 10px; overflow-x: hidden; }
  .layout #filters[hidden] { display: block !important; }
  #filterBtn { display: none; }
}
.rail .amzlink { display: block; color: var(--link); text-decoration: none; margin-top: 6px; }

/* "today's deals" scope line above the results */
.count .scope { display: inline-block; background: var(--deal); color: #fff; font-weight: 700;
  font-size: 12px; padding: 2px 10px; border-radius: 999px; margin-left: 8px; }
.count .scope-all { border: 1px solid var(--border); background: #fff; border-radius: 999px;
  padding: 2px 10px; font-size: 12px; margin-right: 8px; cursor: pointer; }

/* shared settings store broken (dead GitHub token): impossible to miss */
.set-alert { background: #fdecea; color: #8a1c12; border: 1px solid #f5c2bd;
  border-radius: 10px; padding: 10px 14px; margin: 10px 14px 0; font-size: 13px;
  line-height: 1.7; text-align: right; }
.set-alert b { color: #b3261e; }
.set-alert a { color: #b3261e; font-weight: 700; white-space: nowrap; }
#sharedState.set-alert { margin: 8px 0 12px; }

/* ---- "Amazon today": the rows on top of amazon.de, live ---- */
.home { background: var(--panel); border-radius: var(--radius); padding: 12px 12px 6px;
  margin: 10px 0 14px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.home-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.home-head h2 { margin: 0; font-size: 17px; }
.home-head .hint { font-size: 11px; }
.home-camps { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px 0 4px; }
.home-camps::-webkit-scrollbar { display: none; }
.hchip { flex: none; border: 0; border-radius: 18px; padding: 7px 14px; font-weight: 700;
  font-size: 13px; background: #f0f2f2; color: var(--text); cursor: pointer; }
.hchip:first-child { background: #111114; color: #ffd400; }
.hrow { margin-top: 10px; }
.hrow-head { display: flex; align-items: center; justify-content: space-between; }
.hrow-head h3 { margin: 0 0 6px; font-size: 15px; }
.hmore { border: 0; background: none; color: var(--link); font-weight: 700; cursor: pointer; font-size: 13px; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 8px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.htile { flex: none; width: 140px; scroll-snap-align: start; cursor: pointer;
  border: 2px solid transparent; border-radius: var(--radius); position: relative; }
.htile.sel { border-color: var(--sel); }
.htile .hph { position: relative; aspect-ratio: 1; background: #f7f7f7; border-radius: 6px;
  display: grid; place-items: center; overflow: hidden; }
.htile .hph img { max-width: 88%; max-height: 88%; object-fit: contain; }
.htile .off { position: absolute; top: 6px; right: 6px; background: var(--deal); color: #fff;
  font-size: 12px; font-weight: 700; border-radius: 6px; padding: 0 6px; }
.htile .check { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #d5d9d9; background: rgba(255,255,255,.9); color: transparent;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.htile.sel .check { background: var(--sel); border-color: var(--sel); color: #fff; }
.htile .t { margin: 6px 2px 0; font-size: 12px; line-height: 1.45; direction: ltr; text-align: left;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.htile .hprice { margin: 2px; font-size: 12px; color: var(--muted); font-weight: 700; }
.htile.sel .hprice { color: var(--accent); }
.htile.busy::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius);
  background: rgba(255,255,255,.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%23e77600' stroke-width='5' stroke-dasharray='90 40'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.9s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center no-repeat; }
