/* DLBI Field theme 1.3: a modern, iOS-style layer over app.css.
   Keeps DLBI's red, gold, Bitter / Public Sans and the gold rule; softer corners, grouped cards, tinted controls, line icons. */
:root {
  --bg: #F3F0E9;
  --card: #FFFFFF;
  --fill: rgba(60, 50, 35, 0.07);
  --fill-2: rgba(60, 50, 35, 0.11);
  --sep: rgba(60, 50, 35, 0.12);
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 26px;
  --lift: 0 1px 2px rgba(31, 27, 21, .05), 0 6px 20px rgba(31, 27, 21, .06);
  --lift-2: 0 2px 6px rgba(31, 27, 21, .06), 0 16px 40px rgba(31, 27, 21, .10);
  --t-red: #D7262B; --t-amber: #C27A0E; --t-ink: #2E2921; --t-green: #2F8A45; --t-blue: #2463EB; --t-gold: #A97F46;
  --surface-page: var(--bg);
  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 20px;
}
body { background: var(--bg); }
.ico { flex: none; display: block; }

/* ---------- bars ---------- */
.topbar { background: rgba(255, 255, 255, .78); border-bottom: 2px solid var(--gold-500); box-shadow: 0 1px 0 rgba(31, 27, 21, .03); }
.user-btn { border: 0; background: var(--fill); padding: 7px 14px; }
.user-btn:hover { background: var(--fill-2); }
.pnav { background: rgba(255, 255, 255, .72); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-bottom: 1px solid var(--sep); }
@media (min-width: 768px) {
  .pnav-tabs { gap: 2px; padding: 6px 0; }
  .pnav-tabs a { height: 36px; border: 0; border-radius: 999px; padding: 0 14px; }
  .pnav-tabs a:hover { background: var(--fill); }
  .pnav-tabs a.on { background: var(--ink, #1F1B15); background: var(--neutral-900); color: #fff; }
  .pnav-tabs a.on .badge { box-shadow: 0 0 0 2px var(--neutral-900); }
}
@media (max-width: 767px) {
  .pnav-tabs { border-top: 1px solid var(--sep); background: rgba(255, 255, 255, .82); }
  .pnav-tabs a, .tab-more { border-top: 0 !important; color: #8A8172; }
  .pnav-tabs a.on, .tab-more.on { color: var(--red-600); }
  .pnav-tabs a.on svg, .tab-more.on svg { stroke-width: 2.2; }
}

/* ---------- type ---------- */
.large-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 22px; }
.large-title h1 { font-size: clamp(30px, 4.5vw, 40px); line-height: 1.08; letter-spacing: -0.02em; margin: 2px 0 4px; }
.large-title .muted { font-size: 15px; }
.greet { margin: 0; font-size: 15px; font-weight: 600; color: var(--gold-700); }
.group-title { font: 600 13px var(--font-body); letter-spacing: .02em; color: #7A7060; text-transform: uppercase; margin: 28px 4px 10px; }
.page-title { letter-spacing: -0.02em; }
.eyebrow { letter-spacing: .1em; }

/* ---------- controls ---------- */
.btn { border: 0; border-radius: 12px; background: var(--fill); font-weight: 600; min-height: 42px; }
.btn:hover { background: var(--fill-2); border: 0; }
.btn.primary { background: var(--red-600); box-shadow: 0 1px 2px rgba(168, 0, 0, .25), 0 4px 12px rgba(168, 0, 0, .18); }
.btn.primary:hover { background: var(--red-700); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--fill); }
.btn.tinted { background: var(--red-50); color: var(--red-700); }
.btn.tinted:hover { background: #F6D5D0; }
.btn.round { border-radius: 999px; padding: 0 18px; gap: 8px; }
.btn.small { border-radius: 10px; }
.icon-btn { border-radius: 50%; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  border: 1px solid transparent; background: #F2EFE8; border-radius: 12px; min-height: 44px; padding: 10px 12px; transition: background-color 150ms, border-color 150ms, box-shadow 150ms; }
input:focus, select:focus, textarea:focus { background: #fff; border-color: var(--gold-500); box-shadow: 0 0 0 4px rgba(192, 152, 96, .22); }
input:disabled, select:disabled, textarea:disabled { background: #F6F4EF; color: var(--text-muted); }
.field > span { font-size: 13px; color: #6B6151; font-weight: 600; }
input[type=checkbox] { accent-color: var(--red-600); width: 20px; height: 20px; }
.chip { border: 0; background: var(--card); box-shadow: inset 0 0 0 1px var(--sep); min-height: 34px; padding: 6px 14px; }
.chip.on { background: var(--neutral-900); box-shadow: none; }
.pill { border-radius: 999px; padding: 2px 10px; }
.tag { border-radius: 999px; }
.segmented { border: 0; background: var(--fill); border-radius: 12px; padding: 3px; gap: 3px; }
.seg { border: 0 !important; border-radius: 9px; min-height: 40px; color: #6B6151; }
.seg.on { box-shadow: 0 1px 3px rgba(31, 27, 21, .18); }
.seg:not(.on):not(:disabled):hover { background: rgba(255, 255, 255, .6); }

/* ---------- cards ---------- */
.card { border: 0; border-radius: var(--r-lg); box-shadow: var(--lift); }
.sub-head { letter-spacing: .06em; }
.alert { border-radius: var(--r-md); }
.review-box { border-radius: var(--r-lg); box-shadow: var(--lift-2); padding: 16px 18px; }
.dialog { border-radius: 22px; border-top: 0; box-shadow: 0 30px 80px rgba(31, 27, 21, .28); }
.dialog::after { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold-500); }
.dialog { position: relative; }
@media (max-width: 600px) { .dialog { border-radius: 26px 26px 0 0; } .dialog::after { display: none; } }
.toast { border-radius: 999px; padding: 12px 20px; box-shadow: var(--lift-2); }
.empty-ico { width: 64px; height: 64px; border-radius: 20px; background: var(--card); box-shadow: var(--lift); display: grid; place-items: center; margin: 0 auto 14px; color: var(--gold-700); }

/* ---------- tiles ---------- */
.tiles4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile4 { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 14px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--lift); color: #7A7060; font-size: 14px; font-weight: 600; text-decoration: none !important; transition: transform 200ms var(--ease-out), box-shadow 200ms; }
a.tile4:hover { transform: translateY(-2px); box-shadow: var(--lift-2); }
.tile4 b { font: 700 30px/1.1 var(--font-display); color: var(--neutral-900); margin-top: 10px; letter-spacing: -0.02em; }
.tile-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.t-open .tile-ico { background: var(--t-red); }
.t-progress .tile-ico { background: var(--t-amber); }
.t-review .tile-ico { background: var(--t-ink); color: var(--gold-300); }
.t-overdue .tile-ico { background: #F1D1CC; color: var(--red-700); }
.t-overdue b { color: var(--red-600); }
.t-closed .tile-ico { background: var(--t-green); }
@media (max-width: 640px) { .tiles4 { grid-template-columns: 1fr 1fr; gap: 10px; } .tile4 b { font-size: 26px; margin-top: 6px; } }

/* hero card: ring + tiles */
.hero-card { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: stretch; margin-bottom: 8px; }
.hero-ring { background: linear-gradient(160deg, #2E2921, #1F1B15); border-radius: var(--r-lg); box-shadow: var(--lift-2); padding: 18px 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #CFC6B4; font-size: 13px; font-weight: 600; }
.hero-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ring .ring-bg { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 9; }
.ring .ring-fg { fill: none; stroke: var(--gold-500); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease-out); }
.ring .ring-t { fill: #fff; font: 700 22px var(--font-display); }
@media (max-width: 900px) { .hero-tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) {
  .hero-card { grid-template-columns: 1fr; }
  .hero-ring { flex-direction: row; justify-content: flex-start; gap: 16px; padding: 14px 18px; font-size: 15px; }
  .hero-ring .ring { width: 72px; height: 72px; }
}

/* ---------- grouped lists ---------- */
.group { margin: 22px 0 0; }
.group-head { display: flex; align-items: center; gap: 10px; margin: 0 4px 10px; }
.group-head h2 { font: 700 19px var(--font-display); margin: 0; letter-spacing: -0.01em; }
.group-head a { margin-left: auto; font-size: 14px; font-weight: 600; }
.gh-n { font: 600 12px var(--font-body); color: #7A7060; background: var(--fill); border-radius: 999px; padding: 1px 8px; }
.gh-date { margin-left: auto; font-size: 13px; color: #7A7060; font-weight: 600; }
.gh-ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #fff; }
.tone-red { background: var(--t-red); } .tone-gold { background: var(--t-gold); } .tone-ink { background: var(--t-ink); color: var(--gold-300); } .tone-green { background: var(--t-green); } .tone-blue { background: var(--t-blue); }
.inset { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--lift); overflow: hidden; }
.lrow { position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px 10px 16px; color: var(--text-body); text-decoration: none !important; transition: background-color 150ms; }
.lrow + .lrow::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; height: 1px; background: var(--sep); }
a.lrow:hover { background: #FAF8F3; }
a.lrow:active { background: #F2EFE8; }
.lrow-pin { flex: none; width: 34px; display: flex; justify-content: center; }
.lrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lrow-main b { color: var(--neutral-900); font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow-main small { color: #7A7060; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow-num { text-align: right; display: flex; flex-direction: column; line-height: 1.1; }
.lrow-num b { font: 700 18px var(--font-display); color: var(--neutral-900); }
.lrow-num small { font-size: 11px; color: #7A7060; }
.chev { color: #BDB4A3; }
.app-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.bg-gold { background: linear-gradient(160deg, #CEAC6F, #A97F46); } .bg-blue { background: linear-gradient(160deg, #4B83F0, #2463EB); } .bg-green { background: linear-gradient(160deg, #47A35E, #2F7A3D); } .bg-red { background: linear-gradient(160deg, #E0443F, #A80000); } .bg-ink { background: linear-gradient(160deg, #453E34, #1F1B15); }
.count-chip { font: 700 14px var(--font-body); color: var(--neutral-900); background: var(--fill); border-radius: 999px; min-width: 28px; padding: 2px 9px; text-align: center; }
.ok-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--t-green); color: #fff; display: grid; place-items: center; }
.due-chip { flex: none; font-size: 12px; font-weight: 700; color: #6B6151; background: var(--fill); border-radius: 999px; padding: 3px 9px; }
.due-chip.late { color: var(--red-700); background: var(--red-50); }
.pbar { display: block; height: 6px; background: var(--fill); border-radius: 999px; overflow: hidden; }
.pbar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-500), var(--t-green)); border-radius: 999px; transition: width 800ms var(--ease-out); }
.pbar.thin { height: 4px; margin-top: 6px; max-width: 220px; }
.avatar { flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--av); color: #fff; font-weight: 700; letter-spacing: .02em; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }

/* sheet strip */
.sheet-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.strip-item { display: block; background: var(--card); border-radius: var(--r-md); box-shadow: var(--lift); overflow: hidden; color: var(--neutral-900); text-decoration: none !important; transition: transform 200ms var(--ease-out), box-shadow 200ms; }
.strip-item:hover { transform: translateY(-2px); box-shadow: var(--lift-2); }
.strip-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #fff; border-bottom: 1px solid var(--sep); }
.strip-item span { display: block; padding: 6px 10px; font-size: 13px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 6px 0; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--lift); }
.timeline li { display: flex; gap: 12px; padding: 10px 16px; position: relative; }
.timeline li + li::before { content: ""; position: absolute; left: 32px; top: -10px; height: 20px; width: 2px; background: var(--sep); }
.timeline a { display: flex; flex-direction: column; min-width: 0; color: var(--text-body); text-decoration: none !important; font-size: 14px; }
.timeline a b { color: var(--neutral-900); }
.timeline small { color: #7A7060; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-av { position: relative; flex: none; }
.tl-badge { position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; background: var(--card); color: var(--gold-700); display: grid; place-items: center; box-shadow: 0 0 0 2px var(--card), 0 1px 3px rgba(0, 0, 0, .15); }
.sync-note { display: flex; align-items: center; gap: 4px; justify-content: center; margin-top: 14px; }

/* ---------- project cards ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.pcard { display: flex; flex-direction: column; background: var(--card); border-radius: var(--r-xl); box-shadow: var(--lift); overflow: hidden; color: inherit; text-decoration: none !important; transition: transform 250ms var(--ease-out), box-shadow 250ms; animation: enter 320ms var(--ease-out) both; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--lift-2); }
.pcard-cover { position: relative; aspect-ratio: 16 / 8; background: linear-gradient(160deg, #F6F2E8, #ECE6D8); overflow: hidden; border-bottom: 1px solid var(--sep); }
.pcard-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; transform: scale(1.04); transition: transform 600ms var(--ease-out); }
.pcard:hover .pcard-cover img { transform: scale(1.09); }
.pcard-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold-500); }
.pcard-flag { position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(168, 0, 0, .92); padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(6px); }
.pcard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; }
.pcard-body h3 { font-size: 20px; margin: 0; }
.pcard-body .pbar { margin: 10px 0 12px; }
.pcard-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-chip { display: inline-flex; align-items: center; gap: 5px; font: 700 13px var(--font-body); padding: 4px 10px; border-radius: 999px; }
.s-open { background: #FCE7E5; color: #B11A1A; } .s-progress { background: #F7EAD2; color: #8A5A08; } .s-review { background: #ECE8E0; color: #2E2921; } .s-closed { background: #E1EFE0; color: #22592C; }

/* ---------- lists elsewhere ---------- */
.task-list { border: 0; border-radius: var(--r-lg); box-shadow: var(--lift); overflow: hidden; }
.task-row { border-bottom: 0; position: relative; }
.task-row + .task-row::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; height: 1px; background: var(--sep); }
.task-row:hover { background: #FAF8F3; }
.form-ico { border-radius: 10px; }
.sheet-card { border: 0; border-radius: var(--r-lg); box-shadow: var(--lift); }
.sheet-thumb { border-bottom: 1px solid var(--sep); }
.thumb { border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--sep); }
.thumb.add { background: var(--fill); box-shadow: none; }
.file-chip { border: 0; border-radius: 12px; background: var(--fill); }
.insp { border-radius: var(--r-lg); }
.insp-btns { border: 0; background: var(--fill); border-radius: 10px; padding: 3px; gap: 3px; }
.insp-b { border: 0 !important; border-radius: 8px; background: transparent; }
.insp-b.on { box-shadow: 0 1px 3px rgba(31, 27, 21, .2); }
.table { background: var(--card); }
.more-item { border: 0; border-radius: var(--r-md); background: var(--fill); }
.more-item:hover, .more-item.on { background: var(--gold-50); box-shadow: inset 0 0 0 1px var(--gold-300); }
.setup { border-top: 0; }
.setup-steps a { border: 0; background: var(--fill); border-radius: var(--r-md); }
.answer-card.answered { border: 0; }

/* ---------- viewer ---------- */
.viewer-stage { background: #E8E3D8; }
.viewer-canvas { box-shadow: 0 4px 24px rgba(31, 27, 21, .12); }
.zoom-btns { background: rgba(255, 255, 255, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 14px; box-shadow: var(--lift-2); padding: 4px; gap: 0; }
.zoom-btns .btn { box-shadow: none; background: transparent; border-radius: 10px; }
.viewer-tools .btn.primary { border-radius: 999px; }
.tool-pair .btn:not(.primary) { border-radius: 999px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); }
.mk-bar { border: 0; border-radius: 20px; box-shadow: var(--lift-2); }
.mk-tool { border-radius: 12px; }
.viewer-hint { border-radius: 999px; padding-left: 18px; }
.side-panel { border-top: 0 !important; border-left: 0 !important; box-shadow: -10px 0 40px rgba(31, 27, 21, .12); }
@media (max-width: 1023px) { .side-panel { border-radius: 26px 26px 0 0; } }
.compare-bar { border: 0; border-radius: 999px; box-shadow: var(--lift-2); }

/* ---------- motion on the overview ---------- */
.tile4, .lrow, .strip-item, .timeline li { animation: enter 320ms var(--ease-out) both; }
.hero-tiles .tile4:nth-child(2) { animation-delay: 40ms; } .hero-tiles .tile4:nth-child(3) { animation-delay: 80ms; } .hero-tiles .tile4:nth-child(4) { animation-delay: 120ms; }
.ring .ring-fg { animation: ring-in 1100ms var(--ease-out) both; }
@keyframes ring-in { from { stroke-dashoffset: 238.76; } }
@media (prefers-reduced-motion: reduce) { .ring .ring-fg { animation: none; } }

/* Phones: the project bar must not blur, or the fixed bottom tab bar would be positioned inside it instead of the screen. */
@media (max-width: 767px) {
  .pnav { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; }
}
.form-ico { width: 36px; height: 36px; color: #fff; }
.form-ico.daily { background: linear-gradient(160deg, #CEAC6F, #A97F46); }
.form-ico.inspection { background: linear-gradient(160deg, #453E34, #1F1B15); color: var(--gold-300); }
.form-ico.rfi { background: linear-gradient(160deg, #4B83F0, #2463EB); }
.form-ico.sub { background: linear-gradient(160deg, #47A35E, #2F7A3D); }
