:root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
    color: #303030;
    background: #fafafa;
}

* { box-sizing: border-box; }
body { margin: 0; background: #fafafa; }
a { color: #d67e00; text-decoration: none; }
button, input { font: inherit; }

.app-header {
    min-height: 64px;
    padding: 8px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

.brand img { display: block; width: 180px; max-height: 48px; }
.user-menu { position: relative; }
.menu-toggle { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #555; font-size: 1.8rem; line-height: 1; cursor: pointer; list-style: none; }
.menu-toggle::-webkit-details-marker { display: none; }
.menu-toggle:hover { background: #f2f2f2; }
.menu-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: min(310px, calc(100vw - 24px)); padding: 8px 0; background: #fff; border-radius: 4px; box-shadow: 0 3px 12px rgba(0, 0, 0, .2); }
.menu-panel a { padding: 10px 18px; display: flex; align-items: center; gap: 16px; color: #555; font-size: .95rem; white-space: nowrap; }
.menu-panel a:hover { background: #f6f6f6; }
.menu-panel hr { margin: 6px 0; border: 0; border-top: 1px solid #e0e0e0; }
.menu-icon { width: 24px; flex: none; color: #666; font-size: 1.35rem; text-align: center; }
.main-content { padding: 20px; }
.page-section { max-width: 1400px; margin: 0 auto; }
.page-section.narrow { max-width: 760px; }

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    color: #fff;
    background: #f29600;
}

.section-title h1 { margin: 0; font-size: 1.25rem; font-weight: 500; }
.section-title a { color: #fff; font-size: 2rem; line-height: 1; }
.section-title .debug-link { font-size: .85rem; }
.tabs { display: flex; overflow-x: auto; background: #fff; border-bottom: 1px solid #ddd; }
.tab { padding: 14px 20px; border: 0; background: transparent; color: #666; white-space: nowrap; cursor: pointer; }
.tab.active { color: #d67e00; border-bottom: 3px solid #f29600; }

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding-top: 16px;
}

.schedule-card {
    min-height: 174px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .16);
}

.schedule-card.reserved { background: #f0f8ff; }
.schedule-card h2 { margin: 12px 0 6px; font-size: 1.45rem; font-weight: 500; }
.schedule-card p { margin: 4px 0; color: #666; font-size: .9rem; }
.schedule-heading { min-height: 28px; display: flex; align-items: center; gap: 7px; }
.schedule-tags { display: flex; flex: none; flex-wrap: wrap; gap: 3px; }
.schedule-tags:empty { display: none; }
.tag { height: 16px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 999px; font-size: .68rem; line-height: 1; white-space: nowrap; }
.tag.closed { color: #fff; background: #808080; }
.tag.online { color: #fff; background: #e00000; }
.tag.booked { color: #fff; background: #0000cc; }
.tag.reservable { color: #1676c2; border: 1px solid #1e90ff; }
.tag.full { color: #222; border: 1px solid #222; }
.course-name { min-width: 0; text-transform: uppercase; letter-spacing: .08em; }
.schedule-actions { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; }
.schedule-actions:empty { display: none; }
.link-button { padding: 4px 0; border: 0; color: #d67e00; background: none; cursor: pointer; }
.link-button:disabled, .disabled-action { color: #999; cursor: default; }

.debug-description { margin: 16px 0 0; color: #666; }
.debug-schedule-grid { align-items: start; }
.schedule-sample > h2 { margin: 0 0 6px; color: #666; font-size: .8rem; font-weight: 500; }

.plain-layout { width: min(100% - 32px, 440px); margin: 7vh auto; }
.plain-logo { display: block; margin: 0 auto 26px; text-align: center; }
.plain-logo img { width: min(300px, 90%); }
.auth-card, .panel { padding: 28px; background: #fff; border-radius: 5px; box-shadow: 0 2px 8px rgba(0, 0, 0, .16); }
.auth-card h1, .panel h2 { margin-top: 0; }
.auth-card .lead { color: #777; }
label { display: block; margin: 16px 0 5px; color: #555; font-size: .9rem; }
input { width: 100%; margin-top: 5px; padding: 11px; border: 1px solid #aaa; border-radius: 4px; }
button.primary, .button.primary { padding: 11px 18px; border: 1px solid #f29600; border-radius: 4px; color: #fff; background: #f29600; cursor: pointer; text-align: center; }
.wide { display: block; width: 100%; margin-top: 22px; }
.sub-link { display: block; margin-top: 18px; text-align: center; }
.sub-link.left { text-align: left; }
.alert { margin: 14px 0; padding: 12px; border-radius: 4px; }
.alert.error { color: #9b1c1c; background: #fde8e8; }
.alert.success { color: #176b32; background: #e7f6eb; }
.error-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, .4);
}
.error-dialog {
    width: min(100%, 420px);
    padding: 24px;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
}
.error-dialog h2 { margin: 0 0 24px; font-size: 1.25rem; font-weight: 500; }
.error-dialog p { margin: 0; color: #666; }
.error-dialog-actions { display: flex; justify-content: flex-end; margin-top: 32px; }
.error-dialog-actions button { padding: 8px 12px; border: 0; color: #d67e00; background: transparent; cursor: pointer; }
.validation-message { color: #b00020; font-size: .8rem; }
.empty { padding: 28px; text-align: center; color: #777; background: #fff; }

@media (max-width: 1050px) { .schedule-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
    .app-header { padding: 10px 14px; }
    .brand img { width: 140px; }
    .schedule-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .main-content { padding: 12px; }
    .schedule-grid { grid-template-columns: 1fr; }
}
