:root {
    --bg-ink: #09213a;
    --bg-deep: #061526;
    --bg-soft: #eef5fb;
    --surface: #ffffff;
    --surface-muted: #f3f7fb;
    --text-strong: #10253f;
    --text-body: #314763;
    --text-soft: #6c7f97;
    --line: #d5dfeb;
    --accent: #e86a33;
    --accent-deep: #c94f1c;
    --danger: #b6273d;
    --danger-bg: #fdecef;
    --focus: #2d79c7;
    --shadow-lg: 0 24px 56px rgba(7, 26, 49, 0.22);
    --shadow-md: 0 12px 26px rgba(12, 37, 64, 0.13);
    --radius-xl: 24px;
    --radius-lg: 16px;
    --radius-md: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Noto Sans JP", "M PLUS 1p", sans-serif;
    color: var(--text-body);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
}

.body-auth {
    background:
        radial-gradient(65rem 35rem at 15% -10%, rgba(88, 144, 204, 0.33), transparent 75%),
        radial-gradient(52rem 30rem at 100% 0%, rgba(232, 106, 51, 0.26), transparent 75%),
        linear-gradient(170deg, var(--bg-ink), var(--bg-deep));
}

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 2rem 1rem;
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(100%, 27.5rem);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem 1.25rem;
    backdrop-filter: blur(8px);
    animation: rise-in 360ms ease-out both;
}

.auth-badge {
    margin: 0 0 0.55rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.34rem 0.62rem;
    border-radius: 999px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #0b416f;
    background: #dceeff;
}

.auth-title {
    margin: 0;
    color: var(--text-strong);
    font-size: 1.52rem;
    line-height: 1.25;
}

.auth-subtitle {
    margin: 0.6rem 0 1.25rem;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.alert {
    border-radius: var(--radius-md);
    padding: 0.72rem 0.78rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #f7c7d1;
}

.alert-success {
    background: #eaf8ef;
    color: #18633f;
    border: 1px solid #bee3cd;
}

.auth-form {
    display: grid;
    gap: 0.45rem;
}

.field-label {
    color: var(--text-strong);
    font-size: 0.88rem;
    font-weight: 700;
}

.field-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--surface);
    color: var(--text-strong);
    font: inherit;
    font-size: 1rem;
    line-height: 1.25;
    padding: 0.8rem 0.8rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
    margin-bottom: 0.2rem;
}

.field-input:focus {
    outline: none;
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(45, 121, 199, 0.18);
}

.field-input.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(182, 39, 61, 0.14);
}

.field-error {
    margin: 0 0 0.78rem;
    color: var(--danger);
    font-size: 0.82rem;
}

.field-group {
    position: relative;
    margin-bottom: 0.2rem;
}

.field-group .field-input {
    margin-bottom: 0;
    padding-right: 5.35rem;
}

.field-password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0.65rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #5a6f88;
    font-family: inherit;
}

.field-password-toggle:hover {
    color: #183a5d;
}

.field-password-toggle:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
    border-radius: 0.72rem;
}

.field-password-toggle .icon-eye,
.field-password-toggle .icon-eye-off {
    width: 1.2rem;
    height: 1.2rem;
}

.field-password-toggle-text {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.field-password-toggle .icon-eye-off {
    display: none;
}

.field-password-toggle[aria-pressed="true"] .icon-eye {
    display: none;
}

.field-password-toggle[aria-pressed="true"] .icon-eye-off {
    display: block;
}

.btn {
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    padding: 0.82rem 1rem;
    cursor: pointer;
}

.btn-primary {
    margin-top: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #f08742);
    box-shadow: 0 10px 18px rgba(201, 79, 28, 0.3);
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 22px rgba(201, 79, 28, 0.34);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-spinner {
    display: none;
    width: 0.95rem;
    height: 0.95rem;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-top-color: #fff;
    border-radius: 999px;
    animation: spin 0.72s linear infinite;
}

.btn-primary.is-loading .btn-spinner {
    display: inline-block;
}

.btn-primary.is-loading,
.btn-primary:disabled {
    cursor: wait;
    transform: none;
    box-shadow: 0 7px 14px rgba(201, 79, 28, 0.22);
}

.auth-help {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e6ecf3;
    color: var(--text-soft);
    font-size: 0.8rem;
}

.auth-help p {
    margin: 0;
}

.auth-company {
    margin-top: 0.35rem;
}

.body-home {
    background:
        radial-gradient(45rem 20rem at -12% -5%, rgba(100, 156, 224, 0.28), transparent 72%),
        linear-gradient(180deg, #f5f9fe 0%, #edf4fb 100%);
    color: var(--text-body);
}

.home-shell {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1rem 1rem 5rem;
    max-width: 66rem;
    margin: 0 auto;
}

.hero-panel {
    margin-top: 0.5rem;
    padding: 0.75rem 1.2rem;
    border-radius: var(--radius-lg);
    animation: rise-in 380ms ease-out both;
}

.section-panel {
    margin-top: 0.5rem;
    padding: 0.82rem 1.2rem;
    background: #ffffff;
    border: 1px solid #dce5f0;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 18px rgba(12, 37, 64, 0.08);
    animation: rise-in 380ms ease-out both;
}

.hero-panel {
    position: relative;
    min-height: 14rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background:
        linear-gradient(180deg,
            rgba(33, 74, 114, 0) 40%,
            rgba(20, 50, 84, 0.24) 80%,
            rgba(10, 28, 48, 0.65) 100%),
        url("../images/top-hero.jpg");
    background-size: cover;
    background-position: center 28%;
    color: #fff;
    border: 0;
}

.hero-copy-panel {
    display: inline-flex;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.62rem 0.78rem;
    border-radius: 0.86rem;
    max-width: min(100%, 31rem);
    background: linear-gradient(145deg, rgba(5, 22, 41, 0.7), rgba(8, 30, 55, 0.56));
    border: 1px solid rgba(255, 255, 255, 0.26);
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
    backdrop-filter: blur(4px);
}

.hero-logout-form {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    margin: 0;
}

.hero-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.3rem 0.65rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border: 0;
    border-radius: 999px;
    color: var(--text-strong);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
    transition: background 0.14s ease, box-shadow 0.14s ease;
}

.hero-logout-btn:hover {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.34);
}

.hero-logout-btn .material-symbols-outlined {
    font-size: 1rem;
    line-height: 1;
}

.hero-day {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-soft);
}

.hero-title {
    margin: 0.42rem 0 0.58rem;
    line-height: 1.35;
    font-size: 1.2rem;
    color: var(--text-strong);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-soft);
}

.hero-panel .hero-day {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.hero-panel .hero-title {
    color: #ffffff;
    margin: 0.18rem 0 0;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.7),
        0 4px 10px rgba(0, 0, 0, 0.5);
}

.hero-panel .hero-meta {
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

header.section-panel {
    position: relative;
    overflow: hidden;
    padding: 1rem 1.4rem 1rem;
    background:
        linear-gradient(135deg, #1a5fa8 0%, #2479c7 55%, #1e90c4 100%);
    border: none;
    box-shadow:
        0 4px 20px rgba(26, 95, 168, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* subtle mesh pattern */
header.section-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 80% -20%, rgba(255, 255, 255, 0.12) 0%, transparent 55%),
        radial-gradient(circle at -10% 110%, rgba(0, 180, 255, 0.12) 0%, transparent 50%);
    pointer-events: none;
}

/* accent bar at the bottom edge */
header.section-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.1) 60%, transparent);
}

header.section-panel .hero-day {
    margin: 0 0 0.18rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    color: rgba(255, 255, 255, 0.72);
    text-shadow: none;
}

header.section-panel .hero-title {
    margin: 0 0 0.1rem;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.3;
    color: #ffffff;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

header.section-panel .hero-meta {
    margin: 0.3rem 0 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: none;
    gap: 0.3rem 0.7rem;
}

.notice-form {
    display: grid;
    gap: 0.45rem;
}

.manage-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.72rem;
}

.notice-textarea {
    min-height: 6.8rem;
    resize: vertical;
}

.notice-submit {
    width: fit-content;
    min-width: 9.8rem;
}

.notice-admin-text {
    margin: 0 0 0.75rem;
    color: var(--text-soft);
}

.class-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.55rem;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    margin-bottom: 0.2rem;
}

.class-chip-group.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(182, 39, 61, 0.14);
}

.class-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.3rem 0.72rem;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.14s, background 0.14s, color 0.14s, box-shadow 0.14s;
}

.class-chip input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    overflow: hidden;
}

.class-chip:hover {
    border-color: var(--focus);
    background: rgba(45, 121, 199, 0.07);
    color: var(--text-strong);
}

.class-chip:has(input:checked) {
    border-color: var(--focus);
    background: var(--focus);
    color: #fff;
    box-shadow: 0 2px 8px rgba(45, 121, 199, 0.3);
}

.class-chip:has(input:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.class-chip-code {
    font-size: 0.75rem;
    opacity: 0.6;
}

.class-chip:has(input:checked) .class-chip-code {
    opacity: 0.85;
}

.manage-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.manage-link-btn {
    text-decoration: none;
    background: #ffffff;
    color: var(--text-strong);
    border: 1px solid #c6d4e4;
}

.manage-delete-btn {
    background: #fff6f8;
    color: var(--danger);
    border: 1px solid #f2ccd3;
}

.section-title {
    margin: 0 0 0.3rem;
    color: var(--text-strong);
    font-size: 1rem;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
}

.menu-card {
    display: block;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: 1px solid #d5dfeb;
    background: var(--surface-muted);
    color: var(--text-strong);
    padding: 0.85rem 0.72rem;
    font-weight: 700;
    font-size: 0.87rem;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.menu-card:not(.is-disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(12, 37, 64, 0.14);
}

.is-disabled {
    color: #8a9cb3;
    cursor: not-allowed;
    pointer-events: none;
}

.notice-list {
    display: grid;
    gap: 0.2rem;
}

.notice-item {
    background: #f7fbff;
    border: 1px solid #d8e6f6;
    border-radius: var(--radius-md);
    padding: 0.3rem 0.68rem;
}

.notice-item h3 {
    margin: 0.08rem 0 0.18rem;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--text-strong);
}

.notice-item p {
    margin: 0;
    line-height: 1.45;
}

.notice-body {
    margin-top: 0.06rem;
    font-size: 0.85rem;
}

.notice-body p {
    margin: 0.08rem 0 0.16rem;
}

.notice-period {
    margin-top: 0.2rem !important;
    color: var(--text-soft);
    font-size: 0.74rem;
}

.notice-date {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.74rem;
}

.notice-title {
    display: block;
    margin-top: 0.18rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.35;
}

.notice-class {
    margin-left: 0.5rem;
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #dceeff;
    color: #0b416f;
    font-size: 0.72rem;
    font-weight: 700;
}

.manage-item-actions {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.manage-delete-form {
    margin: 0;
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.doc-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface-muted);
    color: var(--text-strong);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.14s ease, box-shadow 0.14s ease;
}

.doc-link:not(.is-disabled):hover {
    background: #e6eef8;
    box-shadow: 0 4px 10px rgba(12, 37, 64, 0.1);
}

.doc-link .material-symbols-outlined {
    font-size: 1.25rem;
    color: var(--text-soft);
    flex-shrink: 0;
}

.timesheet-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), #f08742);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 6px 16px rgba(201, 79, 28, 0.28);
    animation: rise-in 380ms ease-out both;
}

.timesheet-banner .material-symbols-outlined {
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.contact-panel {
    border-top: 3px solid var(--accent);
}

.contact-list {
    display: grid;
    gap: 1rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.contact-name {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-soft);
    letter-spacing: 0.03em;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--focus);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    width: fit-content;
}

.contact-link:hover {
    text-decoration: underline;
}

.contact-link .material-symbols-outlined {
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-soft);
    flex-shrink: 0;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0.25rem 0.25rem env(safe-area-inset-bottom, 0);
    background: rgba(10, 31, 54, 0.94);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 3.5rem;
    padding: 0.4rem 0.25rem;
    border-radius: 0.75rem;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-family: inherit;
    text-decoration: none;
    transition: color 0.14s ease;
}

.bottom-nav-item.active {
    color: var(--accent);
    position: relative;
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    inset: 0.15rem 0.2rem;
    border-radius: 0.65rem;
    background: rgba(232, 106, 51, 0.14);
}

.bottom-nav-item.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.bottom-nav-icon {
    font-size: 1.5rem;
    line-height: 1;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.bottom-nav-item.active .bottom-nav-icon {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.bottom-nav-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
}

/* ============================================================
   Profile
   ============================================================ */

.profile-summary-panel {
    padding: 0.75rem;
}

.profile-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.45rem;
}

.profile-summary-title {
    margin: 0;
}

.profile-photo-thumb {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: cover;
    border: 1px solid #9fb4c9;
    border-radius: 50%;
    margin-bottom: 0.5rem;
}

.profile-change-link {
    color: var(--focus);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.profile-change-link:hover {
    text-decoration: underline;
}

.profile-change-link.is-disabled {
    color: #8a9cb3;
    pointer-events: none;
    cursor: default;
}

.profile-summary-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #9fb4c9;
    font-size: 0.84rem;
}

.profile-summary-table th,
.profile-summary-table td {
    border: 1px solid #9fb4c9;
    padding: 0.45rem 0.5rem;
    vertical-align: top;
}

.profile-summary-table th {
    width: 34%;
    background: #e3f1f7;
    color: var(--text-strong);
    text-align: left;
    font-weight: 700;
}

.profile-summary-table td {
    background: #f9fbff;
    color: var(--text-body);
}

.profile-edit-form {
    display: grid;
    gap: 0.8rem;
}

.profile-edit-grid {
    display: grid;
    gap: 0.6rem;
}

.work-edit-grid {
    display: grid;
    gap: 0.7rem;
}

.work-edit-card {
    border: 1px solid #c6d6e6;
    border-radius: var(--radius-md);
    background: #f8fbff;
    padding: 0.65rem;
}

.work-edit-title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: var(--text-strong);
}

.work-edit-note {
    margin: -0.2rem 0 0.45rem;
    color: var(--danger);
    font-size: 0.84rem;
    font-weight: 700;
}

.profile-photo-preview {
    display: block;
    width: 150px;
    height: auto;
    border: 1px solid #9fb4c9;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.work-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.work-chip {
    position: relative;
    display: inline-block;
}

.work-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.work-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.3rem;
    padding: 0.35rem 0.85rem;
    border-radius: 0.65rem;
    border: 1px solid #c9d6e5;
    background: #f4f6f9;
    color: var(--text-strong);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    white-space: nowrap;
    transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.work-chip input:checked + span {
    border-color: #7eaedb;
    background: #e8f3ff;
    color: #184d86;
}

.work-chip input:focus-visible + span {
    outline: none;
    box-shadow: 0 0 0 3px rgba(45, 121, 199, 0.18);
}

.work-chip-grid--compact .work-chip span {
    min-width: 7.2rem;
}

.work-count-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.work-count-item .field-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.84rem;
}

.profile-edit-item .field-input {
    margin-bottom: 0;
}

.field-input--readonly {
    margin: 0;
    background: var(--surface-muted);
    color: var(--text-soft);
}

.station-edit-grid {
    display: grid;
    gap: 0.7rem;
}

.station-edit-card {
    border: 1px solid #c6d6e6;
    border-radius: var(--radius-md);
    background: #f7fbff;
    padding: 0.65rem;
}

.station-edit-title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    color: var(--text-strong);
}

.station-edit-item {
    margin-bottom: 0.45rem;
}

.station-edit-item:last-child {
    margin-bottom: 0;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 768px) {
    .auth-shell {
        padding: 2.5rem 1.2rem;
    }

    .auth-card {
        width: min(100%, 29rem);
        padding: 1.8rem 1.55rem;
    }

    .auth-title {
        font-size: 1.74rem;
    }

    .home-shell {
        padding: 1.6rem 1.3rem 5rem;
    }

    .hero-title {
        font-size: 1.5rem;
    }

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

/* ============================================================
   Schedule / Shift
   ============================================================ */

.schedule-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.schedule-month-form {
    display: flex;
    align-items: center;
}

.schedule-month-select {
    width: auto;
    min-width: 8rem;
    padding: 0.32rem 0.7rem;
    font-size: 0.9rem;
}

.schedule-status-bar {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
    font-size: 0.85rem;
}

.schedule-status {
    font-weight: 700;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
}

.schedule-status.is-submitted {
    background: rgba(45, 121, 199, 0.12);
    color: var(--focus);
}

.schedule-status.is-pending {
    background: rgba(232, 106, 51, 0.12);
    color: var(--accent);
}

.schedule-deadline-badge {
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    color: var(--text-soft);
}

.schedule-deadline-badge.is-over {
    background: var(--danger-bg);
    border-color: #f7c7d1;
    color: var(--danger);
}

.schedule-deadline-notice {
    margin-bottom: 0.75rem;
}

.schedule-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

/* Calendar grid */
.schedule-calendar {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: 0.875rem;
}

.schedule-header,
.schedule-row {
    display: grid;
    grid-template-columns: 5.5rem 1fr 1fr;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.schedule-header {
    background: var(--surface-muted);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-soft);
    padding: 0.3rem 0;
}

.schedule-row:last-child {
    border-bottom: none;
}

.schedule-row.is-saturday {
    background: rgba(45, 121, 199, 0.04);
}

.schedule-row.is-sunday {
    background: rgba(232, 106, 51, 0.04);
}

.schedule-row.is-gw {
    background: rgba(45, 199, 121, 0.04);
}

.schedule-row.is-confirmed {
    background: rgba(45, 121, 199, 0.07);
}

.schedule-date-cell,
.schedule-flag-cell,
.schedule-cond-cell,
.schedule-shift-cell {
    padding: 0.38rem 0.55rem;
}

.schedule-date-cell {
    font-weight: 600;
    font-size: 0.83rem;
    border-right: 1px solid var(--line);
}

.schedule-date-label {
    display: block;
}

.text-saturday {
    color: var(--focus);
}

.text-sunday {
    color: var(--accent);
}

/* Radio flag pills */
.schedule-flag-cell {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.sched-flag-label {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.sched-flag-radio {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    clip: rect(0, 0, 0, 0);
    overflow: hidden;
    white-space: nowrap;
}

.sched-flag-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--text-soft);
    font-size: 0.82rem;
    font-weight: 600;
    transition: border-color 0.13s, background 0.13s, color 0.13s;
    user-select: none;
}

.sched-flag-label:hover .sched-flag-pill {
    border-color: #aab8cc;
    background: var(--surface-muted);
}

/* Checked states via sibling selector */
.sched-flag-radio:checked+.sched-flag-pill.sched-flag-maru {
    border-color: #27a860;
    background: #27a860;
    color: #fff;
    box-shadow: 0 1px 6px rgba(39, 168, 96, 0.3);
}

.sched-flag-radio:checked+.sched-flag-pill.sched-flag-sanka {
    border-color: #d68a00;
    background: #f0a800;
    color: #fff;
    box-shadow: 0 1px 6px rgba(240, 168, 0, 0.3);
}

.sched-flag-radio:checked+.sched-flag-pill.sched-flag-batsu {
    border-color: #6c7f97;
    background: #6c7f97;
    color: #fff;
    box-shadow: 0 1px 6px rgba(108, 127, 151, 0.25);
}

.sched-flag-radio:focus-visible+.sched-flag-pill {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* Static pills (confirm/view pages) */
.sched-flag-pill--static {
    pointer-events: none;
}

.sched-flag-pill--static.sched-flag-maru {
    border-color: #27a860;
    background: #27a860;
    color: #fff;
}

.sched-flag-pill--static.sched-flag-sanka {
    border-color: #d68a00;
    background: #f0a800;
    color: #fff;
}

.sched-flag-pill--static.sched-flag-batsu {
    border-color: #6c7f97;
    background: #6c7f97;
    color: #fff;
}

/* Conditions cell */
.schedule-cond-cell {
    min-width: 0;
}

.schedule-cond-cell.is-hidden {
    visibility: hidden;
    pointer-events: none;
}

.schedule-cond-input {
    padding: 0.25rem 0.5rem;
    font-size: 0.82rem;
    border-radius: 0.5rem;
    margin-bottom: 0;
}

.schedule-cond-text {
    font-size: 0.82rem;
    color: var(--text-soft);
}

/* Confirmed schedule (view) */
.schedule-shift-cell {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.schedule-shift-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.55rem;
    background: rgba(45, 121, 199, 0.12);
    color: var(--focus);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.schedule-case-id {
    font-size: 0.75rem;
    opacity: 0.8;
}

.schedule-confirmed-badge {
    font-size: 0.72rem;
    padding: 0.1rem 0.4rem;
    background: rgba(39, 168, 96, 0.12);
    color: #27a860;
    border-radius: 999px;
    font-weight: 600;
}

.schedule-no-shift {
    color: var(--text-soft);
    font-size: 0.85rem;
}

.schedule-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--text-soft);
    text-align: center;
}

.schedule-empty .material-symbols-outlined {
    font-size: 2.5rem;
    opacity: 0.5;
}

/* Read-only calendar */
.schedule-calendar--readonly .schedule-row {
    grid-template-columns: 5.5rem 1fr 1fr;
}

.schedule-calendar--readonly .schedule-shift-cell {
    grid-column: 2 / -1;
}

@media (max-width: 480px) {

    .work-count-grid {
        grid-template-columns: 1fr;
    }

    .profile-summary-table th,
    .profile-summary-table td {
        display: block;
        width: 100%;
    }

    .profile-summary-table th {
        border-bottom: 0;
    }

    .profile-summary-table td {
        border-top: 0;
    }

    .schedule-header,
    .schedule-row {
        grid-template-columns: 4.5rem 1fr;
    }

    .schedule-cond-cell {
        grid-column: 1 / -1;
        padding-top: 0;
    }

    .schedule-cond-cell.is-hidden {
        display: none;
    }
}

/* ============================================================
   Schedule Legacy Mock
   ============================================================ */

.body-schedule-legacy {
    background: #e5e5e5;
}

.legacy-schedule-shell {
    width: min(100%, 390px);
    margin: 0 auto;
    padding: 0 0 1.2rem;
    color: #222;
}

.legacy-schedule-topbar {
    position: relative;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: linear-gradient(180deg, #0f5f95, #0b4c77);
    color: #fff;
    padding: 0.48rem 0.72rem;
    border-bottom: 1px solid #093a5c;
}

.legacy-schedule-title {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.2;
    font-weight: 700;
}

.legacy-schedule-title span {
    font-size: 0.95rem;
    font-weight: 700;
}

.legacy-topbar-nav-wrap {
    position: relative;
    flex-shrink: 0;
}

.legacy-nav-drawer {
    position: relative;
}

.legacy-nav-drawer > summary {
    list-style: none;
    cursor: pointer;
}

.legacy-nav-drawer > summary::-webkit-details-marker {
    display: none;
}

.legacy-nav-toggle {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.legacy-nav-drawer[open] .legacy-nav-toggle {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.75);
}

.legacy-nav-toggle .material-symbols-outlined {
    font-size: 1.2rem;
    line-height: 1;
}

.legacy-nav-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 40;
    min-width: 11.5rem;
    max-width: min(16rem, calc(100vw - 1.5rem));
    padding: 0.35rem 0;
    border: 1px solid #093a5c;
    border-radius: 0.4rem;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.legacy-nav-menu {
    display: flex;
    flex-direction: column;
}

.legacy-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.52rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: #0b4c77;
    text-decoration: none;
    text-align: left;
    border: 0;
    background: transparent;
    font-family: inherit;
    line-height: 1.2;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: background 0.12s ease;
}

a.legacy-nav-link:hover,
button.legacy-nav-link:hover {
    background: #e8f2fa;
    text-decoration: none;
}

.legacy-nav-link-form {
    margin: 0;
}

.legacy-nav-link .material-symbols-outlined {
    font-size: 1.15rem;
    line-height: 1;
    color: #1465ab;
    flex-shrink: 0;
}

.legacy-nav-link--current {
    cursor: default;
    color: #08578d;
    background: #f0f4e0;
}

.legacy-nav-link--current .material-symbols-outlined {
    color: #0b4c77;
}

.legacy-nav-link--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    color: #6e7a8a;
}

.legacy-nav-link--disabled .material-symbols-outlined {
    color: #8a96a8;
}

.app-nav-drawer-floating {
    position: fixed;
    top: calc(0.45rem + env(safe-area-inset-top, 0px));
    right: calc(0.45rem + env(safe-area-inset-right, 0px));
    z-index: 100;
}

.app-nav-drawer-floating .legacy-nav-toggle {
    background: linear-gradient(180deg, #0f5f95, #0b4c77);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 2px 10px rgba(9, 58, 92, 0.35);
}

.app-nav-drawer-floating .legacy-nav-drawer[open] .legacy-nav-toggle {
    background: linear-gradient(180deg, #1270ad, #0d5a8f);
    border-color: rgba(255, 255, 255, 0.75);
}

.legacy-menu-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.legacy-menu-btn .material-symbols-outlined {
    font-size: 1.15rem;
}

.legacy-email-row {
    padding: 0.32rem 0.75rem;
    border-bottom: 1px solid #cfd6dd;
    background: #f8f8f8;
    font-size: 0.76rem;
}

.legacy-email-row a {
    color: #1166cc;
    text-decoration: underline;
}

.legacy-month-panel {
    padding: 0.2rem 0.45rem 0;
}

.legacy-month-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.15rem;
    margin-bottom: 0.2rem;
    font-size: 0.94rem;
    font-weight: 700;
}

.legacy-month-nav a {
    text-align: center;
    color: #1465ab;
    text-decoration: underline;
    padding: 0.12rem 0.2rem;
    border: 1px solid #6f7d87;
    background: #e8edf2;
}

.legacy-month-current {
    text-align: center;
    padding: 0.18rem 0.35rem;
    border: 1px solid #7f8d97;
    background: #e6e7b8;
    color: #08578d;
}

.legacy-month-current--input {
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

.legacy-month-current--input:hover,
.legacy-month-current--input:focus-visible {
    background: #dcdea0;
}

.legacy-month-current--input::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

.legacy-shift-info {
    margin-top: 0.35rem;
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
    line-height: 1.35;
}

.legacy-shift-status {
    margin-bottom: 0.2rem;
}

.legacy-shift-status a {
    margin-left: 0.45rem;
    color: #105a9a;
    text-decoration: underline;
    font-weight: 700;
}

.legacy-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.35rem;
    padding: 0.2rem 0.7rem;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    vertical-align: middle;
}

.legacy-status-badge .material-symbols-outlined {
    font-size: 1.2rem;
}

.legacy-status-badge.is-submitted {
    background: #dff2e3;
    color: #1c7a3d;
}

.legacy-status-badge.is-pending {
    background: #fdecd2;
    color: #a85c00;
}

.legacy-status-badge.is-editing {
    background: #dce8fa;
    color: #0c5ea5;
}

.legacy-shift-locked {
    margin-left: 0.4rem;
    color: #aa2f22;
    font-size: 0.84rem;
}

.legacy-shift-note {
    margin-top: 0.08rem;
    color: #32506a;
    font-size: 0.8rem;
}

.legacy-shift-note.is-danger {
    color: #b33327;
}

.legacy-shift-note.is-deadline-alert {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.4rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid #b33327;
    border-radius: 0.3rem;
    background: #fbe4e1;
    color: #8f261c;
    font-size: 0.85rem;
    font-weight: 700;
}

.legacy-shift-note.is-deadline-alert .material-symbols-outlined {
    font-size: 1.1rem;
    color: #b33327;
}

.legacy-shift-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.legacy-quick-btn {
    border: 1px solid #8c9ba7;
    border-radius: 0.35rem;
    background: linear-gradient(180deg, #ffffff, #dce3ea);
    color: #183d61;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.52rem;
}

.legacy-quick-btn:disabled {
    opacity: 0.58;
    color: #6e7277;
}

.legacy-shift-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.82rem;
    border: 1px solid #757f89;
    background: #fff;
}

.legacy-shift-table th,
.legacy-shift-table td {
    border: 1px solid #757f89;
    padding: 0.22rem 0.3rem;
    vertical-align: middle;
}

.legacy-shift-table th {
    background: #d3e4f0;
    color: #25313d;
    text-align: center;
    font-size: 0.72rem;
    line-height: 1.25;
}

.legacy-shift-table td {
    background: #f6f6f6;
}

.legacy-shift-table.is-past-deadline td {
    background: #dcdcdc;
    color: #8a8f94;
}

.legacy-shift-table.is-past-deadline th {
    background: #c7ccd1;
}

.legacy-shift-table tr.is-sat .legacy-shift-date span {
    color: #205ec5;
}

.legacy-shift-table tr.is-sun .legacy-shift-date span {
    color: #c54135;
}

.legacy-shift-date {
    width: 5.2rem;
    text-align: center;
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
}

.legacy-shift-flag-cell {
    width: 8.6rem;
    text-align: center;
    white-space: nowrap;
}

.legacy-flag-option {
    display: inline-flex;
    align-items: center;
    margin-right: 0.22rem;
    cursor: pointer;
}

.legacy-flag-option:last-child {
    margin-right: 0;
}

.legacy-flag-radio {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.legacy-flag-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    height: 1.6rem;
    border: 1px solid #9ca8b4;
    border-radius: 0.32rem;
    background: linear-gradient(180deg, #ffffff, #d8dfe6);
    font-size: 0.92rem;
    font-weight: 700;
    color: #233242;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
    transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.legacy-flag-radio:focus-visible + .legacy-flag-chip {
    outline: 2px solid #2d79c7;
    outline-offset: 1px;
}

.legacy-flag-radio:checked + .legacy-flag-chip {
    color: #fff;
}

.legacy-flag-radio:checked + .legacy-flag-chip.is-maru {
    border-color: #2a9c5d;
    background: linear-gradient(180deg, #3cc170, #248f53);
}

.legacy-flag-radio:checked + .legacy-flag-chip.is-sankaku {
    border-color: #c38814;
    background: linear-gradient(180deg, #f1b335, #d8940b);
}

.legacy-flag-radio:checked + .legacy-flag-chip.is-batsu {
    border-color: #7a8896;
    background: linear-gradient(180deg, #8f9eac, #6f7f8f);
}

.legacy-flag-radio:disabled + .legacy-flag-chip {
    opacity: 0.58;
    cursor: not-allowed;
}

.legacy-shift-cond-cell {
    width: auto;
}

.legacy-shift-cond {
    margin: 0;
    padding: 0.26rem 0.38rem;
    border-radius: 0.35rem;
    font-size: 0.82rem;
}

.legacy-shift-readonly {
    text-align: center;
    font-size: 0.98rem;
    font-weight: 700;
}

.legacy-shift-readonly-cond {
    font-size: 0.84rem;
    color: #3b4650;
    word-break: break-word;
}

.legacy-shift-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.38rem;
    margin-top: 0.45rem;
}

.legacy-submit-btn {
    border: 1px solid #c8b357;
    border-radius: 0.35rem;
    background: linear-gradient(180deg, #ffe98f, #f2d65f);
    color: #233e5c;
    font-size: 0.92rem;
    font-weight: 700;
    padding: 0.34rem 0.7rem;
}

.legacy-sub-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    border: 1px solid #8b97a3;
    border-radius: 0.35rem;
    background: linear-gradient(180deg, #ffffff, #dfe6ee);
    color: #20394f;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.2rem 0.58rem;
}

.legacy-main-table-wrap {
    border: 1px solid #666;
    background: #d7d7d7;
}

.legacy-main-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.78rem;
}

.legacy-main-table th,
.legacy-main-table td {
    border: 1px solid #6b6b6b;
    vertical-align: middle;
}

.legacy-main-table th {
    background: #d8e3e8;
    color: #24323f;
    font-weight: 700;
    text-align: center;
    padding: 0.14rem 0.16rem;
    font-size: 0.66rem;
    line-height: 1.25;
}

.legacy-main-table .legacy-th-sub {
    font-size: 0.6rem;
}

.legacy-main-table tr.has-shift td {
    background: #bff0bf;
}

.legacy-main-table tr.is-sat .legacy-date-label {
    color: #1c57c8;
}

.legacy-main-table tr.is-sun .legacy-date-label {
    color: #cc3e2f;
}

.legacy-date-cell {
    width: 3.45rem;
    text-align: center;
    padding: 0.18rem 0.12rem;
}

.legacy-date-label {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.legacy-check-btn {
    margin-top: 0.24rem;
    width: 2rem;
    height: 1.62rem;
    border: 1px solid #3f4750;
    border-radius: 0.28rem;
    background: linear-gradient(180deg, #3b434d, #1f262f);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.legacy-status-cell {
    width: 1.55rem;
    padding: 0.1rem;
}

.legacy-site-cell {
    width: 8.8rem;
    padding: 0.2rem 0.2rem 0.2rem 0.24rem;
}

.legacy-site-link {
    color: #1f69bf;
    text-decoration: underline;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.25;
}

.legacy-time {
    margin-top: 0.1rem;
    color: #2f4d43;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.15;
}

.legacy-staff-cell {
    width: 2.35rem;
    text-align: center;
}

.legacy-staff-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    border: 1px solid #2f6e9f;
    border-radius: 0.32rem;
    background: linear-gradient(180deg, #3e8fcb, #2c6da0);
    color: #fff;
    font-size: 0.64rem;
    padding: 0.06rem 0.15rem;
    font-weight: 700;
}

.legacy-job-cell {
    width: 1.8rem;
    text-align: center;
    font-size: 0.79rem;
    padding: 0.2rem 0;
}

.legacy-action-cell {
    width: 2.05rem;
    text-align: center;
    padding: 0.16rem 0.04rem;
}

.legacy-action-btn {
    min-width: 1.75rem;
    height: 1.8rem;
    border: 1px solid #a3a3a3;
    border-radius: 0.35rem;
    background: linear-gradient(180deg, #ffffff, #d7d7d7);
    color: #22313d;
    font-weight: 700;
    font-size: 0.82rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.legacy-action-btn.is-outline {
    border-style: dashed;
    background: #f9f9f2;
}

.legacy-sub-panel {
    margin: 0.45rem 0.45rem 0;
    border: 1px solid #7c8a93;
    background: #ededed;
}

.legacy-sub-panel h2 {
    margin: 0;
    text-align: center;
    font-size: 1.02rem;
    color: #274a5f;
    font-weight: 700;
    padding: 0.23rem 0.35rem;
    border-bottom: 1px solid #7c8a93;
    background: #dce8ef;
}

.legacy-simple-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.9rem;
}

.legacy-simple-table td {
    border: 1px solid #7c8a93;
    background: #f7f7f7;
    padding: 0.22rem 0.28rem;
    line-height: 1.25;
}

.legacy-simple-table td.no {
    width: 1.2rem;
    text-align: center;
    background: #f2f2f2;
}

.legacy-simple-table td.name {
    font-size: 0.96rem;
}

.legacy-simple-table td.job {
    width: 1.5rem;
    text-align: center;
}

.legacy-simple-table td.btn-col {
    width: 3.5rem;
    text-align: center;
    background: #f0f0f0;
}

.legacy-simple-table td.status {
    width: 1.8rem;
    text-align: center;
    color: #d6352a;
    font-size: 1.15rem;
    font-weight: 700;
    background: #f6f6f6;
}

.legacy-simple-table td.empty {
    text-align: center;
    color: #4f5a62;
    background: #f9f9f9;
}

.legacy-apply-btn {
    width: 3.1rem;
    height: 2rem;
    border: 1px solid #cfbc6d;
    border-radius: 0.4rem;
    background: linear-gradient(180deg, #f9e789, #f3d85f);
    color: #21405b;
    font-size: 1rem;
    font-weight: 700;
    padding: 0;
}

.legacy-mini-btn {
    width: 3.15rem;
    min-height: 1.7rem;
    border: 1px solid #3f6789;
    border-radius: 0.35rem;
    background: linear-gradient(180deg, #fefefe, #d9ebfb);
    color: #163f64;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 0.1rem 0.2rem;
}

.legacy-mini-btn.is-green {
    border-color: #387340;
    background: linear-gradient(180deg, #3ab156, #1c8c39);
    color: #fff;
}

.legacy-home-row {
    padding: 0.75rem 0.58rem 0.2rem;
}

.legacy-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.48rem 0.78rem;
    border-radius: 0.36rem;
    border: 1px solid #3f6b92;
    background: linear-gradient(180deg, #74a8d6, #3f79ad);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.94rem;
}

.legacy-home-btn .material-symbols-outlined {
    font-size: 1.05rem;
    line-height: 1;
}

.legacy-footer {
    padding: 0.3rem 0.6rem 0.6rem;
    text-align: center;
    color: #525252;
    font-size: 0.7rem;
}

@media (min-width: 768px) {
    .legacy-schedule-shell {
        margin-top: 0.35rem;
        border: 1px solid #b9c2ca;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    }
}

/* ============================================================
   Payroll / 給与明細  (compact 1-screen layout)
   ============================================================ */

/* 専用シェル: home-shell より余白を大幅に削減 */
.payroll-shell {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0.4rem 0.55rem 6rem;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    font-size: 0.78rem;
    color: var(--text-body);
}

/* ヘッダーバー: タイトル + 月ナビ */
.payroll-header-bar {
    background: linear-gradient(135deg, #1a5fa8 0%, #2479c7 55%, #1e90c4 100%);
    border-radius: var(--radius-md);
    padding: 0.38rem 0.7rem 0.42rem;
    color: #fff;
    box-shadow: 0 2px 10px rgba(26, 95, 168, 0.25);
}

.payroll-header-title {
    margin: 0 0 0.22rem;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.payroll-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
}

.payroll-nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.12s;
    white-space: nowrap;
}

.payroll-nav-btn:hover {
    background: rgba(255, 255, 255, 0.28);
}

.payroll-current-month {
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
}

/* カード（各セクション） */
.payroll-card {
    background: #fff;
    border: 1px solid #d0dce9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(12, 37, 64, 0.06);
}

.payroll-section-label {
    padding: 0.18rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-strong);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--line);
}

/* テーブルグリッド */
.payroll-table {
    width: 100%;
}

.ps-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    border-bottom: 1px solid #e0eaf4;
}

.ps-row:last-child {
    border-bottom: none;
}

.ps-lbl,
.ps-val {
    padding: 0.2rem 0.32rem;
    line-height: 1.4;
}

.ps-lbl {
    background: #e8f6ff;
    font-weight: 600;
    color: var(--text-strong);
    font-size: 0.72rem;
    border-right: 1px solid #cfe2f0;
    display: flex;
    align-items: center;
}

.ps-val {
    background: #ffffee;
    text-align: right;
    color: var(--text-body);
    border-right: 1px solid #e0eaf4;
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
}

.ps-val:last-child {
    border-right: none;
}

.ps-lbl--empty {
    background: #fff;
    border-right: 1px solid #e0eaf4;
}

.ps-val--empty {
    background: #fff;
}

.ps-val--bold {
    font-weight: 800;
    color: var(--text-strong);
}

.ps-val--net {
    color: var(--focus);
    font-weight: 800;
}

/* アクションボタン行 */
.payroll-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.1rem 0 0.1rem;
    margin-top: 0.35rem;
}

.payroll-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: background 0.12s, box-shadow 0.12s;
    white-space: nowrap;
}

.payroll-action-btn--home {
    background: #2d79c7;
    color: #fff;
    border-color: #2d79c7;
    box-shadow: 0 2px 6px rgba(45, 121, 199, 0.28);
}

.payroll-action-btn--home:hover {
    background: #1a5fa8;
}

.payroll-action-btn--home .material-symbols-outlined {
    font-size: 0.95rem;
}

.payroll-action-btn--sub {
    background: #f0a800;
    color: #fff;
    border-color: #f0a800;
    box-shadow: 0 2px 6px rgba(240, 168, 0, 0.28);
}

.payroll-action-btn--sub:hover {
    background: #d68a00;
}

.payroll-action-btn--sub:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.payroll-action-btn--pdf {
    background: #fff4e5;
    color: #c94f1c;
    border-color: #f5c49a;
}

.payroll-action-btn--pdf:hover {
    background: #ffe8cc;
}

.payroll-action-btn--pdf .material-symbols-outlined {
    font-size: 0.95rem;
}

.payroll-action-btn--withholding {
    background: #e6f4ea;
    color: #1a7a4c;
    border-color: #9bd7b4;
}

.payroll-action-btn--withholding:hover {
    background: #d2ecdb;
}

.payroll-action-btn--withholding .material-symbols-outlined {
    font-size: 0.95rem;
}

/* ============================================================
   支払内訳ページ (payroll/breakdown)
   ============================================================ */

/* セクションラベル行 */
.bd-section-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.12rem 0.2rem 0;
}

.bd-section-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-strong);
}

.bd-badge {
    display: inline-block;
    padding: 0.06rem 0.45rem;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.5;
}

.bd-badge--ok {
    background: #2d79c7;
    color: #fff;
}

.bd-badge--ng {
    background: #d32f2f;
    color: #fff;
}

/* テーブルカード */
.bd-card {
    background: #fff;
    border: 1px solid #d0dce9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(12, 37, 64, 0.06);
}

.bd-card--undecided {
    background: #e8e8e8;
}

/* テーブル本体 */
.bd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.68rem;
    table-layout: fixed;
}

/* ヘッダー行 */
.bd-thead-row {
    background: #e8f6ff;
}

.bd-th {
    padding: 0.18rem 0.18rem;
    text-align: center;
    font-weight: 700;
    color: var(--text-strong);
    border: 1px solid #cfe2f0;
    font-size: 0.67rem;
    line-height: 1.3;
}

/* データ行 */
.bd-row {
    border-bottom: 1px solid #e0eaf4;
}

.bd-row--pay,
.bd-row--time {
    background: #ffffee;
}

.bd-row--shift {
    background: #f0f0f0;
}

.bd-row--empty {
    background: #fff;
}

/* セル共通 */
.bd-table td {
    border: 1px solid #e0eaf4;
    padding: 0.18rem 0.22rem;
    vertical-align: middle;
    line-height: 1.3;
}

/* 日付セル */
.bd-td-date {
    text-align: center;
    font-weight: 600;
    white-space: nowrap;
    width: 12%;
}

.bd-date--sun { color: #c30; }
.bd-date--sat { color: #03c; }

.bd-month-mark {
    background: #d32f2f;
    color: #fff;
    font-size: 0.6rem;
    padding: 1px 3px;
    border-radius: 2px;
    margin-top: 2px;
    white-space: nowrap;
}

/* 案件名セル */
.bd-td-case {
    font-weight: 600;
    color: #333399;
    font-size: 0.67rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 0;
    width: 36%;
}

/* 勤務時間セル */
.bd-td-worktime {
    text-align: center;
    color: #333399;
    font-size: 0.65rem;
    white-space: nowrap;
}

/* 職種セル */
.bd-td-shokushu {
    text-align: center;
    width: 10%;
    font-size: 0.64rem;
}

/* 日給・交通費セル */
.bd-td-sum,
.bd-td-trans {
    text-align: right;
    width: 15%;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-right: 0.3rem;
}

/* ポップアップリンク */
.bd-sum-link,
.bd-trans-link {
    color: #2d79c7;
    text-decoration: underline;
    cursor: pointer;
}

/* フッター行 */
.bd-footer-row {
    background: #ffffee;
}

.bd-footer-total {
    background: #ffffcc;
}

.bd-footer-lbl {
    text-align: center;
    font-weight: 700;
    background: #e8f6ff;
    font-size: 0.72rem;
    padding: 0.2rem 0.3rem;
}

.bd-footer-val {
    text-align: right;
    font-weight: 700;
    font-size: 0.72rem;
    padding-right: 0.35rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.bd-footer-val--total {
    font-size: 0.8rem;
    color: var(--focus);
}

/* ============================================================
   日給ポップアップ
   ============================================================ */

.bd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 200;
}

.bd-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 201;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
    padding: 0.9rem 1rem 0.7rem;
    min-width: 220px;
    max-width: 88vw;
}

.bd-popup-header {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-strong);
    margin-bottom: 0.45rem;
}

.bd-popup-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.bd-popup-lbl {
    color: var(--text-soft);
    padding: 0.15rem 0.5rem 0.15rem 0;
    white-space: nowrap;
}

.bd-popup-val {
    text-align: right;
    font-variant-numeric: tabular-nums;
    padding: 0.15rem 0;
    min-width: 70px;
}

.bd-popup-total-row .bd-popup-lbl,
.bd-popup-total-row .bd-popup-val {
    font-weight: 800;
    border-top: 1px solid #ccc;
    padding-top: 0.25rem;
}

.bd-popup-remarks {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-body);
    background: #f7f7f7;
    padding: 0.3rem 0.4rem;
    border-radius: 4px;
    line-height: 1.5;
}

.bd-popup-trans-body {
    font-size: 0.82rem;
    color: var(--text-body);
    padding: 0.3rem 0;
    line-height: 1.6;
}

.bd-popup-close {
    display: block;
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.35rem;
    background: #e8e8e8;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-body);
}

.bd-popup-close:hover {
    background: #d0d0d0;
}
