body:has(#guide:not([hidden])) {
  background: radial-gradient(ellipse at 51% 0%, #fbfaf3, transparent 56%), #f3f3eb;
}
@scope (#guide) {
  :scope {
    --ink: #19332a;
    --muted: #53645a;
    --white: #fffefa;
    --strong: #204c39;
    --serif: "Songti SC", "Noto Serif CJK SC", "STSong", serif;
    --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
    padding-top: 27px;
    color: var(--ink);
    font: 14px/1.58 var(--sans);
  }
  button, select, textarea { font: inherit; }
  :is(button, input, select, textarea, summary):focus-visible { outline: 3px solid #378560; outline-offset: 3px; }
  button:disabled { cursor: wait; }

  .top, .shell { max-width: 1176px; margin-inline: auto; }
  .top {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 217px;
    margin-bottom: 16px;
    padding: 31px 39px;
    border: 1px solid #294e3d;
    border-radius: 23px;
    background: linear-gradient(107deg, #14382d, #1a4134 54%, #355947);
    box-shadow: 0 10px 26px #1c382229;
  }
  .top::after {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid #e5eed320;
    border-radius: 17px;
    pointer-events: none;
  }
  .mast { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 20px; width: 75%; }
  .mast-mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    margin-top: 4px;
    border-radius: 11px;
    background: #e1e9d3;
    color: #244c38;
  }
  .mast-mark svg { width: 34px; stroke: currentColor; stroke-width: 1.45; }
  .mark-dot { fill: #9c713f; stroke: none; }
  .mast-heading { display: grid; gap: 7px; }
  .brand { color: #fffdf1; font: 700 31px/1.2 var(--serif); letter-spacing: .035em; }
  .mast-kicker { color: #f5d59b; font: 700 23px/1.4 var(--serif); letter-spacing: .06em; }
  .worldplate {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: min(43%, 480px);
    opacity: .9;
    pointer-events: none;
    mask-image: linear-gradient(90deg, transparent, #000 32%);
  }
  .header-clock { position: absolute; right: 22px; bottom: 14px; color: #e1ebdc; }

  .shell {
    display: grid;
    grid-template-columns: minmax(270px, .76fr) minmax(0, 1.54fr);
    margin-bottom: 28px;
    border: 1px solid #d5ded1;
    border-radius: 22px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 14px 44px #284a3112;
  }
  .side {
    display: flex;
    flex-direction: column;
    container-type: inline-size;
    gap: 22px;
    padding: 30px 30px 24px;
    border-right: 1px solid #d6e1d2;
    background: linear-gradient(152deg, #edf4e8 3%, #e3eee1 70%, #eaf2e7);
  }
  .steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
  .steps li { position: relative; display: flex; align-items: center; gap: 11px; color: #3d5b48; font-size: 13px; }
  .steps li:first-child::after { content: ""; position: absolute; top: 100%; left: 14px; width: 1px; height: 12px; background: #a6bda8; }
  .steps li[aria-current] { color: #214b36; font-weight: 750; }
  .dot {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid #afc4af;
    border-radius: 50%;
    background: #f5f8ef;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
  }
  .steps li[aria-current] .dot { border-color: #234e39; background: #234e39; color: #f8faef; }
  .live { margin-top: auto; padding: 14px; border: 1px solid #cbdac8; border-radius: 10px; background: #f7faf4cc; }
  .live h3 { margin: 0 0 8px; font: 700 15px/1.5 var(--serif); }
  .live dl { display: grid; gap: 4px; margin: 0; }
  .live dl div { display: grid; grid-template-columns: 37px minmax(0, 1fr); gap: 8px; padding: 4px 0; font-size: 13px; }
  .live dt { color: #405f49; }
  .live dd { margin: 0; color: #213e2e; overflow-wrap: anywhere; white-space: pre-wrap; }

  .main { min-width: 0; padding: 29px 37px 25px; }
  .stepmeta { display: flex; align-items: center; gap: 8px; color: #3c644f; font-size: 11px; font-weight: 800; letter-spacing: .11em; }
  .stepmeta::before { content: ""; width: 14px; height: 2px; background: #a68c59; }
  .pane h1 { margin: 8px 0 0; font: 700 clamp(24px, 2.5vw, 35px)/1.33 var(--serif); }
  #work-title { max-width: 19em; text-wrap: pretty; }
  .choice-card { margin-top: 18px; padding: 15px 16px; border: 1px solid #dce4d8; border-radius: 12px; background: #fafbf6; }
  .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 15px; }
  .form-field { display: flex; flex-direction: column; }
  .form-field label, .section-title { display: block; margin-bottom: 6px; color: #244638; font-weight: 770; }
  .form-field small, .section-title small { margin-left: 7px; color: #52685a; font-weight: 400; }
  .choice-card :is(select, input), textarea {
    width: 100%;
    min-height: 41px;
    padding: 8px 10px;
    border: 1px solid #c4d1c5;
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font: inherit;
  }
  .form-field select { margin-top: auto; }
  .manual-entry, .domain-label { margin-top: 9px; }
  .manual-entry label, .domain-label { color: var(--muted); font-size: 13px; font-weight: 650; }
  .domain-label { display: block; margin-bottom: 5px; }
  .domain-entry { display: flex; gap: 7px; }
  .domain-entry button { flex: none; }
  .group { margin-top: 12px; }
  .chips { display: flex; flex-wrap: wrap; gap: 7px; }
  .quick { gap: 5px; margin-bottom: 7px; }
  .quick .chip { min-height: 32px; padding-inline: 7px; font-size: 12px; }
  .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 35px;
    padding: 5px 11px;
    border: 1px solid #c9d5c8;
    border-radius: 7px;
    background: var(--white);
    color: #274735;
    line-height: 1.3;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .chip:hover { border-color: #739681; background: #f0f6ee; }
  .chip[aria-pressed="true"] { border-color: #6e957b; background: #e8f2e4; color: #1b5038; font-weight: 760; }
  .chip[aria-pressed="true"]::before { content: "✓"; }
  #more-domains { margin-top: 8px; }
  #more-domains summary { width: fit-content; color: #345b45; font-size: 13px; font-weight: 650; }
  #related-domains { margin-top: 8px; }
  #related-domains:empty, #domains-error:empty { display: none; }
  .topic-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .topic-grid .chip { justify-content: center; min-height: 40px; padding-inline: 6px; text-align: center; }

  .writing { margin-top: 13px; padding: 13px 15px; border: 1px solid #dbe6d8; border-radius: 12px; background: #f1f5ed; }
  .writing label { display: block; margin-bottom: 6px; font-weight: 770; }
  textarea { display: block; min-height: 60px; line-height: 1.5; resize: vertical; }
  textarea::placeholder { color: #54655a; opacity: 1; }
  .hint, .privacy { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
  .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid #e1e8dd; }
  .primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    margin-left: auto;
    padding: 9px 17px;
    border: 1px solid var(--strong);
    border-radius: 9px;
    background: var(--strong);
    color: #fff;
    box-shadow: 0 3px 7px #244b3726;
    font-weight: 760;
  }
  .primary:hover { background: #2a5c44; }
  .linkbtn { min-height: 40px; padding: 5px 7px; border: 0; border-radius: 6px; background: transparent; color: #245e43; font-weight: 730; }
  .linkbtn:hover { background: #e4efe3; }
  .privacy { margin-top: 9px; }
  .data-settings { margin-top: 8px; color: #345b45; font-size: 13px; }
  .data-settings > summary { width: fit-content; padding-block: 8px; }
  .guide-footer { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; }
  .mobile-review { display: none; }

  @media (max-width: 1240px) { .top, .shell { margin-inline: 24px; } }
  @media (max-width: 920px) {
    .mast { width: 81%; }
    .worldplate { width: 37%; opacity: .72; }
    .main { padding: 25px 27px; }
  }
  @media (max-width: 860px) {
    .top { padding-inline: 29px; }
    .mast { width: 100%; }
    .shell { grid-template-columns: minmax(205px, .72fr) minmax(0, 1.58fr); }
    .side { padding: 25px 21px 22px; }
  }
  @media (max-width: 690px) {
    :scope { padding-top: 12px; }
    .top, .shell { margin-inline: 12px; }
    .top { min-height: 0; margin-bottom: 10px; padding: 19px 16px 21px; border-radius: 17px; }
    .top::after { inset: 5px; border-radius: 12px; }
    .mast { display: block; }
    .mast-mark { width: 29px; height: 29px; margin: 0 0 10px; border-radius: 7px; }
    .mast-mark svg { width: 22px; }
    .brand { font-size: clamp(21px, 6.2vw, 31px); letter-spacing: .005em; }
    .mast-kicker { font-size: 19px; }
    .worldplate { top: 36%; right: -27px; width: 48%; opacity: .25; }
    .header-clock { top: 18px; right: 16px; bottom: auto; }
    .shell { display: block; border-radius: 16px; }
    .side { gap: 7px; padding: 10px 13px 11px; border-right: 0; border-bottom: 1px solid #d6e1d2; }
    .live, .steps li:first-child::after { display: none; }
    .steps { display: flex; flex-wrap: wrap; gap: 6px 15px; }
    .steps li { gap: 6px; font-size: 12px; }
    .dot { width: 24px; height: 24px; font-size: 10px; }
    .main { padding: 18px 14px 17px; }
    .choice-card, .writing { padding: 11px; }
    .choice-card :is(select, input), textarea { font-size: 16px; }
    .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .chip, .quick .chip, .topic-grid .chip, .linkbtn { min-height: 43px; }
    .mobile-review { display: block; margin-top: 15px; padding: 8px 10px; border: 1px solid #dce6d8; border-radius: 8px; color: #345b45; }
    .mobile-review summary { font-weight: 750; }
    .mobile-review p { margin: 5px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
  }
  @media (max-width: 400px) { .fields { grid-template-columns: 1fr; } }
  @media (max-width: 380px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
}
