/* Jastip.me design system — Anthropic-inspired palette, Montserrat type.
   Section accents sampled from anthropic.com/learn. */
:root {
  --ivory: #faf9f5;
  --cream: #f0eee6;
  --cream-200: #e8e4d8;
  --clay: #cc785c;          /* primary accent ("book cloth") */
  --clay-dark: #99492f;
  --clay-soft: #f6e4db;
  --slate: #1a1a18;
  --slate-600: #3d3a35;
  --slate-400: #6b665c;
  --line: #e3ded2;
  --white: #ffffff;
  --success: #2f7d5b;
  --warning: #b9772b;
  --danger: #b23b32;
  --info: #3a6ea5;
  --muted: #8a857a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(26,26,24,.06), 0 8px 24px rgba(26,26,24,.06);
  --maxw: 1280px;
  --font: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--slate-600);
  background: var(--ivory);
  line-height: 1.6;
  font-size: 16px;
  /* Sticky footer: keep the footer at the bottom on short pages (no gap below it) */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
h1, h2, h3, h4 { font-family: var(--font); color: var(--slate); line-height: 1.2; font-weight: 700; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
a { color: var(--clay-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 600; font-family: var(--font); font-size: .95rem;
  padding: .65rem 1.25rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; transition: .15s ease;
  text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--clay); color: #fff; }
.btn-primary:hover { background: var(--clay-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--slate); border-color: var(--line); }
.btn-outline:hover { border-color: var(--clay); color: var(--clay-dark); }
.btn-ghost { background: var(--cream); color: var(--slate); }
/* Register button: white label, dark hover (scoped to beat .nav-links a) */
.nav-links a.btn-register { color: #fff; }
.nav-links a.btn-register:hover { background: #161616; color: #fff; }
/* "I want to buy" button: clay label + border */
.btn-buy { color: #cc785c; border-color: #cc785c; }
.btn-buy:hover { color: #cc785c; border-color: #cc785c; background: rgba(204,120,92,.08); }
/* Non-clickable inverted Block button: brown text, no fill */
.btn-blocked { background: transparent; color: var(--clay-dark); border-color: var(--clay); cursor: default; }
.btn-blocked:hover { transform: none; }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* --- Header / nav --- */
.site-header { background: var(--ivory); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.3rem; color: var(--slate); }
.brand .logo-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--clay); color: #fff;
  display: grid; place-items: center; font-weight: 800; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 34px; width: auto; display: block; }
.footer-logo { height: 30px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--slate-600); font-weight: 600; font-size: .95rem; }
.nav-links a:hover { color: var(--clay-dark); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--slate); }

/* --- Sections --- */
section { padding: 56px 0; }
.section-cream { background: var(--cream); }
.section-clay { background: var(--clay-soft); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head p { color: var(--slate-400); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--clay-dark); }

/* --- Hero --- */
.hero { background: linear-gradient(180deg, var(--ivory), var(--cream)); padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero p.lead { font-size: 1.15rem; color: var(--slate-400); margin-bottom: 1.5rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.hero-visual { display: flex; justify-content: center; align-items: center; }
.hero-illustration { width: 100%; max-width: 520px; height: auto; display: block; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps .n { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--clay); color: #fff;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700; }

/* --- Cards / grid --- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-body { padding: 20px; }
.card h3 { font-size: 1.15rem; }

/* --- Foldable card (accordion) --- */
details.fold > summary { list-style: none; cursor: pointer; padding: 20px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; user-select: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h3 { margin: 0; }
details.fold > summary::after { content: "\25BE"; color: var(--muted); font-size: .9rem; transition: transform .2s ease; }
details.fold:not([open]) > summary::after { transform: rotate(-90deg); }
details.fold > .fold-body { padding: 0 20px 20px; }

/* --- Offer table --- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table.offers { width: 100%; border-collapse: collapse; min-width: 760px; }
table.offers th, table.offers td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: .92rem; }
table.offers th { background: var(--cream); font-weight: 700; color: var(--slate); white-space: nowrap; }
table.offers tr:last-child td { border-bottom: 0; }
table.offers tbody tr:hover { background: var(--ivory); }
/* Centered variant: headers centered both axes + centered Status/Action/Margin/Terms columns */
table.offers.offers-centered th { text-align: center; vertical-align: middle; }
table.offers.offers-centered td.status-cell,
table.offers.offers-centered td.action-cell,
table.offers.offers-centered td.margin-cell,
table.offers.offers-centered td.terms-cell,
table.offers.offers-centered td.avail-cell { text-align: center; }
table.offers.offers-centered td.shipment-cell { text-align: right; }
/* Fully centered variant (Completed table): every header and cell centered */
table.offers.offers-allcenter th,
table.offers.offers-allcenter td { text-align: center; }
.route-cell strong { color: var(--slate); display: block; }
.route-cell span { color: var(--slate-400); font-size: .82rem; }
.offers-notes { text-align: left; margin-top: 14px; font-size: .82rem; color: var(--slate-400); line-height: 1.5; }
.offers-notes .notes-head { font-weight: 700; color: var(--slate); margin: 0 0 4px; }
.offers-notes p { margin: 0 0 2px; }

/* --- Badges --- */
.badge { display: inline-block; padding: .25rem .6rem; border-radius: var(--radius-sm); font-size: .74rem; font-weight: 700;
  letter-spacing: .02em; text-align: center; }
.badge-info { background: #e6eef7; color: var(--info); }
.badge-success { background: #e2f1ea; color: var(--success); }
.badge-warning { background: #f8ecd9; color: var(--warning); }
.badge-danger { background: #f8e3e1; color: var(--danger); }
.badge-primary { background: var(--clay-soft); color: var(--clay-dark); }
.badge-muted { background: var(--cream-200); color: var(--muted); }

/* --- Forms --- */
.form-field { margin-bottom: 1.1rem; }
.form-field label { display: block; font-weight: 600; color: var(--slate); margin-bottom: .35rem; font-size: .9rem; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: .95rem; background: #fff; color: var(--slate); }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Item rows on the order form: Item name / Qty / Unit at 75 / 10 / 15 */
.form-row.item-cols { grid-template-columns: 75fr 10fr 15fr; }
/* Let the fr ratio hold: inputs default to min-width:auto which would otherwise
   stop the narrow Qty/Unit columns from shrinking to 10/15. */
.form-row.item-cols > .form-field { min-width: 0; }
/* Purchase rows: Actual qty / Unit / Actual unit cost at 25 / 25 / 50, centered headers */
.form-row.purchase-cols { grid-template-columns: 25fr 25fr 50fr; }
.form-row.purchase-cols > .form-field { min-width: 0; }
.form-row.purchase-cols .form-field > label { text-align: center; }
/* Read-only field value (e.g. Unit on the purchase row) */
.static-field { padding: .65rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--cream); color: var(--slate); text-align: center; }
.help { font-size: .8rem; color: var(--slate-400); margin-top: .25rem; }
.errorlist { color: var(--danger); font-size: .82rem; list-style: none; padding: 0; margin: .3rem 0 0; }
.password-wrap { position: relative; }
.password-wrap .peek { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; color: var(--slate-400); font-size: .82rem; font-weight: 600; }

/* --- Auth card --- */
.auth-wrap { max-width: 440px; margin: 48px auto; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--slate-400); font-size: .82rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .65rem; font-weight: 600; background: #fff; color: var(--slate); }
.social-btn:hover { border-color: var(--clay); text-decoration: none; }

/* --- Messages --- */
.messages { list-style: none; padding: 0; margin: 16px 0 0; }
.messages li { padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: .5rem; font-size: .9rem; border: 1px solid; }
.messages .success { background: #e2f1ea; color: var(--success); border-color: #bfe0cf; }
.messages .error { background: #f8e3e1; color: var(--danger); border-color: #eec3bf; }
.messages .warning { background: #f8ecd9; color: var(--warning); border-color: #ecd6ad; }
.messages .info { background: #e6eef7; color: var(--info); border-color: #c6d8ec; }

/* --- Footer --- */
.site-footer { background: var(--slate); color: #cfc9bd; padding: 48px 0 28px; margin-top: 48px; }
.site-footer a { color: #e7e2d6; }
.footer-grid { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.footer-legal { margin-top: 18px; font-style: normal; font-size: .82rem; line-height: 1.7; color: #948f84; }
.footer-bottom { border-top: 1px solid #322f2a; margin-top: 28px; padding-top: 28px; font-size: .85rem; color: #948f84; }

/* --- Misc --- */
.tag-prose p { margin: 0 0 1rem; }
.pill-list { display: flex; gap: 8px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.muted { color: var(--slate-400); }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.adslot { margin: 28px auto; max-width: var(--maxw); min-height: 90px; display: grid; place-items: center;
  border: 1px dashed var(--cream-200); color: var(--muted); font-size: .82rem; border-radius: var(--radius-sm); }

/* --- Content + right ad sidebar (static pages, blog) --- */
.content-layout { display: flex; gap: 32px; align-items: flex-start; }
.content-main { flex: 1 1 auto; min-width: 0; }
.content-side { flex: 0 0 300px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 88px; }
.ad-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; }
.ad-card img { width: 100%; border-radius: var(--radius-sm); margin-bottom: 10px; }
.ad-card h4 { margin: 0 0 6px; font-size: 1rem; }
.ad-card p { margin: 0 0 12px; font-size: .9rem; color: var(--slate-600); }
.ad-badge { display: inline-block; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--cream); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; margin-bottom: 8px; }
.ad-card-cta { background: var(--cream); border-style: dashed; }
@media (max-width: 980px) {
  .content-layout { flex-direction: column; }
  .content-side { order: 1; flex-basis: auto; width: 100%; position: static;
    flex-direction: row; flex-wrap: wrap; }
  .content-side .ad-card { flex: 1 1 260px; }
}
/* --- Chat --- */
.chat-thread { display: flex; flex-direction: column; gap: 10px; max-height: 380px; overflow-y: auto;
  padding: 6px 2px; }
.chat-msg { max-width: 80%; background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 12px; align-self: flex-start; }
.chat-msg.chat-mine { align-self: flex-end; background: var(--clay-soft); border-color: var(--clay-soft); }
.chat-meta { font-size: .72rem; color: var(--slate-400); font-weight: 700; margin-bottom: 2px; }
.chat-body { font-size: .92rem; color: var(--slate); white-space: pre-wrap; word-break: break-word; }
.chat-photo { margin-top: 6px; max-width: 180px; border-radius: 6px; border: 1px solid var(--line); }

.invoice { width: 100%; border-collapse: collapse; }
.invoice td { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.invoice tr.total td { font-weight: 800; color: var(--slate); border-bottom: 0; font-size: 1.05rem; }
/* Right-aligned numeric columns (e.g. Qty / Unit cost on the review table) */
.invoice td.num-right { text-align: right; }
.invoice td.num-right input { width: 100%; text-align: right; padding: .4rem .55rem; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; }
/* Right-aligned numeric input outside tables (e.g. Actual unit cost on purchase) */
input.num-right { text-align: right; }

/* Two-column (Estimate / Actual) invoice */
table.invoice.inv2 { font-size: .9rem; }
table.invoice.inv2 th,
table.invoice.inv2 td { padding: .4rem .55rem; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.invoice.inv2 th.lcell,
table.invoice.inv2 td.lcell { text-align: left; white-space: normal; }
table.invoice.inv2 thead th { background: var(--cream, #f5f1ea); font-weight: 700; color: var(--slate); border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
table.invoice.inv2 th.unit-cell,
table.invoice.inv2 td.unit-cell { text-align: left; }
table.invoice.inv2 tr.subtotal td { font-weight: 700; border-top: 1px solid var(--line); }
table.invoice.inv2 tr.total td { font-weight: 800; color: var(--slate); border-bottom: 0; border-top: 2px solid var(--slate); font-size: .95rem; }

@media (max-width: 860px) {
  .hero-grid, .grid-3, .grid-2, .form-row, .footer-grid { grid-template-columns: 1fr; }
  .nav-links { position: fixed; inset: 68px 0 auto 0; background: var(--ivory); flex-direction: column;
    align-items: flex-start; padding: 16px 20px; gap: 1rem; border-bottom: 1px solid var(--line);
    transform: translateY(-130%); transition: .25s ease; box-shadow: var(--shadow); }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle { display: block; }
}

/* Profile page: main content + right sidebar with tabbed panels */
.profile-layout { display: flex; gap: 28px; align-items: flex-start; }
.profile-main { flex: 1 1 auto; min-width: 0; }
.profile-side { flex: 0 0 230px; }
.profile-side .side-nav { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.profile-side .side-nav li { margin: 0; }
.profile-side .side-nav a { display: block; padding: .75rem 1rem; color: var(--slate-600);
  font-weight: 600; border-bottom: 1px solid var(--line); }
.profile-side .side-nav li:last-child a { border-bottom: 0; }
.profile-side .side-nav a:hover { background: var(--cream); text-decoration: none; }
.profile-side .side-nav a.active { background: var(--clay); color: #fff; }
.profile-panel-header { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px; }

@media (max-width: 860px) {
  .profile-layout { flex-direction: column; }
  .profile-side { order: -1; flex-basis: auto; width: 100%; }
}
