:root {
    --pmc-bg: #f5f7f4;
    --pmc-panel: #ffffff;
    --pmc-panel-soft: #eef4ee;
    --pmc-text: #17211b;
    --pmc-muted: #637067;
    --pmc-border: #d8e1d8;
    --pmc-primary: #256b4f;
    --pmc-primary-dark: #174634;
    --pmc-accent: #2d5b8a;
    --pmc-warn: #8f5a12;
    --pmc-danger: #9d2f2f;
    --pmc-ok: #2f6b38;
    --pmc-shadow: 0 14px 32px rgba(24, 42, 32, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--pmc-bg);
    color: var(--pmc-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.7;
}

body {
    margin: 0;
    background: var(--pmc-bg);
}

a {
    color: var(--pmc-accent);
}

button,
input,
textarea {
    font: inherit;
}

.pmc-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 36px;
}

.pmc-hero,
.pmc-panel,
.pmc-card,
.pmc-related,
.pmc-comments,
.pmc-ad {
    background: var(--pmc-panel);
    border: 1px solid var(--pmc-border);
    border-radius: 8px;
    box-shadow: var(--pmc-shadow);
}

.pmc-hero {
    padding: clamp(18px, 4vw, 36px);
}

.pmc-back {
    display: inline-flex;
    align-items: center;
    margin-bottom: 18px;
    font-size: 0.92rem;
    text-decoration: none;
}

.pmc-kicker {
    margin: 0 0 8px;
    color: var(--pmc-primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
}

.pmc-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(1.75rem, 3vw, 2.6rem);
    line-height: 1.18;
    letter-spacing: 0;
}

.pmc-lead,
.pmc-notice {
    max-width: 820px;
    margin: 0 0 12px;
}

.pmc-notice {
    color: var(--pmc-muted);
}

.pmc-policy {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.pmc-policy span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--pmc-border);
    border-radius: 999px;
    background: var(--pmc-panel);
    color: var(--pmc-primary-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.pmc-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
    gap: 16px;
}

.pmc-panel {
    padding: 22px;
    min-width: 0;
}

.pmc-panel h2,
.pmc-card h2,
.pmc-related h2 {
    margin: 0 0 16px;
    font-size: 1.35rem;
    letter-spacing: 0;
}

.pmc-field,
.pmc-fieldset {
    display: block;
    margin: 0 0 14px;
}

.pmc-field span,
.pmc-fieldset legend {
    display: block;
    margin: 0 0 6px;
    font-weight: 700;
}

.pmc-field input,
.pmc-field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--pmc-border);
    border-radius: 8px;
    background: #fff;
    color: var(--pmc-text);
    padding: 11px 12px;
}

.pmc-field textarea {
    resize: vertical;
}

.pmc-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.pmc-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.pmc-fieldset {
    min-width: 0;
    border: 1px solid var(--pmc-border);
    border-radius: 8px;
    padding: 12px;
}

.pmc-fieldset label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 14px;
    min-height: 32px;
}

.pmc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.pmc-actions button,
.pmc-inline button {
    min-height: 42px;
    border: 1px solid var(--pmc-border);
    border-radius: 8px;
    background: #fff;
    color: var(--pmc-text);
    padding: 8px 12px;
    cursor: pointer;
}

.pmc-actions button:hover,
.pmc-inline button:hover {
    border-color: var(--pmc-primary);
}

.pmc-actions .pmc-primary {
    border-color: var(--pmc-primary);
    background: var(--pmc-primary);
    color: #fff;
    font-weight: 700;
}

.pmc-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.pmc-status {
    margin: 12px 0 0;
    color: var(--pmc-muted);
}

.pmc-print-note {
    margin: 10px 0 0;
    color: var(--pmc-muted);
    font-size: 0.92rem;
}

.pmc-print-template {
    display: none;
}

.pmc-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.pmc-summary div {
    min-width: 0;
    border: 1px solid var(--pmc-border);
    border-radius: 8px;
    padding: 10px;
    background: var(--pmc-panel-soft);
}

.pmc-summary span {
    display: block;
    color: var(--pmc-muted);
    font-size: 0.82rem;
}

.pmc-summary strong {
    display: block;
    font-size: 1.5rem;
}

.pmc-result-list {
    display: grid;
    gap: 10px;
}

.pmc-result-card {
    border: 1px solid var(--pmc-border);
    border-left: 5px solid var(--pmc-muted);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.pmc-result-card h3 {
    margin: 6px 0;
    font-size: 1rem;
}

.pmc-result-card p {
    margin: 0;
    color: var(--pmc-muted);
}

.pmc-result-card[data-level="critical"] {
    border-left-color: var(--pmc-danger);
}

.pmc-result-card[data-level="warning"] {
    border-left-color: var(--pmc-warn);
}

.pmc-result-card[data-level="memo"] {
    border-left-color: var(--pmc-accent);
}

.pmc-result-card[data-level="ok"] {
    border-left-color: var(--pmc-ok);
}

.pmc-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 2px 8px;
    background: var(--pmc-panel-soft);
    color: var(--pmc-primary-dark);
    font-size: 0.8rem;
    font-weight: 700;
}

.pmc-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.pmc-card,
.pmc-related,
.pmc-comments {
    padding: 22px;
}

.pmc-link-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.pmc-link-grid a {
    display: grid;
    gap: 4px;
    min-width: 0;
    min-height: 88px;
    border: 1px solid var(--pmc-border);
    border-radius: 8px;
    padding: 12px;
    text-decoration: none;
    background: #fff;
}

.pmc-link-grid strong {
    color: var(--pmc-text);
}

.pmc-link-grid span {
    color: var(--pmc-muted);
    font-size: 0.92rem;
}

.pmc-ad {
    margin: 16px 0;
    padding: 12px;
    min-height: 100px;
}

.pmc-ad-label {
    margin-bottom: 8px;
    color: var(--pmc-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.pmc-comment-note {
    margin: 0 0 14px;
    color: var(--pmc-muted);
}

.pmc-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-top: 18px;
    color: var(--pmc-muted);
    font-size: 0.92rem;
}

@media (max-width: 820px) {
    .pmc-shell {
        width: min(100% - 20px, 1120px);
        padding-top: 10px;
    }

    .pmc-hero,
    .pmc-panel,
    .pmc-card,
    .pmc-related,
    .pmc-comments {
        padding: 18px;
    }

    .pmc-workspace,
    .pmc-info-grid,
    .pmc-two-col,
    .pmc-link-grid {
        grid-template-columns: 1fr;
    }

    .pmc-inline {
        grid-template-columns: 1fr;
    }

    .pmc-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pmc-actions button,
    .pmc-inline button {
        width: 100%;
    }
}

@page {
    size: A4 portrait;
    margin: 8mm;
}

@media print {
    * {
        box-shadow: none !important;
    }

    html,
    body {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        padding: 0;
        background: #fff !important;
        color: #111 !important;
    }

    body.work-request-check-page > :not(.pmc-print-template) {
        display: none !important;
    }

    .pmc-print-template {
        display: block !important;
        width: 194mm;
        height: 281mm;
        margin: 0 auto;
        background: #fff;
    }

    .pmc-print-page {
        display: grid;
        grid-template-columns: repeat(2, 97mm);
        grid-template-rows: repeat(3, 93.66mm);
        width: 194mm;
        height: 281mm;
    }

    .pmc-print-card {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 1.25mm;
        min-width: 0;
        min-height: 0;
        padding: 3.4mm 4mm 2.8mm;
        border: 0.35mm dashed #777;
        break-inside: avoid;
        page-break-inside: avoid;
        font-family: "Yu Gothic", "Meiryo", sans-serif;
        font-size: 7.8pt;
        line-height: 1.18;
    }

    .pmc-print-card-header {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 3mm;
        border-bottom: 0.35mm solid #222;
        padding-bottom: 1mm;
    }

    .pmc-print-card h2 {
        margin: 0;
        font-size: 12pt;
        line-height: 1;
        letter-spacing: 0;
    }

    .pmc-print-card-header span,
    .pmc-print-card footer {
        color: #555;
        font-size: 6.8pt;
        white-space: nowrap;
    }

    .pmc-print-row {
        display: grid;
        grid-template-columns: 25mm minmax(0, 1fr);
        align-items: end;
        gap: 2mm;
        min-height: 4.5mm;
    }

    .pmc-print-row span,
    .pmc-print-area span {
        font-weight: 700;
        white-space: nowrap;
    }

    .pmc-print-row i,
    .pmc-print-area i {
        display: block;
        min-width: 0;
        border-bottom: 0.25mm solid #999;
    }

    .pmc-print-area {
        display: grid;
        grid-template-columns: 25mm minmax(0, 1fr);
        grid-auto-rows: 4.5mm;
        gap: 1mm 2mm;
        align-items: end;
    }

    .pmc-print-area span {
        grid-row: 1 / -1;
        align-self: start;
        padding-top: 0.8mm;
    }

    .pmc-print-card footer {
        margin-top: auto;
        text-align: right;
    }
}
