/* AMAADOR Aurora content layer: tools, generators and editorial pages.
   Deliberately excludes the shared header/footer, which are owned by the shell. */
html[data-aurora-tools] {
  --af-canvas: #fbf8f3;
  --af-surface: rgba(255, 255, 255, .94);
  --af-surface-2: #f5f0fb;
  --af-text: #14213d;
  --af-muted: #647084;
  --af-line: rgba(61, 44, 95, .14);
  --af-accent: #7757e8;
  --af-accent-2: #ed5c88;
  --af-focus: #5b43d6;
  --af-shadow: 0 18px 46px rgba(40, 29, 76, .10);
  --af-soft-shadow: 0 8px 24px rgba(40, 29, 76, .08);
  --af-radius-xl: 30px;
  --af-radius: 20px;
  --af-radius-sm: 13px;
  color-scheme: light;
}

html[data-aurora-tools][data-theme="dark"],
html[data-aurora-tools].dark {
  --af-canvas: #11162a;
  --af-surface: rgba(29, 35, 58, .96);
  --af-surface-2: #24213c;
  --af-text: #f8f5ff;
  --af-muted: #bac2d4;
  --af-line: rgba(232, 225, 255, .16);
  --af-accent: #b6a2ff;
  --af-accent-2: #ff8db0;
  --af-focus: #d2c5ff;
  --af-shadow: 0 20px 52px rgba(0, 0, 0, .34);
  --af-soft-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  color-scheme: dark;
}

html[data-aurora-tools][data-theme="dark"] body{background:var(--af-canvas)!important;color:var(--af-text)!important}
html[data-aurora-tools][data-theme="dark"] body.ins main{color:var(--af-text)!important}
html[data-aurora-tools][data-theme="dark"] body.ins .ix-h,
html[data-aurora-tools][data-theme="dark"] body.ins .method,
html[data-aurora-tools][data-theme="dark"] body.ins .grid.ix article{background:var(--af-surface)!important;border-color:var(--af-line)!important;color:var(--af-text)!important}
html[data-aurora-tools][data-theme="dark"] body.ins .ix-h :where(h1,p),
html[data-aurora-tools][data-theme="dark"] body.ins .method :where(h2,p){color:var(--af-text)!important}
html[data-aurora-tools][data-theme="dark"] body.ins .chips a{background:var(--af-surface)!important;border:1px solid var(--af-line)!important;color:var(--af-text)!important}
html[data-aurora-tools][data-theme="dark"] body.ins .chips a[aria-current="page"],
html[data-aurora-tools][data-theme="dark"] body.ins .chips a:hover{background:var(--af-accent)!important;color:#fff!important}

html[data-aurora-domain="safety"] { --af-domain: #ef5d77; --af-domain-soft: #fff0f3; }
html[data-aurora-domain="health"] { --af-domain: #8b5cf6; --af-domain-soft: #f4efff; }
html[data-aurora-domain="environment"] { --af-domain: #159f88; --af-domain-soft: #e9faf5; }
html[data-aurora-domain="energy"] { --af-domain: #3984e6; --af-domain-soft: #edf5ff; }
html[data-aurora-domain="csr"] { --af-domain: #ef8a3d; --af-domain-soft: #fff4e9; }
html[data-aurora-domain="security"] { --af-domain: #5570d8; --af-domain-soft: #eef1ff; }

html[data-aurora-tools][data-theme="dark"] { --af-domain-soft: rgba(130, 106, 220, .13); }

html[data-aurora-tools] body {
  background: var(--af-canvas);
  color: var(--af-text);
}

html[data-aurora-tools] main[data-aurora-content] {
  color: var(--af-text);
  min-width: 0;
}

html[data-aurora-tools] main[data-aurora-content] :where(h1, h2, h3, h4, legend, summary, label, th) {
  color: var(--af-text);
}

html[data-aurora-tools] main[data-aurora-content] :where(p, li, small, figcaption, .muted, .note, .dek, .meta, .sub) {
  color: var(--af-muted);
}

html[data-aurora-tools] main[data-aurora-content] a { color: var(--af-accent); }
html[data-aurora-tools] main[data-aurora-content] a:hover { color: var(--af-accent-2); }
html[data-aurora-tools] main[data-aurora-content] :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--af-focus) 55%, transparent);
  outline-offset: 3px;
}

/* Directory and editorial canvas */
html[data-aurora-tools="directory"] main,
html[data-aurora-tools="insights-index"] main,
html[data-aurora-tools="article"] main {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

html[data-aurora-tools] main :where(.page-head, .search-section, .search-note, .post, .related, .method, .faq, .sources) {
  background: var(--af-surface);
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius-xl);
  box-shadow: var(--af-soft-shadow);
}

html[data-aurora-tools] main .page-head {
  margin-block: 24px;
  overflow: hidden;
  position: relative;
}

html[data-aurora-tools] main .page-head::before,
html[data-aurora-tools] main .post-h::before {
  content: "";
  display: block;
  width: 76px;
  height: 7px;
  margin-bottom: 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--af-domain), var(--af-accent), var(--af-accent-2));
}

html[data-aurora-tools] main :where(.page-head, .post-h) h1 {
  font-family: "Inter Tight", Inter, system-ui, sans-serif;
  font-size: clamp(2.35rem, 5vw, 4.9rem);
  line-height: .98;
  letter-spacing: -.045em;
  max-width: 16ch;
}

html[data-aurora-tools] main .search-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block: 18px 24px;
}
html[data-aurora-tools="directory"] main .search-jumps[hidden] { display: none !important; }

html[data-aurora-tools] main .search-jumps a,
html[data-aurora-tools] main :where(.chip, .pill, .tag, .badge, .kick, .rt) {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid var(--af-line);
  border-radius: 999px;
  background: var(--af-domain-soft);
  color: var(--af-text);
  font-weight: 700;
  text-decoration: none;
}

html[data-aurora-tools] main .directory-tools,
html[data-aurora-tools] main .grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  list-style: none;
}

html[data-aurora-tools] main :where(.directory-tool, .card) {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  background: linear-gradient(145deg, var(--af-surface), var(--af-domain-soft));
  box-shadow: var(--af-soft-shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

html[data-aurora-tools] main :where(.directory-tool, .card):hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--af-domain) 42%, var(--af-line));
  box-shadow: var(--af-shadow);
}

html[data-aurora-tools] main .directory-tool { padding: 18px; }
html[data-aurora-tools] main .directory-tool > a { display: block; color: var(--af-text); font-weight: 800; text-decoration: none; }
html[data-aurora-tools] main .directory-tool small { display: block; margin-top: 7px; }
html[data-aurora-tools] main .card > a { color: inherit; text-decoration: none; }
html[data-aurora-tools] main .card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
html[data-aurora-tools] main .card-b { padding: 20px; }

/* Rich Tools directory: compact themes and faithful cards built from the existing catalogue. */
html[data-aurora-tools] main .aurora-theme-deck {
  margin: 24px 0 34px;
  padding: clamp(18px, 2.6vw, 28px);
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius-xl);
  background: linear-gradient(135deg, color-mix(in srgb, var(--af-surface) 92%, #ffe1eb), color-mix(in srgb, var(--af-surface) 90%, #e4dcff));
  box-shadow: var(--af-soft-shadow);
}

html[data-aurora-tools] main .aurora-theme-deck > h2 {
  margin: 0 0 16px;
  font: 800 clamp(1.35rem, 2.3vw, 2rem)/1.1 "Inter Tight", Inter, system-ui, sans-serif;
  letter-spacing: -.025em;
}

html[data-aurora-tools] main .aurora-theme-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

html[data-aurora-tools] main .aurora-theme-card {
  --tool-accent: #7757e8;
  --tool-accent-2: #ec5b8d;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--tool-accent) 30%, var(--af-line));
  border-radius: 18px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--af-surface) 88%, var(--tool-accent)), var(--af-surface));
  color: var(--af-text);
  text-align: start;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--tool-accent) 12%, transparent);
  cursor: pointer;
}

html[data-aurora-tools] main .aurora-theme-card[data-aurora-theme-filter="safety"] { --tool-accent:#ff3f64;--tool-accent-2:#ff0f78 }
html[data-aurora-tools] main .aurora-theme-card[data-aurora-theme-filter="security"] { --tool-accent:#4056c9;--tool-accent-2:#7687ee }
html[data-aurora-tools] main .aurora-theme-card[data-aurora-theme-filter="mental"] { --tool-accent:#a12ee7;--tool-accent-2:#ec4fa4 }
html[data-aurora-tools] main .aurora-theme-card[data-aurora-theme-filter="health"] { --tool-accent:#7650ec;--tool-accent-2:#ad55df }
html[data-aurora-tools] main .aurora-theme-card[data-aurora-theme-filter="environment"] { --tool-accent:#0aa885;--tool-accent-2:#35cfa0 }
html[data-aurora-tools] main .aurora-theme-card[data-aurora-theme-filter="energy"] { --tool-accent:#1476ed;--tool-accent-2:#45a4ff }
html[data-aurora-tools] main .aurora-theme-card[data-aurora-theme-filter="csr"] { --tool-accent:#f17816;--tool-accent-2:#ffaf35 }
html[data-aurora-tools] main .aurora-theme-card[data-aurora-theme-filter="quality"] { --tool-accent:#ce3c9d;--tool-accent-2:#7f52e8 }

html[data-aurora-tools] main .aurora-theme-card:hover,
html[data-aurora-tools] main .aurora-theme-card[aria-pressed="true"] {
  transform: translateY(-2px);
  border-color: var(--tool-accent);
  background: linear-gradient(135deg, var(--tool-accent), var(--tool-accent-2));
  color: #fff;
  box-shadow: 0 13px 26px color-mix(in srgb, var(--tool-accent) 24%, transparent);
}

html[data-aurora-tools] main .aurora-theme-icon,
html[data-aurora-tools] main .aurora-tool-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--tool-accent), var(--tool-accent-2));
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--tool-accent) 23%, transparent);
}

html[data-aurora-tools] main :where(.aurora-theme-icon, .aurora-tool-icon) svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-aurora-tools] main .aurora-theme-card[aria-pressed="true"] .aurora-theme-icon,
html[data-aurora-tools] main .aurora-theme-card:hover .aurora-theme-icon {
  background: rgba(255,255,255,.18);
  box-shadow: none;
}

html[data-aurora-tools] main .aurora-theme-copy { display: grid; gap: 3px; min-width: 0; }
html[data-aurora-tools] main .aurora-theme-copy strong { font-size: .94rem; line-height: 1.1; }
html[data-aurora-tools] main .aurora-theme-copy small { color: inherit; opacity: .78; font-size: .76rem; }

html[data-aurora-tools] main .aurora-rich-tool {
  --tool-accent: #ff3f64;
  --tool-accent-2: #ff0f78;
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-content: start;
  column-gap: 13px;
  row-gap: 7px;
  min-height: 168px;
  padding: 17px;
  border-color: color-mix(in srgb, var(--tool-accent) 25%, var(--af-line));
  background:
    linear-gradient(90deg, var(--tool-accent), var(--tool-accent-2)) 0 0 / 100% 5px no-repeat,
    linear-gradient(150deg, var(--af-surface), color-mix(in srgb, var(--af-surface) 91%, var(--tool-accent)));
}

html[data-aurora-tools] main .aurora-rich-tool[data-aurora-tool-domain="security"] { --tool-accent:#4056c9;--tool-accent-2:#7687ee }
html[data-aurora-tools] main .aurora-rich-tool[data-aurora-tool-domain="mental"] { --tool-accent:#a12ee7;--tool-accent-2:#ec4fa4 }
html[data-aurora-tools] main .aurora-rich-tool[data-aurora-tool-domain="health"] { --tool-accent:#7650ec;--tool-accent-2:#ad55df }
html[data-aurora-tools] main .aurora-rich-tool[data-aurora-tool-domain="environment"] { --tool-accent:#0aa885;--tool-accent-2:#35cfa0 }
html[data-aurora-tools] main .aurora-rich-tool[data-aurora-tool-domain="energy"] { --tool-accent:#1476ed;--tool-accent-2:#45a4ff }
html[data-aurora-tools] main .aurora-rich-tool[data-aurora-tool-domain="csr"] { --tool-accent:#f17816;--tool-accent-2:#ffaf35 }
html[data-aurora-tools] main .aurora-rich-tool[data-aurora-tool-domain="quality"] { --tool-accent:#ce3c9d;--tool-accent-2:#7f52e8 }

html[data-aurora-tools] main .aurora-rich-tool > .aurora-tool-icon { grid-column: 1; grid-row: 1 / span 2; margin-top: 2px; }
html[data-aurora-tools] main .aurora-rich-tool > :where(a, h3) { grid-column: 2; margin: 0; align-self: center; }
html[data-aurora-tools] main .aurora-rich-tool > h3 a,
html[data-aurora-tools] main .aurora-rich-tool > a {
  color: var(--af-text);
  font: 800 1rem/1.25 "Inter Tight", Inter, system-ui, sans-serif;
  text-decoration: none;
}
html[data-aurora-tools] main .aurora-rich-tool > h3 a::after,
html[data-aurora-tools] main .aurora-rich-tool > a::after { content:""; position:absolute; inset:0; border-radius:inherit; }
html[data-aurora-tools] main .aurora-rich-tool > :where(small, p) {
  grid-column: 2;
  margin: 0;
  color: var(--af-muted);
  font-size: .84rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
html[data-aurora-tools] main .aurora-tool-status {
  grid-column: 2;
  justify-self: start;
  align-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tool-accent) 12%, var(--af-surface));
  color: color-mix(in srgb, var(--tool-accent) 78%, var(--af-text));
  font-size: .72rem;
  font-weight: 800;
}

html[data-aurora-tools] main .aurora-rich-tool:hover .aurora-tool-icon { transform: rotate(-4deg) scale(1.04); }
html[dir="rtl"][data-aurora-tools] main .aurora-rich-tool { text-align: right; }

/* Tool workbenches and document generators */
html[data-aurora-tools="tool"] main,
html[data-aurora-tools="generator"] main,
html[data-aurora-tools="documents"] main {
  width: min(1240px, calc(100% - 40px));
  margin-inline: auto;
}

html[data-aurora-tools] main :where(form, fieldset, .panel, .card, .box, .section, .workspace, .result, .output, .preview, [class$="-card"], [class$="-panel"]) {
  border-color: var(--af-line);
}

html[data-aurora-tools] main :where(fieldset, .panel, .box, .workspace, .result, .output, .preview, [class$="-card"], [class$="-panel"]) {
  background: var(--af-surface);
  color: var(--af-text);
  border-radius: var(--af-radius);
  box-shadow: var(--af-soft-shadow);
}

html[data-aurora-tools] main fieldset { padding: clamp(16px, 3vw, 26px); }
html[data-aurora-tools] main legend { padding-inline: 8px; font-weight: 800; }

html[data-aurora-tools] main :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--af-line) 75%, var(--af-muted));
  border-radius: var(--af-radius-sm);
  background: var(--af-surface);
  color: var(--af-text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset;
}

html[data-aurora-tools] main textarea { min-height: 112px; resize: vertical; }
html[data-aurora-tools] main ::placeholder { color: color-mix(in srgb, var(--af-muted) 72%, transparent); }

html[data-aurora-tools] main :where(button, .btn, input[type="submit"], input[type="button"]) {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--af-accent), var(--af-accent-2));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 9px 22px color-mix(in srgb, var(--af-accent) 24%, transparent);
  cursor: pointer;
}

html[data-aurora-tools] main :where(button, .btn):hover { filter: saturate(1.08) brightness(1.03); transform: translateY(-1px); }
html[data-aurora-tools] main :where(button, input)[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

html[data-aurora-tools] main :where(.table-wrap, [class$="tablewrap"], [class$="table-wrap"], [class*="-tablew"], [class*="rowtable"]) {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius-sm);
  background: var(--af-surface);
}

html[data-aurora-tools] main table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--af-text);
  background: var(--af-surface);
}

html[data-aurora-tools] main :where(th, td) { padding: 11px 12px; border-color: var(--af-line); }
html[data-aurora-tools] main th { background: var(--af-domain-soft); font-weight: 800; }
html[data-aurora-tools] main tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--af-surface-2) 42%, transparent); }

/* Articles: readable measure, premium media and accessible disclosure blocks. */
html[data-aurora-tools="article"] main .post { overflow: hidden; }
html[data-aurora-tools="article"] main :where(.post-h, .prose) { width: min(860px, calc(100% - 40px)); margin-inline: auto; }
html[data-aurora-tools="article"] main .post-h { padding-block: clamp(32px, 6vw, 70px) 24px; }
html[data-aurora-tools="article"] main .prose { padding-bottom: 50px; font-size: clamp(1rem, 1.2vw, 1.12rem); line-height: 1.75; }
html[data-aurora-tools="article"] main .prose :where(h2, h3) { margin-top: 2em; line-height: 1.15; }
html[data-aurora-tools="article"] main :where(.hero-fig, .dia, .vid) { overflow: hidden; border-radius: var(--af-radius); background: var(--af-surface-2); }
html[data-aurora-tools="article"] main .hero-fig img { width: 100%; height: auto; display: block; }
html[data-aurora-tools="article"] main figcaption { padding: 10px 14px; font-size: .86rem; }
html[data-aurora-tools="article"] main details { border: 1px solid var(--af-line); border-radius: var(--af-radius-sm); background: var(--af-surface); padding: 14px 16px; }
html[data-aurora-tools="article"] main details + details { margin-top: 10px; }
html[data-aurora-tools="article"] main summary { cursor: pointer; font-weight: 800; }

html[dir="rtl"][data-aurora-tools] main :where(input, select, textarea, table) { text-align: start; }

@media (max-width: 920px) {
  html[data-aurora-tools] main .aurora-theme-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-aurora-tools] main .directory-tools,
  html[data-aurora-tools] main .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-aurora-tools] main :where(.page-head, .post-h) h1 { font-size: clamp(2.2rem, 8vw, 3.8rem); }
}

@media (max-width: 620px) {
  html[data-aurora-tools] main .aurora-theme-list { grid-template-columns: 1fr; }
  html[data-aurora-tools] main .aurora-theme-card { min-height: 64px; }
  html[data-aurora-tools] main .aurora-rich-tool { min-height: 150px; }
  html[data-aurora-tools="directory"] main,
  html[data-aurora-tools="insights-index"] main,
  html[data-aurora-tools="article"] main,
  html[data-aurora-tools="tool"] main,
  html[data-aurora-tools="generator"] main,
  html[data-aurora-tools="documents"] main { width: min(100% - 24px, 100%); }
  html[data-aurora-tools] main .directory-tools,
  html[data-aurora-tools] main .grid { grid-template-columns: 1fr; }
  html[data-aurora-tools] main :where(.page-head, .search-section, .search-note, .post, .related, .method, .faq, .sources) { border-radius: 22px; }
  html[data-aurora-tools] main :where(.page-head, .post-h) h1 { font-size: clamp(2rem, 11vw, 3rem); }
  html[data-aurora-tools] main :where(.post-h, .prose) { width: min(100% - 26px, 100%); }
  html[data-aurora-tools] main :where(button, .btn, input[type="submit"]) { max-width: 100%; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-aurora-tools] main *,
  html[data-aurora-tools] main *::before,
  html[data-aurora-tools] main *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  html[data-aurora-tools] body { background: #fff !important; color: #111 !important; }
  html[data-aurora-tools] main :where(.page-head, .search-section, .post, .panel, .card, fieldset) { box-shadow: none !important; background: #fff !important; color: #111 !important; }
}
