/* The People's Tea storefront (views/shop/*). The plain demo pages use style.css. */
:root {
  --green: #1f3d2b;
  --green-soft: #2f5a40;
  --cream: #f6efe2;
  --paper: #fbf8f2;
  --gold: #c8a24a;
  --brown: #8a5a2b;
  --ink: #2b2a26;
  --muted: #6b6457;
  --line: #e6dccb;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
body.shop { margin: 0; min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); }
body.shop > .site-main { flex: 1; width: 100%; }
.shop a { color: var(--green-soft); }
.shop h1, .shop h2, .shop h3 { font-family: var(--serif); font-weight: 600; color: var(--green); line-height: 1.2; }
.shop h1 { font-size: 2.2rem; margin: .25rem 0 1rem; }
.shop h2 { font-size: 1.15rem; }
.shop code { font-size: .9em; background: var(--cream); padding: .05rem .3rem; border-radius: 4px; }

/* Header */
.announcement { background: var(--green); color: var(--cream); text-align: center; font-size: .85rem; padding: .4rem 1rem; letter-spacing: .02em; }
.site-header { display: flex; align-items: center; gap: 2rem; padding: 1rem 2rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.wordmark { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; color: var(--green); letter-spacing: .01em; }
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.site-nav a:hover { color: var(--green-soft); }
.account-nav { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.account-link { color: var(--ink) !important; text-decoration: none; font-weight: 500; }
.cart-link { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink) !important; text-decoration: none; font-weight: 500; }
.cart-count { display: inline-grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; border-radius: 999px; background: var(--gold); color: var(--green); font-size: .8rem; font-weight: 700; }
.flash { width: calc(100% - 4rem); max-width: 1056px; margin: 1rem auto 0; padding: .75rem 1rem; border-radius: 8px; background: #e7f0e3; color: var(--green); border: 1px solid #c9dcc1; }

/* Buttons. .button is the class the shared demo views use. */
.btn, .button { display: inline-block; padding: .6rem 1.15rem; border-radius: 999px; border: 2px solid var(--green); background: var(--green); color: var(--cream) !important; font: 600 .95rem var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover, .button:hover { background: var(--green-soft); border-color: var(--green-soft); }
.btn-ghost, .button.secondary { background: transparent; color: var(--green) !important; }
.btn-ghost:hover, .button.secondary:hover { background: var(--cream); }
.btn-large { padding: .8rem 1.6rem; font-size: 1.05rem; }
.btn-small { padding: .3rem .8rem; font-size: .85rem; }
.btn-block { display: block; width: 100%; text-align: center; margin-top: 1rem; }
.link-button { background: none; border: 0; padding: 0; color: var(--brown); font: inherit; font-size: .9rem; text-decoration: underline; cursor: pointer; }

/* Layout */
.site-main { max-width: 1120px; margin: 0 auto; padding: 2rem; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--brown); }
.shop .section-title { font-size: 1.6rem; margin: 2.5rem 0 1rem; }
.page-title { margin-bottom: 1.5rem; }
.hint, .muted { color: var(--muted); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.panel h2 { font-size: 1.15rem; margin: 0 0 .5rem; }
.panel p { margin: .25rem 0; }

/* Hero */
.hero { margin: -2rem calc(50% - 50vw) 0; padding: 4rem max(2rem, calc(50vw - 528px)); background: linear-gradient(120deg, var(--cream), #efe3cc); border-bottom: 1px solid var(--line); }
.hero-text { max-width: 640px; }
.hero h1 { font-size: 3rem; margin: .4rem 0 .75rem; }
.lede { font-size: 1.15rem; color: var(--muted); margin: 0 0 1.5rem; }

/* Catalog */
.tea-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 1.5rem; }
.tea-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; scroll-margin-top: 1rem; }
.tea-card:target { box-shadow: 0 0 0 3px var(--gold); }
.tea-art { display: grid; place-items: center; padding: 1.5rem 0 .5rem; background: var(--cream); }
.tea-art .tin { width: 120px; height: auto; }
.tea-body { padding: 1rem 1.25rem 0; flex: 1; }
.tea-body h3 { font-size: 1.3rem; margin: .2rem 0 .5rem; }
.tea-type { margin: 0; font-size: .82rem; color: var(--brown); font-weight: 600; letter-spacing: .02em; }
.tea-description { margin: 0 0 .75rem; color: var(--ink); }
.tea-notes { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 .5rem; }
.tea-notes li { font-size: .8rem; padding: .1rem .6rem; border-radius: 999px; background: var(--cream); color: var(--green); }
.tea-steep { margin: 0; font-size: .85rem; color: var(--muted); }
.tea-buy { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem 1.25rem; }
.tea-buy form { margin: 0; }
.price { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; color: var(--green); line-height: 1.2; }
.price small { display: block; font-family: var(--sans); font-size: .78rem; font-weight: 400; color: var(--muted); }

/* Cart and checkout */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line { display: grid; grid-template-columns: 80px 1fr auto; gap: 1.25rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.cart-line h3 { margin: 0; font-size: 1.15rem; }
.cart-art { display: grid; place-items: center; background: var(--cream); border-radius: 10px; padding: .4rem; }
.cart-art .tin { width: 56px; height: auto; }
.qty-form { display: flex; align-items: center; gap: .75rem; margin-top: .5rem; }
.qty-form select { margin-left: .4rem; padding: .25rem .4rem; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; }
.cart-line-total { font-weight: 600; }
.summary { position: sticky; top: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; }
.summary h2 { margin-top: 0; font-size: 1.3rem; }
.summary-lines { list-style: none; padding: 0; margin: 0 0 1rem; }
.summary-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; }
.totals { margin: 0; }
.totals div { display: flex; justify-content: space-between; padding: .3rem 0; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; }
.totals .grand { border-top: 1px solid var(--line); margin-top: .4rem; padding-top: .6rem; font-weight: 700; font-size: 1.1rem; }
.totals .grand dt { color: var(--ink); }
.continue { display: block; text-align: center; margin-top: .9rem; font-size: .9rem; }
.empty { padding: 3rem; text-align: center; background: #fff; border: 1px dashed var(--line); border-radius: 14px; }
.demo-card { font-family: ui-monospace, monospace; }
.confirmation { max-width: 620px; }
.order-number { font-family: ui-monospace, monospace; }
.product-detail { margin-top: 1.5rem; }
.product-detail .tea-art { border-radius: 14px; min-height: 320px; }

.renewal-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.renewal-actions form { margin: 0; }
.shop button:disabled { opacity: .55; cursor: not-allowed; }
.renewal-status { font-weight: 700; }
.renewal-renewed { color: var(--green); }
.renewal-blocked, .renewal-unavailable { color: #943b23; }
.renewal-evidence { overflow-wrap: anywhere; }
.renewal-evidence dt { font-weight: 600; margin-top: .5rem; }
.renewal-evidence dd { margin-left: 0; }

/* Tea school (profiling mode's /video) */
.hero-text .btn + .btn { margin-left: .5rem; }
.promo { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-top: 2rem; padding: 1.5rem 2rem; border-radius: 14px; background: var(--green); color: var(--cream); }
.promo h2 { margin: .2rem 0 .4rem; font-size: 1.5rem; color: var(--cream); }
.promo p { margin: 0; opacity: .9; }
.promo .eyebrow { color: var(--gold); }
.promo .btn { background: var(--gold); border-color: var(--gold); color: var(--green) !important; }
.guide-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, var(--green), #10241a); display: grid; place-items: center; }
.player-art .tin { width: 150px; height: auto; opacity: .9; }
.player-play { position: absolute; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: rgba(246, 239, 226, .92); color: var(--green); font-size: 1.6rem; padding-left: 6px; }
.player-bar { position: absolute; left: 1rem; right: 1rem; bottom: 1rem; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .25); }
.player-bar span { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.guide-steps { margin-top: 1rem; }
.guide-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: .75rem; }
.guide-list li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .75rem 1rem; }
.guide-list a { display: block; font-weight: 600; }
.demo-hint { margin-top: 1rem; padding-top: .75rem; border-top: 1px dashed var(--line); font-size: .8rem; color: var(--muted); word-break: break-all; }
.stacked-form { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.stacked-form label { font-weight: 600; }
.stacked-form input { padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--paper); }
.stacked-form .btn { align-self: flex-start; margin-top: .4rem; }
.form-error { padding: .6rem .9rem; border-radius: 8px; background: #fbeae7; color: #8a2a1d; border: 1px solid #f0c9c2; }

/* Shared demo views (profile, /demo, webhooks, errors) inside the storefront */
.shop table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.shop th, .shop td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.shop th { width: 14rem; color: var(--muted); font-weight: 600; }
.shop table.orders th { width: auto; }
.shop pre { background: #1d2a22; color: #e8efe6; padding: 1rem; border-radius: 10px; overflow-x: auto; font-size: 13px; }
.shop pre.error { background: #6b1f1a; }
.shop details summary { cursor: pointer; font-weight: 600; margin: 1rem 0 .5rem; }

/* Footer */
.site-footer { margin-top: 4rem; padding: 2rem; background: var(--green); color: var(--cream); }
.site-footer a { color: var(--gold); }
.footer-brand { max-width: 1120px; margin: 0 auto; }
.footer-brand strong { font-family: var(--serif); font-size: 1.2rem; }
.footer-brand p { margin: .3rem 0 0; opacity: .85; }
.demo-note { max-width: 1120px; margin: 1.5rem auto 0; font-size: .8rem; opacity: .75; display: flex; flex-wrap: wrap; gap: .75rem; }
.demo-mode { margin-left: auto; font-family: ui-monospace, monospace; }

/* The People's Tea - Marketplace (views/marketplace/*), the seller app */
.market-badge { margin-left: .2rem; padding: .15rem .55rem; border-radius: 999px; background: var(--green); color: var(--gold); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.market-nav a { padding: .35rem .2rem; border-bottom: 2px solid transparent; }
.market-nav a[aria-current=page] { border-bottom-color: var(--gold); color: var(--green); font-weight: 700; }
.seller { color: var(--muted); font-size: .9rem; }
.seller strong { color: var(--ink); }
.market-hero .lede { max-width: 560px; }
.market-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 1rem; margin-top: 2rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.kpi-label { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; color: var(--green); }
.kpi-change { font-size: .82rem; color: var(--muted); }
.kpi-change.up { color: #15803d; }
.kpi-change.down { color: #b45309; }
.chart-panel { padding-bottom: .75rem; }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; }
.chart-head .hint { margin: 0; font-size: .85rem; }
.key { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; vertical-align: -1px; margin: 0 .2rem 0 .6rem; }
.key-actual, .bar.actual rect { background: var(--green); fill: var(--green); }
.key-projection { background: repeating-linear-gradient(45deg, #c8a24a, #c8a24a 2px, #ead9a6 2px, #ead9a6 4px); }
.bar.projection rect { fill: #ead9a6; stroke: var(--gold); stroke-dasharray: 3 2; }
.bar:hover rect { opacity: .8; }
.chart { width: 100%; height: auto; display: block; margin-top: .5rem; }
.chart .grid { stroke: var(--line); }
.chart .divider { stroke: var(--gold); stroke-dasharray: 4 3; }
.chart .whisker { stroke: var(--brown); stroke-width: 1.5; }
.chart .axis { font: 11px var(--sans); fill: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.two-col .panel { margin-bottom: 0; }
.shop .two-col table.weeks, .shop table.listings { margin-bottom: 0; }
.shop table.weeks th, .shop table.listings th { width: auto; }
.top-list { list-style: none; padding: 0; margin: 0; }
.top-list li { display: grid; grid-template-columns: 48px 1fr auto; gap: .9rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.top-list li:last-child { border-bottom: 0; }
.top-art .tin, .listing-art .tin { width: 40px; height: auto; display: block; }
.top-figures { text-align: right; font-size: .9rem; }
.shop table.listings td { vertical-align: middle; }
.shop table.listings tr.new td { background: #f7f3e3; }
.listing-art { width: 56px; }
.tag { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.tag-ok { background: #dcfce7; color: #166534; }
.tag-muted { background: #e7e5e4; color: #44403c; }
.tag-bad { background: #fee2e2; color: #991b1b; }
.tag-warn { margin-top: .2rem; background: #fef3c7; color: #92400e; }
.stacked-form select { padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--paper); }
.listing-form { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: .75rem; align-items: end; margin-top: .75rem; }
.listing-form label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; }
.listing-form input, .listing-form select { padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; background: var(--paper); min-width: 0; }
.listing-action { text-align: right; }
.shop table.listings td.listing-art { padding-right: 0; }

@media (max-width: 760px) {
  .market .site-nav { display: flex; order: 3; width: 100%; }
  .two-col, .listing-form { grid-template-columns: 1fr; }
  .shop table.listings { display: block; overflow-x: auto; }
}

@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; gap: 1rem; padding: 1rem; }
  .site-nav { display: none; }
  .site-nav.subscription-nav { display: flex; flex-wrap: wrap; order: 3; width: 100%; }
  .site-main { padding: 1.25rem; }
  .hero { margin-top: -1.25rem; padding: 2.5rem 1.25rem; }
  .hero h1 { font-size: 2.2rem; }
  .cart-layout, .guide-layout { grid-template-columns: 1fr; }
  .promo { flex-direction: column; align-items: flex-start; }
  .shop th { width: 9rem; }
}
.risk-settings textarea { display: block; width: 100%; max-width: 42rem; padding: .75rem; border: 1px solid var(--green); border-radius: .5rem; font: inherit; resize: vertical; }
.risk-settings section { padding: 1rem 0; border-bottom: 1px solid var(--green); }
