/* ==========================================================================
   פורטל החברים · מסעדנים חזקים ביחד
   Design system: neo-brutalist paper & ink, RTL first
   ========================================================================== */

:root {
  /* Brand */
  --ink:        #121212;
  --yellow:     #FFC900;
  --yellow-hi:  #FFD633;
  --red:        #D8291C;
  --red-hi:     #ef3a2c;
  --paper:      #F7F4EC;
  --white:      #FFFFFF;

  /* Text on paper */
  --text:       #121212;
  --text-2:     #4a453d;
  --text-3:     #6b6459;
  --text-4:     #8a8378;

  /* Text on ink */
  --on-ink:     #f5f1e8;
  --on-ink-2:   #cfc9bd;
  --on-ink-3:   #9b958a;

  /* Lines */
  --line:       #d8d1c3;
  --line-soft:  #eae3d5;
  --line-ink:   rgba(255,255,255,.14);

  /* Borders & shadows */
  --bw:         2.5px;
  --bw-thick:   3px;
  --shadow:     5px 5px 0 var(--ink);
  --shadow-lg:  7px 7px 0 var(--ink);
  --shadow-sm:  4px 4px 0 var(--ink);
  --shadow-y:   7px 7px 0 var(--yellow);

  /* Radii */
  --r-sm:  9px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  18px;
  --r-pill: 999px;

  /* Type */
  --font-display: 'Heebo', sans-serif;
  --font-body:    'Assistant', 'Heebo', sans-serif;
  --font-mono:    ui-monospace, 'SFMono-Regular', 'Menlo', monospace;

  /* Spacing scale, 4 / 8 base */
  --s-xs: 4px;  --s-sm: 8px;  --s-md: 16px;
  --s-lg: 24px; --s-xl: 32px; --s-2xl: 48px; --s-3xl: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-x: hidden; scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--red); text-decoration: none; font-weight: 700; }
a:hover { color: var(--ink); text-decoration: underline; }

input, button, textarea, select { font-family: inherit; }
::selection { background: var(--yellow); color: var(--ink); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 900; letter-spacing: -0.5px; }

@keyframes riseIn  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px 96px;
}

section { padding: 56px 0; }

.section-divider {
  height: var(--bw-thick);
  background: var(--ink);
  border-radius: 2px;
}

.section-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 5px 12px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1;
  letter-spacing: -1.2px;
}

.section-desc {
  max-width: 720px;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text-2);
  text-wrap: pretty;
}

.subsection {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 32px 0 16px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
}
.subsection::after { content: ''; flex: 1; height: 2px; background: var(--line); }

.rule { height: var(--bw-thick); width: 76px; background: var(--red); border-radius: 2px; }
.rule--yellow { background: var(--yellow); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 18px; }
.stack   { display: flex; flex-direction: column; gap: 14px; }
.row     { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mt-auto { margin-top: auto; }

/* --------------------------------------------------------------------------
   Chapter navigation
   -------------------------------------------------------------------------- */

.chapter-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(247, 244, 236, .92);
  backdrop-filter: blur(8px);
  border-bottom: var(--bw) solid var(--ink);
}

.chapter-nav-inner {
  display: flex;
  gap: 8px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 28px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav-item {
  flex: 0 0 auto;
  padding: 8px 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--yellow); color: var(--ink); text-decoration: none; }
.nav-item.is-active { background: var(--ink); color: var(--yellow); }

/* --------------------------------------------------------------------------
   Masthead
   -------------------------------------------------------------------------- */

.masthead {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 0;
  margin: 32px 0 0;
  border: var(--bw-thick) solid var(--ink);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.masthead-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 48px 44px;
  background: var(--paper);
}

.masthead-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 22px;
  padding: 44px;
  background: var(--ink);
  overflow: hidden;
}
.masthead-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(255,201,0,.09) 0 12px, transparent 12px 26px);
}
.masthead-side > * { position: relative; }

.masthead-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 5vw, 46px);
  line-height: 1.05;
  letter-spacing: -1.5px;
}
.masthead-lead { max-width: 460px; font-size: 17px; line-height: 1.55; color: var(--text-2); text-wrap: pretty; }

.masthead-slogan {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(38px, 5vw, 52px);
  line-height: 1;
  letter-spacing: -2px;
  color: var(--yellow);
}
.masthead-side p { max-width: 380px; font-size: 17px; line-height: 1.6; color: #e8e2d6; }

/* --------------------------------------------------------------------------
   Brand lockup
   -------------------------------------------------------------------------- */

.lockup { display: flex; align-items: center; gap: 14px; }
.lockup-mark {
  width: 46px;
  height: 78px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 2px solid var(--ink);
  flex: 0 0 auto;
}
.lockup-mark--sm { width: 34px; height: 58px; border-radius: 6px; }
.lockup-text { display: flex; flex-direction: column; gap: 2px; }
.lockup-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.lockup-sub { font-size: 14px; font-weight: 600; color: var(--text-3); }

.on-ink .lockup-mark { border-color: var(--yellow); }
.on-ink .lockup-name { color: var(--yellow); font-size: 16px; }
.on-ink .lockup-sub  { color: var(--on-ink-3); font-size: 12.5px; }

.logo-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 18px;
  text-align: center;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.logo-tile--ink { background: var(--ink); }
.logo-tile--ink .tile-name { color: var(--on-ink); }
.logo-tile--ink .tile-role { color: var(--on-ink-3); }
.logo-tile--yellow { background: var(--yellow); }
.logo-tile--paper  { background: var(--paper); }

.tile-name { font-family: var(--font-display); font-weight: 900; font-size: 15.5px; }
.tile-role { font-size: 13px; font-weight: 600; color: var(--text-4); text-wrap: pretty; }

.mark-badge {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  color: var(--ink);
  background: var(--yellow);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
}
.mark-badge--red { background: var(--red); color: var(--white); }
.mark-badge--ink { background: var(--ink); color: var(--yellow); }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card--flush { padding: 26px; }
.card--paper { background: var(--paper); }
.card--ink   { background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-y); }
.card--ink .card-title { color: var(--yellow); }
.card--pop   { border-width: var(--bw-thick); box-shadow: var(--shadow-lg); }
.card--pop-y { border-width: var(--bw-thick); box-shadow: var(--shadow-y); }
.card--flat  { box-shadow: none; }

.card-title { font-family: var(--font-display); font-weight: 900; font-size: 18px; }
.card-meta  { font-size: 12.5px; font-weight: 700; color: var(--text-4); }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1.5px dashed var(--line);
}

/* Pinned / hero card */
.pinned {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  background: var(--red);
  border: var(--bw-thick) solid var(--ink);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.pinned::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(135deg, rgba(0,0,0,.12) 0 10px, transparent 10px 22px);
}
.pinned > * { position: relative; }
.pinned h2 {
  max-width: 560px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.12;
  color: var(--white);
  letter-spacing: -1px;
  text-wrap: pretty;
}
.pinned p { max-width: 520px; font-size: 16px; line-height: 1.55; color: #ffe9e6; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: 11px;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, color .12s, box-shadow .12s, transform .12s;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

.btn-lg { padding: 16px 24px; font-size: 18px; border-radius: var(--r-md); }
.btn-sm { padding: 9px 14px; font-size: 14px; border-radius: var(--r-sm); border-width: 2px; }

.btn-primary { background: var(--yellow); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--yellow-hi); box-shadow: 1px 1px 0 var(--ink); transform: translate(3px, 3px); }

.btn-danger { background: var(--red); color: var(--yellow); box-shadow: var(--shadow-sm); }
.btn-danger:hover { background: var(--red-hi); color: var(--yellow); box-shadow: 1px 1px 0 var(--ink); transform: translate(3px, 3px); }

.btn-ink { background: var(--ink); color: var(--yellow); box-shadow: var(--shadow-sm); }
.btn-ink:hover { color: var(--yellow); box-shadow: 1px 1px 0 var(--yellow); transform: translate(3px, 3px); }

.btn-outline { background: var(--white); }
.btn-outline:hover { background: var(--yellow); }

.btn-quiet {
  background: var(--paper);
  border-color: var(--ink);
  box-shadow: none;
  font-weight: 800;
}
.btn-quiet:hover { background: var(--yellow); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-3);
  font-weight: 800;
}
.btn-ghost:hover { color: var(--ink); background: rgba(18,18,18,.06); }

.btn:disabled, .btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Chips: filter row */
.chip {
  padding: 9px 16px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.chip:hover { background: var(--yellow); }
.chip.is-active { background: var(--ink); color: var(--yellow); }

/* --------------------------------------------------------------------------
   Pills / badges
   -------------------------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  padding: 5px 11px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.pill--yellow { background: var(--yellow); }
.pill--red    { background: var(--red); color: var(--white); }
.pill--ink    { background: var(--ink); color: var(--yellow); border-color: var(--ink); }
.pill--lg     { padding: 6px 12px; font-size: 12.5px; border-width: 2px; }
.pill .dot    { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }

/* --------------------------------------------------------------------------
   Typography specimens
   -------------------------------------------------------------------------- */

.type-sample { padding: 20px 0; border-bottom: 1.5px dashed var(--line); }
.type-sample:last-child { border-bottom: none; padding-bottom: 0; }
.type-meta {
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--text-4);
  direction: ltr;
  text-align: right;
}

.t-display { font-family: var(--font-display); font-weight: 900; font-size: clamp(40px, 7vw, 64px); line-height: 1; letter-spacing: -2.5px; }
.t-h1      { font-family: var(--font-display); font-weight: 900; font-size: 42px; line-height: 1.05; letter-spacing: -1.5px; }
.t-h2      { font-family: var(--font-display); font-weight: 900; font-size: 32px; line-height: 1.12; letter-spacing: -1px; }
.t-h3      { font-family: var(--font-display); font-weight: 900; font-size: 21px; line-height: 1.2; letter-spacing: -0.5px; }
.t-lead    { font-size: 17.5px; line-height: 1.75; color: var(--text-2); }
.t-body    { font-size: 15px; line-height: 1.55; color: var(--text-2); }
.t-small   { font-size: 13.5px; font-weight: 700; color: var(--text-4); }
.t-mono    { font-family: var(--font-mono); font-size: 14px; direction: ltr; text-align: right; }

.font-card { align-items: flex-start; }
.font-showcase { font-size: 44px; line-height: 1.1; }
.font-showcase--display { font-family: var(--font-display); font-weight: 900; letter-spacing: -1.5px; }
.font-showcase--body    { font-family: var(--font-body); font-weight: 700; }
.font-showcase--mono    { font-family: var(--font-mono); font-size: 34px; direction: ltr; }
.font-note { font-size: 13.5px; font-weight: 600; color: var(--text-3); line-height: 1.5; }

/* --------------------------------------------------------------------------
   Color swatches
   -------------------------------------------------------------------------- */

.swatch {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.swatch-preview { height: 104px; border-bottom: var(--bw) solid var(--ink); }
.swatch-preview--ink    { background: var(--ink); }
.swatch-preview--yellow { background: var(--yellow); }
.swatch-preview--red    { background: var(--red); }
.swatch-preview--paper  { background: var(--paper); }
.swatch-preview--white  { background: var(--white); }
.swatch-preview--line   { background: var(--line); }
.swatch-preview--soft   { background: var(--line-soft); }
.swatch-preview--t2     { background: var(--text-2); }
.swatch-preview--t3     { background: var(--text-3); }
.swatch-preview--t4     { background: var(--text-4); }

.swatch-info { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; }
.swatch-name { font-family: var(--font-display); font-weight: 900; font-size: 16px; }
.swatch-hex  { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--text-3); direction: ltr; text-align: right; }
.swatch-role { font-size: 13px; font-weight: 600; color: var(--text-4); text-wrap: pretty; }

/* --------------------------------------------------------------------------
   Form elements
   -------------------------------------------------------------------------- */

.input-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.input-label { font-size: 14px; font-weight: 700; color: var(--text-2); }
.input-label--error { color: var(--red); }

.input-field {
  width: 100%;
  padding: 15px 17px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
  outline: none;
  transition: box-shadow .12s, border-color .12s;
}
.input-field::placeholder { color: var(--text-4); font-weight: 600; }
.input-field:focus { box-shadow: var(--shadow-sm); }
.input-field--ltr { direction: ltr; text-align: left; }
.input-field.error { border-color: var(--red); }
.input-field.error:focus { box-shadow: 4px 4px 0 var(--red); }
.input-error-msg { font-size: 13.5px; font-weight: 700; color: var(--red); }
.input-hint { font-size: 13.5px; font-weight: 600; color: var(--text-4); }

textarea.input-field { font-size: 15.5px; font-weight: 600; line-height: 1.55; resize: vertical; }

.input-code {
  direction: ltr;
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 16px;
  padding: 16px 18px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 11px;
}
.search-bar span { font-weight: 800; color: var(--text-4); }
.search-bar input { flex: 1; min-width: 0; border: none; outline: none; font-size: 15px; font-weight: 600; background: transparent; }

/* Custom select */
.custom-select { position: relative; }
.custom-select__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 17px;
  font-size: 16px;
  font-weight: 700;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
  cursor: pointer;
}
.custom-select.open .custom-select__trigger { box-shadow: var(--shadow-sm); }
.custom-select__text  { flex: 1; }
.custom-select__arrow { font-size: 13px; transition: transform .15s; }
.custom-select.open .custom-select__arrow { transform: rotate(180deg); }

.custom-select__options {
  position: absolute;
  z-index: 15;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: none;
  list-style: none;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.custom-select.open .custom-select__options { display: block; }
.custom-select__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 1.5px solid var(--line-soft);
}
.custom-select__option:last-child { border-bottom: none; }
.custom-select__option:hover { background: var(--yellow); }
.custom-select__option.selected { background: var(--ink); color: var(--yellow); }

/* Date picker (daterangepicker overrides) */
.daterangepicker {
  font-family: var(--font-body);
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.daterangepicker::before, .daterangepicker::after { display: none; }
.daterangepicker td.active, .daterangepicker td.active:hover { background: var(--ink); color: var(--yellow); }
.daterangepicker td.available:hover, .daterangepicker th.available:hover { background: var(--yellow); }

/* --------------------------------------------------------------------------
   Side navigation preview
   -------------------------------------------------------------------------- */

.sidenav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 18px;
  background: var(--ink);
  border-radius: var(--r-lg);
}
.sidenav-head { display: flex; align-items: center; gap: 12px; padding: 4px 6px 18px; }

.sidenav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15.5px;
  color: var(--on-ink-2);
  background: transparent;
  border: 2px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  text-align: right;
}
.sidenav-item:hover { background: rgba(255,201,0,.14); color: var(--on-ink); }
.sidenav-item.is-active { background: var(--yellow); color: var(--ink); border-color: var(--ink); }

.sidenav-badge {
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--on-ink-3);
  background: rgba(255,255,255,.09);
  border-radius: var(--r-pill);
}
.sidenav-item.is-active .sidenav-badge { color: var(--ink); background: rgba(18,18,18,.12); }

.sidenav-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1.5px solid var(--line-ink);
}
.sidenav-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  background: rgba(255,255,255,.06);
  border: 1.5px solid rgba(255,255,255,.16);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: right;
}
.sidenav-user:hover { background: rgba(255,201,0,.14); }
.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
  color: var(--ink);
  background: var(--yellow);
  border-radius: var(--r-sm);
}
.sidenav-user-name { font-size: 14px; font-weight: 700; color: var(--on-ink); }
.sidenav-user-meta { font-size: 12px; color: var(--on-ink-3); }

/* App bar preview */
.appbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: rgba(247,244,236,.92);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-md);
}
.appbar .search-bar { flex: 1 1 260px; max-width: 520px; }

/* --------------------------------------------------------------------------
   Data display
   -------------------------------------------------------------------------- */

.data-table {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
}
.data-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 14px 20px;
  background: var(--ink);
}
.data-head span { font-size: 13px; font-weight: 800; color: var(--yellow); }
.data-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 15px 20px;
  border-top: 1.5px solid var(--line-soft);
}
.data-row:hover { background: var(--paper); }
.col-name { flex: 1 1 200px; display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 15.5px; font-weight: 700; }
.col-cat  { flex: 0 1 120px; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text-2); }
.col-sm   { flex: 0 1 74px;  min-width: 0; font-size: 14px; color: var(--text-4); white-space: nowrap; }

.filetype {
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.stat-number { font-family: var(--font-display); font-weight: 900; font-size: 30px; letter-spacing: -1px; line-height: 1.1; }
.stat-label  { font-size: 13.5px; font-weight: 700; color: var(--text-4); }

.stat-card--ink { background: rgba(255,255,255,.06); border: 1.5px solid rgba(255,201,0,.35); box-shadow: none; border-radius: var(--r-md); }
.stat-card--ink .stat-number { color: var(--yellow); font-size: 26px; }
.stat-card--ink .stat-label  { color: var(--on-ink-2); font-weight: 600; }

/* Date block: events */
.datebox {
  display: grid;
  place-items: center;
  align-content: center;
  flex: 0 0 96px;
  width: 96px;
  height: 88px;
  border-radius: var(--r-md);
  background: var(--ink);
  font-family: var(--font-display);
  line-height: 1.05;
}
.datebox .day   { font-weight: 900; font-size: 30px; color: var(--yellow); }
.datebox .month { font-weight: 700; font-size: 13px; color: var(--on-ink); }
.datebox--sm { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 10px; background: var(--yellow); }
.datebox--sm .day   { font-size: 19px; color: var(--ink); }
.datebox--sm .month { font-size: 11px; color: var(--ink); }

.event-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  padding: 20px;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.event-body { flex: 1 1 260px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.event-side { flex: 0 1 200px; min-width: 180px; display: flex; flex-direction: column; gap: 8px; }

.mini-event { display: flex; gap: 12px; padding-bottom: 12px; border-bottom: 1.5px solid var(--line-ink); }
.mini-event:last-of-type { border-bottom: none; padding-bottom: 0; }
.mini-title { font-size: 14.5px; font-weight: 700; color: var(--on-ink); }
.mini-meta  { font-size: 12.5px; color: var(--on-ink-3); }

/* Benefit card */
.benefit-head { display: flex; align-items: center; gap: 12px; }
.supplier-logo {
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border-radius: var(--r-md);
  border: 2px solid var(--ink);
  background-image: repeating-linear-gradient(45deg, #e9e2d3 0 6px, var(--paper) 6px 12px);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-3);
}
.supplier-name { font-family: var(--font-display); font-weight: 900; font-size: 18px; }
.supplier-tag  { font-size: 13px; font-weight: 700; color: var(--red); }

.code-btn {
  padding: 13px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15.5px;
  color: var(--ink);
  background: var(--yellow);
  border: var(--bw) dashed var(--ink);
  border-radius: 11px;
  cursor: pointer;
}
.code-btn:hover { background: var(--yellow-hi); }
.code-btn.is-revealed {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 1px;
  background: var(--ink);
  color: var(--yellow);
}

/* Thread row */
.thread-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 19px;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: 15px;
  box-shadow: var(--shadow);
}
.thread-count {
  display: grid;
  place-items: center;
  align-content: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  background: var(--yellow);
  border: 2px solid var(--ink);
  font-family: var(--font-display);
  line-height: 1;
}
.thread-count .num { font-weight: 900; font-size: 20px; }
.thread-count .lbl { font-weight: 700; font-size: 10.5px; }

/* Toast */
.toast {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 14px 18px;
  background: var(--ink);
  border: var(--bw) solid var(--yellow);
  border-radius: 13px;
  box-shadow: 5px 5px 0 rgba(0,0,0,.25);
  animation: toastIn .2s ease both;
}
.toast .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); }
.toast span:last-child { font-size: 15px; font-weight: 700; color: var(--on-ink); }

.toast--live {
  position: fixed;
  bottom: 26px;
  left: 26px;
  z-index: 50;
}

/* --------------------------------------------------------------------------
   Scales: spacing, radius, shadows
   -------------------------------------------------------------------------- */

.scale-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 22px; }
.scale-item { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.scale-block { background: var(--ink); border-radius: 4px; }
.scale-label { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: var(--text-3); text-align: center; line-height: 1.4; }

.sp-4  { width: 4px;  height: 4px;  }
.sp-8  { width: 8px;  height: 8px;  }
.sp-12 { width: 12px; height: 12px; }
.sp-16 { width: 16px; height: 16px; }
.sp-24 { width: 24px; height: 24px; }
.sp-32 { width: 32px; height: 32px; }
.sp-48 { width: 48px; height: 48px; }
.sp-64 { width: 64px; height: 64px; }

.radius-box {
  width: 84px;
  height: 84px;
  background: var(--yellow);
  border: var(--bw) solid var(--ink);
}
.r-9  { border-radius: 9px; }
.r-12 { border-radius: 12px; }
.r-16 { border-radius: 16px; }
.r-18 { border-radius: 18px; }
.r-pill { border-radius: var(--r-pill); }

.shadow-demo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  background: var(--white);
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-lg);
}
.sh-sm { box-shadow: var(--shadow-sm); }
.sh-md { box-shadow: var(--shadow); }
.sh-lg { box-shadow: var(--shadow-lg); }
.sh-y  { box-shadow: var(--shadow-y); }
.shadow-name  { font-family: var(--font-mono); font-size: 13px; font-weight: 700; direction: ltr; text-align: right; }
.shadow-usage { font-size: 13px; font-weight: 600; color: var(--text-4); }

/* --------------------------------------------------------------------------
   Rules: do & don't
   -------------------------------------------------------------------------- */

.do-dont { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }

.rule-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--white);
  border: var(--bw-thick) solid var(--ink);
  border-radius: var(--r-xl);
}
.rule-box--do   { box-shadow: var(--shadow-y); }
.rule-box--dont { box-shadow: var(--shadow-lg); }

.rule-label {
  align-self: flex-start;
  padding: 6px 13px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
}
.rule-label--do   { background: var(--yellow); color: var(--ink); }
.rule-label--dont { background: var(--red); color: var(--white); }

.rules-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rules-list li {
  display: flex;
  gap: 9px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
}
.rules-list li::before { content: '·'; color: var(--text-4); font-weight: 700; }

/* Code block */
.code-block {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.75;
  color: var(--on-ink);
  background: var(--ink);
  border-radius: var(--r-md);
  direction: ltr;
  text-align: left;
  overflow-x: auto;
}
.code-comment { color: var(--on-ink-3); }
.code-y { color: var(--yellow); }
.code-r { color: #ff6b5e; }

/* Footer */
.page-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding: 26px 28px;
  background: var(--ink);
  border-radius: var(--r-xl);
}
.page-footer .foot-title { font-family: var(--font-display); font-weight: 900; font-size: 17px; color: var(--yellow); }
.page-footer .foot-meta  { font-size: 13.5px; font-weight: 600; color: var(--on-ink-3); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
  .page { padding: 0 18px 64px; }
  .chapter-nav-inner { padding: 10px 18px; }
  section { padding: 40px 0; }
  .masthead-main, .masthead-side { padding: 32px 24px; }
  .t-h1 { font-size: 32px; }
  .t-h2 { font-size: 26px; }
  .card { padding: 18px; }
  .toast--live { left: 14px; right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}
