:root {
  --bg: #f3f4f7;
  --panel: #ffffff;
  --ink: #1c2230;
  --ink-2: #4a5365;
  --ink-3: #8a93a5;
  --line: #e3e6ec;
  --line-2: #eef0f4;
  --brand: #b91c1c;
  --accent: #2563eb;
  --accent-soft: #e8efff;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fff5e6;
  --bad: #b91c1c;
  --bad-soft: #fdeceb;
  --radius: 10px;
  --font: 'IBM Plex Sans Arabic', Inter, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --num: Inter, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.5; display: flex; flex-direction: column; }
[dir='ltr'] body { --font: Inter, -apple-system, 'Segoe UI', sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--ink-3); }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 20px; padding: 0 20px; height: 56px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand strong { font-size: 15px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #b91c1c, #7f1d1d); color: #fff; display: grid; place-items: center; font-weight: 700; font-family: var(--num); }
.mock { font-size: 11.5px; color: var(--warn); background: var(--warn-soft); border-radius: 99px; padding: 3px 10px; font-weight: 500; }
.tabs { display: flex; gap: 4px; margin-inline-start: auto; }
.user { display: flex; gap: 8px; align-items: center; font-size: 12.5px; white-space: nowrap; }
.user:empty { display: none; }
body.embed .user .ghost { display: none; }
.tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.tabs button:hover { background: var(--line-2); }
.tabs button[aria-selected='true'] { background: var(--accent-soft); color: var(--accent); }

/* Buttons */
.btn { border: 1px solid var(--line); background: var(--panel); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--line-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #1d4ed8; }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.success:hover:not(:disabled) { background: #166534; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
.ghost { border: 1px solid var(--line); background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.icon-btn { border: 0; background: none; cursor: pointer; color: var(--ink-3); padding: 4px 6px; border-radius: 6px; font-size: 16px; line-height: 1; }
.icon-btn:hover { background: var(--bad-soft); color: var(--bad); }

/* Layout */
#view { flex: 1; min-height: 0; display: flex; }
.inbox { width: 330px; flex: none; background: var(--panel); border-inline-end: 1px solid var(--line); overflow-y: auto; }
.workspace { flex: 1; min-width: 0; display: flex; }

.msg { display: block; width: 100%; text-align: start; border: 0; border-bottom: 1px solid var(--line-2); background: none; padding: 12px 16px; cursor: pointer; }
.msg:hover { background: #f8f9fb; }
.msg[aria-current='true'] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
[dir='rtl'] .msg[aria-current='true'] { box-shadow: inset -3px 0 0 var(--accent); }
.msg-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.msg-from { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-time { font-size: 11.5px; color: var(--ink-3); flex: none; }
.msg-subject { font-size: 13px; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-preview { font-size: 12px; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.msg-foot { display: flex; gap: 6px; margin-top: 6px; align-items: center; flex-wrap: wrap; }

.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.pill.in_review { background: var(--warn-soft); color: var(--warn); }
.pill.needs_finance_review { background: #f3e8ff; color: #7e22ce; }
.pill.ready_for_approval { background: var(--accent-soft); color: var(--accent); }
.pill.approved { background: var(--ok-soft); color: var(--ok); }
.pill.created { background: var(--ok); color: #fff; }
.chip { font-size: 11px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-2); }
.chip.bad { border-color: #f3c3c0; color: var(--bad); }

.empty { margin: auto; text-align: center; max-width: 420px; padding: 40px; color: var(--ink-2); }
.empty h2 { color: var(--ink); margin: 12px 0 6px; font-size: 18px; }
.empty .big { font-size: 40px; }

/* Message reader (before processing) */
.reader { flex: 1; overflow-y: auto; padding: 28px; }
.reader-card { max-width: 760px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.reader h1 { font-size: 19px; margin: 0 0 6px; }
.reader .from { color: var(--ink-2); font-size: 13px; }
.reader pre, .orig pre { white-space: pre-wrap; font-family: inherit; margin: 16px 0; line-height: 1.7; }
.cta { display: flex; align-items: center; gap: 16px; margin-top: 20px; padding: 16px; border-radius: 12px; background: var(--accent-soft); }
.cta p { margin: 0; font-size: 13px; color: var(--ink-2); }
.atts { display: flex; flex-wrap: wrap; gap: 8px; }
.att { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; text-decoration: none; color: var(--ink); background: var(--panel); }
a.att:hover { border-color: var(--accent); }
.att.bad { color: var(--bad); border-color: #f3c3c0; background: var(--bad-soft); }

/* Review column */
.review { width: 470px; flex: none; overflow-y: auto; background: var(--panel); border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; }
.review-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line-2); }
.review-head h1 { font-size: 16px; margin: 0 0 2px; }
.review-head .from { font-size: 12.5px; color: var(--ink-3); }
.stepper { display: flex; gap: 4px; margin-top: 12px; }
.step { flex: 1; font-size: 11px; text-align: center; color: var(--ink-3); }
.step::before { content: ''; display: block; height: 4px; border-radius: 4px; background: var(--line); margin-bottom: 5px; }
.step.done { color: var(--ok); }
.step.done::before { background: var(--ok); }
.step.current { color: var(--accent); font-weight: 600; }
.step.current::before { background: var(--accent); }
.review-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 14px; flex: 1; }

.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card h3 { margin: 0 0 8px; font-size: 13px; }
.card.warn { background: var(--warn-soft); border-color: #f5dcb5; }
.card.warn h3 { color: var(--warn); }
.card.bad { background: var(--bad-soft); border-color: #f3c3c0; }
.card.bad h3 { color: var(--bad); }
.card.good { background: var(--ok-soft); border-color: #bfe5cb; color: var(--ok); font-weight: 500; }
.card.purple { background: #faf5ff; border-color: #e9d5ff; }
.card.purple h3 { color: #7e22ce; }
.card ul { margin: 0; padding-inline-start: 18px; }
.card li { margin: 3px 0; font-size: 13px; }
.card li small { display: block; color: var(--ink-2); }
.card code { font-family: var(--num); font-size: 12px; background: rgba(0,0,0,.05); padding: 1px 4px; border-radius: 4px; direction: ltr; unicode-bidi: isolate; }
.card-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

details.orig { border: 1px solid var(--line); border-radius: var(--radius); }
details.orig summary { padding: 10px 14px; cursor: pointer; font-weight: 500; font-size: 13px; }
details.orig > div { padding: 0 14px 12px; font-size: 13px; }
details.orig pre { margin: 8px 0; color: var(--ink-2); }

fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 600; font-size: 13px; margin-bottom: 8px; padding: 0; display: flex; justify-content: space-between; width: 100%; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
label.f.full { grid-column: 1 / -1; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; font-size: 13.5px; min-width: 0; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input.invalid, select.invalid { border-color: var(--bad); background: #fffafa; }
input[type='date'], input.n { font-family: var(--num); }
input.n { text-align: end; direction: ltr; }
textarea { resize: vertical; min-height: 54px; }
input:disabled, select:disabled, textarea:disabled { background: var(--line-2); color: var(--ink-2); }

.lines { display: flex; flex-direction: column; gap: 8px; }
.line { display: grid; grid-template-columns: 1fr 64px 104px 28px; gap: 6px; align-items: start; padding: 8px; border: 1px solid var(--line-2); border-radius: 8px; background: #fbfbfc; }
.line .desc { grid-column: 1 / -1; }
.line .total { align-self: center; font-size: 12px; color: var(--ink-2); }
.line .total b { color: var(--ink); }
.line-labels { display: grid; grid-template-columns: 1fr 64px 104px 28px; gap: 6px; font-size: 11px; color: var(--ink-3); padding: 0 8px; }

.check { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.check .computed { background: var(--line-2); border-radius: 8px; padding: 7px 10px; font-size: 13.5px; display: flex; justify-content: space-between; gap: 6px; }
.hint { font-size: 11.5px; color: var(--ink-3); margin: 4px 0 0; }
.badge-ok { color: var(--ok); font-weight: 600; font-size: 12px; }
.badge-bad { color: var(--bad); font-weight: 600; font-size: 12px; }

.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radio { flex: 1; min-width: 110px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; gap: 6px; align-items: center; cursor: pointer; font-size: 13px; }
.radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio input { width: auto; margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 5px 12px; cursor: pointer; font-size: 12.5px; }
.seg button[aria-pressed='true'] { background: var(--ink); color: #fff; }

.actions { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; }
.actions-row { display: flex; gap: 8px; }
.actions-row .btn { flex: 1; justify-content: center; padding: 10px; }
.savestate { font-size: 11.5px; color: var(--ink-3); display: flex; justify-content: space-between; }
.approval-note { font-size: 12px; color: var(--ok); }
.voided { font-size: 12px; color: var(--warn); }

.draft-box { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.draft-box header { background: #f8f9fb; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; display: grid; gap: 2px; }
.draft-box header .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.draft-box pre { margin: 0; padding: 12px 14px; white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.7; }
.draft-tag { background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }

.audit { font-size: 12px; color: var(--ink-2); }
.audit summary { cursor: pointer; font-weight: 500; }
.audit ol { margin: 6px 0 0; padding-inline-start: 18px; }
.audit li { margin: 2px 0; }

/* Invoice column */
.paper { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #e6e8ec; }
.paper-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.paper-bar .title { font-weight: 600; font-size: 13px; margin-inline-end: auto; display: flex; gap: 8px; align-items: center; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.live-dot.issued { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.paper-scroll { flex: 1; overflow: auto; padding: 16px 0; }
.paper-fit { margin: 0 auto; transform-origin: top center; }
.paper-fit iframe { width: 860px; height: 1180px; border: 0; display: block; background: transparent; }

/* Tables */
.page { flex: 1; overflow-y: auto; padding: 24px; }
.page-inner { max-width: 1040px; margin: 0 auto; }
.page h1 { font-size: 20px; margin: 0 0 16px; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.toolbar input { max-width: 360px; }
table.list { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.list th { text-align: start; font-size: 12px; color: var(--ink-2); font-weight: 600; background: #f8f9fb; padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #f8f9fb; }
.drafts { display: grid; gap: 14px; }
.page-inner > .card, .page-inner > .card-actions, .page-inner > table { margin-bottom: 12px; }

#toast { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; max-width: 90vw; }
[dir='rtl'] #toast { transform: translateX(50%); }
#toast.show { opacity: 1; }

@media (max-width: 1180px) {
  .workspace { flex-direction: column; overflow-y: auto; }
  .review { width: auto; border-inline-end: 0; overflow: visible; }
  .paper { min-height: 80vh; }
}
@media (max-width: 760px) {
  #view { flex-direction: column; overflow-y: auto; }
  .inbox { width: auto; max-height: 40vh; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .mock { display: none; }
  .reader, .page { padding: 16px; }
}
/* Outlook task pane: one column, no inbox list or tabs (the pane is tied to the open message). */
body.embed .tabs, body.embed .inbox, body.embed .mock { display: none; }
body.embed .topbar { height: auto; padding: 8px 12px; gap: 8px; }
body.embed #view { flex-direction: column; overflow-y: auto; }
body.embed .workspace { flex-direction: column; overflow: visible; }
body.embed .review { width: auto; border-inline-end: 0; overflow: visible; }
body.embed .reader { padding: 12px; overflow: visible; }
body.embed .reader-card { padding: 16px; }
body.embed .cta { flex-direction: column; align-items: stretch; }
body.embed .paper { min-height: 70vh; }
body.embed .grid2 { grid-template-columns: 1fr; }

@media print {
  body > *:not(#view) { display: none; }
}

/* ---------- Home dashboard ---------- */
.home { background:
  radial-gradient(1200px 400px at 85% -10%, rgba(185, 28, 28, .06), transparent 60%),
  radial-gradient(900px 380px at 0% 0%, rgba(37, 99, 235, .05), transparent 60%),
  var(--bg); }
.home-inner { max-width: 1160px; display: flex; flex-direction: column; gap: 22px; padding-bottom: 32px; }

.hero { position: relative; overflow: hidden; border-radius: 22px; color: #fff; padding: 34px 36px; min-height: 210px;
  display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: center;
  background: linear-gradient(125deg, #7f1d1d 0%, #b91c1c 48%, #dc5a3c 100%);
  box-shadow: 0 18px 40px -18px rgba(127, 29, 29, .55); }
.hero::before { content: ''; position: absolute; inset: 0; opacity: .14; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.9) 1px, transparent 1.2px); background-size: 22px 22px; }
.hero::after { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; inset-inline-end: -120px; top: -180px;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%); pointer-events: none; }
.hero-text { position: relative; z-index: 1; }
.hero-date { margin: 0 0 6px; font-size: 13px; opacity: .85; }
.hero h1 { margin: 0 0 8px; font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.hero-sub { margin: 0 0 18px; font-size: 15px; opacity: .92; max-width: 520px; line-height: 1.7; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-btn { background: #fff; color: #7f1d1d; border: 0; font-weight: 600; padding: 10px 18px; border-radius: 10px; }
.hero-btn:hover { background: #fff5f3 !important; }
.ghost-light { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); padding: 10px 18px; border-radius: 10px; }
.ghost-light:hover { background: rgba(255,255,255,.2) !important; }

.hero-art { position: relative; height: 170px; z-index: 1; }
.hero-art .paper-a, .hero-art .paper-b { position: absolute; background: #fff; border-radius: 12px; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 9px; box-shadow: 0 16px 30px -12px rgba(0,0,0,.35); }
.hero-art .paper-a { width: 150px; height: 160px; inset-inline-start: 20px; top: 6px; transform: rotate(-7deg); }
.hero-art .paper-b { width: 150px; height: 150px; inset-inline-start: 120px; top: 14px; transform: rotate(6deg); }
.hero-art span { display: block; height: 8px; border-radius: 6px; background: #f1d9d6; }
.hero-art span.short { width: 55%; }
.hero-art .paper-b b { font-family: var(--num); color: #b91c1c; font-size: 20px; letter-spacing: .08em; }
.hero-art .seal { position: absolute; inset-inline-start: 215px; top: 110px; width: 54px; height: 54px; border-radius: 50%;
  background: #16a34a; color: #fff; display: grid; place-items: center; box-shadow: 0 10px 20px -6px rgba(22,163,74,.6); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; gap: 14px; align-items: flex-start;
  transition: transform .15s ease, box-shadow .15s ease; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(20,30,50,.3); }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.kpi.amber .kpi-icon { background: #fff4e0; color: #b45309; }
.kpi.blue .kpi-icon { background: #e8efff; color: #2563eb; }
.kpi.green .kpi-icon { background: #e7f6ec; color: #15803d; }
.kpi.red .kpi-icon { background: #fdeceb; color: #b91c1c; }
.kpi-label { font-size: 12.5px; color: var(--ink-2); }
.kpi-value { font-size: 24px; font-weight: 700; margin: 2px 0; }
.kpi-sub { font-size: 11.5px; color: var(--ink-3); }

.home-grid { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.panel h2 { margin: 0 0 14px; font-size: 15.5px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.panel-head a { font-size: 13px; color: var(--accent); text-decoration: none; }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li a { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 12px; align-items: center; padding: 11px 8px; border-radius: 12px;
  text-decoration: none; color: inherit; }
.recent li a:hover { background: #f7f8fa; }
.recent li + li { border-top: 1px solid var(--line-2); }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #b91c1c, #f97316); }
.recent li:nth-child(3n+2) .avatar { background: linear-gradient(135deg, #2563eb, #06b6d4); }
.recent li:nth-child(3n) .avatar { background: linear-gradient(135deg, #15803d, #84cc16); }
.who { display: flex; flex-direction: column; min-width: 0; }
.who strong, .who .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .muted { font-size: 12.5px; }
.amt { font-weight: 600; font-size: 13.5px; }
.recent-empty { text-align: center; color: var(--ink-3); padding: 36px 12px; }
.recent-empty p { margin: 10px auto 0; max-width: 320px; }

.journey { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; position: relative; }
.step-card { position: relative; background: #fafbfc; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; }
.step-card strong { display: block; font-size: 14px; margin: 6px 0 2px; }
.step-card p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.step-top { display: flex; justify-content: space-between; align-items: center; }
.step-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--ink); }
.step-ic { color: #b91c1c; }
.step-card:last-child .step-n { background: #16a34a; }

.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.link { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.link .dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd5e1; }
.link.on .dot { background: #16a34a; box-shadow: 0 0 0 4px #dcfce7; }
.link .muted { font-size: 12.5px; }

@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 26px 22px; }
  .hero-art { display: none; }
  .hero h1 { font-size: 24px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { flex-direction: column; gap: 10px; padding: 14px; }
  .kpi-icon { width: 36px; height: 36px; border-radius: 10px; }
  .kpi-value { font-size: 20px; }
  .recent li a { grid-template-columns: 36px 1fr auto; }
  .recent li a .pill { display: none; }
}

/* "Open full page" button inside the Outlook pane */
.full-btn { width: 100%; justify-content: center; margin-bottom: 12px; background: var(--ink); color: #fff; border-color: var(--ink); padding: 8px 12px; font-size: 13px; }
.full-btn:hover:not(:disabled) { background: #0f1420 !important; }

/* Large Outlook dialog: same page as the pane but in the wide two-column layout */
body.embed.dialog .topbar { height: 52px; padding: 0 16px; }
body.embed.dialog #view { flex-direction: row; overflow: hidden; }
body.embed.dialog .workspace { flex-direction: row; overflow: hidden; }
body.embed.dialog .review { width: 470px; border-inline-end: 1px solid var(--line); overflow-y: auto; }
body.embed.dialog .reader { padding: 24px; overflow-y: auto; }
body.embed.dialog .grid2 { grid-template-columns: 1fr 1fr; }
body.embed.dialog .paper { min-height: 0; }

.mismatch-hint { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: #fff; color: var(--ink) !important; line-height: 1.6; }
