:root {
  color-scheme: dark;
  --bg: #0b0e10;
  --surface: #14191c;
  --surface-2: #1a2024;
  --line: #30383d;
  --line-soft: #242b2f;
  --text: #f4f6f7;
  --muted: #a5afb5;
  --accent: #59d6ad;
  --accent-deep: #123a30;
  --accent-text: #062018;
  --warm: #f4bf62;
  --danger: #ff8c8c;
  --shadow: 0 18px 44px rgba(0, 0, 0, .28);
}

body.image-site {
  --accent: #74c7ff;
  --accent-deep: #123148;
  --accent-text: #061b29;
  --warm: #ffc96d;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: Inter, "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif; line-height: 1.68; letter-spacing: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button, label { touch-action: manipulation; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line-soft); background: rgba(11, 14, 16, .96); backdrop-filter: blur(12px); }
.header-inner, .page-shell, .footer-inner { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { min-width: 0; display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 55%, #263137); border-radius: 7px; background: var(--accent-deep); color: var(--accent); font-size: .74rem; font-weight: 900; }
.brand-copy { min-width: 0; display: grid; line-height: 1.18; }
.brand-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy small { color: var(--muted); font-size: .7rem; }
.site-nav { display: flex; align-items: center; gap: 18px; font-size: .84rem; }
.site-nav a { color: #c8cfd3; text-underline-offset: 5px; text-decoration-color: #4b555b; }
.site-nav a:hover { color: var(--accent); }

.page-shell { padding: 36px 0 80px; }
.page-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: end; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: .73rem; font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
.page-intro h1 { margin-bottom: 8px; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.18; }
.page-intro p:last-child { max-width: 720px; margin-bottom: 0; color: var(--muted); }
.privacy-signal { min-width: 174px; display: flex; align-items: center; gap: 12px; padding: 11px 0 11px 16px; border-left: 3px solid var(--accent); }
.privacy-signal svg { width: 25px; color: var(--accent); }
.privacy-signal span { display: grid; }
.privacy-signal small { color: var(--muted); }

.tool-layout { display: grid; grid-template-columns: minmax(0, 760px) minmax(240px, 1fr); gap: 44px; align-items: start; padding: 34px 0 50px; }
.tool-frame { padding: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.mode-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-bottom: 22px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: #0e1214; }
.mode-tab { min-height: 48px; display: inline-grid; place-items: center; gap: 2px; padding: 6px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: .75rem; font-weight: 800; cursor: pointer; }
.mode-tab svg { width: 19px; height: 19px; }
.mode-tab:hover { background: var(--surface-2); color: var(--text); }
.mode-tab.is-active { background: var(--accent-deep); color: var(--accent); }
.step-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 16px; }
.step-number { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 6px; background: var(--accent-deep); color: var(--accent); font-weight: 850; }
.step-heading h2 { margin-bottom: 2px; font-size: 1.1rem; }
.step-heading p { margin: 0; color: var(--muted); font-size: .84rem; }
.drop-zone { min-height: 166px; display: grid; place-items: center; align-content: center; gap: 5px; padding: 22px; border: 1px dashed #536068; border-radius: 7px; background: #0f1315; text-align: center; cursor: pointer; }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent-deep) 45%, #0f1315); outline: 0; }
.drop-zone svg { width: 32px; height: 32px; margin-bottom: 5px; color: var(--accent); }
.drop-zone span, .drop-zone small { color: var(--muted); }
.drop-zone small { font-size: .75rem; }
.file-list { display: grid; gap: 7px; margin-top: 12px; }
.file-row { min-height: 58px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; gap: 10px; align-items: center; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 6px; background: #101416; }
.file-row > svg { width: 20px; color: var(--accent); }
.file-row span { min-width: 0; display: grid; }
.file-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.file-row small { color: var(--muted); font-size: .7rem; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.icon-button svg { width: 18px; }

.options-panel { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field { display: grid; gap: 5px; color: var(--muted); font-size: .75rem; font-weight: 750; }
.field.wide { grid-column: 1 / -1; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: #0d1113; color: var(--text); }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.check-row { display: grid; grid-template-columns: 21px minmax(0, 1fr); gap: 9px; align-items: start; color: #d4dade; font-size: .82rem; font-weight: 700; cursor: pointer; }
.check-row input { width: 19px; height: 19px; margin: 2px 0 0; accent-color: var(--accent); }
.option-note { margin: 11px 0 0; color: var(--muted); font-size: .75rem; }
.action-row { display: flex; gap: 10px; margin-top: 20px; }
.primary-button, .secondary-button, .download-link { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 20px; border-radius: 7px; font-weight: 850; text-decoration: none; cursor: pointer; }
.primary-button { flex: 1; border: 1px solid color-mix(in srgb, var(--accent) 75%, white); background: var(--accent); color: var(--accent-text); }
.primary-button:disabled { border-color: var(--line); background: #293035; color: #747e84; cursor: not-allowed; }
.secondary-button { border: 1px solid var(--line); background: transparent; color: var(--text); }
.primary-button svg, .secondary-button svg, .download-link svg { width: 19px; }
.progress-panel, .result-panel, .error-panel { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.progress-copy { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.progress-copy span { color: var(--accent); font-weight: 850; }
.progress-track { height: 8px; margin-top: 10px; overflow: hidden; border-radius: 4px; background: #283035; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .18s ease; }
.progress-panel p { margin: 8px 0 0; color: var(--muted); font-size: .76rem; }
.result-panel > strong { display: block; margin-bottom: 10px; }
.result-list { display: grid; gap: 8px; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.result-row:last-child { border-bottom: 0; }
.result-row span { min-width: 0; display: grid; }
.result-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.result-row small { color: var(--muted); font-size: .7rem; }
.download-link { min-height: 40px; padding: 0 13px; background: var(--warm); color: #211703; font-size: .78rem; }
.error-panel { color: var(--danger); }
.error-panel p { margin: 3px 0 0; color: #d9a9a9; font-size: .8rem; }

.tool-aside { display: grid; }
.aside-row { display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.aside-row:first-child { padding-top: 4px; }
.aside-row svg { width: 23px; color: var(--accent); }
.aside-row h2 { margin-bottom: 4px; font-size: .95rem; }
.aside-row p { margin: 0; color: var(--muted); font-size: .81rem; }

.directory, .network, .content-band { padding: 36px 0; border-top: 1px solid var(--line); }
.section-head h2 { margin-bottom: 6px; font-size: 1.35rem; }
.section-head p:last-child { max-width: 760px; margin-bottom: 0; color: var(--muted); }
.directory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.directory-grid a { min-height: 72px; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 11px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); text-decoration: none; }
.directory-grid a:hover { border-color: var(--accent); }
.directory-grid svg { width: 21px; color: var(--accent); }
.directory-grid span { min-width: 0; display: grid; }
.directory-grid small { color: var(--muted); font-size: .7rem; }
.content-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 22px; }
.content-columns article { padding-top: 14px; border-top: 2px solid var(--line); }
.content-columns h3 { margin-bottom: 7px; font-size: .98rem; }
.content-columns p { margin-bottom: 0; color: var(--muted); font-size: .84rem; }
.faq-list { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 34px; margin-top: 22px; }
.faq-list h3 { margin-bottom: 5px; font-size: .94rem; }
.faq-list p { margin-bottom: 0; color: var(--muted); font-size: .82rem; }
.network { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .9fr); gap: 36px; align-items: center; }
.network-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.network-actions a { min-height: 66px; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); text-decoration: none; }
.network-actions a:hover { border-color: var(--accent); }
.network-actions svg { width: 20px; color: var(--warm); }
.network-actions span { display: grid; }
.network-actions small { color: var(--muted); font-size: .68rem; }

.guide-shell, .legal-shell { width: min(900px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 80px; }
.guide-hero, .legal-hero { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.guide-hero h1, .legal-hero h1 { margin-bottom: 10px; font-size: clamp(1.85rem, 5vw, 2.7rem); line-height: 1.22; }
.guide-hero > p:last-of-type, .legal-hero > p:last-of-type { color: var(--muted); }
.guide-action { min-height: 50px; display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 0 20px; border-radius: 7px; background: var(--accent); color: var(--accent-text); font-weight: 850; text-decoration: none; }
.guide-section, .legal-section { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 34px; padding: 30px 0; border-bottom: 1px solid var(--line-soft); }
.guide-section h2, .legal-section h2 { margin: 0; font-size: 1.08rem; }
.guide-section p, .guide-section li, .legal-section p, .legal-section li { color: #c7ced2; font-size: .9rem; }
.guide-section p:last-child, .legal-section p:last-child { margin-bottom: 0; }
.guide-section ul, .guide-section ol, .legal-section ul { margin-top: 0; padding-left: 1.25rem; }
.guide-section li, .legal-section li { margin-bottom: 7px; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.legal-nav a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: .78rem; text-decoration: none; }

.site-footer { border-top: 1px solid var(--line-soft); }
.footer-inner { min-height: 160px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-content: center; }
.footer-inner p { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 16px; justify-content: flex-end; font-size: .78rem; }
.footer-inner nav a { color: var(--muted); text-underline-offset: 4px; }
.footer-inner > small { grid-column: 1 / -1; color: #747d82; }

@media (max-width: 860px) {
  .tool-layout { grid-template-columns: 1fr; gap: 30px; }
  .network { grid-template-columns: 1fr; }
}

@media (max-width: 660px) {
  .header-inner, .page-shell, .footer-inner, .guide-shell, .legal-shell { width: min(100% - 28px, 1160px); }
  .header-inner { min-height: 62px; }
  .brand-copy small { display: none; }
  .site-nav { gap: 12px; font-size: .75rem; }
  .site-nav a:last-child { display: none; }
  .page-shell { padding-top: 24px; }
  .page-intro { grid-template-columns: 1fr; gap: 16px; align-items: start; }
  .page-intro h1 { font-size: 1.75rem; }
  .privacy-signal { min-width: 0; padding: 4px 0 4px 12px; }
  .tool-layout { padding-top: 24px; }
  .tool-frame { margin: 0 -4px; padding: 18px 14px; }
  .mode-tabs { grid-template-columns: repeat(5, 68px); overflow-x: auto; justify-content: start; scrollbar-width: thin; }
  .mode-tab { min-height: 50px; }
  .drop-zone { min-height: 150px; padding: 17px 10px; }
  .drop-zone span { display: none; }
  .options-grid { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .action-row { flex-direction: column; }
  .primary-button, .secondary-button { width: 100%; min-height: 52px; }
  .directory-grid, .content-columns, .faq-list { grid-template-columns: 1fr; }
  .network-actions { grid-template-columns: 1fr; }
  .guide-section, .legal-section { grid-template-columns: 1fr; gap: 12px; }
  .footer-inner { grid-template-columns: 1fr; padding: 28px 0; }
  .footer-inner nav { justify-content: flex-start; }
  .footer-inner > small { grid-column: auto; }
}
