:root {
    --masao-yellow: #f9c215;
    --masao-yellow-dark: #dca600;
    --masao-yellow-soft: #fff8dc;
    --masao-brown: #322d24;
    --masao-brown-dark: #211e19;
    --masao-accent: #a76e00;
    --ink: #322d24;
    --muted: #706a60;
    --panel: #fff;
    --canvas: #f6f5f1;
    --border: #dedbd3;
    --shadow: 0 7px 22px rgba(50, 45, 36, .07);
}

.member-body,
.admin-body {
    color: var(--ink);
    background: var(--canvas);
    font-family: "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

.member-body h1,
.member-body h2,
.admin-body h1,
.admin-body h2 {
    margin-top: 0;
    border: 0;
    padding: 0;
    color: var(--ink);
    letter-spacing: .025em;
}

.member-body a,
.admin-body a { color: #7a5300; }

.eyebrow {
    margin: 0 0 5px;
    color: var(--masao-accent);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .16em;
}

.system-card,
.admin-card {
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.flash {
    border-radius: 6px;
    box-shadow: none;
}

.member-body input,
.member-body select,
.member-body textarea,
.admin-body input,
.admin-body select,
.admin-body textarea {
    border: 1px solid #bbb7ae;
    border-radius: 5px;
    background: #fff;
    transition: border-color .16s, box-shadow .16s;
}

.member-body input:focus,
.member-body select:focus,
.member-body textarea:focus,
.admin-body input:focus,
.admin-body select:focus,
.admin-body textarea:focus {
    outline: 0;
    border-color: var(--masao-yellow-dark);
    box-shadow: 0 0 0 3px rgba(249, 194, 21, .24);
}

.member-body .button,
.member-body button.primary,
.admin-body .button,
.admin-body button.primary {
    border: 1px solid var(--masao-yellow-dark);
    border-radius: 5px;
    background: var(--masao-yellow);
    box-shadow: none;
    color: var(--masao-brown);
    transition: background .16s, border-color .16s;
}

.member-body .button:hover,
.member-body button.primary:hover,
.admin-body .button:hover,
.admin-body button.primary:hover {
    border-color: #c79500;
    background: #eeb712;
}

.member-body .button.secondary,
.member-body button.secondary,
.admin-body .button.secondary,
.admin-body button.secondary {
    border-color: var(--masao-brown);
    background: var(--masao-brown);
    color: #fff;
}

.member-body .button.danger,
.member-body button.danger,
.admin-body .button.danger,
.admin-body button.danger {
    border-color: #7c1922;
    background: #8f1c27;
    color: #fff;
}

/* Member */
.member-body .site-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 104px;
    border-top: 6px solid var(--masao-yellow);
    border-bottom: 1px solid var(--border);
    padding: 18px 24px;
    background: #fff;
}

.member-body .site-header img { width: min(340px, 76vw); }

.member-site-label {
    position: absolute;
    right: max(24px, calc((100vw - 1060px) / 2));
    border-left: 3px solid var(--masao-yellow);
    padding-left: 10px;
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
}

.member-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    gap: 0;
    min-height: 50px;
    border-bottom: 3px solid var(--masao-yellow);
    padding: 0 14px;
    background: var(--masao-brown);
}

.member-nav a,
.member-nav button {
    padding: 13px 18px;
    background: transparent;
    color: #fff;
    font-size: .88rem;
    font-weight: 700;
}

.member-nav a:hover,
.member-nav a.active,
.member-nav button:hover {
    background: var(--masao-yellow);
    color: var(--masao-brown);
}

.system-container { max-width: 1080px; margin: 32px auto 68px; }

.system-footer {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 0;
    padding: 30px;
    background: var(--masao-brown-dark);
}

.system-footer span { color: var(--masao-yellow); font-size: .82rem; font-weight: 800; letter-spacing: .18em; }
.system-footer small { color: #c9c3b8; }

.portal-intro {
    max-width: 760px;
    margin: 0 auto 20px;
    border-left: 6px solid var(--masao-yellow);
    padding: 2px 0 2px 18px;
}

.portal-intro h1 { margin: 0 0 7px; font-size: clamp(1.7rem, 4vw, 2.15rem); }
.portal-intro p:last-child { margin: 0; color: var(--muted); font-size: .92rem; }

.auth-portal {
    position: relative;
    overflow: hidden;
    max-width: 760px;
    margin: 0 auto;
    padding: 0;
}

.auth-mode-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.auth-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--border);
    background: #eeece6;
}

.auth-mode-tabs label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    border-bottom: 4px solid transparent;
    padding: 10px 16px 8px;
    color: #615c52;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
}

.auth-mode-tabs label + label { border-left: 1px solid #d6d2c8; }
.auth-mode-tabs label span { margin-bottom: 1px; color: #7d776d; font-size: .7rem; font-weight: 500; }

#auth-mode-login:checked ~ .auth-mode-tabs label[for="auth-mode-login"],
#auth-mode-register:checked ~ .auth-mode-tabs label[for="auth-mode-register"] {
    border-bottom-color: var(--masao-yellow);
    background: #fff;
    color: var(--masao-brown);
}

#auth-mode-login:focus-visible ~ .auth-mode-tabs label[for="auth-mode-login"],
#auth-mode-register:focus-visible ~ .auth-mode-tabs label[for="auth-mode-register"] {
    outline: 3px solid rgba(249, 194, 21, .45);
    outline-offset: -3px;
}

.auth-panel { max-width: 620px; margin: 0 auto; padding: 32px 30px 36px; }
.auth-register-panel { display: none; }
#auth-mode-register:checked ~ .auth-login-panel { display: none; }
#auth-mode-register:checked ~ .auth-register-panel { display: block; }

.auth-panel-heading { margin-bottom: 20px; }
.auth-panel-heading h2 { margin: 0 0 4px; font-size: 1.42rem; }
.auth-panel-heading p:last-child { margin: 0; color: var(--muted); font-size: .88rem; }

.auth-form-grid,
.login-form-grid { display: grid; gap: 7px; }
.auth-form-grid label,
.login-form-grid label { margin-top: 7px; font-size: .84rem; font-weight: 700; }
.auth-form-grid input,
.login-form-grid input { width: 100%; min-height: 47px; padding: 10px 12px; font: inherit; }

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 17px;
    color: #59544c;
    font-size: .82rem;
}

.check-row input { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 3px; }
.auth-actions { align-items: center; justify-content: space-between; }
.auth-actions button { min-width: 150px; }

.registration-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 0 0 16px;
    border: 1px solid #ecdfa9;
    border-radius: 5px;
    padding: 11px;
    background: var(--masao-yellow-soft);
    color: #65531b;
    font-size: .75rem;
}

.registration-flow span { display: flex; align-items: center; gap: 5px; font-weight: 700; white-space: nowrap; }
.registration-flow b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--masao-yellow); color: var(--masao-brown); }
.registration-flow i { color: #a98d39; font-size: 1.2rem; font-style: normal; }

.member-welcome {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-top: 5px solid var(--masao-yellow);
    border-radius: 7px;
    padding: 29px 32px;
    background: #fff;
    box-shadow: var(--shadow);
}

.member-welcome h1 { margin-bottom: 7px; font-size: 1.85rem; }
.member-welcome p:last-child { margin: 0; color: var(--muted); }
.member-welcome dl { display: flex; gap: 12px; margin: 0; }
.member-welcome dl div { min-width: 125px; border: 1px solid var(--border); border-radius: 5px; padding: 13px 15px; background: #faf9f6; }
.member-welcome dt { color: var(--muted); font-size: .72rem; }
.member-welcome dd { margin: 3px 0 0; font-weight: 800; }

.identity-notice {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
    border-left: 4px solid var(--masao-yellow-dark);
    border-radius: 0 5px 5px 0;
    padding: 14px 17px;
    background: var(--masao-yellow-soft);
    color: #65531b;
}

.identity-notice span { font-size: .84rem; }
.member-quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.member-quick-links a { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 6px; padding: 17px 19px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: none; }
.member-quick-links a:hover { border-color: var(--masao-yellow-dark); background: #fffdf5; }
.member-quick-links span { color: var(--muted); font-size: .79rem; }

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; }
.announcement-list article { display: grid; grid-template-columns: 105px 1fr; gap: 20px; border-top: 1px solid var(--border); padding: 17px 0; }
.announcement-list time { color: var(--masao-accent); font-size: .84rem; font-weight: 800; }
.announcement-list article p:first-child { margin-top: 0; }
.count-badge { border-radius: 999px; padding: 4px 10px; background: #ece9e1; color: #635d54; font-size: .77rem; font-weight: 700; }
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 5px; }
.table-scroll table.data { min-width: 720px; border: 0; }
.empty-state { color: var(--muted); text-align: center !important; }

/* Admin */
.admin-header {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 68px;
    border-top: 5px solid var(--masao-yellow);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 3px 12px rgba(50, 45, 36, .05);
}

.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-brand-logo { width: 174px; height: auto; }
.admin-brand span { border-left: 1px solid var(--border); padding-left: 12px; }
.admin-brand small { display: block; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.admin-header-actions { display: flex; align-items: center; gap: 12px; }
.admin-header-actions form { margin: 0; }
.admin-public-link { color: #625d54 !important; font-size: .81rem; font-weight: 700; text-decoration: none; }
.admin-logout { border: 1px solid #cfcac0 !important; border-radius: 5px; background: #fff !important; color: #575148 !important; font-weight: 700; }

.admin-workspace { display: grid; grid-template-columns: 226px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.admin-guest .admin-workspace { display: block; }
.admin-nav { position: sticky; top: 68px; align-self: start; display: block; height: calc(100vh - 68px); overflow-y: auto; padding: 19px 13px 30px; background: var(--masao-brown-dark); }
.admin-nav-label { margin: 14px 11px 6px; color: #887f70; font-size: .61rem; font-weight: 800; letter-spacing: .15em; }
.admin-nav a { display: flex; align-items: center; gap: 10px; margin: 2px 0; border-radius: 4px; padding: 10px 11px; background: transparent; color: #ddd8ce; font-size: .83rem; font-weight: 700; }
.admin-nav a span { display: grid; place-items: center; width: 20px; color: #aaa190; font-size: .83rem; }
.admin-nav a:hover { background: #3a352d; color: #fff; }
.admin-nav a.active { background: var(--masao-yellow); color: var(--masao-brown); }
.admin-nav a.active span { color: var(--masao-brown); }

.admin-container { width: 100%; max-width: 1500px; margin: 0 auto; padding: 27px 30px 70px; }
.admin-guest .admin-container { max-width: 760px; padding-top: 46px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin-bottom: 5px; font-size: 1.85rem; }
.page-heading p:last-child { margin: 0; color: var(--muted); }
.page-heading time { color: var(--muted); font-size: .81rem; white-space: nowrap; }

.metric-grid { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.metric-card { display: flex; flex-direction: column; min-height: 150px; margin: 0; border-top: 4px solid var(--masao-yellow); padding: 19px; color: var(--ink); text-decoration: none; }
.metric-card > span { color: var(--muted); font-size: .79rem; font-weight: 700; }
.metric-card .metric { margin: auto 0 3px; color: var(--masao-brown); font-size: 2.2rem; line-height: 1; }
.metric-card small { color: #888176; }
.metric-card.attention { border-top-color: #b97700; }
.metric-card:hover { border-color: var(--masao-yellow-dark); background: #fffdf7; }

.dashboard-lower-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr); gap: 16px; margin-top: 18px; }
.quick-action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-action-grid a { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 5px; padding: 14px 15px; color: var(--ink); text-decoration: none; }
.quick-action-grid a:hover { border-color: var(--masao-yellow-dark); background: #fffdf5; }
.quick-action-grid span { color: var(--muted); font-size: .77rem; }
.status-card dl { margin: 0 0 18px; }
.status-card dl div { display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--border); padding: 10px 0; }
.status-card dt { color: var(--muted); }
.status-card dd { margin: 0; font-size: .84rem; font-weight: 700; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.status-dot.ok { background: #3da361; box-shadow: 0 0 0 3px #e0f3e6; }
.status-dot.test { background: #d59c20; box-shadow: 0 0 0 3px #fff2cf; }
.full-button { display: block; text-align: center; }

.admin-login-wrap { display: flex; align-items: center; justify-content: center; min-height: 520px; }
.admin-login-card { width: 100%; max-width: 470px; margin: 0; border-top: 5px solid var(--masao-yellow); padding: 32px; }
.login-card-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 11px; }
.login-card-heading p { margin: 0; color: var(--masao-accent); font-size: .67rem; font-weight: 800; letter-spacing: .15em; }
.login-card-heading h1 { margin: 1px 0 0; font-size: 1.5rem; }
.admin-login-lead { margin: 0 0 18px; color: var(--muted); font-size: .85rem; }
.login-submit { width: 100%; margin-top: 24px; padding: 12px 20px !important; }
.login-help { margin: 15px 0 0; color: var(--muted); font-size: .73rem; text-align: center; }

.admin-body .toolbar h1 { margin: 0; }
.admin-body table.data { overflow: hidden; border: 1px solid var(--border); border-radius: 5px; border-collapse: separate; border-spacing: 0; box-shadow: none; }
.admin-body table.data th { border-color: var(--border); background: #eeeae0; color: #575249; font-size: .77rem; }
.admin-body table.data td { border-color: var(--border); background: #fff; }
.admin-body table.data tr:hover td { background: #fffdf5; }
.admin-body .form-grid label { color: #49443c; font-size: .85rem; }
.admin-body .admin-card h2 { margin-top: 0; }

/* Admin lists and forms */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

.admin-list-heading,
.admin-form-heading { align-items: center; }

.heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.admin-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 720px;
    margin: 0 0 20px;
}

.admin-search-form .full-input {
    flex: 1 1 420px;
    width: auto;
    min-width: 220px;
    min-height: 44px;
}

.admin-search-form button,
.admin-search-form .button { flex: 0 0 auto; min-height: 44px; }

.admin-form-page { display: grid; gap: 18px; }
.admin-form-page > .admin-card { margin-bottom: 0; }

.admin-form-section { padding: 25px 28px; }

.admin-form-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 23px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.admin-form-section-heading h2 { margin: 0 0 3px !important; font-size: 1.22rem; }
.admin-form-section-heading p { margin: 0; color: var(--muted); font-size: .82rem; }

.section-number {
    color: #c3bba9;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.required-mark {
    display: inline-block;
    margin-left: 5px;
    border-radius: 3px;
    padding: 1px 5px;
    background: #8f1c27;
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    vertical-align: 1px;
}

.field-help {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: .74rem;
}

.readonly-value {
    min-height: 44px;
    border: 1px solid #dfdcd5;
    border-radius: 5px;
    padding: 9px 12px;
    background: #f5f3ee;
    font-weight: 700;
}

.choice-control {
    display: flex !important;
    align-items: center !important;
    gap: 9px;
    min-height: 44px;
    padding: 9px 12px !important;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #faf9f6;
    font-weight: 700;
    cursor: pointer;
}

.choice-control input,
.choice-card input { flex: 0 0 auto; width: 18px !important; height: 18px; margin: 0; }
.danger-choice { color: #7c1922 !important; }

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

.choice-card {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 74px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 13px 15px;
    background: #faf9f6;
    cursor: pointer;
}

.choice-card:has(input:checked) { border-color: var(--masao-yellow-dark); background: var(--masao-yellow-soft); }
.choice-card span { display: flex; flex-direction: column; }
.choice-card strong { font-size: .86rem; }
.choice-card small { color: var(--muted); font-size: .7rem; }

.inline-field-grid { display: grid; gap: 10px; }
.inline-field-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inline-field-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.inline-field-grid label,
.inline-field-grid > div { min-width: 0; }
.inline-field-grid label { padding: 0 !important; }
.sub-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: .72rem; font-weight: 700; }

.unit-input { display: flex; align-items: center; gap: 9px; }
.unit-input input { max-width: 180px; }
.unit-input span { color: var(--muted); }

.rich-editor-wrap { min-width: 0; }
.rich-toolbar {
    flex-wrap: wrap;
    margin: 0;
    border: 1px solid #bbb7ae;
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    padding: 7px;
    background: #f0eee8;
}
.rich-toolbar button {
    border: 1px solid #cbc6bc;
    border-radius: 3px;
    padding: 5px 9px;
    background: #fff;
    color: var(--ink);
    font-size: .76rem;
    font-weight: 700;
}
.rich-editor {
    min-height: 240px;
    border: 1px solid #bbb7ae;
    border-radius: 0 0 5px 5px;
    padding: 13px;
}
.rich-editor:focus { outline: 0; border-color: var(--masao-yellow-dark); box-shadow: 0 0 0 3px rgba(249, 194, 21, .24); }

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

.upload-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    background: #faf9f6;
}
.upload-item > strong { font-size: .82rem; }
.upload-item img { width: 100%; height: 190px; border-radius: 4px; object-fit: contain; background: #e9e6df; }
.upload-item input[type="file"] { width: 100%; font-size: .76rem; }
.upload-placeholder { display: grid; place-items: center; height: 150px; border: 1px dashed #cbc7be; border-radius: 4px; color: #918a7e; font-size: .78rem; }
.subsection-title { margin: 25px 0 11px; font-size: .95rem; }
.admin-form-section-heading + .subsection-title { margin-top: 0; }

.slot-table { overflow: hidden; border: 1px solid var(--border); border-radius: 6px; }
.slot-table-heading,
.slot-row {
    display: grid;
    grid-template-columns: 66px minmax(110px, 1fr) minmax(110px, 1fr) 100px 140px;
    gap: 9px;
    align-items: center;
}
.slot-table-heading { padding: 8px 12px; background: #e9e5dc; color: #655f55; font-size: .72rem; font-weight: 800; }
.slot-row { border: 0; border-top: 1px solid var(--border); padding: 9px 12px; background: #fff; }
.slot-row:nth-child(odd) { background: #fbfaf7; }
.slot-row label { min-width: 0; padding: 0 !important; }
.slot-row label > span { display: none; }
.slot-row input,
.slot-row select { min-width: 0; width: 100%; padding: 7px 8px; font-size: .82rem; }
.slot-row strong { color: #6e675c; font-size: .78rem; }

.sticky-form-actions {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    border: 1px solid #d2cdbf;
    border-radius: 6px;
    padding: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 7px 24px rgba(50, 45, 36, .16);
    backdrop-filter: blur(5px);
}
.sticky-form-actions button { min-width: 190px; }

.danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 22px;
    border-color: #e4c9cc;
    background: #fffafa;
}
.danger-zone h2 { margin-bottom: 3px !important; font-size: 1.05rem; }
.danger-zone p { margin: 0; color: var(--muted); font-size: .8rem; }
.danger-zone form { flex: 0 0 auto; }

.account-status-list { display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 10px; margin: 0; }
.account-status-list div { border: 1px solid var(--border); border-radius: 5px; padding: 11px 13px; background: #faf9f6; }
.account-status-list dt { color: var(--muted); font-size: .72rem; }
.account-status-list dd { margin: 2px 0 0; font-weight: 800; }
.account-actions-card .form-actions form { margin: 0; }
.muted-copy { margin: 0; color: var(--muted); font-size: .82rem; }

.mailbox-card { padding: 0; overflow: hidden; }
.mailbox-note { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); padding: 14px 18px; background: var(--masao-yellow-soft); color: #65531b; font-size: .82rem; }
.mailbox-note strong { flex: 0 0 auto; border-radius: 999px; padding: 3px 8px; background: var(--masao-yellow); font-size: .68rem; }
.mailbox-content { min-height: 300px; max-height: 66vh; margin: 0; overflow: auto; padding: 20px; background: #1f1f1c; color: #f3f1e9; font: .78rem/1.65 Consolas, "Courier New", monospace; white-space: pre-wrap; word-break: break-word; }

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

@media (max-width: 900px) {
    .member-site-label { display: none; }
    .member-welcome { flex-direction: column; }
    .member-welcome dl { flex-wrap: wrap; }
    .member-quick-links { grid-template-columns: 1fr; }
    .admin-workspace { display: block; }
    .admin-nav { position: sticky; top: 68px; display: flex; height: auto; overflow-x: auto; padding: 8px 12px; }
    .admin-nav-label { display: none; }
    .admin-nav a { flex: 0 0 auto; white-space: nowrap; }
    .admin-container { padding: 24px 18px 60px; }
    .dashboard-lower-grid { grid-template-columns: 1fr; }
    .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .upload-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .member-body .site-header { min-height: 82px; padding: 12px 18px; }
    .member-nav { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
    .member-nav a,
    .member-nav button { white-space: nowrap; padding: 12px 14px; }
    .system-container { margin: 20px auto 45px; padding: 0 13px; }
    .portal-intro { margin-bottom: 16px; padding-left: 13px; }
    .auth-mode-tabs label { min-height: 66px; padding: 8px 7px 6px; font-size: .91rem; }
    .auth-panel { padding: 25px 19px 29px; }
    .registration-flow { flex-wrap: wrap; justify-content: flex-start; }
    .member-welcome { padding: 23px 19px; }
    .member-welcome dl div { flex: 1 1 120px; }
    .announcement-list article { grid-template-columns: 1fr; gap: 5px; }
    .admin-header { padding: 8px 12px; }
    .admin-brand-logo { width: 138px; }
    .admin-brand span,
    .admin-public-link { display: none; }
    .admin-header-actions { gap: 7px; }
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .metric-card { min-height: 135px; padding: 15px; }
    .quick-action-grid { grid-template-columns: 1fr; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .admin-guest .admin-container { padding-top: 26px; }
    .admin-login-wrap { min-height: auto; }
    .admin-login-card { padding: 26px 20px; }
    .admin-body table.data { display: block; overflow-x: auto; white-space: nowrap; }
    .admin-form-section { padding: 20px 16px; }
    .admin-search-form { align-items: stretch; flex-wrap: wrap; }
    .admin-search-form .full-input { flex-basis: calc(100% - 86px); min-width: 0; }
    .heading-actions { align-items: flex-start; flex-direction: column; }
    .inline-field-grid.two-columns,
    .inline-field-grid.three-columns,
    .choice-grid,
    .upload-grid,
    .account-status-list { grid-template-columns: 1fr; }
    .slot-table { border: 0; overflow: visible; }
    .slot-table-heading { display: none; }
    .slot-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 6px; padding: 12px; }
    .slot-row > strong { grid-column: 1 / -1; }
    .slot-row label > span { display: block; margin-bottom: 3px; color: var(--muted); font-size: .68rem; }
    .slot-row label:last-child { grid-column: 1 / -1; }
    .sticky-form-actions { bottom: 7px; }
    .sticky-form-actions button { width: 100%; }
    .danger-zone { align-items: flex-start; flex-direction: column; }
    .mailbox-note { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 430px) {
    .metric-grid { grid-template-columns: 1fr; }
    .auth-actions { align-items: flex-start; flex-direction: column; }
    .auth-actions button { width: 100%; }
}
