@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@500;600;700;800&family=Mulish:wght@400;500;600;700;800&display=swap");

* { box-sizing: border-box; }

:root {
  --ink: #16273F;
  --body: #33404F;
  --doc-body: #3A4757;
  --muted: #8791A0;
  --muted2: #5B6675;
  --muted3: #98A2B0;
  --teal: #1B7FB0;
  --teal-dark: #1B5E86;
  --teal-hover: #166B94;
  --card-border: #EAEDF3;
  --line: #E7EBF1;
  --line2: #EEF1F6;
  --btn-border: #E4E8EF;
  --input-border: #E4E9F1;
  --table-head: #F8FAFD;
  --label-cell: #FAFBFD;
  --code-bg: #F6F8FC;
  --red: #E8402A;
  --link: #2F6FE0;
  --link-hover: #1E56C0;
}

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: "Mulish", system-ui, sans-serif;
  color: var(--body);
  background: linear-gradient(180deg, #F5F3FB 0%, #F1F6F6 100%);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }
body.modal-open { overflow: hidden; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
body.auth-pending .app-shell { display: none; }

.app-shell .rm-header-inner,
.app-shell .rm-footer-inner { max-width: 90%; }

@keyframes dcFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dcModalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
/* Aliases referenced by the ported governance inline styles */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ------------------------------- Hero ------------------------------- */
.dc-hero-inner { max-width: 90%; margin: 0 auto; padding: 32px 32px 8px; }
.dc-title {
  font-family: "Lexend", sans-serif;
  font-weight: 700;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin: 0 0 4px;
}
.dc-domain-url { font-size: 15px; color: var(--link); font-weight: 600; text-decoration: none; }
.dc-domain-url:hover { color: var(--link-hover); text-decoration: underline; }

/* Profile chips beneath the org/domain name */
.dc-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dc-chip { display: inline-flex; align-items: center; gap: 7px; font-family: "Lexend", sans-serif; font-weight: 600; font-size: 12.5px; color: #3A4757; background: #fff; border: 1px solid #E4E8EF; border-radius: 999px; padding: 6px 13px; }
.dc-chip-k { font-weight: 700; color: #98A2B0; }
.dc-chip-change { display: inline-flex; align-items: center; gap: 6px; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 12.5px; color: var(--teal); background: #EAF4F9; border: 1px solid #CFE5F0; border-radius: 999px; padding: 6px 13px; cursor: pointer; }
.dc-chip-change:hover { background: #DDEDF5; }

/* Full-width tab band (standard suite treatment) */
.dc-tabbar { background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(18, 38, 63, 0.03); margin-top: 20px; }
.dc-tabbar-inner { max-width: 90%; margin: 0 auto; padding: 0 32px; display: flex; gap: 32px; flex-wrap: wrap; }
.dc-tabbar-inner button:focus-visible { outline: 3px solid rgba(27, 127, 176, 0.35); outline-offset: 2px; border-radius: 4px; }

/* Right-aligned action row */
.dc-actionbar-inner { max-width: 90%; margin: 0 auto; padding: 20px 32px 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ------------------------------- Tab + action bar ------------------------------- */
.dc-bar-inner {
  max-width: 90%;
  margin: 0 auto;
  padding: 24px 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dc-tabs {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--btn-border);
  border-radius: 13px;
  padding: 5px;
  box-shadow: 0 1px 2px rgba(18, 38, 63, 0.05);
}
.dc-tab {
  appearance: none;
  border: none;
  background: transparent;
  font-family: "Lexend", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  border-radius: 9px;
  padding: 11px 20px;
}
.dc-tab.active { font-weight: 700; color: #fff; background: var(--teal); }
.dc-tab:not(.active):hover { color: var(--teal-dark); }

.dc-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dc-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Lexend", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--btn-border);
  border-radius: 11px;
  padding: 11px 18px;
}
.dc-action svg { stroke: currentColor; }
.dc-action:hover { border-color: var(--teal-dark); color: var(--teal-dark); }
.dc-action--embed {
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
  padding: 11px 20px;
  box-shadow: 0 4px 12px rgba(27, 127, 176, 0.28);
}
.dc-action--embed:hover { background: var(--teal-hover); border-color: var(--teal-hover); color: #fff; }

/* ------------------------------- Document card ------------------------------- */
.dc-main { flex: 1; max-width: 90%; width: 100%; margin: 0 auto; padding: 20px 32px 56px; }
.dc-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(18, 38, 63, 0.06);
  padding: 46px 52px;
  animation: dcFadeUp 0.3s ease both;
}
.dc-empty { text-align: center; color: var(--muted); font-size: 15px; padding: 40px 0; }

/* Document head */
.doc-title { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 30px; color: var(--teal-dark); margin: 0 0 6px; letter-spacing: -0.4px; }
.doc-generated { font-size: 14px; color: var(--muted); }
.doc-divider { height: 1px; background: var(--card-border); margin: 24px 0 28px; }

/* Shared document typography */
.doc-body p { margin: 0 0 14px; font-size: 15px; line-height: 1.7; color: var(--doc-body); }
.doc-body ul { margin: 0 0 16px; padding-left: 22px; }
.doc-body li { font-size: 15px; line-height: 1.7; color: var(--doc-body); margin-bottom: 9px; }
.doc-body h3 { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 20px; color: var(--teal-dark); margin: 30px 0 12px; letter-spacing: -0.2px; }
.doc-body h4 { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 15.5px; color: var(--ink); margin: 20px 0 8px; }
.doc-body strong { color: var(--ink); }
.doc-body a { color: var(--link); text-decoration: none; }
.doc-body a:hover { color: var(--link-hover); text-decoration: underline; }
.doc-muted { color: var(--muted); font-size: 14px; }

/* Stat tiles */
.doc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 26px 0 8px; }
.doc-stat { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.doc-stat-label { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 12.5px; color: var(--teal-dark); }
.doc-stat-value { font-family: "Lexend", sans-serif; font-weight: 800; font-size: 28px; color: var(--ink); margin-top: 6px; line-height: 1; }
.doc-stats--vpat { margin: 0; }
.doc-stats--vpat .doc-stat { padding: 18px 20px; }
.doc-stats--vpat .doc-stat-value { font-size: 30px; }

/* VPAT product info block */
.doc-info { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 4px; }
.doc-info-row { display: flex; border-bottom: 1px solid var(--line2); }
.doc-info-row:last-child { border-bottom: none; }
.doc-info-label { width: 200px; flex: 0 0 auto; padding: 14px 18px; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 14px; color: var(--teal-dark); background: var(--label-cell); border-right: 1px solid var(--line2); }
.doc-info-value { flex: 1; padding: 14px 18px; font-family: "Mulish", sans-serif; font-size: 14.5px; color: var(--doc-body); word-break: break-word; }

/* VPAT conformance table */
.doc-table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; overflow-x: auto; }
.doc-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.doc-table thead tr { background: var(--table-head); border-bottom: 1px solid var(--card-border); }
.doc-table th { text-align: left; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 12.5px; letter-spacing: 0.3px; color: var(--teal-dark); padding: 13px 18px; }
.doc-table td { padding: 15px 18px; font-family: "Mulish", sans-serif; font-size: 14px; color: var(--doc-body); }
.doc-table tbody tr { border-bottom: 1px solid #F1F4F8; }
.doc-table tbody tr:last-child { border-bottom: none; }
.doc-table .doc-td-criterion { font-family: "Lexend", sans-serif; font-weight: 600; color: var(--ink); }
.doc-table .doc-td-level { color: var(--muted); }
.doc-conf-pill { display: inline-block; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 12.5px; color: #3B5678; background: #EEF2FA; border-radius: 7px; padding: 5px 12px; }
.doc-conf-pill.supports { color: #1F8A5B; background: #E7F7F1; }
.doc-empty-cell { text-align: center; color: var(--muted); padding: 28px 18px; }

/* ------------------------------- Embed modal ------------------------------- */
.dc-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 60px 20px; overflow-y: auto; }
.dc-modal-backdrop { position: fixed; inset: 0; background: rgba(16, 26, 40, 0.5); }
.dc-modal-panel {
  position: relative;
  width: 100%;
  max-width: 600px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 80px -18px rgba(16, 26, 40, 0.5);
  overflow: hidden;
  animation: dcModalIn 0.28s cubic-bezier(.22,.61,.36,1) both;
}
.dc-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 28px; border-bottom: 1px solid var(--line2); }
.dc-modal-title { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 21px; color: var(--ink); margin: 0; letter-spacing: -0.3px; }
.dc-modal-sub { font-size: 13.5px; color: var(--muted); margin: 3px 0 0; }
.dc-modal-close { width: 40px; height: 40px; border-radius: 12px; background: #F4F6FA; border: 1px solid var(--btn-border); color: var(--muted2); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.dc-modal-close:hover { background: #EBEFF5; }
.dc-modal-body { padding: 24px 28px; }
.dc-embed-label { display: block; font-family: "Lexend", sans-serif; font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 9px; }
.dc-embed-code {
  width: 100%;
  min-height: 120px;
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: all;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--body);
  background: var(--code-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 12px;
}
.dc-embed-code:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(27, 127, 176, 0.14); }
.dc-embed-note { display: flex; align-items: center; gap: 9px; margin-top: 12px; background: #EFF6FB; border: 1px solid #CFE6F2; border-radius: 11px; padding: 12px 15px; }
.dc-embed-note svg { flex: 0 0 auto; }
.dc-embed-note span { font-size: 13px; color: #286B90; line-height: 1.5; }
.dc-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 18px 28px; border-top: 1px solid var(--line2); background: #FBFCFE; }
.dc-btn-ghost { font-family: "Lexend", sans-serif; font-weight: 600; font-size: 14.5px; color: var(--muted2); background: #fff; border: 1px solid var(--btn-border); border-radius: 11px; padding: 11px 22px; }
.dc-btn-ghost:hover { border-color: #C7D0DE; }
.dc-btn-primary { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 14.5px; color: #fff; background: var(--teal); border: none; border-radius: 11px; padding: 11px 22px; box-shadow: 0 4px 12px rgba(27, 127, 176, 0.28); }
.dc-btn-primary:hover { background: var(--teal-hover); }

/* ------------------------------- Responsive ------------------------------- */
@media (max-width: 900px) {
  .doc-stats { grid-template-columns: repeat(2, 1fr); }
  .dc-card { padding: 32px 26px; }
}
@media (max-width: 640px) {
  .dc-hero-inner, .dc-tabbar-inner, .dc-actionbar-inner, .dc-main { padding-left: 20px; padding-right: 20px; }
  .dc-tabbar-inner { gap: 20px; overflow-x: auto; flex-wrap: nowrap; }
  .doc-stats { grid-template-columns: 1fr 1fr; }
  .doc-info-label { width: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  .dc-card, .dc-modal-panel { animation: none; }
}

/* ------------------------------- Print ------------------------------- */
@media print {
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .dc-main { padding: 0 !important; max-width: none !important; }
  .dc-card { box-shadow: none !important; border: none !important; padding: 0 !important; animation: none !important; }
}
