:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --ink: #261d26;
  --muted: #6b626b;
  --brand: #72243f;
  --deep: #351426;
  --gold: #d5ad68;
  --line: #e8e0d8;
  --white: #fff;
  --shadow: 0 4px 20px #43233108;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Devanagari", sans-serif;
  font-size: 15px;
  line-height: 1.55;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible { outline: 3px solid #bd8645; outline-offset: 3px; }
button { cursor: pointer; font: inherit; }
button:disabled { cursor: wait; opacity: .65; }
p { margin: 0; }
body > header {
  isolation: isolate; position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 88% 5%, #9b4b51 0%, transparent 55%), linear-gradient(115deg, #321222, #541b35 65%, #702c42);
  color: #fff; padding: 23px max(24px, calc((100vw - 1200px)/2)) 64px;
  border-bottom: 3px solid #bc965d;
}
body > header::after, body > header::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; border: 1px solid #d8b67a38; border-radius: 50%;
  width: 400px; height: 400px; right: -115px; top: -228px;
}
body > header::before { width: 520px; height: 520px; right: -170px; top: -290px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 11px; color: #e7d2ad; letter-spacing: .13em; font-weight: 700; }
.top a { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; letter-spacing: 0; font-size: 14px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 33px; height: 33px; border: 1px solid #e5c58c85; border-radius: 10px; color: #f7dca7; background: #ffffff0d; }
.icon { display: inline-block; vertical-align: middle; flex: none; width: 21px; height: 21px; }
.hero-kicker { display: block; color: #e8c88e; text-transform: uppercase; font-size: 11px; font-weight: 700; letter-spacing: .17em; margin-top: 29px; }
h1 { font-size: clamp(29px, 4vw, 46px); margin: 4px 0 8px; font-weight: 760; letter-spacing: -.042em; line-height: 1.15; }
body > header > p { color: #f1dce3; font-size: 14px; max-width: 720px; }
main { position: relative; width: min(100%, 1248px); margin: -34px auto 0; padding: 0 24px 28px; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 20px 24px; box-shadow: 0 8px 25px #3e1a2510; }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; letter-spacing: .11em; color: #704a24; background: #f8f0e2; padding: 4px 9px; border-radius: 6px; }
.intro h2 { font-size: clamp(17px, 2.2vw, 22px); font-weight: 750; margin: 6px 0 2px; letter-spacing: -.02em; overflow-wrap: anywhere; }
#status { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
#refresh { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; flex-shrink: 0; padding: 10px 16px; border: 1px solid #d8c8c4; border-radius: 10px; color: var(--brand); background: white; font-size: 13px; font-weight: 700; }
#refresh:hover:not(:disabled) { background: #fcf4f5; border-color: #aa7181; }
#refresh .icon { width: 17px; height: 17px; }
#refresh:disabled .icon { animation: spin 1.3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { margin: 16px 0; border: 1px solid #e9ddc7; border-left: 3px solid #b88a43; background: #fffaf1; border-radius: 11px; padding: 12px 15px; color: #5e4b37; font-size: 12px; line-height: 1.7; }
.notice-title { display: flex; align-items: center; gap: 7px; font-weight: 750; font-size: 13px; color: #61431d; margin-bottom: 3px; }
.notice-title .icon { width: 16px; height: 16px; }
/* V2 adds a plain HEART link. The new role-aware feature card replaces its display. */
main > p:has(> a[href="../heart-pilot/"]) { display: none; }
.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.summary-card { display: flex; align-items: center; gap: 15px; min-width: 0; padding: 17px 19px; border-radius: 14px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.summary-icon { width: 45px; height: 45px; display: grid; place-items: center; background: #f6eef0; color: var(--brand); border-radius: 12px; flex: none; }
.summary-card:nth-child(2) .summary-icon { color: #865921; background: #f8f0e2; }
.summary-card:nth-child(3) .summary-icon { color: #2e6b64; background: #e9f3ef; }
.summary-text { min-width: 0; }
.summary-label { color: var(--muted); font-size: 12px; font-weight: 600; }
.summary-value { display: block; font-size: clamp(24px, 3vw, 30px); font-weight: 790; line-height: 1.3; letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.summary-value.unavailable { font-size: 15px; letter-spacing: 0; }
.heart-feature { position: relative; isolation: isolate; overflow: hidden; margin: 18px 0 27px; display: flex; gap: 20px; align-items: center; background: linear-gradient(110deg, #3c192a, #65253f 70%, #78374a); border: 1px solid #a4775b; color: #fff; border-radius: 17px; padding: 25px 24px; box-shadow: 0 6px 20px #471a2920; }
.heart-feature::after { content: ""; border: 1px solid #e8c98735; position: absolute; right: -50px; top: -100px; width: 230px; height: 230px; border-radius: 50%; z-index: -1; pointer-events: none; }
.heart-emblem { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border: 1px solid #e0b97a78; border-radius: 19px; background: #ffffff0e; color: #f2d69c; }
.heart-emblem .icon { width: 34px; height: 34px; }
.heart-content { flex: 1; min-width: 0; }
.heart-kicker { color: #f0cc89; font-size: 10px; letter-spacing: .13em; font-weight: 750; }
.heart-feature h2 { margin: 4px 0; font-size: clamp(21px, 3vw, 29px); line-height: 1.2; letter-spacing: -.03em; }
.heart-feature p { font-size: 12px; color: #f2dce3; margin: 5px 0; line-height: 1.65; }
.heart-action { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; justify-content: center; background: #f2d9a6; color: #49263a; padding: 11px 15px; border-radius: 9px; font-weight: 750; font-size: 13px; text-decoration: none; }
.heart-action:hover { background: #ffebbf; }
.heart-action .icon { width: 16px; height: 16px; }
.heart-restricted { color: #f2dfbb; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 650; border: 1px solid #e4c38962; padding: 10px 13px; border-radius: 9px; text-align: center; }
.heart-restricted .icon { width: 16px; height: 16px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.section-heading h2 { font-size: 22px; font-weight: 760; margin: 0; letter-spacing: -.025em; }
.section-heading p { color: var(--muted); font-size: 12px; margin: 3px 0 0; }
.section-count { color: #855d42; font-size: 12px; font-weight: 750; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.tile { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 21px 19px 17px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.tile::before { content: ""; height: 3px; position: absolute; top: 0; left: 0; right: 0; background: linear-gradient(90deg, var(--accent), #fff); }
.tile-central { --accent: #7a304b; --tint: #f6edf1; }
.tile-profit { --accent: #2f7863; --tint: #eaf4ef; }
.tile-purchase { --accent: #95662a; --tint: #f9f0df; }
.tile-sop { --accent: #545a96; --tint: #eff0f8; }
.tile-security { --accent: #936047; --tint: #f8eee8; }
.tile-retention { --accent: #2e777e; --tint: #e8f4f5; }
.tile-cash { --accent: #77602d; --tint: #f5f0e1; }
.tile-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.tile-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--accent); background: var(--tint); flex: none; }
.tile .label { display: inline-flex; align-items: center; gap: 5px; color: #746c6b; font-size: 11px; font-weight: 650; }
.tile .label::before { content: ""; width: 6px; height: 6px; background: #b49769; border-radius: 50%; }
.tile h3 { font-size: 18px; font-weight: 750; line-height: 1.3; letter-spacing: -.025em; margin: 0; }
.tile .description { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 5px 0 0; min-height: 38px; }
.primary-metric { border-radius: 11px; background: var(--tint); padding: 11px 13px; }
.primary-metric .metric-label { color: var(--accent); font-size: 12px; font-weight: 650; display: block; }
.primary-metric b { color: var(--ink); font-size: 31px; letter-spacing: -.055em; font-variant-numeric: tabular-nums; line-height: 1.4; display: block; overflow-wrap: anywhere; }
.primary-metric b.unavailable { font-size: 16px; letter-spacing: 0; padding: 5px 0; }
.metrics { margin: 0; }
.metric { display: flex; justify-content: space-between; align-items: baseline; gap: 9px; padding: 7px 0; border-bottom: 1px solid #f0ebe7; font-size: 12px; }
.metric:last-child { border-bottom: 0; }
.metric span { color: #665e66; overflow-wrap: anywhere; }
.metric b { font-weight: 750; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 11px; border-top: 1px solid #eee9e4; margin-top: auto; }
.actions a { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 11px; color: var(--brand); background: #fff; border: 1px solid #e0d5d4; border-radius: 9px; font-weight: 700; text-decoration: none; font-size: 12px; min-height: 38px; flex: 1 1 auto; }
.actions a:hover { border-color: #a97989; background: #fbf4f5; }
.actions a.native { background: #67233d; color: #fff; border-color: #67233d; }
.actions a.native:hover { background: #4b172c; }
.actions a .icon { width: 15px; height: 15px; }
#missing { margin-top: 22px; }
footer { color: var(--muted); margin: 19px 0 3px; font-size: 12px; overflow-wrap: anywhere; }
@media (min-width: 1100px) { .tile { min-height: 315px; } }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  body > header { padding: 17px 17px 52px; }
  .top { letter-spacing: .04em; font-size: 10px; }
  .top a { font-size: 13px; gap: 6px; }
  .brand-mark { width: 29px; height: 29px; }
  .hero-kicker { margin-top: 23px; }
  main { margin-top: -27px; padding: 0 14px 20px; }
  .intro { padding: 15px; gap: 9px; align-items: flex-start; }
  .intro h2 { font-size: 17px; }
  #refresh { padding: 9px 10px; min-height: 40px; font-size: 12px; }
  .notice { margin: 13px 0; }
  .summary-grid { gap: 8px; margin-top: 15px; }
  .summary-card { flex-direction: column; align-items: flex-start; gap: 7px; padding: 12px 9px; border-radius: 12px; }
  .summary-icon { width: 32px; height: 32px; border-radius: 8px; }
  .summary-icon .icon { width: 17px; height: 17px; }
  .summary-label { font-size: 10px; }
  .summary-value { font-size: 22px; }
  .summary-value.unavailable { font-size: 13px; }
  .heart-feature { flex-wrap: wrap; gap: 12px; padding: 18px 15px; margin: 13px 0 22px; }
  .heart-emblem { width: 48px; height: 48px; border-radius: 13px; }
  .heart-emblem .icon { width: 27px; height: 27px; }
  .heart-content { flex: 1 1 70%; }
  .heart-action, .heart-restricted { width: 100%; }
  .section-heading h2 { font-size: 19px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .tile { padding: 17px 16px; }
  .tile .description { min-height: 0; }
  .primary-metric b { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
/* Give the seventh module a balanced closing row instead of a lone card. */
@media (min-width: 981px) {
  .tile-cash { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr) minmax(0,1fr) minmax(0,.8fr); grid-template-areas: "head head head head" "copy major metrics actions"; align-items: center; min-height: 0; }
  .tile-cash .tile-head { grid-area: head; }
  .tile-cash .tile-copy { grid-area: copy; }
  .tile-cash .primary-metric { grid-area: major; }
  .tile-cash .metrics { grid-area: metrics; }
  .tile-cash .actions { grid-area: actions; padding-top: 0; border-top: 0; margin-top: 0; }
  .tile-cash .description { min-height: 0; }
}
@media (min-width: 641px) and (max-width: 980px) {
  .tile-cash { grid-column: 1 / -1; }
}
