/* =====================================================================
   TCG-Teilen – Stylesheet  (Design an tcg-ohof.de angelehnt:
   schwarzer Kopf, Serifen-Wortmarke, Orange als Akzent auf Weiß)
   ===================================================================== */
:root{
  --ink:#1c1a17;
  --ink-soft:#4f4a43;
  --ink-faint:#867e73;
  --ground:#fbf9f6;
  --surface:#ffffff;
  --surface-2:#f3efe8;
  --line:#e7e1d7;
  --line-soft:#efeae1;
  --header:#141210;
  --orange:#d97b0f;
  --orange-dark:#b3630a;
  --orange-wash:#fbefdd;
  --give:#3c8a5b;  --give-wash:#e6f2ea;
  --swap:#2f6fb0;  --swap-wash:#e5eef8;
  --lend:#d97b0f;  --lend-wash:#fbefdd;
  --ok:#3c8a5b; --stop:#c0392b; --stop-wash:#f8e6e3;
  --radius:13px;
  --maxw:640px;
  --shadow:0 1px 2px rgba(20,18,16,.05), 0 8px 22px rgba(20,18,16,.06);
  --font-body:'Source Sans 3',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-display:'Playfair Display',Georgia,'Times New Roman',serif;
  --font-mono:ui-monospace,'SF Mono',Menlo,Consolas,monospace;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{background:var(--ground);color:var(--ink);font-family:var(--font-body);font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:var(--orange-dark)}
img{max-width:100%}

.wrap{max-width:var(--maxw);margin:0 auto;padding:0 16px 110px}

/* Kopf */
header.top{background:var(--header);position:sticky;top:0;z-index:20}
.top-inner{max-width:var(--maxw);margin:0 auto;padding:14px 16px;display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.wordmark{font-family:var(--font-display);font-weight:700;font-size:1.6rem;color:#fff;letter-spacing:.01em;text-decoration:none}
.wordmark .sep{color:var(--orange)}
.motto{font-family:var(--font-display);font-style:italic;color:#e9e2d6;font-size:.86rem;opacity:.85}

h1.page-title{font-family:var(--font-display);font-weight:700;font-size:1.5rem;margin:20px 0 4px;text-wrap:balance;line-height:1.15}
.page-sub{color:var(--ink-soft);margin:0 0 16px;font-size:.96rem}
.section-label{font-size:.72rem;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--ink-faint);margin:22px 2px 9px}

/* Flash */
.flash{border-radius:11px;padding:11px 14px;margin:14px 0;font-size:.92rem;border:1px solid}
.flash.info{background:var(--orange-wash);border-color:#eccfa3;color:#8a5205}
.flash.ok{background:var(--give-wash);border-color:#bcdcc7;color:#256045}
.flash.error{background:var(--stop-wash);border-color:#eab8b0;color:#992d20}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:inherit;font-size:.98rem;
  font-weight:600;cursor:pointer;border-radius:11px;border:1px solid transparent;padding:11px 17px;text-decoration:none;
  transition:background .15s,border-color .15s,transform .05s;line-height:1}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--orange);color:#fff;border-color:var(--orange)}
.btn-primary:hover{background:var(--orange-dark);color:#fff}
.btn-ghost{background:var(--surface);color:var(--ink);border-color:var(--line)}
.btn-ghost:hover{background:var(--surface-2)}
.btn-danger{background:transparent;color:var(--stop);border-color:var(--stop)}
.btn-danger:hover{background:var(--stop-wash)}
.btn-block{width:100%}
.btn-sm{padding:8px 13px;font-size:.86rem;border-radius:9px}

/* Suche + Filter */
.toolbar{display:flex;flex-direction:column;gap:10px;margin-bottom:16px}
.search input{width:100%;padding:11px 14px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--ink);font-size:1rem;font-family:inherit}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{border:1px solid var(--line);background:var(--surface);color:var(--ink-soft);border-radius:999px;padding:6px 14px;font-size:.85rem;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:7px;text-decoration:none}
.chip[aria-pressed="true"]{background:var(--ink);color:#fff;border-color:var(--ink)}
.chip .swatch{width:9px;height:9px;border-radius:50%}

/* Kategorien + schlanke Zeilen */
.cat{margin-bottom:22px}
.cat-head{display:flex;align-items:baseline;justify-content:space-between;margin:0 2px 8px}
.cat-title{font-weight:700;font-size:1rem}
.cat-count{font-size:.8rem;color:var(--ink-faint);font-variant-numeric:tabular-nums}
.rows{display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow)}
.row{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line-soft);text-decoration:none;color:inherit}
.row:last-child{border-bottom:none}
.row:hover{background:var(--surface-2)}
.num{font-family:var(--font-mono);font-weight:600;font-size:.9rem;color:var(--orange-dark);background:var(--orange-wash);border-radius:7px;padding:3px 7px;font-variant-numeric:tabular-nums}
.row-main{min-width:0}
.row-title{font-weight:600;font-size:1rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.row-meta{font-size:.78rem;color:var(--ink-faint);display:flex;gap:7px;align-items:center;margin-top:1px}
.art-dot{width:8px;height:8px;border-radius:50%;flex:0 0 auto}
.badge{font-size:.68rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;padding:3px 8px;border-radius:6px;white-space:nowrap}
.b-give{background:var(--give-wash);color:var(--give)}
.b-swap{background:var(--swap-wash);color:var(--swap)}
.b-lend{background:var(--lend-wash);color:var(--lend)}
.b-gone{background:var(--surface-2);color:var(--ink-faint)}
.b-pending{background:#fff4d6;color:#8a6d10}

.empty{text-align:center;color:var(--ink-faint);padding:42px 20px;font-size:.95rem}

/* Karten + Formulare */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow)}
.card + .card{margin-top:14px}
.field{display:flex;flex-direction:column;gap:5px;margin-bottom:14px}
.field label{font-size:.85rem;font-weight:600;color:var(--ink-soft)}
.field .hint{font-size:.78rem;color:var(--ink-faint);font-weight:400}
input[type=text],input[type=email],input[type=tel],input[type=password],textarea,select{
  font-family:inherit;font-size:1rem;padding:11px 13px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);width:100%}
textarea{resize:vertical;min-height:96px}
input:focus,textarea:focus,select:focus,.btn:focus-visible,.chip:focus-visible,.row:focus-visible{outline:2px solid var(--orange);outline-offset:2px}

/* Segment (Art) */
.seg{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.seg label{cursor:pointer}
.seg input{position:absolute;opacity:0;pointer-events:none}
.seg .opt{display:flex;flex-direction:column;align-items:center;gap:3px;text-align:center;border:1px solid var(--line);border-radius:11px;padding:11px 6px;background:var(--surface);font-size:.86rem;font-weight:600;color:var(--ink-soft)}
.seg .opt small{font-weight:400;font-size:.7rem;color:var(--ink-faint)}
.seg input:checked + .opt{border-color:var(--sel);color:var(--sel);background:var(--sel-wash);box-shadow:inset 0 0 0 1px var(--sel)}
.seg .give{--sel:var(--give);--sel-wash:var(--give-wash)}
.seg .swap{--sel:var(--swap);--sel-wash:var(--swap-wash)}
.seg .lend{--sel:var(--lend);--sel-wash:var(--lend-wash)}

.checkline{display:flex;gap:10px;align-items:flex-start;font-size:.88rem;color:var(--ink-soft)}
.checkline input{margin-top:3px;width:auto}
.note{font-size:.85rem;color:var(--ink-soft);background:var(--surface-2);border-radius:10px;padding:11px 13px}
.note.warn{background:var(--lend-wash);color:#8a5205}
.err{color:var(--stop);font-size:.82rem}

.photo-drop{display:block;border:1.5px dashed var(--line);border-radius:12px;padding:20px;text-align:center;color:var(--ink-faint);font-size:.9rem;background:var(--surface-2);cursor:pointer}
.photo-prev{border-radius:12px;overflow:hidden;border:1px solid var(--line)}
.photo-prev img{display:block;width:100%;max-height:260px;object-fit:cover}

/* Detailseite */
.detail-photo{border-radius:14px;overflow:hidden;border:1px solid var(--line);margin:16px 0;background:var(--surface-2)}
.detail-photo img{display:block;width:100%;max-height:340px;object-fit:cover}
.detail-photo .ph{display:flex;align-items:center;justify-content:center;height:150px;color:var(--ink-faint)}
.detail-head{display:flex;align-items:flex-start;gap:10px;justify-content:space-between}
.detail-title{font-family:var(--font-display);font-weight:700;font-size:1.5rem;line-height:1.15;text-wrap:balance}
.detail-meta{display:flex;flex-wrap:wrap;gap:9px;align-items:center;margin:10px 0 14px;font-size:.85rem;color:var(--ink-faint)}
.price{font-weight:700;color:var(--ink)}
.detail-desc{font-size:1rem;white-space:pre-wrap;margin-bottom:18px}

/* Vorgang / Nachrichten */
.thread{display:flex;flex-direction:column;gap:8px;margin:12px 0}
.msg{max-width:84%;padding:9px 13px;border-radius:14px;font-size:.95rem;white-space:pre-wrap;line-height:1.4}
.msg .who{font-size:.66rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;opacity:.75;margin-bottom:2px}
.msg.mine{align-self:flex-end;background:var(--orange);color:#fff;border-bottom-right-radius:4px}
.msg.theirs{align-self:flex-start;background:var(--surface-2);color:var(--ink);border-bottom-left-radius:4px}
.msg .ts{font-size:.66rem;opacity:.65;margin-top:3px}
.status-line{text-align:center;font-size:.85rem;padding:10px;border-radius:10px;background:var(--surface-2)}
.status-stop{color:var(--stop);font-weight:600}
.status-done{color:var(--ok);font-weight:600}
.composer{display:flex;gap:8px;align-items:flex-end;margin-top:10px}
.composer textarea{min-height:46px}

/* Mini-Listen (Konto/Admin) */
.list-mini{display:flex;flex-direction:column;gap:8px}
.mini-row{display:flex;align-items:center;gap:10px;justify-content:space-between;background:var(--surface);border:1px solid var(--line);border-radius:11px;padding:11px 13px;text-decoration:none;color:inherit}
.mini-row:hover{background:var(--surface-2)}
.mini-left{display:flex;align-items:center;gap:10px;min-width:0}
.mini-title{font-weight:600;font-size:.94rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mini-sub{font-size:.76rem;color:var(--ink-faint)}
.dot-unread{width:9px;height:9px;border-radius:50%;background:var(--stop);flex:0 0 auto}
.codebox{font-family:var(--font-mono);font-size:1.5rem;letter-spacing:.28em;font-weight:600;color:var(--orange-dark);background:var(--orange-wash);border-radius:10px;padding:13px;text-align:center;margin:6px 0}

/* Untere Navigation */
nav.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:30;background:var(--surface);border-top:1px solid var(--line);display:flex;justify-content:center}
.tabbar-inner{display:grid;grid-template-columns:repeat(3,1fr);width:100%;max-width:var(--maxw)}
.tab{display:flex;flex-direction:column;align-items:center;gap:3px;padding:9px 4px 10px;color:var(--ink-faint);font-size:.72rem;font-weight:600;text-decoration:none}
.tab svg{width:23px;height:23px}
.tab[aria-current="true"]{color:var(--orange)}
.tab .pos{position:relative}
.tab .dot{position:absolute;top:-3px;right:-6px;width:8px;height:8px;border-radius:50%;background:var(--stop)}

footer.legal{text-align:center;font-size:.78rem;color:var(--ink-faint);padding:8px 0 4px}
footer.legal a{color:var(--ink-faint);margin:0 6px}

.link-line{text-align:center;margin:14px 0 0;font-size:.9rem}
.spacer{height:8px}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
