/* ============================================================
   InterAudit — red / white design system
   Single source of truth. No competing override layers.
   ============================================================ */
:root {
  --red:       #d11f33;
  --red-600:   #b51a2b;
  --red-700:   #8f1320;
  --red-50:    #fdecee;
  --red-100:   #f9d7dc;

  --ink:       #1a1d23;
  --ink-soft:  #41464f;
  --muted:     #6b7280;
  --line:      #e6e8ee;
  --line-soft: #f0f2f6;
  --canvas:    #f4f5f8;
  --surface:   #ffffff;

  --ok-bg:#e7f6ec; --ok-fg:#1b7a3d;
  --err-bg:#fdecec; --err-fg:#c0182b;
  --warn-bg:#fff4e2; --warn-fg:#9a6300;

  --shadow-sm: 0 1px 2px rgba(20,24,38,.06), 0 1px 3px rgba(20,24,38,.05);
  --shadow-md: 0 10px 30px -12px rgba(20,24,38,.18);
  --shadow-lg: 0 24px 60px -24px rgba(20,24,38,.28);
  --radius: 16px;

  --serif: "Fraunces", Georgia, serif;
  --sans:  "Inter", system-ui, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.hidden { display: none !important; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.ital { font-style: italic; color: var(--red); }
b { font-weight: 700; }

/* ---------------- header ---------------- */
.site-header {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-700) 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
  position: sticky; top: 0; z-index: 40;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo-wrap {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; overflow: hidden;
  background: #fff; padding: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.brand-logo { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }
.brand-fallback { place-items: center; width: 100%; height: 100%;
  font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--red); }
.brand-title { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1; display: block; }
.brand-accent { opacity: .8; }
.brand-sub { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; opacity: .8; }
.header-right { display: flex; align-items: center; gap: 18px; }
@media (max-width: 640px) { .brand-sub { display: none; } }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font-family: var(--sans); font-weight: 600; font-size: 13px; cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn-primary { background: var(--red); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover:not(:disabled) { background: var(--red-600); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--ink); color: #fff; }
.btn-accent:hover:not(:disabled) { background: #2a2f39; }
.btn-ghost { background: #fff; color: var(--red-700); border-color: var(--red-100); }
.btn-ghost:hover:not(:disabled) { background: var(--red-50); border-color: var(--red); }
.btn-outline-light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); }
.btn-outline-light:hover { background: rgba(255,255,255,.22); }
.btn-outline-light .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.8s ease-in-out infinite; }
.btn-linkedin { background: #0a66c2; color: #fff; font-weight: 700; }
.btn-linkedin:hover { background: #084c93; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity:1; } 50% { transform: scale(1.4); opacity:.6; } }

/* ---------------- cards / layout ---------------- */
.main { padding: 28px 0 60px; display: flex; flex-direction: column; gap: 22px; }
.page { display: flex; flex-direction: column; gap: 22px; animation: pageIn .45s cubic-bezier(.2,.7,.2,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 24px;
}
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 11px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--red-700); font-weight: 600; margin-bottom: 12px; }
.bar { width: 34px; height: 3px; border-radius: 99px; background: var(--red); }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; margin: 0; }
.section-head.sm h2 { font-size: 20px; }
.hint { font-size: 12px; color: var(--muted); }
.push-right { margin-left: auto; }

/* ---------------- hero ---------------- */
.hero { background:
  radial-gradient(900px 360px at 100% -40%, var(--red-50), transparent 60%),
  var(--surface); overflow: hidden; }
.hero-title { font-family: var(--serif); font-weight: 600; line-height: .98;
  font-size: clamp(2.2rem, 6vw, 4.4rem); margin: 6px 0 14px; letter-spacing: -.01em; }
.hero-lead { color: var(--muted); max-width: 40ch; font-size: 15px; }
.marquee { margin-top: 26px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 12px 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: inline-flex; align-items: center; gap: 28px; white-space: nowrap;
  animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }
.marquee-track i { color: var(--red); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------------- tiles ---------------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 940px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .tiles { grid-template-columns: 1fr; } }
.tile { display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; min-height: 280px;
  box-shadow: var(--shadow-sm); transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s ease, border-color .25s ease; }
.tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--red-100); }
.tile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.orb { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  background: var(--red-50); color: var(--red); border: 1px solid var(--red-100); }
.orb svg { width: 28px; height: 28px; }
.tile h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 0 0 8px; }
.tile p { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 11px; padding: 4px 11px; border-radius: 99px; background: var(--canvas);
  border: 1px solid var(--line); color: var(--ink-soft); }
.chip b { color: var(--red-700); }
.cta { margin-top: auto; padding-top: 16px; color: var(--red); font-weight: 700; font-size: 13px;
  letter-spacing: .02em; transition: letter-spacing .2s ease; }
.tile:hover .cta { letter-spacing: .06em; }
.tile-add { border-style: dashed; border-color: var(--red-100); align-items: flex-start; text-align: left;
  background: linear-gradient(180deg, #fff, var(--red-50)); }
.add-plus { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  border: 1px dashed var(--red); color: var(--red); margin-bottom: 16px; }
.add-plus svg { width: 28px; height: 28px; }

.tag { font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 99px; }
.tag-live { background: var(--ok-bg); color: var(--ok-fg); display: inline-flex; align-items: center; gap: 6px; }
.tag-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok-fg); }
.tag-beta { background: var(--red-50); color: var(--red-700); }

/* ---------------- breadcrumbs / workflow head ---------------- */
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.crumb-link { padding: 6px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line);
  color: var(--red-700); font-weight: 600; transition: background .15s ease, border-color .15s ease; }
.crumb-link:hover { background: var(--red-50); border-color: var(--red-100); }
.crumbs .sep { opacity: .5; }
.wf-title { font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 8px 0 0; display: flex; align-items: center; gap: 12px; }

/* tooltip */
.tip { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1px solid var(--red-100); color: var(--red); font-family: var(--serif); font-style: italic;
  font-size: 13px; cursor: help; position: relative; flex: 0 0 auto; }
.tip:hover { background: var(--red-50); }
.tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px); width: max-content; max-width: 300px; text-align: left;
  background: var(--ink); color: #fff; padding: 10px 13px; border-radius: 9px; font-size: 12px;
  font-style: normal; line-height: 1.5; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease; z-index: 60; }
.tip:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- actions / uploads ---------------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.actions.downloads { margin-top: 16px; }
.downloads-label { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.file-badge { margin-left: auto; font-size: 12px; color: var(--ink-soft); background: var(--canvas);
  border: 1px solid var(--line); padding: 8px 14px; border-radius: 99px; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 600px) { .upload-grid { grid-template-columns: 1fr; } }
.upload-slot { background: var(--canvas); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.slot-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--red-700);
  font-weight: 600; margin-bottom: 10px; }
.slot-badge { margin-top: 10px; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field { display: block; font-size: 12px; }
.field span { display: block; text-transform: uppercase; letter-spacing: .14em; color: var(--muted);
  font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-family: var(--sans); font-size: 14px; color: var(--ink); }
.field input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-50); }

/* ---------------- tables ---------------- */
.note { font-size: 14px; color: var(--ink-soft); margin-bottom: 16px; line-height: 1.6; }
.table-surface { border: 1px solid var(--line); border-radius: 12px; overflow: auto; background: #fff; }
.scroll-380 { max-height: 380px; } .scroll-520 { max-height: 520px; }
.scroll-560 { max-height: 560px; } .scroll-600 { max-height: 600px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { position: sticky; top: 0; background: var(--ink); color: #fff; text-align: left;
  font-weight: 600; font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
  padding: 11px 14px; white-space: nowrap; z-index: 1; }
.data-table th.r, .data-table td.r { text-align: right; }
.data-table td { padding: 9px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.data-table tbody tr.row-odd { background: var(--canvas); }
.data-table tbody tr:hover { background: var(--red-50); }
.data-table .empty { text-align: center; color: var(--muted); font-style: italic; padding: 40px; }
.data-table tr.is-total { font-weight: 700; background: var(--red-50) !important; border-top: 2px solid var(--red-100); }
.data-table td.neg { color: var(--err-fg); }
.data-table tr.is-flagged { background: var(--err-bg) !important; }
.clickable { cursor: pointer; }

/* status pill inside sheets table */
.pill { display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: 11px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; }
.pill-pending { background: var(--canvas); color: var(--muted); }
.pill-ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill-err { background: var(--err-bg); color: var(--err-fg); }
.pill-skip { background: var(--warn-bg); color: var(--warn-fg); }
.proc-cell { color: var(--muted); font-size: 12px; }
.notes-cell { color: var(--muted); font-size: 12px; }
.more-rows { font-size: 12px; color: var(--muted); padding: 10px 14px; }

/* ---------------- tabs ---------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab-btn { padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--muted);
  border: none; border-bottom: 2px solid transparent; background: none; cursor: pointer; }
.tab-btn:hover { color: var(--ink); }
.tab-btn.active { color: var(--red); border-color: var(--red); }

/* ---------------- history ---------------- */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.empty-history { padding: 40px; text-align: center; color: var(--muted); font-style: italic;
  border: 1px dashed var(--line); border-radius: 12px; }
.hist-card { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease; }
.hist-card:hover { border-color: var(--red-100); box-shadow: var(--shadow-sm); }
.hist-main { min-width: 0; flex: 1; }
.hist-row1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hist-title { font-family: var(--serif); font-size: 17px; color: var(--ink); }
.hist-time { font-size: 12px; color: var(--muted); margin-left: auto; }
.hist-files { font-size: 12px; color: var(--ink-soft); margin-top: 6px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.hist-summary { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.hist-actions { display: flex; gap: 8px; flex-shrink: 0; }
.hist-actions .btn { padding: 7px 14px; font-size: 12px; }
@media (max-width: 640px) {
  .hist-card { flex-direction: column; }
  .hist-time { margin-left: 0; }
  .hist-actions { width: 100%; }
}

/* ---------------- footer ---------------- */
.site-footer { background: var(--ink); color: #c7cbd4; margin-top: 48px; }
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; padding: 48px 24px 36px; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; gap: 32px; } }
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-logo-link { flex: 0 0 auto; display: inline-grid; place-items: center; overflow: hidden;
  background: #fff; border-radius: 12px; padding: 9px 11px; box-shadow: var(--shadow-sm); }
.footer-logo { height: 42px; width: auto; max-width: 150px; display: block; }
.footer-logo-fallback { place-items: center; width: 48px; height: 42px;
  font-family: var(--serif); font-weight: 600; font-size: 20px; color: var(--red); }
.footer-co-name { font-family: var(--serif); font-size: 21px; color: #fff; }
.footer-co-tag { font-size: 13px; color: #9aa0ac; margin: 6px 0 10px; max-width: 42ch; line-height: 1.6; }
.footer-site { font-size: 13px; font-weight: 600; color: #fff; border-bottom: 1px solid var(--red);
  padding-bottom: 1px; transition: color .15s ease; }
.footer-site:hover { color: var(--red); }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.footer-col h4 { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--red);
  margin: 0 0 12px; }
.footer-col a { display: block; font-size: 13px; color: #c7cbd4; padding: 5px 0; transition: color .15s ease; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.footer-bottom-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; font-size: 12px; color: #9aa0ac; flex-wrap: wrap; }
.foot-status { display: inline-flex; align-items: center; gap: 8px; letter-spacing: .02em; }
.foot-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok-fg);
  box-shadow: 0 0 0 3px rgba(27,122,61,.18); }
.footer-copy { letter-spacing: .02em; }

/* ---------------- modals ---------------- */
.modal-bg { position: fixed; inset: 0; background: rgba(26,29,35,.55); display: flex;
  align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 22px;
  line-height: 1; cursor: pointer; z-index: 5; }
.modal-close:hover { background: rgba(255,255,255,.3); }
.modal-close.dark { background: rgba(255,255,255,.2); }

/* intro modal */
.intro-shell { position: relative; width: 100%; max-width: 980px; max-height: 94vh; overflow: auto;
  border-radius: 24px; color: #fff; box-shadow: var(--shadow-lg);
  background: linear-gradient(160deg, var(--red-700) 0%, var(--red) 60%, var(--red-600) 100%);
  animation: pageIn .35s cubic-bezier(.2,.7,.2,1); }
.intro-grid { display: grid; grid-template-columns: 290px 1fr; gap: 32px; padding: 32px; }
@media (max-width: 760px) { .intro-grid { grid-template-columns: 1fr; } }
.photo-frame { position: relative; border-radius: 16px; overflow: hidden; background: rgba(0,0,0,.2);
  box-shadow: var(--shadow-lg); }
.logo-frame { background: #fff; display: grid; place-items: center; padding: 36px 24px; min-height: 200px; }
.logo-frame img { max-width: 100%; height: auto; }
.photo-placeholder { aspect-ratio: 3/4; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 24px; }
.photo-placeholder .avatar { width: 90px; height: 90px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); font-size: 28px; font-weight: 700; }
.photo-placeholder small { color: rgba(255,255,255,.85); font-size: 12px; }
.photo-placeholder code { color: #fff; background: rgba(0,0,0,.25); padding: 2px 6px; border-radius: 5px; }
.photo-tag { position: absolute; left: 12px; bottom: 12px; background: #fff; color: var(--red-700);
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 5px 11px; border-radius: 99px; }
.stat-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.stat-card { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 12px 14px; }
.stat-num { font-family: var(--serif); font-size: 26px; line-height: 1; }
.stat-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; margin-top: 4px; }
.intro-aside .btn { margin-top: 16px; }
.intro-eyebrow { font-size: 13px; letter-spacing: .04em; opacity: .85; }
.intro-name { font-family: var(--serif); font-weight: 600; font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 4px 0 14px; }
.intro-body .chips .chip { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.pull-quote { font-family: var(--serif); font-style: italic; font-size: 19px; margin: 22px 0; padding-left: 16px;
  border-left: 3px solid #fff; opacity: .95; }
.pull-quote b { font-style: normal; }
.intro-prose { display: flex; flex-direction: column; gap: 16px; font-size: 15px; line-height: 1.7; color: rgba(255,255,255,.94); }
.intro-prose .hl { font-weight: 600; }
.drop-cap::first-letter { font-family: var(--serif); float: left; font-size: 3.4rem; line-height: .8;
  padding: .3rem .5rem 0 0; font-weight: 700; }

/* detail modal */
.detail-shell { width: 100%; max-width: 1080px; max-height: 90vh; background: var(--surface);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.detail-head { background: var(--red); color: #fff; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; }
.detail-head h3 { margin: 0; font-family: var(--serif); font-size: 20px; }
.detail-head .modal-close { position: static; }
.detail-note { padding: 14px 24px; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail-note .label { color: var(--red-700); font-weight: 700; margin-bottom: 4px; }
.detail-tabs { padding: 12px 24px 0; margin: 0; }
.detail-content { flex: 1; overflow: auto; padding: 16px 24px; }

/* ---------------- scroll reveal + scrollbars ---------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(20px); }
  .reveal.in { opacity: 1; transform: none; transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); }
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--red-100); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: var(--red); }
*::-webkit-scrollbar-track { background: transparent; }
