/*
 * One stylesheet for the shop and the panel. Mobile first: the shop is mostly
 * opened on a phone, and the shop owner often runs the panel from one too.
 * No inline styles anywhere (the Content-Security-Policy forbids them); the
 * shop's own colour comes from index.php?r=tema as --brand.
 */
:root {
  --brand: #1f5f8b;
  --ink: #1f2328;
  --muted: #5d6570;
  --line: #dde4ea;
  --bg: #f6f8fa;
  --card: #ffffff;
  --soft: #edf2f6;
  --ok: #1d7a4c;
  --ok-bg: #e7f5ee;
  --warn: #9a5b00;
  --warn-bg: #fff4dc;
  --bad: #b3261e;
  --bad-bg: #fdecea;
  --info: #22529a;
  --info-bg: #e8f0fb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 10px rgba(0, 0, 0, .04);
  --focus: 0 0 0 3px rgba(34, 82, 154, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
.blog-cover { width: 100%; max-height: 420px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: var(--soft); }
.blog-cover-preview { width: min(100%, 300px); border-radius: 12px; }
.blog-body { max-width: 70ch; line-height: 1.7; }
.blog-body h2 { margin-top: 1.5em; }
a { color: var(--info); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: .5rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.row-between { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 1rem; }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* Demo band */
.demo-band {
  background: #2d2a26;
  color: #fff;
  font-size: .86rem;
  padding: .45rem 16px;
  text-align: center;
}
.demo-band strong { color: #ffd88a; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .55rem 1rem;
  border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  background: var(--brand); color: #fff;
}
.btn:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--info); border-color: transparent; padding-left: .4rem; padding-right: .4rem; }
.btn-danger { background: #fff; color: var(--bad); border-color: #efc4c0; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-big { min-height: 52px; font-size: 1.05rem; padding: .7rem 1.3rem; }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
form.inline { display: inline; }

/* Cards and notices */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.notice { border-radius: 10px; padding: .75rem 1rem; border: 1px solid; margin: 0 0 1rem; }
.notice p:last-child { margin-bottom: 0; }
.notice-ok { background: var(--ok-bg); border-color: #b8e0cb; color: #11472d; }
.notice-warn { background: var(--warn-bg); border-color: #f1d49a; color: #5c3900; }
.notice-error { background: var(--bad-bg); border-color: #f2c1bc; color: #7a1a14; }
.notice-info { background: var(--info-bg); border-color: #c4d6f2; color: #173a70; }

/* Chips */
.chip {
  display: inline-block; padding: .12rem .55rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; white-space: nowrap;
  background: var(--soft); color: var(--ink); border: 1px solid transparent;
}
/* Listing statuses and warning tones */
.st-draft { background: #eef0f3; color: #4a5560; }
.st-published { background: #e7f5ee; color: #11472d; }
.st-sold, .st-rented { background: #e3ecf8; color: #173a70; }
.st-withdrawn, .st-expired { background: #eeeeee; color: #555; }
.st-terminated { background: #fdecea; color: #7a1a14; border-color: #f2c1bc; }
.st-planned { background: #e8f0fb; color: #173a70; }
.st-done { background: #e7f5ee; color: #11472d; }
.st-noshow { background: #fff4dc; color: #5c3900; }
.st-cancelled { background: #eeeeee; color: #555; text-decoration: line-through; }
.st-failed { background: #fdecea; color: #7a1a14; border-color: #f2c1bc; }
.pay-paid { background: #e7f5ee; color: #11472d; }
.pay-unpaid { background: #fff4dc; color: #5c3900; }
.chip-warn { background: #fff4dc; color: #5c3900; border-color: #f1d49a; }
.chip-high { background: #ffe6cc; color: #7a3d00; border-color: #f0b878; }
.chip-crit { background: #fdecea; color: #7a1a14; border-color: #f2c1bc; }
.chip-late { background: #b3261e; color: #fff; }

/* Forms */
.field { margin: 0 0 1rem; }
.field label, .label { display: block; font-weight: 600; margin: 0 0 .3rem; }
.field .hint { font-size: .86rem; color: var(--muted); margin: .25rem 0 0; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=color], select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .7rem;
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #cfc7c0; border-radius: 10px;
}
input[type=color] { padding: .2rem; width: 5rem; }
textarea { min-height: 96px; resize: vertical; }
[aria-invalid=true] { border-color: var(--bad); background: #fffafa; }
.field-error { color: var(--bad); font-size: .88rem; font-weight: 600; margin: .3rem 0 0; }
.check { display: flex; gap: .6rem; align-items: flex-start; margin: .4rem 0; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: none; }
/* min-width: 0 — a fieldset is otherwise as wide as its widest option text and pushes the phone layout sideways */
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1.2rem; background: #fff; min-width: 0; }
select { max-width: 100%; text-overflow: ellipsis; }
.slots > p { grid-column: 1 / -1; margin: 0; }
legend { font-weight: 700; font-size: 1.05rem; padding: 0 .4rem; }
legend .num { display: inline-flex; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand); color: #fff; align-items: center; justify-content: center; font-size: .9rem; margin-right: .35rem; }
.counter { font-size: .85rem; color: var(--muted); text-align: right; }
.counter.over { color: var(--bad); font-weight: 700; }
.options { display: grid; gap: .5rem; }
.option-card { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; background: #fff; cursor: pointer; }
.option-card input { width: 1.2rem; height: 1.2rem; flex: none; }
.option-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.option-card .price { margin-left: auto; font-weight: 700; }
.option-card.disabled { opacity: .55; cursor: not-allowed; }
.slots { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.qty button { width: 44px; height: 44px; border: 0; background: var(--soft); font-size: 1.2rem; cursor: pointer; }
.qty input { width: 3.2rem; border: 0; text-align: center; min-height: 44px; border-radius: 0; }
.honey { position: absolute; left: -5000px; }

/* Shop */
.shop-head { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.shop-head .wrap { display: flex; align-items: center; gap: .8rem; min-height: 60px; }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--brand); text-decoration: none; margin-right: auto; }
.head-link { text-decoration: none; color: var(--ink); font-weight: 600; padding: .5rem .4rem; }
.cart-link { position: relative; }
.cart-count { display: inline-flex; min-width: 1.4rem; height: 1.4rem; padding: 0 .3rem; border-radius: 999px; background: var(--brand); color: #fff; font-size: .8rem; align-items: center; justify-content: center; }
main { padding: 1.2rem 0 2.5rem; }
.hero { background: linear-gradient(135deg, #fff 0%, var(--soft) 100%); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.2rem; }
.hero h1 { font-size: 1.5rem; }
.pill-nav { display: flex; gap: .5rem; overflow-x: auto; padding: .2rem 0 .6rem; margin-bottom: .6rem; scrollbar-width: thin; }
.pill-nav a { flex: none; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; font-weight: 600; font-size: .92rem; }
.pill-nav a[aria-current=page] { background: var(--brand); color: #fff; border-color: var(--brand); }
.products { display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.product-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.product-card img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; background: var(--soft); }
.product-card .body { padding: .6rem .7rem .8rem; }
.product-card .name { font-weight: 700; font-size: .95rem; }
.product-card .price { color: var(--brand); font-weight: 800; }
.product-card .from { font-weight: 400; font-size: .8rem; color: var(--muted); }
.badge-out { display: inline-block; margin-top: .3rem; font-size: .78rem; font-weight: 700; color: var(--bad); }
.product-page { display: grid; gap: 1.2rem; }
@media (min-width: 800px) { .product-page { grid-template-columns: 1fr 1fr; align-items: start; } }
.product-page img { border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.price-big { font-size: 1.5rem; color: var(--brand); font-weight: 800; margin: .2rem 0 .8rem; }
.cart-line { display: grid; grid-template-columns: 72px 1fr; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.cart-line .controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .4rem; }
.totals { width: 100%; border-collapse: collapse; }
.totals td { padding: .35rem 0; }
.totals td:last-child { text-align: right; font-weight: 600; }
.totals tr.total td { border-top: 1px solid var(--line); font-size: 1.1rem; font-weight: 800; padding-top: .6rem; }
.summary dl { display: grid; grid-template-columns: minmax(7rem, 35%) 1fr; gap: .35rem .8rem; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.code-box { font-size: 2rem; font-weight: 800; letter-spacing: .12em; background: #fff; border: 2px dashed var(--brand); border-radius: var(--radius); padding: .6rem 1rem; display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: .35rem; top: .35rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--line); }
.timeline li.done::before { background: var(--ok); }
.timeline li.now::before { background: var(--brand); box-shadow: 0 0 0 4px rgba(31, 95, 139, .18); }
.timeline li.bad::before { background: var(--bad); }
.shop-foot { border-top: 1px solid var(--line); background: #fff; padding: 1.2rem 0 5rem; font-size: .92rem; color: var(--muted); }
.shop-foot a { color: var(--muted); }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); padding: .6rem 16px calc(.6rem + env(safe-area-inset-bottom)); z-index: 30; }
.sticky-cta .wrap { display: flex; gap: .6rem; align-items: center; padding: 0; }
@media (min-width: 900px) { .sticky-cta { position: static; border: 0; background: none; padding: 0; } }

/* Panel */
.panel-head { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 25; }
.panel-head .wrap { display: flex; align-items: center; gap: .6rem; min-height: 56px; max-width: none; }
.panel-shell { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 56px); }
@media (min-width: 960px) { .panel-shell { grid-template-columns: 230px 1fr; } }
.side-nav { display: none; background: #fff; border-right: 1px solid var(--line); padding: 1rem .6rem; }
@media (min-width: 960px) { .side-nav { display: block; } }
.side-nav a { display: block; padding: .55rem .8rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; }
.side-nav a[aria-current=page] { background: var(--soft); color: var(--brand); }
.side-nav .sep { border-top: 1px solid var(--line); margin: .6rem 0; }
.panel-main { padding: 1rem 16px 6rem; min-width: 0; }
@media (min-width: 960px) { .panel-main { padding: 1.4rem 28px 3rem; } }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 960px) { .bottom-nav { display: none; } }
.bottom-nav a, .bottom-nav summary { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; font-size: .75rem; font-weight: 700; color: var(--muted); text-decoration: none; list-style: none; cursor: pointer; }
.bottom-nav summary::-webkit-details-marker { display: none; }
.bottom-nav .ico { font-size: 1.2rem; line-height: 1; }
.bottom-nav a[aria-current=page] { color: var(--brand); }
.bottom-nav details { position: relative; }
.bottom-nav details[open] .more-menu { display: block; }
.more-menu { display: none; position: absolute; right: .4rem; bottom: 62px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); min-width: 210px; padding: .4rem; }
.more-menu a { flex-direction: row; justify-content: flex-start; font-size: .95rem; color: var(--ink); min-height: 44px; padding: 0 .8rem; }
.who { font-size: .85rem; color: var(--muted); }
@media (max-width: 700px) {
  .panel-head .who { display: none; }
  .panel-head .brand { font-size: 1rem; }
}
.page-title { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-title h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .stats { grid-template-columns: repeat(7, 1fr); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .6rem .8rem; text-decoration: none; color: var(--ink); }
.stat .n { font-size: 1.45rem; font-weight: 800; }
.stat .t { font-size: .82rem; color: var(--muted); }
.slot-card { margin-bottom: 1rem; }
.slot-head { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
progress, meter { width: 140px; height: 12px; }
.order-row { display: grid; grid-template-columns: 1fr; gap: .4rem; padding: .7rem 0; border-top: 1px solid var(--line); }
@media (min-width: 900px) { .order-row { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.4fr) auto; align-items: center; } }
.order-row .who-line { font-weight: 700; }
.order-row .meta { font-size: .88rem; color: var(--muted); }
.order-row .actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-start; align-items: center; }
@media (min-width: 900px) { .order-row .actions { justify-content: flex-end; } }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .85rem; color: var(--muted); font-weight: 700; background: #fcfaf8; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.steps { display: flex; gap: .3rem; flex-wrap: wrap; margin: .3rem 0 1rem; padding: 0; list-style: none; }
.steps li { font-size: .8rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; background: var(--soft); color: var(--muted); }
.steps li.done { background: var(--ok-bg); color: var(--ok); }
.steps li.now { background: var(--brand); color: #fff; }
.action-box { border: 2px solid var(--brand); }
.filters { display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1rem; }
@media (min-width: 900px) { .filters { grid-template-columns: 2fr repeat(5, 1fr) auto; align-items: end; } }
.filters .field { margin: 0; }
.filters .q { grid-column: 1 / -1; }
@media (min-width: 900px) { .filters .q { grid-column: auto; } }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month .dow { font-size: .78rem; font-weight: 700; color: var(--muted); text-align: center; padding: .2rem 0; }
.month a.day { display: block; min-height: 72px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .3rem .35rem; text-decoration: none; color: var(--ink); font-size: .8rem; }
.month a.day .d { font-weight: 800; font-size: .95rem; }
.month a.day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.month a.day.closed { background: #f1f1f1; color: #888; }
.month a.day.full { background: #fdecea; }
.month .pad { min-height: 72px; }
.kv { display: grid; grid-template-columns: minmax(8rem, 32%) 1fr; gap: .3rem .8rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.card-message { font-size: 1.1rem; white-space: pre-wrap; background: #fffdf8; border: 1px dashed #d9c9b6; border-radius: 10px; padding: .8rem 1rem; }
.events { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.events li { padding: .4rem 0; border-top: 1px solid var(--line); }
.onboard ol { margin: 0; padding-left: 1.3rem; }
.onboard li { margin-bottom: .3rem; }
details.box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem 1rem; margin-bottom: 1rem; }
details.box > summary { font-weight: 700; cursor: pointer; min-height: 36px; display: flex; align-items: center; }
.new-banner { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 40; background: var(--info); color: #fff; padding: .6rem 1rem; border-radius: 999px; box-shadow: var(--shadow); font-weight: 700; }
.new-banner a { color: #fff; }
.preview-dialog { border: 0; border-radius: 14px; max-width: min(520px, 92vw); padding: 1.2rem; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.preview-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.preview-text { white-space: pre-wrap; background: #e7f7e3; border-radius: 10px; padding: .8rem; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.login-box { max-width: 420px; margin: 2rem auto; }
.demo-accounts { display: grid; gap: .5rem; }

/* Printing: the card and delivery slip, and the courier's day list */
.print-only { display: none; }
@media print {
  body { background: #fff; font-size: 12pt; }
  .no-print, .panel-head, .side-nav, .bottom-nav, .demo-band, .shop-head, .shop-foot { display: none !important; }
  .print-only { display: block; }
  .panel-shell { display: block; }
  .panel-main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .slip-card { page-break-after: always; }
  a { color: #000; text-decoration: none; }
}

/* ---- Emlak panel additions ---- */
.req { color: var(--bad); }
.span-2 { grid-column: 1 / -1; }
.price-big { font-size: 1.3rem; color: var(--brand); font-weight: 800; margin-left: .4rem; }
.listing-row { display: grid; grid-template-columns: 72px 1fr auto; gap: .8rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--line); }
.listing-row:first-child { border-top: 0; }
.listing-row .price { font-weight: 800; color: var(--brand); white-space: nowrap; }
.listing-row .strong { font-weight: 700; }
.thumb-empty { display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--muted); font-size: 1.6rem; }
.logo-preview { max-height: 56px; width: auto; margin-bottom: .4rem; }
.avatar { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); margin-bottom: .3rem; }
.photo-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.photo { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: relative; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo .chip { position: absolute; top: .4rem; left: .4rem; }
.photo figcaption { padding: .4rem; gap: .25rem; }
.task-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: space-between; padding: .7rem .8rem; border: 1px solid var(--line); border-left-width: 5px; border-radius: 10px; background: #fff; }
.task-row.tone-warn { border-left-color: #e0a526; }
.task-row.tone-high { border-left-color: #e07b1a; }
.task-row.tone-crit, .task-row.tone-late { border-left-color: var(--bad); background: #fffafa; }
.lookup-row input[type=text] { width: auto; flex: 1 1 10rem; }
.lookup-row select { width: auto; }
.grow { flex: 1 1 auto; min-width: 0; }
code { background: var(--soft); padding: .05rem .3rem; border-radius: 4px; font-size: .9em; }

/* ---- Printed documents (A4) ---- */
.doc-page { background: #fff; color: #000; max-width: 190mm; margin: 0 auto 1.2rem; padding: 14mm 16mm; border: 1px solid #bbb; font: 11pt/1.45 "Times New Roman", Georgia, serif; page-break-after: always; }
.doc-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #000; padding-bottom: 4pt; margin-bottom: 10pt; font: 10pt Arial, sans-serif; }
.doc-title { font: 700 15pt Arial, sans-serif; text-align: center; margin: 6pt 0 10pt; }
.doc-section { margin: 0 0 8pt; }
.doc-section h2 { font: 700 11pt Arial, sans-serif; margin: 0 0 3pt; border-bottom: 1px solid #888; }
.doc-kv { display: grid; grid-template-columns: 38mm 1fr; gap: 1pt 8pt; margin: 0; font-size: 10.5pt; }
.doc-kv dt { color: #333; }
.doc-kv dd { margin: 0; }
.doc-text { margin: 8pt 0; }
.doc-footer { font-size: 9.5pt; margin: 8pt 0; }
.doc-copy { font: 8.5pt Arial, sans-serif; color: #444; text-align: right; margin: 8pt 0 0; }
.sign-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10mm; margin-top: 12mm; }
.sign-box { border-top: 1px solid #000; padding-top: 3pt; font: 9.5pt Arial, sans-serif; min-height: 18mm; }
@media print {
  .doc-page { border: 0; margin: 0; padding: 0; max-width: none; }
  @page { size: A4; margin: 14mm; }
}

/* ---- Clients, requests, matches ---- */
.match-row { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; padding: .7rem 0; border-top: 1px solid var(--line); }
.match-row .actions { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.reasons { list-style: none; margin: .3rem 0 0; padding: 0; }
.reasons li::before { content: "\2713\00a0"; color: var(--ok); }
.reasons li.bad::before { content: "\2717\00a0"; color: var(--warn); }
.listing-row.no-thumb { grid-template-columns: 1fr auto; }

/* ---- Viewings, calendar, signatures ---- */
.sign-line { display: inline-block; width: 70mm; border-bottom: 1px solid #000; height: 1.4em; vertical-align: bottom; }
.cal-day { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cal-col { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; }
.cal-col h3 { margin: 0 0 .5rem; font-size: 1rem; }
.cal-item { display: block; text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-left-width: 5px; border-radius: 8px; padding: .4rem .5rem; margin-bottom: .4rem; background: #fff; font-size: .9rem; }
.cal-item.s-planned { border-left-color: var(--info); }
.cal-item.s-done { border-left-color: var(--ok); }
.cal-item.s-noshow { border-left-color: var(--warn); }
.cal-item.s-cancelled { border-left-color: #999; opacity: .7; text-decoration: line-through; }
.cal-week { display: grid; gap: .5rem; grid-template-columns: repeat(7, minmax(0, 1fr)); }
@media (max-width: 899px) { .cal-week { grid-template-columns: 1fr; } }
.cal-week .cal-col.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.feedback-box { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .6rem; }

/* ---- Public site ---- */
body.public { background: #fff; }
.brand-logo { max-height: 40px; width: auto; }
.head-nav { display: flex; align-items: center; gap: .2rem; }
@media (max-width: 640px) { .hide-sm { display: none; } }
.hero-search { background: linear-gradient(135deg, var(--brand), #164a6b); color: #fff; border: 0; }
.hero-search h1 { color: #fff; font-size: 1.7rem; }
.hero-search p { color: #e6eef4; }
.search-box { display: grid; gap: .7rem; grid-template-columns: 1fr; background: rgba(255, 255, 255, .96); border-radius: var(--radius); padding: 1rem; color: var(--ink); }
.search-box .field { margin: 0; }
@media (min-width: 820px) { .search-box { grid-template-columns: repeat(3, 1fr) auto; align-items: end; } }
.listing-grid { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .listing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .listing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1150px) { .listing-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.listing-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.listing-card .card-link { text-decoration: none; color: var(--ink); display: block; }
.card-img { position: relative; background: var(--soft); }
.card-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.img-empty { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--muted); }
.badges { position: absolute; left: .5rem; top: .5rem; display: flex; gap: .3rem; flex-wrap: wrap; }
.badge { display: inline-block; font-size: .74rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--ink); }
.badge-drop { background: #fdecea; color: #7a1a14; }
.badge-new { background: #e7f5ee; color: #11472d; }
.badge-deal { background: var(--brand); color: #fff; }
.listing-card .body { padding: .7rem .8rem; }
.listing-card .price { font-weight: 800; color: var(--brand); font-size: 1.1rem; }
.listing-card .name { font-weight: 700; margin: .1rem 0 .25rem; }
.listing-card .meta { font-size: .86rem; color: var(--muted); }
.card-tools { display: flex; border-top: 1px solid var(--line); }
.card-tools .tool { flex: 1; min-height: 44px; border: 0; background: #fff; font: inherit; font-size: .88rem; cursor: pointer; color: var(--ink); }
.card-tools .tool + .tool { border-left: 1px solid var(--line); }
.card-tools .tool.on { color: var(--brand); font-weight: 700; }
.filters-public { display: grid; gap: .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1rem; }
.filters-public .field { margin: 0; }
.filters-public .field.actions { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: end; }
@media (min-width: 900px) { .filters-public { grid-template-columns: repeat(5, minmax(0, 1fr)); } .filters-public .field.actions { grid-column: auto; } }
.pager { justify-content: center; margin: 1.2rem 0; }
.crumbs { margin: 0 0 .6rem; color: var(--muted); }
.listing-page { display: grid; gap: 1.2rem; }
@media (min-width: 960px) { .listing-page { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .listing-page .side { position: sticky; top: 76px; } }
.gallery-main img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--soft); }
.gallery-thumbs { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.gallery-thumbs img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.kv-wide { grid-template-columns: minmax(8rem, 38%) 1fr; }
.features { margin: 0; padding-left: 1.2rem; columns: 2; }
@media (max-width: 560px) { .features { columns: 1; } }
.agent-line { display: flex; gap: .7rem; align-items: center; }
.contact-card .avatar { margin: 0; }
.sticky-cta .wrap { display: flex; gap: .5rem; }
.sticky-cta .btn { flex: 1; }
@media (min-width: 960px) { .sticky-cta { display: none; } }
.compare-bar { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 2px solid var(--brand); padding: .5rem 0; z-index: 35; }
.btn.disabled { opacity: .55; pointer-events: none; }
table.compare th, table.compare td { min-width: 9rem; }
.team-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.team-card { text-align: center; }
.agent-head { display: flex; gap: 1rem; text-align: left; align-items: center; flex-wrap: wrap; }
.avatar-lg { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; border: 1px solid var(--line); margin: 0 auto .6rem; }
.avatar-empty { display: flex; align-items: center; justify-content: center; background: var(--soft); font-size: 2.6rem; color: var(--muted); }
.page-text { max-width: 760px; }
.flyer-price { font: 700 16pt Arial, sans-serif; text-align: center; margin: 0 0 8pt; }
.flyer-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4pt; margin-bottom: 8pt; }
.flyer-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
@media print { .compare-bar, .sticky-cta { display: none !important; } }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li { padding: .35rem 0; border-top: 1px solid var(--line); }
.checks li:first-child { border-top: 0; }
