.an-editor {
  --ink: #faf6f5;
  --muted: #c0b3b8;
  --edge: #48383e;
  --accent: #ffa5af;
  width: min(880px, calc(100vw - 28px));
  max-width: 100%;
  max-height: min(90vh, 840px);
  max-height: min(90dvh, 840px);
  margin: auto;
  padding: 0;
  border: 1px solid #65414d;
  border-radius: 22px;
  color-scheme: dark;
  background: #191519;
  color: var(--ink);
  font: inherit;
  box-shadow: 0 28px 100px #080305aa;
  overflow: hidden;
}
.an-editor[open] { display: flex; flex-direction: column; }
.an-editor [hidden] { display: none; }
.an-editor::backdrop { background: #10090cdf; backdrop-filter: blur(6px); }
.an-editor :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.an-editor button, .an-editor select, .an-editor input { font: inherit; }
.an-editor button { cursor: pointer; }
.an-editor button:disabled, .an-editor input:disabled, .an-editor select:disabled { cursor: default; opacity: .57; }
.an-head { display: flex; align-items: center; gap: 14px; padding: 22px 25px; background: radial-gradient(ellipse at 85% 0%, #592738, transparent 68%), #22191e; }
.an-mark { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border: 1px solid #70424d; border-radius: 14px; background: #211015; }
.an-mark img { width: 32px; height: 32px; }
.an-guild, .an-eyebrow { font: 600 .71rem/1.5 'JetBrains Mono', monospace; letter-spacing: .07em; color: var(--accent); overflow-wrap: anywhere; }
.an-editor h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); letter-spacing: -.045em; line-height: 1.2; color: var(--ink); }
.an-close { margin-left: auto; align-self: flex-start; background: transparent; border: 1px solid var(--edge); color: var(--ink); border-radius: 50%; width: 36px; height: 36px; flex: none; font-size: 1.4rem !important; }
.an-nav { display: flex; overflow-x: auto; flex: none; padding: 0 22px; gap: 14px; background: #201a1e; border-bottom: 1px solid var(--edge); }
.an-nav button { min-height: 46px; padding: 0 6px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-size: .87rem; font-weight: 650; }
.an-nav button[aria-pressed=true] { color: var(--ink); border-bottom-color: var(--accent); }
.an-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 23px 25px; }
.an-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.an-editor h3 { font-size: 1.12rem; letter-spacing: -.025em; color: var(--ink); margin: 0 0 5px; }
.an-editor p, .an-editor details { font-size: .84rem; line-height: 1.55; color: var(--muted); }
.an-editor .an-secondary, .an-save { padding: 9px 14px; border: 1px solid #605159; border-radius: 9px; color: var(--ink); background: #2b2429; font-size: .83rem; font-weight: 650; }
.an-secondary:hover:enabled, .an-close:hover { background: #403039; }
.an-reset { flex: none; }
.an-presets { margin-bottom:20px; border:1px solid #754353; border-radius:14px; background:linear-gradient(130deg,#39212c,#211b20 75%); padding:clamp(12px,2vw,18px); }
.an-presets header,.an-level-actions { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; }
.an-presets .an-current { color:#e6c5cf; font-size:.76rem; }
.an-levels { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; margin:12px 0 8px; }
.an-levels button { min-height:40px; border-radius:8px; border:1px solid var(--edge); background:#221b20; color:var(--muted); font-weight:650; }
.an-levels button[aria-pressed=true] { background:#5a2b3b; color:#fff; border-color:var(--accent); }
.an-level-actions { justify-content:flex-start; margin-top:12px; }
.an-comparison { width:100%; margin-top:8px; font-size:.8rem; border-collapse:collapse; }
.an-comparison th,.an-comparison td { padding:5px 3px; text-align:right; border-bottom:1px solid var(--edge); }
.an-comparison :is(th,td):first-child { text-align:left; }.an-different,.an-command { color:var(--accent); }
.an-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(195px, 1fr); gap: 16px; align-items: start; }
.an-rules { overflow: hidden; border: 1px solid var(--edge); border-radius: 13px; }
.an-row { display: grid; grid-template-columns: minmax(0,1fr) repeat(2, minmax(54px, 70px)); align-items: center; gap: 10px; padding: 9px 13px; background: #211d20; border-left: 3px solid transparent; }
.an-row + .an-row { border-top: 1px solid #3d3238; }
.an-row.an-selected { background: #33242b; border-left-color: var(--accent); }
.an-row b, .an-switch b { font-size: .88rem; font-weight: 650; }
.an-editor label { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; }
.an-row label { font: 500 .66rem/1.35 'JetBrains Mono', monospace; color: var(--muted); }
.an-editor input[type=number], .an-editor select { width: 100%; min-width: 0; border: 1px solid #605159; border-radius: 7px; background: #19161a; color: var(--ink); padding: 7px; }
.an-editor input[type=number] { font: 600 .94rem 'JetBrains Mono', monospace; }
.an-editor input:invalid { border-color: #ff7489; }
.an-editor select { min-height: 42px; font-size: .87rem; }
.an-preview { padding: 17px; border: 1px solid #754353; border-radius: 14px; background: linear-gradient(150deg,#3b232d,#261d23 70%); }
.an-eyebrow { text-transform: uppercase; margin-bottom: 15px; }
.an-preview label { margin-bottom: 5px; }
.an-reading { display: flex; align-items: baseline; gap: 8px; margin-top: 20px; }
.an-reading strong { font: 600 2.75rem/1.1 'JetBrains Mono', monospace; color: #fff1f0; }
.an-reading span { color: var(--muted); font-size: .85rem; }
.an-meter { height: 6px; border-radius: 9px; background: #583c47; overflow: hidden; margin: 12px 0 8px; }
.an-meter i { display: block; height: 100%; background: var(--accent); transition: width .18s ease; }
.an-preview .an-simulate { margin-top: 12px; width: 100%; }
.an-preview small, .an-switch small { display: block; margin-top: 6px; font-size: .77rem; line-height: 1.5; font-weight: 400; color: var(--muted); }
.an-hint, .an-editor details, .an-em-note, .an-delivery { margin-top: 12px; }
.an-editor summary { cursor: pointer; color: var(--ink); }
.an-editor details p { margin-top: 6px; }
.an-editor .an-switch { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 14px 0; border: 1px solid var(--edge); border-radius: 12px; padding: 15px; background: #231e22; }
.an-switch input { width: 22px; height: 22px; accent-color: #ed5673; flex: none; }
.an-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.an-editor footer { display: flex; align-items: center; gap: 10px; flex: none; margin: 0; padding: 13px 25px; text-align: left; background: #231d21; border-top: 1px solid var(--edge); }
.an-status { margin-right: auto; color: var(--muted); font-size: .79rem; overflow-wrap: anywhere; }
.an-save { background: #ffa5af; color: #34121e; border-color: transparent; white-space: nowrap; }
.an-save:hover:enabled { background: #ffc0c5; }
@media (max-width: 620px) {
  .an-editor { width: calc(100vw - 12px); max-height: 96dvh; border-radius: 16px; }
  .an-head { padding: 15px; }
  .an-nav { padding: 0 12px; gap: 8px; }
  .an-scroll { padding: 16px 12px; }
  .an-layout, .an-fields { grid-template-columns: minmax(0,1fr); }
  .an-editor footer { padding: 12px; }
  .an-row { padding: 9px; gap: 8px; grid-template-columns: minmax(0,1fr) repeat(2, minmax(52px, 18%)); }
  .an-editor input[type=number], .an-editor select { font-size: 16px; min-height: 40px; }
  .an-editor .an-secondary, .an-editor .an-save { padding: 9px 11px; min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) { .an-meter i { transition: none; } }
.an-health-data { overflow-wrap: anywhere; }
.an-timings { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin: 16px 0; }
.an-timings > div { padding: 14px; border: 1px solid var(--edge); background: #291e25; border-radius: 12px; }
.an-timings dt { color: var(--ink); font-size: .85rem; }
.an-timings dd { margin: 6px 0; font: 600 1.45rem 'JetBrains Mono', monospace; color: var(--accent); }
.an-timings small { color: var(--muted); }
@media (max-width: 580px) { .an-timings { grid-template-columns: 1fr; } }
