.ae-entity {
  --ae-ink: #1a0e0a;
  --ae-copy: #3e2f28;
  --ae-muted: #7a6a5f;
  --ae-line: #eadfcd;
  --ae-cream: #f7efe2;
  --ae-cream-deep: #eee2cc;
  --ae-paper: #fffdf9;
  --ae-brand: #d8392b;
  --ae-brand-dark: #b92b20;
  --ae-good: #1f7a59;
  --ae-warn: #b56a16;
  --ae-bad: #c84438;
  width: 100%;
  max-width: 1120px;
  margin: 32px auto 56px;
  color: var(--ae-ink);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  line-height: 1.55;
}
.ae-entity *, .ae-entity *::before, .ae-entity *::after { box-sizing: border-box; }
.ae-entity p { margin-top: 0; }
.ae-entity h2, .ae-entity h3 { color: var(--ae-ink); font-family: Fraunces, Georgia, serif; }
.ae-entity h2 { max-width: 700px; margin: 0 0 14px; font-size: clamp(34px, 5vw, 56px); font-weight: 600; line-height: 1.05; letter-spacing: -.025em; }
.ae-entity h3 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.25; }

.ae-entity__hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, .75fr);
  gap: clamp(28px, 6vw, 70px);
  align-items: center;
  margin-bottom: 28px;
  padding: clamp(24px, 5vw, 48px);
  overflow: hidden;
  border: 1px solid var(--ae-line);
  border-radius: 28px;
  background: radial-gradient(circle at 90% 8%, rgba(216,57,43,.14), transparent 28%), linear-gradient(135deg, #fffdf9 0%, var(--ae-cream) 100%);
}
.ae-entity__hero::after { content: ""; position: absolute; right: -45px; bottom: -65px; width: 210px; height: 210px; border: 1px solid rgba(216,57,43,.15); border-radius: 50%; box-shadow: 0 0 0 30px rgba(216,57,43,.04), 0 0 0 62px rgba(216,57,43,.022); }
.ae-entity__intro { position: relative; z-index: 1; }
.ae-entity__eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--ae-brand); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.ae-entity__eyebrow > span { width: 24px; height: 2px; border-radius: 999px; background: var(--ae-brand); }
.ae-entity__intro > p:not(.ae-entity__eyebrow) { max-width: 670px; margin-bottom: 18px; color: var(--ae-copy); font-size: 17px; }
.ae-entity__trust { display: flex; flex-wrap: wrap; gap: 8px; }
.ae-entity__trust span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid rgba(26,14,10,.1); border-radius: 999px; background: rgba(255,255,255,.65); color: var(--ae-copy); font-size: 12px; font-weight: 650; }
.ae-entity__trust span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ae-brand); }

.ae-entity__visual { position: relative; z-index: 1; min-height: 235px; border: 1px solid rgba(216,57,43,.17); border-radius: 24px; background: rgba(255,255,255,.72); box-shadow: 0 18px 42px rgba(70,40,28,.08); transform: rotate(1.5deg); }
.ae-entity__visual::before { content: "ENTITY GRAPH"; position: absolute; top: 16px; left: 18px; color: var(--ae-muted); font: 700 10px/1 "JetBrains Mono", monospace; letter-spacing: .12em; }
.ae-entity__node { position: absolute; z-index: 2; display: grid; place-content: center; min-width: 84px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--ae-line); border-radius: 12px; background: var(--ae-paper); color: var(--ae-copy); font: 700 11px/1.25 "JetBrains Mono", monospace; box-shadow: 0 8px 20px rgba(70,40,28,.08); animation: ae-float 3.4s ease-in-out infinite; }
.ae-entity__node--main { left: 50%; top: 50%; min-width: 138px; min-height: 70px; transform: translate(-50%,-42%); border-color: rgba(216,57,43,.3); background: var(--ae-ink); color: var(--ae-cream); text-align: center; animation-name: ae-float-main; }
.ae-entity__node--main strong { font-size: 12px; }
.ae-entity__node--main small { margin-top: 5px; color: #cdbfaf; font: 500 9px/1 Inter, sans-serif; }
.ae-entity__node--site { top: 48px; right: 18px; animation-delay: -.8s; }
.ae-entity__node--service { bottom: 25px; left: 18px; animation-delay: -1.7s; }
.ae-entity__line { position: absolute; z-index: 1; height: 1px; background: rgba(216,57,43,.34); transform-origin: left center; }
.ae-entity__line::after { content: ""; position: absolute; right: -2px; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--ae-brand); }
.ae-entity__line--site { width: 82px; left: 54%; top: 43%; transform: rotate(-35deg); }
.ae-entity__line--service { width: 82px; left: 28%; top: 64%; transform: rotate(-20deg); }

.ae-entity__form, .ae-output { overflow: hidden; border: 1px solid var(--ae-line); border-radius: 24px; background: var(--ae-paper); box-shadow: 0 18px 50px rgba(70,40,28,.07); transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease; }
.ae-entity__form:hover { border-color: #dfcfb6; box-shadow: 0 24px 64px rgba(70,40,28,.1); }
.ae-section { padding: clamp(23px,4vw,38px); border-bottom: 1px solid var(--ae-line); }
.ae-section__heading { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 22px; }
.ae-section__heading > span { display: grid; flex: 0 0 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--ae-ink); color: var(--ae-cream); font: 700 10px/1 "JetBrains Mono", monospace; }
.ae-section__heading h3 { font-size: 21px; }
.ae-section__heading p { margin: 3px 0 0; color: var(--ae-muted); font-size: 13px; }
.ae-grid { display: grid; gap: 19px; padding-left: 47px; }
.ae-grid--2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.ae-field { display: block; }
.ae-field--wide { grid-column: 1 / -1; }
.ae-field > span { display: block; margin-bottom: 7px; color: var(--ae-copy); font-weight: 700; }
.ae-field b { color: var(--ae-brand); }
.ae-field small { display: block; margin-top: 7px; color: var(--ae-muted); font-size: 12px; }
.ae-entity input, .ae-entity select, .ae-entity textarea { width: 100%; border: 1px solid #d8cab4; border-radius: 13px; background: #fff; color: var(--ae-ink); font: inherit; outline: 0; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.ae-entity input, .ae-entity select { min-height: 52px; padding: 10px 14px; }
.ae-entity textarea { padding: 14px; resize: vertical; }
.ae-entity input:hover, .ae-entity select:hover, .ae-entity textarea:hover { border-color: #c7b69d; }
.ae-entity input:focus, .ae-entity select:focus, .ae-entity textarea:focus { border-color: var(--ae-brand); box-shadow: 0 0 0 4px rgba(216,57,43,.1); }
.ae-entity input::placeholder, .ae-entity textarea::placeholder { color: #aa9c91; }

.ae-hours { display: grid; gap: 9px; max-width: 650px; padding-left: 47px; }
.ae-hours__row { display: grid; grid-template-columns: 74px 1fr 24px 1fr; align-items: center; gap: 9px; padding: 7px 9px; border: 1px solid transparent; border-radius: 12px; transition: background .18s ease, border-color .18s ease; }
.ae-hours__row:hover { border-color: var(--ae-line); background: var(--ae-cream); }
.ae-hours__row > span { color: var(--ae-muted); font-size: 13px; text-align: center; }
.ae-hours__day { display: flex; align-items: center; gap: 8px; font-weight: 750; }
.ae-hours__day input { width: 18px; min-height: 18px; height: 18px; padding: 0; accent-color: var(--ae-brand); }
.ae-hours__row input[type="time"] { min-height: 42px; }
.ae-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 26px clamp(23px,4vw,38px) 28px 85px; background: linear-gradient(90deg, rgba(247,239,226,.7), rgba(255,253,249,.4)); }
.ae-button { min-height: 48px; padding: 10px 20px; border: 1px solid transparent; border-radius: 999px; font: inherit; font-weight: 750; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.ae-button:hover { transform: translateY(-2px); }
.ae-button:active { transform: translateY(0); }
.ae-button:focus-visible { outline: 3px solid rgba(216,57,43,.22); outline-offset: 3px; }
.ae-button--primary { display: inline-flex; align-items: center; gap: 13px; background: var(--ae-brand); color: #fff; box-shadow: 0 9px 22px rgba(216,57,43,.22); }
.ae-button--primary i { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: rgba(255,255,255,.18); font-style: normal; transition: transform .18s ease; }
.ae-button--primary:hover { background: var(--ae-brand-dark); box-shadow: 0 12px 28px rgba(216,57,43,.28); }
.ae-button--primary:hover i { transform: translateX(3px); }
.ae-button--secondary { border-color: var(--ae-line); background: var(--ae-cream); color: var(--ae-ink); }
.ae-button--secondary:hover { border-color: #d6c4a9; background: var(--ae-cream-deep); }
.ae-error { margin: 20px 38px 0 85px; padding: 12px 14px; border-left: 4px solid var(--ae-bad); border-radius: 8px; background: #fff1ee; color: #8f2922; }

.ae-output { position: relative; margin-top: 24px; padding: clamp(23px,4vw,38px); }
.ae-output.is-visible { animation: ae-rise .48s cubic-bezier(.22,1,.36,1) both; }
.ae-output__heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--ae-line); }
.ae-output__heading h3 { font-size: 28px; }
.ae-output__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ae-status { margin: 20px 0 12px; }
.ae-status__item { position: relative; margin: 0 0 8px; padding: 11px 13px 11px 38px; border-radius: 10px; font-size: 13px; }
.ae-status__item::before { position: absolute; left: 13px; top: 10px; display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; }
.ae-status__item--good { background: #edf8f3; color: #116447; }
.ae-status__item--good::before { content: "✓"; background: var(--ae-good); }
.ae-status__item--warn { background: #fff5e5; color: #805000; }
.ae-status__item--warn::before { content: "!"; background: var(--ae-warn); }
.ae-output__metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 18px 0; }
.ae-output__metrics > div { min-height: 88px; padding: 16px; border: 1px solid var(--ae-line); border-radius: 14px; background: linear-gradient(145deg,#fff 0%,var(--ae-cream) 100%); }
.ae-output__metrics strong { display: block; color: var(--ae-ink); font-family: Fraunces, Georgia, serif; font-size: 24px; line-height: 1.1; }
.ae-output__metrics span { color: var(--ae-muted); font-size: 12px; }
.ae-code { max-height: 540px; margin: 0; padding: 22px; overflow: auto; border: 1px solid rgba(247,239,226,.12); border-radius: 16px; background: var(--ae-ink); color: #f3dfc2; box-shadow: 0 16px 34px rgba(26,14,10,.15); font: 13px/1.65 "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.ae-warning { margin-top: 18px; padding: 17px 18px; border: 1px solid #ead3ad; border-left: 4px solid var(--ae-warn); border-radius: 10px; background: #fff7e9; }
.ae-warning strong { font-family: Fraunces, Georgia, serif; font-size: 18px; }
.ae-warning p { margin: 4px 0 0; color: #674614; font-size: 13px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes ae-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ae-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes ae-float-main { 0%,100% { transform: translate(-50%,-42%); } 50% { transform: translate(-50%,calc(-42% - 5px)); } }

@media (max-width: 840px) {
  .ae-entity__hero { grid-template-columns: 1fr; }
  .ae-entity__visual { display: none; }
}
@media (max-width: 700px) {
  .ae-grid--2 { grid-template-columns: 1fr; }
  .ae-field--wide { grid-column: auto; }
  .ae-output__heading { align-items: flex-start; flex-direction: column; }
  .ae-output__actions, .ae-output__actions .ae-button { width: 100%; }
  .ae-output__metrics { grid-template-columns: 1fr 1fr; }
  .ae-output__metrics > div:last-child { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .ae-entity { margin-top: 18px; }
  .ae-entity__hero, .ae-entity__form, .ae-output { border-radius: 18px; }
  .ae-grid, .ae-hours { padding-left: 0; }
  .ae-actions { padding-left: clamp(23px,4vw,38px); }
  .ae-actions .ae-button { justify-content: center; width: 100%; }
  .ae-error { margin-right: 23px; margin-left: 23px; }
  .ae-hours__row { grid-template-columns: 58px 1fr 15px 1fr; gap: 5px; padding: 4px 0; }
  .ae-hours__row input[type="time"] { padding: 6px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .ae-button, .ae-entity input, .ae-entity select, .ae-entity textarea, .ae-entity__form, .ae-hours__row { transition: none; }
  .ae-entity__node, .ae-output.is-visible { animation: none; }
}
