@scope (.department-walkthrough) {
  :scope {
    color-scheme: light;
    --ink: #243c31;
    --muted: #526c5c;
    --line: #d7e3da;
    --green: #236f51;
  }
  * {
    box-sizing: border-box;
  }
  :scope {
    margin: 0;
    font:
      14px/1.8 -apple-system,
      BlinkMacSystemFont,
      "Yu Gothic",
      sans-serif;
    color: var(--ink);
    background: #f4f7f3;
  }
  button,
  a {
    font: inherit;
    color: inherit;
  }
  a {
    color: #21684e;
    text-underline-offset: 4px;
  }
  button {
    cursor: pointer;
    border: 1px solid #bdcfc1;
    background: white;
    border-radius: 5px;
    padding: 8px 14px;
  }
  button:disabled {
    opacity: 0.4;
    cursor: default;
  }
  button:focus-visible,
  a:focus-visible {
    outline: 3px solid #247bcb;
    outline-offset: 3px;
  }
  .layout {
    display: block;
    max-width: 1600px;
    margin: auto;
  }
  .guide-navigation {
    padding: 16px;
    background: #f9fbf7;
    border: 1px solid var(--line);
    border-radius: 6px;
  }
  .guide-navigation h3 {
    margin: 0;
    font-size: 17px;
  }
  .guide-navigation p {
    font-size: 12px;
    color: var(--muted);
    margin: 5px 0 12px;
  }
  .toc {
    position: static;
    height: auto;
    padding: 0;
    border: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 160px;
    overflow: auto;
    gap: 4px;
  }
  .toc a {
    display: flex;
    gap: 9px;
    align-items: center;
    text-decoration: none;
    font-size: 12px;
    padding: 7px;
    border: 1px solid transparent;
    border-radius: 5px;
  }
  .toc-number {
    min-width: 24px;
    text-align: center;
    background: white;
    border: 1px solid var(--line);
    border-radius: 50%;
  }
  .toc a[aria-current="step"] {
    background: #e5f0e3;
    border-color: #c1d8be;
    font-weight: 600;
  }
  .guide-main {
    min-width: 0;
    padding: 20px 0;
  }
  .pagebar {
    display: flex;
    align-items: start;
    gap: 20px;
    margin-bottom: 16px;
  }
  .pagebar h3 {
    font-size: 23px;
    margin: 0;
  }
  .pagebar p {
    color: var(--muted);
    font-size: 13px;
    margin: 4px 0 0;
  }
  .pagebar button {
    margin-left: auto;
    white-space: nowrap;
  }
  .shortcuts {
    display: flex;
    gap: 20px;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 10px 14px;
    background: #edf5e8;
    margin-bottom: 18px;
    font-size: 12px;
  }
  .step {
    margin: 0 0 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: white;
    margin-bottom: 18px;
  }
  .step-head {
    display: flex;
    align-items: start;
    gap: 15px;
    padding: 20px 22px 14px;
    border-bottom: 1px solid #e5ece6;
  }
  .number {
    background: #e4f0dc;
    padding: 1px 12px;
    border-radius: 6px;
    font-size: 22px;
    color: #29663e;
  }
  .step h4 {
    scroll-margin-top: 16px;
    margin: 0;
    font-size: 20px;
  }
  .step-head p {
    margin: 4px 0 0;
  }
  .step-content {
    padding: 18px 22px;
  }
  .image-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    margin-bottom: 8px;
  }
  .image-tools button {
    margin-left: auto;
    font-size: 12px;
    padding: 4px 10px;
  }
  .image {
    position: relative;
    line-height: 0;
    border: 1px solid var(--line);
    border-radius: 5px;
    overflow: hidden;
  }
  .image img {
    display: block;
    width: 100%;
    height: auto;
  }
  .highlight {
    position: absolute;
    border: 3px solid #cf3434;
    background: #e6514814;
    border-radius: 4px;
    pointer-events: none;
  }
  .check {
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid #cce1c2;
    border-radius: 5px;
    background: #f4faef;
  }
  .check strong {
    margin-right: 14px;
  }
  .caution {
    margin: 12px 0 0;
    border-left: 3px solid #cfb16a;
    padding: 8px 12px;
    background: #fffaf0;
    color: #795f28;
    font-size: 13px;
  }
  .step-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 22px;
    border-top: 1px solid #e5ece6;
    background: #fbfdf9;
  }
  .step-footer span {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
  }
  .step-footer .next {
    color: white;
    background: var(--green);
    border-color: var(--green);
  }
  .note {
    color: var(--muted);
    font-size: 12px;
  }
  dialog {
    width: calc(100vw - 50px);
    max-width: 1500px;
    max-height: calc(100vh - 50px);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
  }
  dialog::backdrop {
    background: #163820b0;
  }
  .zoom-header {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
  }
  dialog h2 {
    margin: 0;
    font-size: 17px;
  }
  .zoom-header button {
    margin-left: auto;
  }
  .zoom-body {
    padding: 18px;
    overflow: auto;
    max-height: calc(100vh - 150px);
  }
  .zoom-body .image {
    width: max-content;
  }
  .zoom-body img {
    width: auto;
    max-width: none;
  }
}
