/* ================================================================
   Fresh Pages Co. — Client Portal
   Theme values are applied from workspace.branding at boot (js/app.js).
   These are the canonical defaults.
   ================================================================ */
:root {
  --primary:        #AF8787;
  --primary-light:  #C4A3A3;
  --primary-pale:   #F5EEEE;
  --primary-dark:   #8F6767;
  --ink:            #2C2020;
  --ink-soft:       #5C4A4A;
  --cream:          #FAF7F5;
  --rule:           rgba(175,135,135,0.25);
  --done:           #7d8b6a;   /* warm sage for success states */
  --warn:           #b8863b;   /* warm amber for due-soon */
  --danger:         #a85246;   /* warm terracotta for overdue */
  --card-shadow:    0 2px 10px rgba(140,100,100,0.10);
  --card-shadow-lg: 0 8px 30px rgba(140,100,100,0.18);
  --font-heading:   'the-seasons', 'Playfair Display', Georgia, serif;
  --font-body:      'Poppins', -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; overflow-x: clip; }
/* lock the page behind a full-screen overlay (drawer/modal/search) so mobile can't scroll or zoom the background */
body.overlay-open { overflow: hidden; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-heading); font-weight: 400; line-height: 1.2; color: var(--ink); letter-spacing: .012em; }
h1 { font-size: 2.15rem; }
h2 { font-size: 1.62rem; }
h3 { font-size: 1.24rem; }
/* the-seasons is a fine, light serif — give the smaller heading uses a touch of tracking so they stay legible */
.wordmark, .notif-head, .capcheck-verdict strong, .tl-stage .tl-name, .agr-title, .stat .stat-num, .prop-pkg-total { letter-spacing: .012em; }
h4 { font-size: .82rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-soft); }

a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: var(--font-body); font-size: .95rem; cursor: pointer; }

img, svg { max-width: 100%; }

/* ---------- dev bar (testing only — removed when auth ships) ---------- */
#devbar {
  position: relative; z-index: 60;
  background: var(--ink); color: #f5eeee;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; font-size: .8rem; flex-wrap: wrap;
}
#devbar .devbar-label { opacity: .75; letter-spacing: .05em; text-transform: uppercase; font-size: .68rem; }
#devbar select {
  font-family: var(--font-body); font-size: .8rem;
  background: #453535; color: #fff; border: 1px solid #6b5555;
  border-radius: 4px; padding: 4px 8px;
}
#devbar .devbar-reset {
  margin-left: auto; background: none; border: 1px solid #6b5555;
  color: #d8c4c4; border-radius: 4px; padding: 3px 10px; font-size: .72rem;
}
#devbar .devbar-reset:hover { background: #453535; }

/* ---------- layout shells ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  display: none;
  width: 236px; flex-shrink: 0;
  background: #fff; border-right: 1px solid var(--rule);
  padding: 34px 0 24px;
  flex-direction: column;
}
.sidebar .wordmark { padding: 0 30px 22px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }
.sidebar nav { padding: 0 12px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 13px; border-radius: 7px;
  padding: 9px 18px; color: var(--ink-soft); font-size: .9rem; letter-spacing: .005em;
  transition: background .14s ease, color .14s ease;
}
.sidebar nav a:hover { text-decoration: none; background: var(--primary-pale); }
.sidebar nav a.active { color: var(--primary-dark); background: var(--primary-pale); font-weight: 500; }
.sidebar nav a svg { width: 17px; height: 17px; stroke-width: 1.6; opacity: .85; }
.sidebar nav a.active svg { opacity: 1; }
.nav-section { margin-bottom: 2px; }
.nav-section + .nav-section { margin-top: 14px; }
.nav-section-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; padding: 10px 18px 8px; cursor: pointer;
  font-size: .64rem; letter-spacing: .17em; text-transform: uppercase; color: var(--primary); font-weight: 600;
}
.nav-section-head:hover { color: var(--primary-dark); }
.nav-chev { font-size: .7rem; opacity: .6; }

.main { flex: 1; min-width: 0; padding: 20px 16px 80px; }

.wordmark { font-family: var(--font-heading); font-size: 1.3rem; color: var(--ink); }
.wordmark span { color: var(--primary); }
.wordmark small { display: block; font-family: var(--font-body); font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--primary); margin-top: 2px; }
.wordmark-logo { display: block; max-height: 58px; max-width: 184px; object-fit: contain; }

/* mobile "More" nav sheet */
.more-scrim { position: fixed; inset: 0; z-index: 49; background: rgba(44,32,32,.28); animation: fadein .15s ease; }
.more-sheet {
  position: fixed; bottom: 60px; left: 0; right: 0; z-index: 50;
  background: #fff; border-top: 1px solid var(--rule); box-shadow: 0 -8px 24px rgba(140,100,100,.14);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 14px 10px;
  animation: slideup .2s ease;
}
.more-sheet a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; font-size: .64rem; color: var(--ink-soft); text-align: center; border-radius: 4px; }
.more-sheet a svg { width: 20px; height: 20px; stroke-width: 1.5; }
.more-sheet a.active { color: var(--primary-dark); background: var(--primary-pale); }
.more-sheet a:hover { text-decoration: none; background: var(--primary-pale); }
@keyframes slideup { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* saved project-view chips */
.view-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.view-chip {
  display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--rule);
  border-radius: 99px; padding: 6px 14px; font-size: .82rem; color: var(--ink-soft); cursor: pointer;
}
.view-chip:hover { background: var(--primary-pale); }
.view-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.view-chip.ghost { border-style: dashed; }
.view-chip .view-x { opacity: .6; font-size: 1rem; line-height: 1; }
.view-chip .view-x:hover { opacity: 1; }

/* mobile top bar + bottom nav (admin) */
.mobilebar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 1px solid var(--rule);
  padding: 14px 16px; position: sticky; top: 0; z-index: 40;
}
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; background: #fff; border-top: 1px solid var(--rule);
}
.tabbar a {
  flex: 1; text-align: center; padding: 9px 0 12px; font-size: .62rem;
  color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tabbar a svg { width: 20px; height: 20px; stroke-width: 1.5; }
.tabbar a.active { color: var(--primary-dark); }
.tabbar a:hover { text-decoration: none; }

/* portal (client) header */
.portal-header {
  background: #fff; border-bottom: 1px solid var(--rule);
  padding: 16px; position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
}
.portal-header nav { display: flex; gap: 18px; align-items: center; }
.portal-header nav a { font-size: .88rem; color: var(--ink-soft); }
.portal-header nav a.active { color: var(--primary-dark); font-weight: 500; }
.portal-main { max-width: 780px; margin: 0 auto; padding: 24px 16px 90px; }

/* ---------- cards & common ---------- */
.card {
  background: #fff; border-radius: 6px; box-shadow: var(--card-shadow);
  padding: 24px 26px; margin-bottom: 22px;
}
.card.clickable { cursor: pointer; transition: box-shadow .18s ease, transform .18s ease; }
.card.clickable:hover { box-shadow: var(--card-shadow-lg); transform: translateY(-1px); }

/* over-capacity alert banner */
.cap-alert { display: flex; gap: 12px; align-items: flex-start; border-radius: 8px; padding: 14px 16px; margin-bottom: 22px; font-size: .88rem; border: 1px solid; }
.cap-alert span { font-size: 1.1rem; line-height: 1.2; }
.cap-alert a { font-weight: 500; white-space: nowrap; }
.cap-alert.danger { background: rgba(193,88,74,.10); border-color: rgba(193,88,74,.4); color: #8a3529; }
.cap-alert.danger a { color: #8a3529; }
.cap-alert.warn { background: rgba(208,162,76,.12); border-color: rgba(208,162,76,.42); color: #7d5916; }
.cap-alert.warn a { color: #7d5916; }

/* hover tooltips (toggle in Settings → Dashboard & display) */
body.tips-on [data-tip] { position: relative; }
body.tips-on [data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: .72rem; line-height: 1.4; font-weight: 400;
  letter-spacing: .01em; text-transform: none; white-space: normal; width: max-content; max-width: 240px;
  padding: 7px 10px; border-radius: 6px; box-shadow: var(--card-shadow-lg); z-index: 200; pointer-events: none;
}
body.tips-on [data-tip]:hover::before {
  content: ''; position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink); z-index: 200; pointer-events: none;
}

/* bell toggle (dashboard recent activity) */
.bell-wrap { position: relative; display: inline-flex; }
.bell-btn { position: relative; padding: 8px 10px; }
.bell-btn svg { width: 19px; height: 19px; }
.bell-btn.on { background: var(--primary-pale); color: var(--primary-dark); }
.bell-dot { position: absolute; top: 6px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); border: 1.5px solid #fff; }
.notif-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 40;
  width: 340px; max-width: 88vw; max-height: 440px; overflow-y: auto;
  background: #fff; border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: var(--card-shadow-lg); padding: 8px 14px 12px;
  animation: pop .16s ease;
}
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); font-family: var(--font-heading); font-size: 1rem; color: var(--ink); }
.notif-panel .list-row { padding: 9px 4px; }
.capcheck-panel { width: 440px; max-width: 92vw; max-height: min(78vh, 640px); }
.capcheck-panel .capcheck-body { padding-top: 6px; }
/* on mobile these popovers become a fixed sheet that sits above the bottom tab bar, fully in view */
@media (max-width: 767px) {
  .notif-panel, .capcheck-panel {
    position: fixed; left: 10px; right: 10px; bottom: 74px; top: auto;
    width: auto; max-width: none; max-height: 66vh;
  }
  /* stack page headers so action rows get full width and wrap instead of overflowing */
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head > .row { justify-content: flex-start; }
  .page-head .bell-wrap { align-self: flex-start; }
}

/* pair cards side by side on wider screens; stack on mobile */
.card-grid-2 { display: grid; grid-template-columns: 1fr; gap: 22px; margin-bottom: 22px; align-items: start; }
.card-grid-2 > .card { margin-bottom: 0; }
@media (min-width: 860px) { .card-grid-2 { grid-template-columns: 1fr 1fr; } }

.page-head { margin: 8px 0 30px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .crumb { font-size: .78rem; color: var(--ink-soft); margin-bottom: 6px; }
.page-head .crumb a { color: var(--primary-dark); }

.eyebrow { font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--primary); font-weight: 600; margin-bottom: 6px; }

.grid-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 28px; }
.stat { background: #fff; border-radius: 6px; box-shadow: var(--card-shadow); padding: 20px 22px; }
.stat .stat-num { font-family: var(--font-heading); font-size: 2.1rem; color: var(--primary-dark); line-height: 1; }
.stat .stat-label { font-size: .74rem; color: var(--ink-soft); margin-top: 8px; letter-spacing: .01em; }
.stat.alert .stat-num { color: var(--danger); }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--ink-soft); font-size: .85rem; }
.small { font-size: .8rem; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }

/* chips & badges */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .7rem; font-weight: 500; padding: 2px 10px; border-radius: 99px;
  background: var(--primary-pale); color: var(--primary-dark); white-space: nowrap;
}
.chip.todo { background: var(--primary-pale); color: var(--ink-soft); }
.chip.in_progress { background: #f2e8d8; color: var(--warn); }
.chip.waiting_on_client { background: #f6e3d9; color: #a2643c; }
.chip.done { background: #e8ecdf; color: var(--done); }
.chip.active { background: #e8ecdf; color: var(--done); }
.chip.paused { background: #f2e8d8; color: var(--warn); }
.chip.complete { background: var(--primary-pale); color: var(--primary-dark); }
.chip.archived { background: #efe9e6; color: var(--ink-soft); }
.chip.overdue { background: #f3ddda; color: var(--danger); }
.chip.private { background: #efe9e6; color: var(--ink-soft); }
.chip.portal { background: var(--primary-pale); color: var(--primary-dark); }
.chip.type { background: #fff; border: 1px solid var(--rule); color: var(--ink-soft); }

/* progress */
.progress { height: 6px; border-radius: 99px; background: var(--primary-pale); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .4s ease; }
.progress.big { height: 9px; }
.progress-label { font-size: .74rem; color: var(--ink-soft); margin-top: 5px; }

/* avatar */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-pale); color: var(--primary-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 600;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary); color: #fff; border: none;
  border-radius: 6px; padding: 9px 18px; font-weight: 500; font-size: .9rem;
  transition: background .15s ease;
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { background: #fff; color: var(--primary-dark); border: 1px solid var(--primary-light); }
.btn.secondary:hover { background: var(--primary-pale); }
.btn.ghost { background: none; color: var(--ink-soft); border: none; padding: 6px 10px; }
.btn.ghost:hover { color: var(--primary-dark); background: var(--primary-pale); }
.btn.sm { padding: 5px 12px; font-size: .8rem; }
.btn.danger { background: none; border: 1px solid #d8b5b0; color: var(--danger); }
.btn.danger:hover { background: #f3ddda; }
.btn svg { width: 15px; height: 15px; stroke-width: 1.5; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* forms */
label.field { display: block; margin-bottom: 14px; }
label.field .lbl { display: block; font-size: .8rem; font-weight: 500; margin-bottom: 6px; }
label.field .help { display: block; font-size: .76rem; color: var(--ink-soft); margin-bottom: 6px; }
label.field .req { color: var(--danger); }
/* Fields match the task-panel sizing everywhere: 14px text, roomier padding */
input[type=text], input[type=email], input[type=date], input[type=url], input[type=number], textarea, select {
  width: 100%; font-family: var(--font-body); font-size: 14px;
  padding: 12px 14px; border: 1px solid var(--rule); border-radius: 6px;
  background: #fff; color: var(--ink);
}
@media (max-width: 640px) {
  /* keep 16px on small screens so iOS doesn't zoom the field on focus */
  input[type=text], input[type=email], input[type=date], input[type=url], input[type=number], textarea, select { font-size: 16px; }
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(175,135,135,.15); }
textarea { min-height: 90px; resize: vertical; }
select.inline { width: auto; font-size: .8rem; padding: 4px 26px 4px 8px; }
input[type=color] { width: 42px; height: 32px; border: 1px solid var(--rule); border-radius: 4px; padding: 2px; background: #fff; cursor: pointer; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.checkline { display: flex; gap: 9px; align-items: flex-start; font-size: .88rem; margin: 6px 0; cursor: pointer; }

/* task rows */
.stage-block { margin-bottom: 26px; }
.stage-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.stage-head h3 { font-family: var(--font-body); font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.stage-head .count { font-size: .72rem; color: var(--primary); }
.task-row {
  background: #fff; border-radius: 4px; box-shadow: var(--card-shadow);
  padding: 12px 14px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  cursor: pointer; transition: box-shadow .15s ease;
}
.task-row:hover { box-shadow: var(--card-shadow-lg); }
.task-row.dimmed { opacity: .62; }
.task-row.inactive { border-left: 3px dashed var(--primary-light); background: repeating-linear-gradient(45deg, #fff, #fff 10px, #fbf7f6 10px, #fbf7f6 20px); }
.task-row .t-title { flex: 1 1 200px; font-size: .92rem; font-weight: 500; }
.task-row .t-title .t-desc { display: block; font-weight: 400; font-size: .76rem; color: var(--ink-soft); margin-top: 2px; }
.task-row .t-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.due { font-size: .74rem; color: var(--ink-soft); white-space: nowrap; }
.due.overdue { color: var(--danger); font-weight: 500; }
.due.soon { color: var(--warn); font-weight: 500; }

/* visibility toggle */
.vis-toggle {
  display: inline-flex; border: 1px solid var(--rule); border-radius: 99px; overflow: hidden; font-size: .68rem;
}
.vis-toggle button { border: none; background: #fff; padding: 3px 10px; color: var(--ink-soft); font-size: .68rem; }
.vis-toggle button.on { background: var(--primary); color: #fff; }

/* ---------- client timeline ---------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--rule); }
.tl-stage { position: relative; padding-bottom: 26px; }
.tl-stage::before {
  content: ''; position: absolute; left: -26px; top: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--primary-light);
}
.tl-stage.done::before { background: var(--primary); border-color: var(--primary); }
.tl-stage.current::before { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(175,135,135,.2); }
.tl-stage .tl-name { font-family: var(--font-heading); font-size: 1.12rem; margin-bottom: 2px; }
.tl-stage .tl-sub { font-size: .76rem; color: var(--ink-soft); margin-bottom: 10px; }
.tl-stage.done .tl-name { color: var(--ink-soft); }

/* portal back navigation */
.backbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--rule); border-radius: 99px;
  padding: 8px 18px; font-size: .85rem; font-weight: 500; color: var(--primary-dark);
  box-shadow: var(--card-shadow);
}
.back-btn:hover { background: var(--primary-pale); text-decoration: none; }
.backbar .crumb-trail { font-size: .78rem; color: var(--ink-soft); }
.backbar .crumb-trail a { color: var(--ink-soft); }
.backbar .crumb-trail a:hover { color: var(--primary-dark); }

/* "what's happening now" hero (client home) */
.now-card {
  background: #fff; border-radius: 4px; box-shadow: var(--card-shadow);
  padding: 26px 22px; margin-bottom: 14px; cursor: pointer;
  border-top: 3px solid var(--primary);
  transition: box-shadow .18s ease, transform .18s ease;
}
.now-card:hover { box-shadow: var(--card-shadow-lg); transform: translateY(-1px); }
.now-stage { font-family: var(--font-heading); font-size: 1.9rem; line-height: 1.15; margin: 6px 0 4px; }
.now-note { font-size: .9rem; color: var(--ink-soft); margin-top: 10px; }
.now-note b { color: var(--primary-dark); }
.stage-dots { display: flex; align-items: center; margin-top: 16px; max-width: 420px; }
.sdot { width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0; background: #fff; border: 2px solid var(--primary-light); }
.sdot.done { background: var(--primary); border-color: var(--primary); }
.sdot.current { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(175,135,135,.22); }
.sline { flex: 1; height: 2px; background: var(--rule); min-width: 12px; }
.sline.done { background: var(--primary); }
.stage-count { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); font-weight: 600; }

/* "waiting on you" — action-needed treatment (client home) */
.attn-card {
  background: var(--primary-pale); border: 1px solid var(--primary-light);
  border-radius: 4px; padding: 18px 16px; margin-bottom: 24px; box-shadow: none;
}
.attn-card h4 { color: var(--primary-dark); margin-bottom: 12px; }
.attn-card .attn-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 4px; box-shadow: var(--card-shadow);
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
  transition: box-shadow .15s ease;
}
.attn-card .attn-item:last-child { margin-bottom: 0; }
.attn-card .attn-item:hover { box-shadow: var(--card-shadow-lg); }
.attn-card .attn-arrow { color: var(--primary); font-size: 1.1rem; flex-shrink: 0; }
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; border-radius: 99px; padding: 0 7px;
  background: var(--primary); color: #fff; font-size: .72rem; font-weight: 600;
}

@media (min-width: 768px) {
  .now-stage { font-size: 2.4rem; }
}

/* client task cards */
.ptask {
  background: #fff; border-radius: 4px; box-shadow: var(--card-shadow);
  padding: 14px 16px; margin-bottom: 8px; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  transition: box-shadow .15s ease;
}
.ptask:hover { box-shadow: var(--card-shadow-lg); }
.ptask .p-check {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--primary-light); display: flex; align-items: center; justify-content: center;
}
.ptask.done .p-check { background: var(--primary); border-color: var(--primary); color: #fff; }
.ptask.done .p-title { text-decoration: line-through; color: var(--ink-soft); }
.ptask .p-title { flex: 1; font-size: .92rem; font-weight: 500; }
.ptask.needs-you { border-left: 3px solid var(--primary); }

/* ---------- drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(44,32,32,.35); z-index: 70; animation: fadein .18s ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 71;
  width: 100%; max-width: 560px; background: var(--cream);
  box-shadow: -12px 0 40px rgba(44,32,32,.18);
  display: flex; flex-direction: column;
  animation: slidein .22s ease;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 30px; border-bottom: 1px solid var(--rule); background: #fff; }
.drawer-body { flex: 1; overflow-y: auto; padding: 30px 30px 52px; }
.drawer-body label.field { margin-bottom: 22px; }
.drawer-body label.field .lbl { margin-bottom: 8px; font-size: .8rem; }
.drawer-body .card { padding: 24px 26px !important; margin-bottom: 20px; }
.drawer-body > form + .card, .drawer-body .card + .card { margin-top: 0; }
.drawer-body h4.mt24 { margin-top: 30px; }
.drawer-body [type=submit].mt16 { margin-top: 8px; }
/* task-panel fields: smaller text, roomier padding */
.drawer-body input[type=text], .drawer-body input[type=email], .drawer-body input[type=date],
.drawer-body input[type=url], .drawer-body input[type=number], .drawer-body textarea, .drawer-body select {
  font-size: 14px; padding: 12px 14px;
}
.drawer-body textarea { min-height: 104px; line-height: 1.55; }
.sched-fields { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (max-width: 640px) {
  /* keep 16px on small screens so iOS doesn't zoom the field on focus */
  .drawer-body input, .drawer-body textarea, .drawer-body select { font-size: 16px; }
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---------- modal ---------- */
.modal-scrim { position: fixed; inset: 0; background: rgba(44,32,32,.35); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadein .18s ease; }
.modal { background: var(--cream); border-radius: 8px; box-shadow: var(--card-shadow-lg); width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; padding: 24px; animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- comments ---------- */
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .c-body { flex: 1; }
.comment .c-meta { font-size: .72rem; color: var(--ink-soft); margin-bottom: 2px; }
.comment .c-text { background: #fff; border-radius: 4px; padding: 9px 12px; font-size: .88rem; box-shadow: var(--card-shadow); }
.comment.resolved .c-text { opacity: .6; }
.comment .c-resolved-tag { font-size: .68rem; color: var(--done); }

/* ---------- emails / outbox ---------- */
.email-card { background: #fff; border-radius: 4px; box-shadow: var(--card-shadow); margin-bottom: 16px; overflow: hidden; }
.email-meta { padding: 12px 16px; border-bottom: 1px solid var(--rule); font-size: .78rem; color: var(--ink-soft); }
.email-meta b { color: var(--ink); }
.email-body-wrap { padding: 16px; background: #f0e9e6; }

/* ---------- proof review (pin comments) ---------- */
.proof-page {
  position: relative; margin-bottom: 14px;
  border-radius: 4px; box-shadow: var(--card-shadow); overflow: visible;
  background: #fff;
}
.proof-page img { display: block; width: 100%; border-radius: 4px; user-select: none; }
.proof-page.pinnable img { cursor: crosshair; }
.pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 26px; height: 26px; border-radius: 50% 50% 50% 4px;
  background: var(--primary-dark); color: #fff; border: 2px solid #fff;
  font-size: .72rem; font-weight: 600; font-family: var(--font-body);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(44,32,32,.35); cursor: pointer; z-index: 5;
}
.pin.resolved { background: var(--done); opacity: .75; }
.pin.draft { background: var(--warn); animation: pop .2s ease; }
.pin.focus { outline: 3px solid rgba(175,135,135,.5); }
.pin.static { position: static; transform: none; flex-shrink: 0; cursor: default; border-radius: 50% 50% 50% 4px; }
.pin-composer {
  position: absolute; z-index: 6; margin-top: 16px;
  width: min(280px, 80%); background: var(--cream); border-radius: 4px;
  box-shadow: var(--card-shadow-lg); padding: 10px; animation: pop .18s ease;
}
.pin-thread {
  background: #fff; border-radius: 4px; box-shadow: var(--card-shadow);
  padding: 12px 14px; margin-bottom: 10px;
}
.pin-thread.resolved { opacity: .65; }
.pin-thread.focus { outline: 2px solid var(--primary-light); }
.pin-thread .c-text { background: var(--primary-pale); box-shadow: none; }
.pin-thread .reply { margin: 8px 0 0 14px; padding-left: 10px; border-left: 2px solid var(--rule); }
.pin-thread .reply .c-text { background: #fff; border: 1px solid var(--rule); }

.proof-caption { font-size: .72rem; color: var(--ink-soft); padding: 6px 4px 2px; }
.proof-approve { display: flex; justify-content: flex-end; padding: 6px 2px 14px; }

/* feedback status summary (client) */
.fs-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.fs-item:last-child { border-bottom: none; }
.fs-item .fs-body { flex: 1; font-size: .84rem; }
.fs-item .fs-body .fs-quote { color: var(--ink-soft); }
.chip.replied { background: var(--primary-pale); color: var(--primary-dark); }
.chip.open { background: #f2e8d8; color: var(--warn); }

/* ---------- proof lightbox (large center view) ---------- */
.lightbox-scrim { position: fixed; inset: 0; background: rgba(44,32,32,.55); z-index: 76; animation: fadein .18s ease; }
.lightbox {
  position: fixed; inset: 2vh 2vw; z-index: 77;
  background: var(--cream); border-radius: 4px; box-shadow: var(--card-shadow-lg);
  display: flex; flex-direction: column; animation: pop .2s ease;
}
.lightbox-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--rule); background: #fff;
  border-radius: 4px 4px 0 0;
}
.lightbox-head h3 { font-size: 1.05rem; }
.lightbox-body { flex: 1; display: flex; min-height: 0; }
.lightbox-proof { flex: 1; overflow-y: auto; padding: 20px 24px; min-width: 0; }
.lightbox-side {
  width: 360px; flex-shrink: 0; overflow-y: auto; padding: 16px 18px;
  background: #fff; border-left: 1px solid var(--rule); border-radius: 0 0 4px 0;
}
.lightbox-side h4:first-child { margin-top: 0 !important; }
@media (max-width: 900px) {
  .lightbox { inset: 0; border-radius: 0; }
  .lightbox-body { flex-direction: column; }
  .lightbox-side { width: auto; border-left: none; border-top: 1px solid var(--rule); max-height: 45%; }
}

/* ---------- template editor ---------- */
.tpl-task-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--rule); border-radius: 4px;
  padding: 8px 10px; margin-bottom: 6px;
}
.tpl-task-row input[type=text] { flex: 2; min-width: 150px; }
.tpl-task-row .offset { width: 74px; }
.tpl-task-row select { width: auto; font-size: .78rem; padding: 6px 24px 6px 8px; }

/* ---------- scheduler ---------- */
.slot-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
  border: 1px solid var(--primary-light); background: #fff; color: var(--primary-dark);
  border-radius: 4px; padding: 8px 14px; font-size: .85rem; cursor: pointer;
}
.slot:hover { background: var(--primary-pale); }
.slot.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.slot:disabled { opacity: .35; cursor: not-allowed; }

/* form builder */
.fb-field { background: #fff; border: 1px solid var(--rule); border-radius: 4px; padding: 12px; margin-bottom: 10px; }
.fb-field .row { flex-wrap: wrap; }

/* table-ish lists */
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 4px;
  border-bottom: 1px solid var(--rule); cursor: pointer;
}
.list-row:hover { background: var(--primary-pale); }
.list-row:last-child { border-bottom: none; }

/* toast */
#toast-root { position: fixed; bottom: 74px; left: 0; right: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  background: var(--ink); color: #fdf9f8; font-size: .84rem;
  padding: 10px 18px; border-radius: 4px; box-shadow: var(--card-shadow-lg);
  animation: toastin .25s ease;
}
@keyframes toastin { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- sign-in screen ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--cream); }
.auth-card { background: #fff; border-radius: 8px; box-shadow: var(--card-shadow-lg); padding: 36px 30px; width: 100%; max-width: 400px; text-align: center; border-top: 3px solid var(--primary); }
.auth-mark { font-size: 1.5rem; margin-bottom: 22px; }
.auth-mark small { display: block; font-family: var(--font-body); font-size: .6rem; letter-spacing: .28em; text-transform: uppercase; color: var(--primary); margin-top: 3px; }
.auth-h { font-size: 1.6rem; margin-bottom: 8px; }
.auth-sub { font-size: .88rem; color: var(--ink-soft); margin-bottom: 22px; line-height: 1.5; }
.auth-icon { font-size: 2rem; margin-bottom: 10px; }
.auth-msg { background: #f3ddda; color: var(--danger); border-radius: 4px; padding: 9px 12px; font-size: .8rem; margin-bottom: 16px; }
.auth-google { width: 100%; justify-content: center; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-soft); font-size: .78rem; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form .btn { width: 100%; justify-content: center; }
.auth-foot { margin-top: 22px; font-size: .82rem; }
.auth-foot a { cursor: pointer; color: var(--ink-soft); }
.auth-foot a:hover { color: var(--primary-dark); }

.desc-btn {
  display: inline-block; background: var(--primary); color: #fff !important; text-decoration: none !important;
  padding: 7px 16px; border-radius: 4px; font-size: .85rem; font-weight: 500; margin: 4px 0;
}
.desc-btn:hover { background: var(--primary-dark); }

.ico-inline { display: inline-flex; }
.ico-inline svg { width: 13px; height: 13px; stroke-width: 1.5; }

/* workload load bars */
.load-track { height: 10px; border-radius: 99px; background: var(--primary-pale); overflow: hidden; }
.load-fill { display: block; height: 100%; border-radius: 99px; transition: width .4s ease; }
.load-fill.ok { background: #7d8b6a; } .load-fill.warn { background: #d0a24c; } .load-fill.danger { background: #c1584a; }
.capcheck-verdict { border-radius: 8px; padding: 14px 16px; border: 1px solid; }
.capcheck-verdict strong { font-family: var(--font-heading); font-size: 1.05rem; font-weight: 400; }
.capcheck-verdict.v-ok { background: rgba(125,139,106,.10); border-color: rgba(125,139,106,.35); color: #566249; }
.capcheck-verdict.v-tight { background: rgba(208,162,76,.12); border-color: rgba(208,162,76,.4); color: #8a6320; }
.capcheck-verdict.v-over { background: rgba(193,88,74,.10); border-color: rgba(193,88,74,.4); color: #964034; }
.capcheck-next { font-size: .82rem; padding-top: 8px; border-top: 1px solid rgba(0,0,0,.08); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.load-pct { font-size: .8rem; font-weight: 600; }
.load-pct.ok { color: #5f6d4e; } .load-pct.warn { color: #a2762c; } .load-pct.danger { color: #a2453a; }

/* My Tasks tabs */
.mytask-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--rule); }
.mytask-tab { background: none; border: none; padding: 8px 14px; font-size: .88rem; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mytask-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 500; }
.mytask-tab:hover { color: var(--primary-dark); }
.mytask-tab .muted { font-size: .78rem; }

.empty { text-align: center; padding: 34px 20px; color: var(--ink-soft); font-size: .88rem; }
.empty .e-icon { font-size: 1.6rem; margin-bottom: 8px; opacity: .5; }

/* ---------- invoices ---------- */
.chip.inv-draft { background: #efe9e6; color: var(--ink-soft); }
.chip.inv-sent { background: #f2e8d8; color: var(--warn); }
.chip.inv-seen { background: var(--primary-pale); color: var(--primary-dark); }
.chip.inv-paid { background: #e8ecdf; color: var(--done); }

.invoice-doc {
  background: #fff; border-radius: 4px; box-shadow: var(--card-shadow);
  padding: 36px 34px; max-width: 720px; margin: 0 auto 20px;
}
.inv-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 28px; flex-wrap: wrap; }
.inv-biz { font-size: .76rem; color: var(--ink-soft); margin-top: 8px; line-height: 1.5; }
.inv-title-block { text-align: right; }
.inv-doctype { font-family: var(--font-heading); font-size: 1.8rem; line-height: 1; }
.inv-number { font-size: .8rem; color: var(--primary-dark); font-weight: 600; letter-spacing: .06em; margin-top: 4px; }
.paid-stamp {
  display: inline-block; margin-top: 10px; padding: 4px 16px;
  border: 2px solid var(--done); color: var(--done); border-radius: 4px;
  font-weight: 600; font-size: .85rem; letter-spacing: .25em; transform: rotate(-4deg);
}
.inv-meta { display: flex; gap: 24px; flex-wrap: wrap; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.inv-meta > div { flex: 1; min-width: 140px; }
.inv-label { font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--primary); font-weight: 600; margin-bottom: 3px; }
.inv-strong { font-weight: 600; font-size: .95rem; }
.inv-table { width: 100%; border-collapse: collapse; margin: 18px 0 6px; }
.inv-table th { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rule); }
.inv-table td { padding: 10px 6px; font-size: .88rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.inv-table .num { text-align: right; white-space: nowrap; }
.inv-totals { margin-left: auto; max-width: 300px; padding: 10px 6px; }
.inv-totals > div { display: flex; justify-content: space-between; font-size: .88rem; padding: 4px 0; }
.inv-totals .inv-discount { color: var(--done); }
.inv-totals .inv-grand { border-top: 2px solid var(--ink); margin-top: 8px; padding-top: 10px; font-weight: 600; font-size: 1.05rem; }
.inv-totals .inv-grand span:last-child { font-family: var(--font-heading); font-size: 1.35rem; }
.inv-pay { display: flex; gap: 20px; align-items: flex-start; background: var(--primary-pale); border-radius: 4px; padding: 16px; margin-top: 18px; flex-wrap: wrap; }
.inv-qr img { width: 120px; height: 120px; object-fit: contain; background: #fff; border-radius: 4px; padding: 6px; display: block; }
.inv-notes { margin-top: 16px; }
.inv-foot { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: .7rem; color: var(--ink-soft); text-align: center; }

/* ---------- agreements & signatures ---------- */
.agr-title { font-family: var(--font-heading); font-size: 1.5rem; margin: 6px 0 14px; }
.agr-body { padding-top: 8px; }
.agr-body p { font-size: .88rem; margin-bottom: 12px; }
.agr-h { font-family: var(--font-body); font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-dark); margin: 18px 0 6px; }
.sig-block { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--rule); }
.sig-col { flex: 1; min-width: 220px; }
.sig-slot { min-height: 64px; display: flex; align-items: flex-end; padding: 4px 2px; border-bottom: 1.5px solid var(--ink); margin: 8px 0 6px; }
.sig-slot.empty-slot { color: var(--ink-soft); font-size: .78rem; font-style: italic; align-items: center; border-bottom-style: dashed; }
.sig-cursive { font-family: 'Great Vibes', 'Brush Script MT', cursive; font-size: 2.1rem; line-height: 1.1; color: var(--ink); min-height: 1em; }
.sig-img { max-height: 64px; max-width: 220px; object-fit: contain; display: block; }
.sig-name { font-size: .85rem; font-weight: 500; }
.sig-record { background: var(--primary-pale); border-radius: 4px; padding: 14px 16px; margin-top: 20px; }

/* invoice editor */
.inv-item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.inv-item-row input[type=text] { flex: 3; min-width: 160px; }
.inv-item-row input[type=number] { width: 84px; }
.qr-preview { width: 90px; height: 90px; object-fit: contain; background: #fff; border: 1px solid var(--rule); border-radius: 4px; padding: 4px; }

/* ---------- print: only the invoice/receipt document ---------- */
@media print {
  #devbar, .sidebar, .mobilebar, .tabbar, .portal-header, .backbar, .no-print, #toast-root, .drawer, .drawer-scrim, .modal-scrim, .lightbox, .lightbox-scrim { display: none !important; }
  body { background: #fff; }
  .shell { display: block; min-height: 0; }
  .main, .portal-main { padding: 0 !important; max-width: none; }
  .invoice-doc { box-shadow: none; border-radius: 0; max-width: none; padding: 10mm 6mm; }
  .paid-stamp { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .inv-pay { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- breakpoints ---------- */
@media (min-width: 768px) {
  .sidebar { display: flex; }
  .mobilebar, .tabbar { display: none; }
  .main { padding: 40px 44px 72px; }
  .grid-stats { grid-template-columns: repeat(4, 1fr); }
  #toast-root { bottom: 24px; }
  .portal-main { padding-top: 36px; }
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.65rem; }
}
@media (min-width: 1100px) {
  .main { padding: 48px 60px 72px; max-width: 1200px; }
}

/* ---------- proposals (styled after Mel's Dubsado layout) ---------- */
.proposal-doc { background: #fff; border-radius: 8px; box-shadow: var(--card-shadow); padding: 0 0 56px; overflow: hidden; max-width: 800px; margin: 0 auto; }
/* mauve uppercase banner */
.prop-banner { background: var(--primary); color: #fff; text-align: center; text-transform: uppercase; letter-spacing: .28em; font-size: .92rem; font-weight: 500; padding: 26px 32px; }
.prop-hero-img { height: 300px; background-size: cover; background-position: center; }
.prop-body { padding: 12px 32px 0; }
.prop-prepared { text-align: center; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); font-weight: 600; padding: 34px 0 0; }
.prop-lead { max-width: 620px; margin: 26px auto 8px; font-size: 1.06rem; line-height: 1.75; color: var(--ink); text-align: center; }
.prop-lead a.desc-btn { text-transform: none; letter-spacing: 0; }
/* big lowercase elegant serif section titles */
.prop-section { padding: 44px 0 0; }
.prop-section-title { font-family: var(--font-heading); font-weight: 400; font-size: 2.8rem; line-height: 1; text-align: center; text-transform: lowercase; color: var(--ink); margin: 0 0 26px; }
.prop-pay-intro { text-align: center; color: var(--ink-soft); font-size: .95rem; margin: -12px 0 20px; }
.prop-packages { max-width: 620px; margin: 0 auto; border-top: 1px solid var(--rule); }
.prop-pkg-row { display: flex; justify-content: space-between; gap: 20px; padding: 18px 4px; border-bottom: 1px solid var(--rule); font-size: 1rem; }
.prop-pkg-desc { flex: 1; }
.prop-pkg-name { font-weight: 500; }
.prop-pkg-points { list-style: none; margin: 8px 0 0; padding: 0; }
.prop-pkg-points li { position: relative; padding-left: 18px; margin: 4px 0; font-size: .92rem; color: var(--ink-soft); line-height: 1.5; }
.prop-pkg-points li::before { content: ''; position: absolute; left: 3px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--primary); }
.prop-pkg-amt { font-weight: 600; white-space: nowrap; }
/* package / proposal line-item editor */
.pkg-item-edit { padding: 12px 0; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.pkg-item-edit:last-of-type { border-bottom: 0; }
.pkg-item-desc { min-height: 62px; font-size: 13px; line-height: 1.5; }
/* archive controls */
.btn.icon-only { padding: 6px 8px; }
.btn.icon-only svg { width: 16px; height: 16px; }
.list-row.is-archived { opacity: .62; }
.archived-block > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 500; color: var(--ink-soft); padding: 6px 2px; }
.archived-block > summary::-webkit-details-marker { display: none; }
.archived-block > summary svg { width: 15px; height: 15px; }
.archived-block > summary:hover { color: var(--primary-dark); }
/* retainer month history */
.ret-history > summary { cursor: pointer; list-style: none; font-size: .78rem; font-weight: 500; color: var(--primary-dark); padding: 4px 0; }
.ret-history > summary::-webkit-details-marker { display: none; }
.ret-months { margin-top: 6px; border-top: 1px solid var(--rule); }
.ret-month-row { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--rule); font-size: .84rem; flex-wrap: wrap; }
.ret-month-lbl { font-weight: 500; min-width: 62px; }
.capcheck-btn.on { background: var(--primary-pale); color: var(--primary-dark); border-color: var(--primary-light); }
/* my-tasks row: controls sit to the right on desktop, drop to their own line on mobile */
.mytask-controls { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
@media (max-width: 767px) {
  .mytask-row { flex-wrap: wrap; align-items: flex-start; }
  .mytask-main { flex: 1 1 100% !important; }
  .mytask-controls { flex: 1 1 100%; flex-wrap: wrap; padding-top: 8px; }
  .mytask-controls .inline { flex: 1; min-width: 130px; }
}
@media (max-width: 767px) {
  /* retainer rows stack cleanly: details on top, actions in their own full-width row below */
  .ret-row { flex-direction: column; align-items: stretch !important; gap: 6px; }
  .ret-row .ret-actions { justify-content: flex-start; padding-top: 4px; border-top: 1px solid var(--rule); }
  .ret-month-row { gap: 8px; }
  .ret-month-row .row { margin-left: 0 !important; }
}
/* ad-hoc project stage scheduler */
.adhoc-stage-head { display: flex; gap: 8px; align-items: center; font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); padding: 0 2px 6px; }
.adhoc-stage-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.adhoc-stage-row input { padding: 9px 11px !important; }
.adhoc-stage-row select.inline { font-size: 14px; padding: 9px 30px 9px 11px; }
.adhoc-stage-row.stage-done input[data-prop="name"] { text-decoration: line-through; color: var(--ink-soft); }
.adhoc-stage-row.stage-done { opacity: .72; }
/* global search */
.nav-search { display: flex; align-items: center; gap: 8px; width: 100%; margin: 14px 0 4px; padding: 9px 12px; border: 1px solid var(--rule); border-radius: 7px; background: #fff; color: var(--ink-soft); font-size: .85rem; text-align: left; }
.nav-search:hover { border-color: var(--primary-light); color: var(--primary-dark); }
.nav-search svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-search span { flex: 1; }
.nav-search kbd { font-family: var(--font-body); font-size: .72rem; padding: 1px 6px; border: 1px solid var(--rule); border-radius: 4px; color: var(--ink-soft); background: var(--bg); }
.mobile-search-btn { position: relative; background: none; border: 0; padding: 6px; color: var(--ink); display: inline-flex; }
.mobile-search-btn svg { width: 20px; height: 20px; }
.mobile-search-btn.on { color: var(--primary-dark); }
.mobilebar-actions { display: flex; align-items: center; gap: 6px; }
.mobilebar-actions .bell-wrap { display: inline-flex; }
@media (max-width: 767px) { .hide-mobile { display: none !important; } }
.search-scrim { position: fixed; inset: 0; background: rgba(40,28,28,.34); z-index: 90; animation: fade .14s ease; }
.search-modal { position: fixed; z-index: 91; top: 12vh; left: 50%; transform: translateX(-50%); width: 560px; max-width: 94vw; background: #fff; border: 1px solid var(--rule); border-radius: 8px; box-shadow: var(--card-shadow-lg); overflow: hidden; animation: pop .16s ease; }
.search-inputwrap { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.search-inputwrap svg { width: 19px; height: 19px; color: var(--ink-soft); flex-shrink: 0; }
.search-inputwrap input { flex: 1; border: 0 !important; padding: 0 !important; font-size: 16px !important; background: none; }
.search-inputwrap input:focus { box-shadow: none !important; }
.search-esc { font-size: .72rem; color: var(--ink-soft); background: var(--bg); border: 1px solid var(--rule); border-radius: 5px; padding: 3px 8px; }
.search-results { max-height: 58vh; overflow-y: auto; padding: 8px; }
.search-empty { padding: 26px 16px; text-align: center; color: var(--ink-soft); font-size: .9rem; }
.search-group-h { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-dark); padding: 12px 10px 5px; }
.search-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; cursor: pointer; text-decoration: none; color: var(--ink); }
.search-item:hover { background: var(--primary-pale); }
.search-item svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; }
.search-item-t { font-size: .9rem; font-weight: 500; white-space: nowrap; }
.search-item-s { font-size: .82rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-more { font-size: .78rem; color: var(--ink-soft); padding: 4px 10px 2px; }
@media (max-width: 640px) { .search-inputwrap input { font-size: 16px !important; } }
.prop-pkg-total { display: flex; justify-content: space-between; gap: 20px; padding: 20px 4px 4px; font-family: var(--font-heading); font-size: 1.4rem; color: var(--primary-dark); }
/* payment plan */
.prop-pay-plan { max-width: 620px; margin: 0 auto; }
.prop-pay-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.prop-pay-row:last-child { border-bottom: none; }
.prop-pay-step { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--primary); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 600; flex-shrink: 0; }
.prop-pay-label { flex: 1; font-size: .98rem; }
.prop-pay-amt { font-weight: 600; white-space: nowrap; text-align: right; }
.prop-pay-pct { display: block; font-weight: 400; font-size: .78rem; color: var(--ink-soft); }
.prop-timeline { max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; }
.prop-tl-row { display: flex; gap: 18px; align-items: flex-start; padding-bottom: 24px; position: relative; }
.prop-tl-row:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 38px; bottom: 0; width: 2px; background: var(--primary-pale); }
.prop-tl-dot { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .88rem; font-weight: 600; flex-shrink: 0; z-index: 1; }
.prop-tl-label { font-weight: 500; font-size: 1.05rem; }
.prop-tl-days { font-size: .84rem; color: var(--ink-soft); margin-top: 3px; }
.prop-faq { max-width: 620px; margin: 0 auto; }
.prop-faq-item { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.prop-faq-item:last-child { border-bottom: none; }
.prop-faq-q { font-weight: 600; font-size: 1rem; margin-bottom: 7px; }
.prop-faq-a { font-size: .94rem; color: var(--ink-soft); line-height: 1.65; }
@media (max-width: 560px) { .prop-section-title { font-size: 2.1rem; } .prop-banner { letter-spacing: .18em; font-size: .8rem; } .prop-body { padding: 12px 20px 0; } }
/* portal accept / request-changes bar */
.prop-actions { max-width: 760px; margin: 22px auto 0; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.prop-actions .btn { padding: 13px 30px; }
.prop-accepted-banner { max-width: 760px; margin: 22px auto 0; background: rgba(125,139,106,.12); border: 1px solid rgba(125,139,106,.4); color: #566249; border-radius: 8px; padding: 16px 20px; text-align: center; font-size: .95rem; }
.prop-changes-banner { max-width: 760px; margin: 22px auto 0; background: rgba(208,162,76,.12); border: 1px solid rgba(208,162,76,.4); color: #8a6320; border-radius: 8px; padding: 16px 20px; font-size: .92rem; }
/* admin editor rows */
.prop-edit-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.prop-edit-row input[type=text] { flex: 1; }
.prop-edit-row input.days-in { width: 90px; flex: none; }

/* segmented document-number editor */
.numseg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.numseg { text-align: center; text-transform: uppercase; font-weight: 600; letter-spacing: .04em; padding: 10px 8px; }
.numseg-fixed { display: inline-flex; align-items: center; justify-content: center; min-width: 56px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 5px; background: var(--cream); font-weight: 600; letter-spacing: .04em; color: var(--ink-soft); }
.numseg-dash { color: var(--ink-soft); font-weight: 600; }
