:root {
    --canvas: #faf6f1;
    --surface: #ffffff;
    --ink: #0e0e0f;
    --muted: #5c5e63;
    --border: #dfddd8;
    --blue: #176cb7;
    --line: #d9dee5;
    --paper: #ffffff;
    --warm: var(--canvas);
    --accent: #ec221f;
    --accent-soft: #fff1eb;
    --navy: #06437f;
    --ok: #16833a;
    --review: #ed6f00;
    --danger: #e81920;
    --unknown: #777b80;
    --info: #1768a6;
    --radius: 4px;
    --max: 1104px;
    font-family: YakuHanJP, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    color: var(--ink);
    background: var(--warm);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--canvas);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.65;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

small {
    font-size: 13px;
}

a {
    color: inherit;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 8px;
    left: 8px;
    padding: 8px 14px;
    color: #fff;
    background: var(--navy);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.shell {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
}

.page-shell {
    width: min(1200px, calc(100% - 40px));
    margin-inline: auto;
}

.brand-header {
    background: #fff;
    border-bottom: 1px solid #e6e6e6;
}

.brand-header__inner {
    display: grid;
    grid-template-columns: 320px 1fr 440px;
    align-items: center;
    gap: 28px;
    width: min(1260px, calc(100% - 32px));
    min-height: 118px;
    margin: auto;
}

.brand-header__logo img {
    display: block;
    width: 100%;
    height: auto;
}

.brand-header__message {
    display: grid;
    font-size: 13px;
    line-height: 1.5;
}

.brand-header__message strong {
    font-size: 15px;
}

.brand-header__actions {
    text-align: right;
}

.brand-header__actions p,
.brand-header__actions small {
    display: block;
    margin: 0;
    font-size: 13px;
}

.brand-header__actions > div {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 8px 0 4px;
}

.brand-header__actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    color: #fff;
    background: var(--blue);
    border-radius: 3px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.brand-nav {
    background: #8a0002;
    border-top: 1px solid #ececec;
    color: #fff;
}

.brand-nav__inner {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    width: min(1260px, calc(100% - 32px));
    margin: auto;
}

.brand-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 8px 6px;
    color: #fff;
    border-left: 1px solid #ececec;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
}

.brand-nav a:last-child {
    border-right: 1px solid #ececec;
}

.brand-nav a:hover,
.brand-nav a:focus-visible {
    color: #fff;
    background: #700002;
}

main {
    width: min(calc(100% - 40px), var(--max));
    margin-inline: auto;
    padding: 34px 0 72px;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumb a {
    color: inherit;
}

.hero {
    width: 100%;
    padding: 0 0 24px;
    text-align: center;
}

.first-view-head {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.usage-limits {
    width: min(100%, 560px);
    margin: 24px auto 26px;
    padding: 14px 24px;
    border: 1px solid #e0d5ab;
    background-color: #fffbea;
}

.usage-limits h2 {
    margin: 0 0 5px;
    font-size: 16px;
    line-height: 1.4;
}

.usage-limits ul {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    color: #454545;
    font-size: 13px;
    line-height: 1.55;
    list-style: none;
    text-align: left;
}

.usage-limits li::before {
    content: none;
}

h1,
h2,
h3,
h4,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 3.2vw, 2.125rem);
    line-height: 1.28;
    letter-spacing: 0;
}

.hero__lead {
    max-width: 100%;
    margin: 10px 0 0;
    color: #323232;
    font-size: 1rem;
}

.scope-note {
    max-width: 100%;
    margin: 4px 0 0;
    padding: 0;
    border: 0;
    color: #323232;
    font-size: 14px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 4px rgb(12 12 13 / 10%), 0 1px 2px rgb(12 12 13 / 5%);
}

.form-area {
    max-width: 1090px;
    margin: 0 auto;
}

.diagnostic-form {
    padding: 0;
}

.form-fields {
    padding: 24px 32px 20px;
    text-align: left;
}

.field + .field {
    margin-top: 18px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.4;
}

.field__label-row {
    display: block;
}

.field-help-link {
    color: var(--ink);
    font-size: 16px;
    font-weight: 400;
    text-underline-offset: 2px;
}

.field-help {
    margin: 7px 0 0;
    font-size: 16px;
    line-height: 1.4;
}

.field label span,
.field small {
    color: var(--muted);
    font-size: 16px;
    font-weight: 500;
}

.field small {
    display: block;
    margin-top: 5px;
    color: #202020;
    font-size: 14px;
}

.field input {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.field input:disabled {
    color: #6a727b;
    background: #eef0f2;
    cursor: not-allowed;
}

.field input:focus-visible,
.primary-button:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 3px solid #4b9ddd;
    outline-offset: 3px;
}

.primary-button {
    width: 100%;
    min-height: 48px;
    max-width: 302px;
    margin: 12px auto 0;
    padding: 12px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: var(--accent);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: block;
}

.primary-button:hover {
    background: #df3500;
}

.primary-button:disabled,
.primary-button:disabled:hover {
    color: #fff;
    background: #777f88;
    cursor: not-allowed;
}

.form-note,
.form-message {
    font-size: 15px;
}

.form-note {
    margin: 18px 0 0;
    font-weight: 700;
    text-align: center;
}

.turnstile-container {
    min-height: 1px;
    margin-top: 10px;
}

.form-message[hidden] {
    display: none;
}

.form-message--notice {
    color: #1d4e73;
    background: #eaf4fb;
}

.form-message {
    margin: 16px auto 0;
    padding: 9px 12px;
    border-radius: 2px;
    text-align: center;
}

.form-message--success {
    color: var(--accent);
    background: transparent;
    font-size: 28px;
    font-weight: 700;
}

.form-message--success::after {
    display: block;
    margin-top: 2px;
    color: #202020;
    content: "↓";
    font-size: 42px;
    font-weight: 400;
    line-height: 1;
}

.form-message--error {
    color: #9f1318;
    background: #fff0f0;
}

.results {
    margin-block: 72px 48px;
    padding-block: 0;
    border-top: 0;
}

.results[hidden] {
    display: none;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
}

.section-heading h2 {
    display: inline;
    margin: 0;
    font-size: 27px;
    font-weight: 800;
}

.result-mode {
    display: inline-block;
    margin-left: 10px;
    color: #4d5358;
    font-size: 13px;
}

.result-domain {
    margin: 8px 0 15px;
    color: var(--muted);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    padding: 24px 60px;
    border: 1px solid #e0d5ab;
    border-radius: 6px;
    background: #fffbea;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    min-height: 79px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: #ff375f;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease;
}

.summary-card:hover {
    border-color: currentColor;
    background: #fafbfc;
}

.summary-card strong {
    font-size: 24px;
}

.summary-card .status-icon {
    display: none;
}

.result-card .status-icon {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-weight: 900;
}

.status-action_required {
    color: var(--danger);
}

.status-review {
    color: var(--review);
}

.status-ok {
    color: var(--ok);
}

.status-unknown {
    color: var(--unknown);
}

.status-info {
    color: var(--info);
}

.summary-card {
    color: #ff375f;
}

.results-detail-title {
    margin: 52px 0 0;
    font-size: 27px;
    font-weight: 800;
}

.result-list {
    margin-top: 24px;
}

.result-group {
    scroll-margin-top: 18px;
    padding-block: 22px 28px;
    border-top: 1px solid var(--line);
}

.result-group:focus-visible,
.help-section:focus-visible {
    outline: 3px solid #4b9ddd;
    outline-offset: 4px;
}

.result-group__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.result-group__heading h3 {
    margin: 0;
    font-size: 1.3rem;
}

.result-group__heading > span {
    color: var(--muted);
    font-size: 13px;
}

.result-group__items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 20px;
}

.result-group__empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 12px 0;
    color: var(--muted);
}

.result-card {
    padding: 18px 18px 20px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-left: 4px solid var(--unknown);
    border-radius: 0;
    background: #fff;
}

.result-group__items > .result-card:only-child {
    grid-column: 1 / -1;
}

.result-card--status-action_required {
    border-left-color: var(--danger);
}

.result-card--status-review {
    border-left-color: var(--review);
}

.result-card--status-ok {
    border-left-color: var(--ok);
}

.result-card--status-unknown {
    border-left-color: var(--unknown);
}

.result-card--status-info {
    border-left-color: var(--info);
}

.result-card__head {
    display: flex;
    gap: 14px;
    align-items: center;
}

.result-card h4 {
    display: inline;
    margin: 0 8px 0 0;
    font-size: 1.25rem;
}

.status-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 2px;
    color: #fff;
    background: currentColor;
    font-size: 13px;
    font-weight: 800;
}

.status-badge.status-action_required {
    background: var(--danger);
}

.status-badge.status-review {
    background: var(--review);
}

.status-badge.status-ok {
    background: var(--ok);
}

.status-badge.status-unknown {
    background: var(--unknown);
}

.status-badge.status-info {
    background: var(--info);
}

.result-card--spf {
    grid-column: 1 / -1;
}

.result-card__reason {
    margin: 14px 0 10px;
}

.result-card__advice {
    margin: 8px 0 12px;
    color: #35404c;
}

details {
    margin: 10px 0;
}

summary {
    min-height: 44px;
    padding-block: 9px;
    color: var(--navy);
    font-weight: 700;
    cursor: pointer;
}

.raw-values {
    margin: 0;
    padding: 10px 10px 10px 30px;
    border-radius: 2px;
    background: #f5f7f8;
}

.raw-values code {
    overflow-wrap: anywhere;
    word-break: break-all;
}

.spf-analysis {
    margin-top: 16px;
    padding: 0 14px 14px;
    border: 1px solid #cbd8e5;
    border-radius: 2px;
    background: #f8fbfd;
}

.spf-analysis__metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.spf-analysis__metrics span {
    padding: 5px 10px;
    border-radius: 2px;
    background: #e5eef6;
    color: #273849;
    font-size: 13px;
}

.spf-analysis__warnings,
.spf-node__warnings {
    margin: 8px 0;
    padding-left: 22px;
    color: #8b3f00;
}

.spf-tree {
    display: grid;
    gap: 10px;
}

.spf-tree__children {
    display: grid;
    gap: 10px;
    margin: 10px 0 0 18px;
    padding-left: 16px;
    border-left: 2px solid #b8c9d8;
}

.spf-tree__relation {
    display: inline-block;
    margin-bottom: 5px;
    padding: 1px 7px;
    border-radius: 2px;
    color: #fff;
    background: var(--navy);
    font-size: 13px;
    font-weight: 800;
}

.spf-node {
    padding: 11px;
    border: 1px solid #d2dce5;
    border-radius: 2px;
    background: #fff;
}

.spf-node--cycle,
.spf-node--depth_limit,
.spf-node--node_limit,
.spf-node--invalid_reference {
    border-color: #f0b183;
    background: #fff8f1;
}

.spf-node--missing,
.spf-node--multiple,
.spf-node--invalid {
    border-color: #e4b6b8;
    background: #fff7f7;
}

.spf-node__head {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 12px;
    align-items: center;
}

.spf-node__head > code {
    font-weight: 800;
    overflow-wrap: anywhere;
}

.spf-node__head > span {
    padding: 1px 7px;
    border-radius: 2px;
    background: #edf1f4;
    font-size: 13px;
    font-weight: 700;
}

.spf-node__head > small {
    color: var(--muted);
}

.spf-node__records {
    margin: 8px 0 0;
    padding: 8px 8px 8px 28px;
    border-radius: 2px;
    background: #f4f6f8;
}

.spf-node__records code {
    overflow-wrap: anywhere;
    word-break: break-all;
}

.help-section {
    display: block;
    scroll-margin-top: 18px;
    margin-block: 0 52px;
    padding-block: 30px;
    border-top: 1px solid #bfc7d0;
    border-bottom: 1px solid #bfc7d0;
}

.help-section h2 {
    margin: 0;
    font-size: 1.5rem;
}

.help-section__body p {
    margin: 0;
}

.help-section__body {
    margin-top: 16px;
}

.help-section__body h3 {
    margin: 22px 0 10px;
    font-size: 1.125rem;
}

.help-section__body ol {
    display: grid;
    gap: 12px;
    margin: 0;
    padding-left: 1.5em;
}

.help-section__body p + p,
.help-section__body ol + p {
    margin-top: 14px;
}

.help-section__note {
    padding: 12px 14px;
    border-left: 3px solid #b7bdc5;
    background: #f4f6f8;
}

footer {
    padding-block: 35px;
    background: #fff;
    border-top: 1px solid var(--border);
}

footer .page-shell {
    display: flex;
    align-items: center;
    gap: 24px;
}

footer img {
    width: 230px;
    height: auto;
}

footer p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

@media (max-width: 1100px) {
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1000px) {
    .brand-header__inner {
        grid-template-columns: 260px 1fr;
        min-height: 96px;
    }

    .brand-header__message {
        display: none;
    }

    .brand-nav__inner {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .brand-nav a {
        border-bottom: 1px solid #ececec;
    }
}

@media (max-width: 760px) {
    .shell {
        width: 100%;
    }

    main {
        width: min(calc(100% - 24px), var(--max));
        padding-top: 26px;
    }

    .hero {
        padding-inline: 0;
    }

    h1 {
        font-size: 1.375rem;
    }

    .first-view-head {
        display: flex;
    }

    .usage-limits {
        margin-bottom: 24px;
        padding: 13px 15px;
    }

    .form-fields {
        padding: 20px 16px;
    }

    .field label {
        font-size: 18px;
    }

    .form-note {
        font-size: 14px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 18px 12px;
    }

    .result-group__items {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 430px) {
    .field label span {
        display: block;
    }

    .result-card {
        padding: 18px;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        min-height: 68px;
    }

    .spf-tree__children {
        margin-left: 6px;
        padding-left: 9px;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 24px, 1200px);
    }

    .brand-header__inner {
        width: calc(100% - 24px);
        grid-template-columns: 1fr;
        gap: 8px;
        padding-block: 14px;
    }

    .brand-header__logo {
        width: 250px;
    }

    .brand-header__actions {
        text-align: left;
    }

    .brand-header__actions p,
    .brand-header__actions small {
        display: none;
    }

    .brand-header__actions > div {
        justify-content: flex-start;
        margin: 0;
    }

    .brand-header__actions a {
        min-height: 44px;
        font-size: 13px;
    }

    .brand-nav__inner {
        width: 100%;
        display: flex;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .brand-nav a {
        flex: 0 0 auto;
        min-width: 132px;
        padding-inline: 12px;
    }

    footer .page-shell {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 420px) {
    .brand-header__actions > div {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .brand-header__actions a {
        padding-inline: 8px;
        text-align: center;
        line-height: 1.35;
    }
}
