body.opd-public-page {
    margin: 0;
    background: #f2f5f6;
    color: #26343b;
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    font-size: 16px;
    line-height: 1.65;
}

body.opd-public-page *,
body.opd-public-page *::before,
body.opd-public-page *::after {
    box-sizing: border-box;
}

.opd-skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    padding: 9px 14px;
    background: #17475d;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-150%);
}

.opd-skip-link:focus {
    color: #fff;
    outline: 3px solid #8ec31f;
    transform: translateY(0);
}

.opd-site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-top: 5px solid #008cd6;
    border-bottom: 1px solid #d7e0e4;
    background: #fff;
    box-shadow: 0 2px 12px rgba(38, 52, 59, .06);
}

.opd-site-header-inner {
    display: flex;
    width: min(1180px, calc(100% - 48px));
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin: 0 auto;
}

.opd-site-brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 20px;
    color: #383635;
    text-decoration: none;
}

.opd-site-brand:hover,
.opd-site-brand:focus {
    color: #383635;
    text-decoration: none;
}

.opd-site-brand:focus-visible {
    outline: 3px solid rgba(0, 140, 214, .28);
    outline-offset: 5px;
}

.opd-site-brand img {
    display: block;
    width: 218px;
    height: auto;
}

.opd-site-service {
    display: flex;
    flex-direction: column;
    padding-left: 20px;
    border-left: 1px solid #cbd6db;
    line-height: 1.35;
}

.opd-site-service strong {
    color: #17475d;
    font-size: 15px;
    font-weight: 700;
}

.opd-site-service small {
    margin-top: 2px;
    color: #68777e;
    font-size: 12px;
}

.opd-site-contact {
    display: flex;
    align-items: baseline;
    gap: 10px;
    white-space: nowrap;
}

.opd-site-contact span {
    color: #68777e;
    font-size: 12px;
}

.opd-site-contact a {
    color: #006d9f;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .03em;
    text-decoration: none;
}

.opd-site-contact a:hover,
.opd-site-contact a:focus {
    color: #00567e;
    text-decoration: underline;
}

.opd-page-frame {
    min-height: calc(100vh - 176px);
}

.opd-site-footer {
    border-top: 1px solid #d7e0e4;
    background: #fff;
    color: #68777e;
}

.opd-site-footer-inner {
    display: flex;
    width: min(1180px, calc(100% - 48px));
    min-height: 74px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto;
    font-size: 13px;
}

.opd-site-footer p {
    margin: 0;
}

.opd-shell {
    --opd-blue: #008cd6;
    --opd-blue-dark: #006d9f;
    --opd-blue-deep: #17475d;
    --opd-blue-soft: #eaf6fc;
    --opd-green: #8ec31f;
    --opd-green-dark: #5f8f12;
    --opd-green-soft: #f2f8e8;
    --opd-ink: #26343b;
    --opd-muted: #68777e;
    --opd-line: #d7e0e4;
    --opd-line-strong: #bdcbd1;
    --opd-paper: #fff;
    --opd-canvas: #f3f6f7;
    --opd-danger: #a23c45;
    --opd-warning: #8c641e;
    max-width: 1120px;
    margin: 0 auto;
    padding: 30px 24px 56px;
    color: var(--opd-ink);
    font-variant-numeric: tabular-nums;
}

.opd-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(245px, 310px);
    grid-template-areas:
        "title context"
        "lead context"
        "actions context"
        "progress progress";
    column-gap: 40px;
    padding: 26px 30px 0;
    overflow: hidden;
    border: 1px solid var(--opd-line);
    border-top: 3px solid var(--opd-blue);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(38, 52, 59, .055);
}

.opd-title {
    grid-area: title;
    margin: 0;
    color: var(--opd-blue-deep);
    font-size: clamp(28px, 3vw, 34px);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.35;
}

.opd-clinic-context {
    grid-area: context;
    align-self: start;
    padding: 15px 18px;
    border: 1px solid #d7e5eb;
    border-left: 4px solid var(--opd-green);
    border-radius: 3px;
    background: #f7fafb;
}

.opd-clinic-context-label {
    display: block;
    margin-bottom: 3px;
    color: var(--opd-muted);
    font-size: 12px;
    font-weight: 700;
}

.opd-clinic-context-name {
    display: block;
    color: var(--opd-blue-deep);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
}

.opd-lead {
    grid-area: lead;
    max-width: 720px;
    margin: 8px 0 0;
    color: #52646c;
    font-size: 16px;
    line-height: 1.8;
}

.opd-hero-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.opd-button-compact {
    min-height: 40px;
    padding: 7px 15px;
    font-size: 14px;
}

.opd-progress {
    grid-area: progress;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 24px -30px 0;
    padding: 0 30px;
    border-top: 1px solid var(--opd-line);
    border-bottom: 0;
    background: #f8fafb;
    list-style: none;
}

.opd-progress li {
    position: relative;
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    border-right: 1px solid var(--opd-line);
    color: var(--opd-muted);
    font-size: 14px;
}

.opd-progress li:last-child {
    border-right: 0;
}

.opd-progress li.is-active {
    background: #fff;
    color: var(--opd-blue-deep);
    font-weight: 700;
}

.opd-progress li.is-active::before {
    position: absolute;
    top: auto;
    bottom: -1px;
    right: 0;
    left: 0;
    height: 3px;
    background: var(--opd-blue);
    content: "";
}

.opd-progress li.is-done {
    color: var(--opd-green-dark);
}

.opd-step-number {
    display: inline-flex;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--opd-line-strong);
    border-radius: 50%;
    background: #fff;
    color: var(--opd-muted);
    font-size: 13px;
    font-weight: 800;
}

.opd-progress .is-active .opd-step-number {
    border-color: var(--opd-blue);
    background: var(--opd-blue);
    color: #fff;
}

.opd-progress .is-done .opd-step-number {
    border-color: #b4ce7e;
    background: var(--opd-green-soft);
    color: var(--opd-green-dark);
}

.opd-panel {
    margin-top: 20px;
    padding: 26px 28px;
    border: 1px solid var(--opd-line);
    border-radius: 6px;
    background: var(--opd-paper);
    box-shadow: 0 4px 16px rgba(38, 52, 59, .04);
}

.opd-panel-title {
    display: flex;
    align-items: center;
    margin: 0 0 20px;
    padding-left: 11px;
    border-left: 4px solid var(--opd-blue);
    color: var(--opd-blue-deep);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.4;
}

.opd-panel-title::before {
    content: none;
}

.opd-form-row,
.opd-actions {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.opd-field {
    flex: 1 1 240px;
}

.opd-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--opd-blue-deep);
    font-size: 14px;
    font-weight: 700;
}

.opd-field input {
    width: 100%;
    min-height: 48px;
    padding: 10px 13px;
    border: 1px solid #aebdc4;
    border-radius: 3px;
    background: #fff;
    color: var(--opd-ink);
    font-size: 16px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.opd-field input:hover {
    border-color: #7f969f;
}

.opd-field input:focus {
    border-color: var(--opd-blue);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 140, 214, .16);
}

.opd-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 1px solid var(--opd-blue-dark);
    border-radius: 3px;
    background: var(--opd-blue-dark);
    color: #fff;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.opd-button:hover,
.opd-button:focus {
    border-color: #00567e;
    background: #00567e;
    color: #fff;
    text-decoration: none;
}

.opd-button:focus-visible {
    outline: 3px solid rgba(0, 140, 214, .24);
    outline-offset: 3px;
}

.opd-button:disabled {
    border-color: #c4ced2;
    background: #dfe5e7;
    color: #738087;
    cursor: not-allowed;
}

.opd-button-secondary {
    border-color: #9eb1b9;
    background: #fff;
    color: var(--opd-blue-dark);
}

.opd-button-secondary:hover,
.opd-button-secondary:focus {
    border-color: var(--opd-blue-dark);
    background: var(--opd-blue-soft);
    color: var(--opd-blue-deep);
}

.opd-alert {
    margin-top: 20px;
    padding: 14px 17px;
    border: 1px solid #edc9cd;
    border-left: 5px solid var(--opd-danger);
    background: #fff5f5;
    color: #782d34;
    line-height: 1.7;
}

.opd-notice {
    border-color: #c9e0eb;
    border-left-color: var(--opd-blue);
    background: var(--opd-blue-soft);
    color: #24566d;
}

.opd-schedule-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--opd-line);
}

.opd-schedule-heading .opd-panel-title {
    margin-bottom: 0;
}

.opd-date-range {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    color: var(--opd-muted);
    font-size: 12px;
}

.opd-date-range strong {
    color: var(--opd-blue-deep);
    font-size: 15px;
    font-weight: 700;
}

.opd-schedule-table-wrap {
    position: relative;
    overflow-x: auto;
    border: 1px solid var(--opd-line-strong);
    border-radius: 4px;
    background: #fff;
    isolation: isolate;
    scroll-padding-left: 116px;
    scrollbar-color: #9db5bf #edf2f4;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.opd-schedule-table-wrap:focus-visible {
    outline: 3px solid rgba(0, 140, 214, .22);
    outline-offset: 3px;
}

.opd-schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

.opd-schedule-table th,
.opd-schedule-table td {
    border-right: 1px solid var(--opd-line);
    border-bottom: 1px solid var(--opd-line);
}

.opd-schedule-table tr > :last-child {
    border-right: 0;
}

.opd-schedule-table tbody tr:last-child > * {
    border-bottom: 0;
}

.opd-schedule-table thead th {
    padding: 12px 14px;
    background: #eef5f8;
    color: var(--opd-blue-deep);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.opd-schedule-axis,
.opd-schedule-period {
    position: sticky;
    left: 0;
    box-sizing: border-box;
    width: 116px;
    min-width: 116px;
    text-align: left;
    box-shadow: 2px 0 0 #b8c8ce;
}

.opd-schedule-axis {
    z-index: 3;
    background: #0879ae !important;
    color: #fff !important;
    white-space: nowrap;
}

.opd-schedule-period {
    z-index: 2;
    padding: 16px 14px;
    background: #f3f6f7;
    color: var(--opd-blue-deep);
    font-size: 15px;
    font-weight: 700;
    vertical-align: middle;
}

.opd-schedule-date {
    width: 190px;
    min-width: 190px;
    padding: 14px;
    background: #eef5f8;
    text-align: center;
    vertical-align: middle;
}

.opd-schedule-date time,
.opd-schedule-date span {
    display: block;
}

.opd-schedule-date strong {
    color: var(--opd-blue-deep);
    font-size: 15px;
}

.opd-schedule-date span {
    margin-top: 3px;
    color: var(--opd-muted);
    font-size: 12px;
    font-weight: 500;
}

.opd-schedule-cell {
    width: 190px;
    min-width: 190px;
    padding: 8px 10px;
    background: #fff;
    text-align: center;
    vertical-align: top;
}

.opd-schedule-choice {
    display: block;
    width: 100%;
    margin: 0 0 8px;
    padding: 11px 12px;
    border: 1px solid #c8dbe3;
    border-left: 3px solid var(--opd-blue);
    border-radius: 3px;
    background: #fff;
    color: var(--opd-ink);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.opd-schedule-choice:last-child {
    margin-bottom: 0;
}

.opd-schedule-choice:hover,
.opd-schedule-choice:focus {
    border-color: var(--opd-blue);
    background: var(--opd-blue-soft);
    outline: 0;
    box-shadow: 0 2px 7px rgba(0, 109, 159, .09);
}

.opd-schedule-choice:focus-visible {
    outline: 3px solid rgba(0, 140, 214, .22);
    outline-offset: -3px;
}

.opd-schedule-choice:disabled {
    cursor: wait;
    opacity: .68;
}

.opd-schedule-doctor,
.opd-schedule-time {
    display: block;
}

.opd-schedule-doctor {
    color: var(--opd-blue-deep);
    font-size: 15px;
    font-weight: 700;
}

.opd-schedule-time {
    margin-top: 5px;
    color: #4f6f2b;
    font-size: 13px;
    font-weight: 500;
}

.opd-schedule-time::before {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--opd-green);
    content: "";
    vertical-align: 2px;
}

.opd-schedule-empty {
    display: inline-block;
    padding: 15px 0;
    color: #87959b;
    font-size: 13px;
}

.opd-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.opd-empty {
    padding: 42px 18px;
    border: 1px solid var(--opd-line);
    border-left: 5px solid var(--opd-line-strong);
    background: #f8fafb;
    color: var(--opd-muted);
    text-align: center;
}

.opd-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    overflow: hidden;
    border-top: 1px solid var(--opd-line);
    border-left: 1px solid var(--opd-line);
    background: #fff;
}

.opd-summary-item {
    min-height: 86px;
    padding: 15px 16px;
    border-right: 1px solid var(--opd-line);
    border-bottom: 1px solid var(--opd-line);
    background: #fff;
}

.opd-summary-label {
    display: block;
    margin-bottom: 6px;
    color: var(--opd-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
}

.opd-summary-value {
    color: var(--opd-blue-deep);
    font-size: 16px;
    font-weight: 700;
}

.opd-visit-badge {
    display: inline-block;
    margin-bottom: 17px;
    padding: 5px 10px;
    border: 1px solid #b8ced8;
    background: #fff;
    color: var(--opd-blue-deep);
    font-size: 13px;
    font-weight: 700;
}

.opd-validation {
    display: block;
    margin-top: 6px;
    color: var(--opd-danger);
    font-size: 13px;
}

.opd-hint {
    margin: 9px 0 0;
    color: var(--opd-muted);
    font-size: 13px;
    line-height: 1.65;
}

.opd-section-actions {
    margin-top: 22px;
}

.opd-inline-form {
    margin: 0;
}

.opd-confirm-callout {
    padding: 15px 17px;
    border: 1px solid #c9e0eb;
    border-left: 5px solid var(--opd-blue);
    background: var(--opd-blue-soft);
    color: #24566d;
    line-height: 1.75;
}

.opd-result-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    margin-top: 22px;
    padding: 24px 26px;
    border: 1px solid var(--opd-line);
    border-left: 5px solid var(--opd-blue);
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(38, 52, 59, .04);
}

.opd-result-card.is-success {
    border-left-color: var(--opd-green);
}

.opd-result-card.is-error {
    border-left-color: var(--opd-danger);
}

.opd-result-card.is-warning {
    border-left-color: var(--opd-warning);
}

.opd-result-icon {
    display: inline-flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--opd-blue-dark);
    font-size: 28px;
    font-weight: 900;
}

.is-success .opd-result-icon {
    color: var(--opd-green-dark);
}

.is-error .opd-result-icon {
    color: var(--opd-danger);
}

.is-warning .opd-result-icon {
    color: var(--opd-warning);
}

.opd-result-title {
    margin: 0;
    color: var(--opd-blue-deep);
    font-size: 24px;
    font-weight: 700;
}

.opd-result-message {
    margin: 8px 0 0;
    color: #52646c;
    font-size: 16px;
    line-height: 1.75;
}

.opd-number-panel {
    border-left: 5px solid var(--opd-green);
    text-align: center;
}

.opd-registration-number {
    display: block;
    margin-top: 6px;
    color: var(--opd-blue-dark);
    font-size: clamp(30px, 6vw, 48px);
    font-weight: 900;
    letter-spacing: .04em;
}

.opd-estimated-time {
    margin: 9px 0 0;
    color: var(--opd-muted);
    font-size: 14px;
}

@media (max-width: 820px) {
    .opd-site-header-inner,
    .opd-site-footer-inner {
        width: min(100% - 32px, 1180px);
    }

    .opd-site-brand {
        gap: 14px;
    }

    .opd-site-brand img {
        width: 185px;
    }

    .opd-site-service {
        padding-left: 14px;
    }

    .opd-hero {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "context"
            "lead"
            "actions"
            "progress";
        padding: 22px 22px 0;
    }

    .opd-clinic-context {
        margin-top: 14px;
        padding: 14px 16px;
        border: 1px solid #d7e5eb;
        border-left: 4px solid var(--opd-green);
    }

    .opd-progress {
        margin: 20px -22px 0;
        padding: 0 22px;
    }
}

@media (max-width: 640px) {
    .opd-site-header {
        position: static;
    }

    .opd-site-header-inner {
        min-height: 72px;
        gap: 12px;
    }

    .opd-site-brand img {
        width: 150px;
    }

    .opd-site-service {
        display: none;
    }

    .opd-site-contact {
        align-items: flex-end;
        flex-direction: column;
        gap: 0;
    }

    .opd-site-contact span {
        font-size: 11px;
    }

    .opd-site-contact a {
        font-size: 14px;
    }

    .opd-shell {
        padding: 20px 16px 40px;
    }

    .opd-hero {
        padding: 20px 16px 0;
    }

    .opd-title {
        font-size: 28px;
    }

    .opd-clinic-context {
        padding: 13px 14px;
    }

    .opd-clinic-context-name {
        font-size: 18px;
    }

    .opd-lead {
        font-size: 15px;
    }

    .opd-progress {
        margin: 18px -16px 0;
        padding: 0;
    }

    .opd-progress li {
        min-height: 58px;
        flex-direction: column;
        gap: 5px;
        padding: 10px 4px;
        font-size: 11px;
        line-height: 1.3;
        text-align: center;
    }

    .opd-step-number {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
        font-size: 12px;
    }

    .opd-panel {
        margin-top: 14px;
        padding: 18px 16px;
        border-radius: 4px;
    }

    .opd-form-row,
    .opd-actions,
    .opd-hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .opd-field {
        width: 100%;
        flex-basis: auto;
    }

    .opd-actions .opd-button,
    .opd-form-row > .opd-button,
    .opd-hero-actions .opd-button {
        width: 100%;
    }

    .opd-inline-form {
        width: 100%;
    }

    .opd-schedule-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .opd-date-range {
        align-items: flex-start;
    }

    .opd-schedule-table-wrap {
        margin-right: -6px;
        margin-left: -6px;
        scroll-padding-left: 96px;
    }

    .opd-schedule-axis,
    .opd-schedule-period {
        width: 96px;
        min-width: 96px;
    }

    .opd-schedule-date,
    .opd-schedule-cell {
        width: 180px;
        min-width: 180px;
    }

    .opd-result-card {
        grid-template-columns: 1fr;
        padding: 22px 19px;
    }

    .opd-site-footer-inner {
        min-height: 86px;
        align-items: flex-start;
        justify-content: center;
        flex-direction: column;
        gap: 2px;
        padding: 18px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .opd-field input,
    .opd-schedule-choice,
    .opd-button,
    .opd-skip-link {
        transition: none;
    }
}
