:root {
  --grad-head: linear-gradient(100deg, #D63FC3 0%, #B24FE0 45%, #8F59EE 75%, #5A63E6 100%);
  --grad-btn: linear-gradient(135deg, #C04DDB 0%, #8C5CEB 100%);
  --grad-foot: linear-gradient(100deg, #5A2390 0%, #3C1F78 55%, #261A4E 100%);
  --grad-widget: linear-gradient(90deg, #F6EAFB 0%, #F3EEFC 60%, #F7F4FD 100%);
  --grad-title: linear-gradient(100deg, #C93BB8 0%, #A048D6 50%, #6A5AE0 100%);
  --accent: #D946EF;
  --accent-ink: #7B3FD0;
  --paper: #F0F1F5;
  --sheet: #FFFFFF;
  --field: #F7F7FA;
  --ink: #333333;
  --ink-soft: #6B6B7B;
  --rule: #DCDCE4;
  --red: #D0364A; --red-bg: #FCE9EC;
  --green: #23855C; --green-bg: #E3F4EB;
  --amber: #A76A0C; --amber-bg: #FCF1DB;
  --blue: #6A4FD8; --blue-bg: #EFEAFC;
  --focus: #8C5CEB;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grad-widget: linear-gradient(90deg, #3A2850 0%, #2E2747 100%);
    --grad-title: linear-gradient(100deg, #F08AE6 0%, #C9A0FF 55%, #A3AEFF 100%);
    --accent: #E879F9; --accent-ink: #C4A5FF;
    --paper: #17161D; --sheet: #22212B; --field: #1B1A22; --ink: #E9E7F0; --ink-soft: #A29FB3; --rule: #3A3846;
    --red: #FF8494; --red-bg: #43232A; --green: #6DD3A4; --green-bg: #1C3529;
    --amber: #F0BC5E; --amber-bg: #3D3019; --blue: #B9A4FF; --blue-bg: #2E2748; --focus: #C4A5FF;
  }
}
:root[data-theme="dark"] {
  --grad-widget: linear-gradient(90deg, #3A2850 0%, #2E2747 100%);
    --grad-title: linear-gradient(100deg, #F08AE6 0%, #C9A0FF 55%, #A3AEFF 100%);
  --accent: #E879F9; --accent-ink: #C4A5FF;
  --paper: #17161D; --sheet: #22212B; --field: #1B1A22; --ink: #E9E7F0; --ink-soft: #A29FB3; --rule: #3A3846;
  --red: #FF8494; --red-bg: #43232A; --green: #6DD3A4; --green-bg: #1C3529;
  --amber: #F0BC5E; --amber-bg: #3D3019; --blue: #B9A4FF; --blue-bg: #2E2748; --focus: #C4A5FF;
}
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
*, *::before, *::after { box-sizing: inherit; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  font-size: 15px; line-height: 1.75; font-variant-numeric: tabular-nums;
  min-height: 100%; display: flex; flex-direction: column;
}
html { height: 100%; }

/* ヘッダー：シャムハムBLOGのグラデーションバー */
.site-header { background: var(--grad-head); }
.site-header .inner { max-width: 1180px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 10px; }
.site-header .logo { color: #fff; font-family: "M PLUS 1 Code", "Noto Sans JP", monospace; font-weight: 700; font-size: 1.35rem; letter-spacing: .02em; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.site-header .logo svg { width: 28px; height: 28px; }

.layout { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px 24px 48px; }
@media (max-width: 760px) { .layout { padding: 16px 12px 40px; } }
.settings { margin-top: 26px; border-top: 1px solid var(--rule); padding-top: 14px; }
.settings .widget { margin-top: 18px; }
.settings .widget:first-child { margin-top: 8px; }
.settings .widget p { max-width: 75ch; }

.card { background: var(--sheet); border-radius: 4px; padding: 28px 30px; }
.card + .card, .main > * + * { margin-top: 20px; }
@media (max-width: 600px) { .card { padding: 20px 16px; } }

.main h1 { font-family: "M PLUS 1 Code", "Noto Sans JP", monospace; font-weight: 700; font-size: 1.75rem; margin: 0 0 6px; letter-spacing: .01em;
  color: var(--accent-ink); background: var(--grad-title); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; width: fit-content; }
.main .lead { margin: 0; font-size: 1rem; max-width: 70ch; }
.main .disclaimer { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--rule); font-size: .8rem; color: var(--ink-soft); max-width: 90ch; }

/* 見出し：サイドバーと同じ「左ボーダー＋淡いグラデーション」 */
.w-title { background: var(--grad-widget); border-left: 4px solid var(--accent); padding: 6px 12px; font-size: .88rem; font-weight: 500; margin: 0 0 14px; border-radius: 0 3px 3px 0; }
.widget + .widget { margin-top: 32px; }
.widget p, .widget li { font-size: .85rem; }
.widget p { margin: 6px 0 0; color: var(--ink-soft); }
.widget ol { margin: 0; padding-left: 1.3em; }
.widget li + li { margin-top: 6px; }

.inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .inputs { grid-template-columns: 1fr; } }
.pane { display: flex; flex-direction: column; }
.pane .w-title { margin-bottom: 6px; }
.pane .hint { color: var(--ink-soft); font-size: .82rem; margin: 0 0 8px; min-height: 3.2em; }
textarea {
  width: 100%; min-height: 260px; resize: vertical; padding: 10px 12px; border: 1px solid var(--rule);
  border-radius: 4px; background: var(--field); color: var(--ink); font: inherit; font-size: .9rem; line-height: 1.6;
}
textarea::placeholder { color: var(--ink-soft); opacity: .8; }
textarea:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
button {
  font: inherit; font-size: .9rem; cursor: pointer; border-radius: 999px; padding: 7px 18px;
  border: 1px solid var(--rule); background: var(--sheet); color: var(--ink);
}
button:hover { border-color: var(--accent-ink); color: var(--accent-ink); }
button.primary { background: var(--grad-btn); color: #fff; border: 0; font-weight: 700; padding: 10px 32px; box-shadow: 0 2px 8px rgba(140, 92, 235, .3); }
button.primary:hover { color: #fff; filter: brightness(1.06); }
button.ghost { background: transparent; }

.bm-link { display: inline-block; padding: 7px 18px; border-radius: 999px; color: #fff; font-weight: 700; font-size: .88rem; text-decoration: none; background: var(--grad-btn); cursor: grab; }
code.inline { font-family: "M PLUS 1 Code", monospace; font-size: .72rem; word-break: break-all; display: block; background: var(--field); padding: 8px; border-radius: 4px; border: 1px solid var(--rule); max-height: 90px; overflow: auto; margin-top: 6px; }
.widget input[type=text] { width: 100%; font: inherit; font-size: .85rem; padding: 6px 8px; border: 1px solid var(--rule); border-radius: 4px; background: var(--field); color: var(--ink); }
.widget .controls { margin-top: 8px; }

#results:empty { display: none; }
#results { background: var(--sheet); border-radius: 4px; padding: 28px 30px; }
@media (max-width: 600px) { #results { padding: 20px 16px; } }
.summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.summary h2 { font-family: "M PLUS 1 Code", "Noto Sans JP", monospace; font-weight: 500; font-size: 1.35rem; margin: 0 12px 0 0; }
.chip { border-radius: 999px; padding: 2px 12px; font-size: .85rem; font-weight: 700; border: 1px solid transparent; cursor: pointer; background: transparent; }
.chip.ok { color: var(--green); border-color: var(--green); }
.chip.ng { color: var(--red); border-color: var(--red); }
.chip.warn { color: var(--amber); border-color: var(--amber); }
.chip.info { color: var(--blue); border-color: var(--blue); }
.chip[aria-pressed="true"] { color: var(--sheet); }
.chip.ok[aria-pressed="true"] { background: var(--green); }
.chip.ng[aria-pressed="true"] { background: var(--red); }
.chip.warn[aria-pressed="true"] { background: var(--amber); }
.chip.info[aria-pressed="true"] { background: var(--blue); }
.verdict { font-weight: 700; padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; border-left: 4px solid; }
.verdict.good { background: var(--green-bg); color: var(--green); }
.verdict.bad { background: var(--red-bg); color: var(--red); }

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 4px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: .9rem; }
th { font-size: .8rem; color: var(--ink-soft); font-weight: 500; background: var(--field); }
tr.section td { background: var(--grad-widget); border-left: 4px solid var(--accent); font-weight: 500; font-size: .85rem; padding-top: 7px; padding-bottom: 7px; }
td.price { white-space: nowrap; }
th:nth-child(1) { width: 92px; }
th:nth-child(2) { width: 34%; }
th:nth-child(5) { width: 22%; }
.badge { display: inline-block; font-size: .78rem; font-weight: 700; padding: 1px 9px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: var(--green-bg); color: var(--green); }
.badge.ng { background: var(--red-bg); color: var(--red); }
.badge.warn { background: var(--amber-bg); color: var(--amber); }
.badge.info { background: var(--blue-bg); color: var(--blue); }
.plabel { color: var(--ink-soft); font-size: .8rem; margin-right: 4px; }
.pline { display: block; }
del.wrong { color: var(--ink-soft); text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.fix { color: var(--red); font-weight: 700; margin-left: 6px; }
.fix::before { content: "→ "; font-weight: 400; }
.note { font-size: .82rem; color: var(--ink-soft); }
.note b { color: var(--ink); font-weight: 500; }
.siteonly-name { color: var(--ink-soft); }

details.outside { margin-top: 14px; }
details.outside summary { cursor: pointer; color: var(--ink-soft); font-size: .88rem; }
.report { margin-top: 28px; }
.report h3 { background: var(--grad-widget); border-left: 4px solid var(--accent); padding: 6px 12px; font-size: .88rem; font-weight: 500; margin: 0 0 10px; }
.report textarea { min-height: 180px; }
.toast { color: var(--green); font-weight: 700; font-size: .85rem; }
.empty { color: var(--ink-soft); padding: 18px; border: 1px dashed var(--rule); border-radius: 4px; }

.site-footer { background: var(--grad-foot); color: rgba(255,255,255,.75); font-size: .8rem; text-align: center; padding: 18px 16px; }
@media (prefers-reduced-motion: no-preference) {
  #results.fresh { animation: show .25s ease-out; }
  @keyframes show { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
