:root {
    --blue: #2563eb;
    --blue-dark: #1e3a8a;
    --blue-deep: #1e40af;
    --blue-soft: #dbeafe;
    --green: #059669;
    --green-dark: #047857;
    --green-soft: #d1fae5;
    --bg: #eef3f2;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #0f172a;
    --text-soft: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --pinned-line: #fcd34d;
    --pinned-bg: #fffbeb;
    --pinned-text: #b45309;
    --danger: #dc2626;
    --danger-dark: #991b1b;
    --danger-bg: #fef2f2;
    --shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(209, 250, 229, 0.48), rgba(238, 243, 242, 0.2) 260px),
        var(--bg);
    color: var(--text);
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a:hover {
    color: var(--blue-dark);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(5, 150, 105, 0.26);
    outline-offset: 2px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, var(--blue-deep), var(--green-dark));
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}

.site-header__inner,
.container {
    width: min(100% - 40px, 1120px);
    margin: 0 auto;
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 22px;
    min-height: 76px;
    padding: 14px 0;
}

.site-header h1 {
    flex: 0 0 auto;
    margin: 0;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    line-height: 1.2;
}

.site-header h1 a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
    text-shadow: 0 1px 8px rgba(15, 23, 42, 0.28);
}

.site-logo {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.35));
}

.site-header h1 a:hover {
    color: var(--green-soft);
    text-decoration: none;
}

.site-nav {
    flex: 1 1 auto;
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a,
.nav-parent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 0.93rem;
    font-weight: 800;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
}

.nav-parent {
    cursor: default;
}

.nav-parent::after {
    content: "\25BE";
    margin-left: 7px;
    font-size: 0.74rem;
    line-height: 1;
}

.nav-menu > li > a:hover,
.nav-has-sub:hover .nav-parent,
.nav-has-sub:focus-within .nav-parent {
    border-color: #ffffff;
    background: #ffffff;
    color: var(--blue-dark);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
    text-decoration: none;
    transform: translateY(-1px);
}

.nav-sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 180px;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
    list-style: none;
}

.nav-has-sub:hover .nav-sub,
.nav-has-sub:focus-within .nav-sub {
    display: block;
}

.nav-sub li a {
    display: block;
    border-radius: 7px;
    padding: 8px 10px;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
}

.nav-sub li a:hover {
    background: var(--blue-soft);
    color: var(--blue-dark);
    text-decoration: none;
}

/* 表示設定ドロップダウン（文字色・文字サイズ） */
.display-settings {
    min-width: 200px;
}
.display-settings .display-setting {
    padding: 8px 4px;
}
.display-settings .display-setting + .display-setting {
    border-top: 1px solid var(--line);
    margin-top: 4px;
    padding-top: 10px;
}
.display-settings label {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 700;
}
.display-settings select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font-size: 0.92rem;
}

.login-status {
    margin: 0 0 0 auto;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.88rem;
    line-height: 1.4;
    text-align: right;
}

.container {
    padding: 30px 0 38px;
}

.panel {
    margin-bottom: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    padding: 26px;
}

.panel:last-child {
    margin-bottom: 0;
}

.panel h2 {
    margin: 0 0 18px;
    border-bottom: 2px solid var(--green-soft);
    padding-bottom: 12px;
    color: var(--blue-dark);
    font-size: 1.42rem;
    line-height: 1.35;
}

.panel h3,
.panel h4 {
    margin: 22px 0 10px;
    color: var(--green-dark);
    line-height: 1.35;
}

.panel h3:first-child,
.panel h4:first-child {
    margin-top: 0;
}

.panel p {
    margin: 0 0 14px;
}

.panel p:last-child,
form p:last-child {
    margin-bottom: 0;
}

.flash {
    margin: 0 0 18px;
    border: 1px solid #a7f3d0;
    border-left: 5px solid var(--green);
    border-radius: 10px;
    background: var(--green-soft);
    color: var(--green-dark);
    box-shadow: 0 8px 18px rgba(5, 150, 105, 0.1);
    padding: 12px 14px;
    font-weight: 800;
}

.flash[role="alert"] {
    border-color: #fecaca;
    border-left-color: var(--danger);
    background: var(--danger-bg);
    color: var(--danger-dark);
}

.pinned {
    margin: 16px 0;
    border: 1px solid #fde68a;
    border-left: 6px solid var(--pinned-line);
    border-radius: 10px;
    background: var(--pinned-bg);
    box-shadow: 0 8px 20px rgba(180, 83, 9, 0.08);
    padding: 16px 18px;
}

.pinned h3,
.pinned h4 {
    margin: 0 0 10px;
    color: var(--pinned-text);
}

.pinned p {
    margin: 0 0 10px;
    color: var(--text-soft);
}

.pinned p:last-child {
    margin-bottom: 0;
}

.pinned strong {
    color: var(--blue-dark);
}

.pinned ul,
.pinned ol {
    margin: 8px 0 0;
    padding-left: 1.35rem;
}

.pinned li {
    margin: 4px 0;
}

label {
    display: block;
    margin: 0 0 6px;
    color: var(--text-soft);
    font-size: 0.92rem;
    font-weight: 800;
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    line-height: 1.5;
    padding: 10px 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="date"]:hover,
select:hover,
textarea:hover {
    border-color: #94a3b8;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: var(--green);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.14);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

fieldset {
    margin: 18px 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    padding: 16px;
}

legend {
    padding: 0 8px;
    color: var(--blue-dark);
    font-weight: 800;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    max-width: 100%;
    border: 1px solid var(--green);
    border-radius: 8px;
    background: var(--green);
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    line-height: 1.2;
    padding: 9px 15px;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

button:hover,
.button:hover {
    border-color: var(--green-dark);
    background: var(--green-dark);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(4, 120, 87, 0.22);
    text-decoration: none;
    transform: translateY(-1px);
}

a.button {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: var(--blue-dark);
}

a.button:hover {
    border-color: var(--blue);
    background: var(--blue-soft);
    color: var(--blue-dark);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
}

.btn-danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    border-color: var(--danger-dark);
    background: var(--danger-dark);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(153, 27, 27, 0.22);
}

table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    border-spacing: 0;
    background: var(--surface);
}

th,
td {
    border: 1px solid var(--line);
    padding: 11px 12px;
    text-align: left;
    vertical-align: top;
}

th {
    background: linear-gradient(180deg, #eff6ff, #ecfdf5);
    color: var(--blue-dark);
    font-size: 0.9rem;
    font-weight: 800;
    white-space: nowrap;
}

td {
    color: var(--text);
}

tbody tr:nth-child(even) td {
    background: #f8fafc;
}

td form {
    margin: 0 0 12px;
}

td form:last-child {
    margin-bottom: 0;
}

td label {
    margin-top: 8px;
}

td button {
    margin-top: 8px;
}

.calendar-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 18px;
}

.calendar-nav h2,
.calendar-nav p {
    margin: 0;
}

.calendar-nav h2 {
    border: 0;
    padding: 0;
}

.calendar-nav p {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.calendar {
    display: table;
    table-layout: fixed;
    overflow: visible;
    border-radius: 10px;
    box-shadow: 0 0 0 1px var(--line);
}

.calendar th {
    background: linear-gradient(135deg, var(--blue-deep), var(--green-dark));
    color: #ffffff;
    text-align: center;
}

.calendar td {
    height: 112px;
    background: #ffffff;
    padding: 8px;
}

.calendar tbody tr:nth-child(even) td {
    background: #ffffff;
}

.calendar td.empty {
    background: #f1f5f9;
}

.calendar .today {
    background: #ecfdf5;
    box-shadow: inset 0 0 0 3px rgba(5, 150, 105, 0.36);
}

.calendar-day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    border-radius: 999px;
    color: var(--blue-dark);
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}

.calendar-day:hover {
    background: var(--blue-soft);
    color: var(--blue-dark);
    text-decoration: none;
}

.calendar .today .calendar-day {
    background: var(--green);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(5, 150, 105, 0.24);
}

.calendar-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.calendar .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: var(--blue-dark);
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1;
    padding: 3px 9px;
    text-decoration: none;
}

.calendar .badge:nth-child(2) {
    border-color: #a7f3d0;
    background: var(--green-soft);
    color: var(--green-dark);
}

.calendar .badge:hover {
    border-color: var(--blue);
    background: var(--blue);
    color: #ffffff;
    text-decoration: none;
}

.calendar .badge:nth-child(2):hover {
    border-color: var(--green);
    background: var(--green);
}

.newnote-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    margin: 0;
}

.newnote-field {
    display: flex;
    flex: 0 1 220px;
    flex-direction: column;
    gap: 6px;
}

.newnote-form button {
    margin-top: 0;
}

.newnote-hint {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.accordion {
    overflow: hidden;
    margin: 0 0 20px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.accordion > summary {
    padding: 16px 20px;
    color: var(--blue-dark);
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.accordion > summary::-webkit-details-marker {
    display: none;
}

.accordion > summary::before {
    content: "\25B6";
    display: inline-block;
    margin-right: 8px;
    color: var(--green);
    font-size: 0.82rem;
}

.accordion > summary:hover {
    background: #ecfdf5;
}

.accordion[open] > summary {
    border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, #eff6ff, #ecfdf5);
}

.accordion[open] > summary::before {
    content: "\25BC";
}

.accordion-count {
    margin-left: 6px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.accordion-body {
    padding: 18px 20px 20px;
}

.accordion-body > :first-child {
    margin-top: 0;
}

.accordion-body > :last-child {
    margin-bottom: 0;
}

.accordion-link {
    margin: 16px 0 0;
}

.accordion-pinned {
    border-color: #fcd34d;
    background: #fffbeb;
}

.accordion-pinned > summary {
    color: #92400e;
}

.accordion-pinned > summary::before {
    color: var(--pinned-text);
}

.accordion-pinned > summary:hover,
.accordion-pinned[open] > summary {
    background: #fef3c7;
}

.accordion-pinned[open] > summary {
    border-bottom-color: #fcd34d;
}

.item-accordion {
    overflow: hidden;
    margin: 0 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.item-accordion:last-child {
    margin-bottom: 0;
}

.item-accordion > summary {
    position: relative;
    padding: 12px 16px 12px 34px;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.item-accordion > summary::-webkit-details-marker {
    display: none;
}

.item-accordion > summary::before {
    content: "\25B6";
    position: absolute;
    left: 14px;
    top: 50%;
    color: var(--blue);
    font-size: 0.76rem;
    transform: translateY(-50%);
}

.item-accordion > summary:hover {
    background: #eff6ff;
    color: var(--blue-dark);
}

.item-accordion[open] > summary {
    border-bottom: 1px solid var(--line);
    background: #ecfdf5;
    color: var(--green-dark);
}

.item-accordion[open] > summary::before {
    content: "\25BC";
    color: var(--green);
}

.item-accordion-body {
    padding: 14px 16px 16px;
}

.item-accordion-body > :first-child {
    margin-top: 0;
}

.item-accordion-body > :last-child {
    margin-bottom: 0;
}

/* 検索キーワードのハイライト */
mark {
    background: #fef08a;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: inherit;
}

.recent-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.recent-list li {
    border-bottom: 1px solid var(--line);
}

.recent-list li:last-child {
    border-bottom: 0;
}

.recent-list a {
    display: block;
    border-radius: 8px;
    padding: 13px 12px;
    color: var(--text);
    text-decoration: none;
}

.recent-list a:hover {
    background: #ecfdf5;
    color: var(--green-dark);
    text-decoration: none;
}

.recent-title {
    display: block;
    font-weight: 700;
}

.recent-meta {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.88rem;
}

.inline-form {
    display: inline-block;
    margin: 0 8px 8px 0;
}

/* 編集・メール送信・削除ボタンを横一列に並べる（削除を右側に） */
.item-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.item-actions .inline-form {
    margin: 0;
}

.delete-note-form {
    margin-top: 22px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.76);
    color: var(--muted);
    font-size: 0.88rem;
}

.site-footer .container {
    padding: 18px 0;
}

.site-footer p {
    margin: 0;
}

@media (max-width: 600px) {
    body {
        font-size: 15px;
    }

    .site-header {
        position: static;
    }

    .site-header__inner,
    .container {
        width: min(100% - 24px, 1120px);
    }

    .site-header__inner {
        align-items: stretch;
        flex-direction: column;
        min-height: 0;
        padding: 14px 0;
    }

    .site-nav {
        width: 100%;
    }

    .nav-menu {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .nav-menu > li {
        width: 100%;
    }

    .nav-menu > li > a,
    .nav-parent {
        justify-content: flex-start;
        width: 100%;
        white-space: normal;
    }

    .nav-sub {
        display: block;
        position: static;
        min-width: 0;
        margin: 6px 0 0 14px;
        box-shadow: none;
    }

    .nav-sub li a {
        white-space: normal;
    }

    .login-status {
        margin-left: 0;
        text-align: left;
    }

    .container {
        padding: 20px 0 28px;
    }

    .panel {
        border-radius: 10px;
        padding: 18px;
    }

    .panel h2 {
        font-size: 1.25rem;
    }

    .calendar-nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .calendar-nav p {
        width: 100%;
    }

    .calendar-nav .button {
        flex: 1 1 calc(33.333% - 8px);
        padding-right: 8px;
        padding-left: 8px;
    }

    th,
    td {
        padding: 8px;
    }

    .calendar {
        font-size: 0.86rem;
    }

    .calendar td {
        height: 82px;
        padding: 5px;
    }

    .calendar-day {
        min-width: 25px;
        min-height: 25px;
    }

    .calendar-badges {
        gap: 4px;
        margin-top: 6px;
    }

    .calendar .badge {
        min-height: 21px;
        padding: 2px 6px;
        font-size: 0.72rem;
    }

    .newnote-form {
        align-items: stretch;
        flex-direction: column;
    }

    .newnote-field {
        flex-basis: auto;
    }

    .accordion {
        border-radius: 10px;
    }

    .accordion > summary,
    .accordion-body {
        padding-right: 16px;
        padding-left: 16px;
    }

    .inline-form {
        display: block;
        margin-right: 0;
    }

    .item-accordion > summary {
        padding-right: 12px;
        padding-left: 30px;
    }

    .item-accordion > summary::before {
        left: 12px;
    }

    .item-accordion-body {
        padding-right: 12px;
        padding-left: 12px;
    }
}

.calendar-jump {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.calendar-jump label {
    display: inline-flex;
    align-items: center;
    margin: 0;
    font-weight: 700;
}

.calendar-jump select {
    width: auto;
}

.calendar-jump button {
    margin-top: 0;
}

.note-view {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.note-body-view {
    min-height: 16rem;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    line-height: 1.8;
    white-space: normal;
    overflow-wrap: anywhere;
}

.draft-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    background: #fffbeb;
    color: #b45309;
}

.draft-notice button {
    min-height: 32px;
    padding: 5px 10px;
    font-size: 0.9rem;
}

.draft-notice-restore {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
}

.draft-notice-discard {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #334155;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
}

.search-form label {
    margin: 0;
}

.search-form input[type="text"] {
    flex: 1 1 240px;
    width: auto;
}

.search-form button {
    margin-top: 0;
}

/* リッチテキストエディタ */
.rt-wrap { margin: 0; }
.rt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border: 1px solid #cbd5e1;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: #f1f5f9;
}
.rt-btn {
    min-width: 32px;
    min-height: 0;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}
.rt-btn:hover { background: #e2e8f0; color: #1f2937; transform: none; box-shadow: none; }
.rt-label {
    margin-left: 6px;
    font-size: 12px;
    color: #475569;
    white-space: nowrap;
}
.rt-menu { position: relative; display: inline-block; }
.rt-menu-btn { font-weight: 600; }
.rt-palette {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    margin-top: 2px;
    padding: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
}
.rt-palette-reset {
    display: block;
    width: 100%;
    min-height: 0;
    margin-bottom: 6px;
    padding: 4px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #f8fafc;
    color: #1f2937;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.rt-palette-grid {
    display: grid;
    grid-template-columns: repeat(8, 20px);
    gap: 3px;
}
.rt-swatch {
    width: 20px;
    height: 20px;
    min-height: 0;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    cursor: pointer;
}
.rt-swatch:hover { outline: 2px solid #1e3a8a; }
.rt-palette button:hover { transform: none; box-shadow: none; }
.rt-sizes { min-width: 92px; }
.rt-size-item {
    display: block;
    width: 100%;
    min-height: 0;
    margin-bottom: 3px;
    padding: 4px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #fff;
    color: #1f2937;
    font-weight: 600;
    text-align: left;
    line-height: 1.1;
    cursor: pointer;
}
.rt-size-item:last-child { margin-bottom: 0; }
.rt-size-item:hover { background: #e2e8f0; }
.rt-editor {
    min-height: 12em;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 0 0 6px 6px;
    background: #fff;
    overflow-wrap: anywhere;
}
.rt-editor:focus { outline: 2px solid #93c5fd; outline-offset: -2px; }
/* 表示側の本文 HTML がレイアウトを壊さないように */
.note-body-view, .item-accordion-body, .pinned { overflow-wrap: anywhere; }

/* ダッシュボードの2ペイン（件名リスト＋コンテンツ） */
.split {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.split-list {
    flex: 0 0 240px;
    max-width: 240px;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}
.split-list li { margin: 0; }
.split-item {
    display: block;
    width: 100%;
    min-height: 0;
    margin: 0;
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-weight: 600;
    text-align: left;
    line-height: 1.3;
    padding: 9px 12px;
    cursor: pointer;
    box-shadow: none;
}
.split-item:hover {
    background: #f1f5f9;
    color: var(--text);
    transform: none;
    box-shadow: none;
}
.split-item.is-active {
    background: #e8edf3;
    color: var(--text);
    font-weight: 800;
    box-shadow: inset 3px 0 0 var(--green);
}
.split-item .split-item-title { display: block; }
.split-item .split-item-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.82rem;
    font-weight: 400;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.split-detail {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 16px 18px;
}
.split-detail h3 { margin-top: 0; }
.split-pane[hidden] { display: none; }
@media (max-width: 720px) {
    .split { flex-direction: column; }
    .split-list { flex-basis: auto; max-width: none; }
}

/* ダッシュボードのタブ（ラベル）切り替え */
.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--line);
}
.tab {
    min-height: 0;
    margin: 0;
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: var(--surface-soft);
    color: var(--text-soft);
    font-weight: 700;
    line-height: 1.25;
    padding: 9px 16px;
    cursor: pointer;
    box-shadow: none;
}
.tab:hover {
    background: var(--blue-soft);
    color: var(--text);
    transform: none;
    box-shadow: none;
}
.tab.is-active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}
.tab .tab-count { font-weight: 400; opacity: 0.85; }
.tab-panel[hidden] { display: none; }

.deposits-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.deposits-table th, .deposits-table td { padding: 8px 10px; border-bottom: 1px solid #e5e7eb; text-align: left; }
.deposits-table td.amount, .deposits-table th.amount { text-align: right; white-space: nowrap; }
.deposits-table tr.is-confirmed { background: #f0fdf4; color: #6b7280; }
.deposits-summary { margin: 8px 0; font-weight: 600; }
.btn-confirm { background: #2563eb; color: #fff; border: none; padding: 4px 10px; border-radius: 4px; cursor: pointer; }
.btn-confirmed { background: #16a34a; color: #fff; border: none; padding: 4px 10px; border-radius: 4px; cursor: pointer; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; }

/* 2ペイン左リストのグループ見出し（候補8: 青のベタ帯・白文字・大きめ） */
.split-group {
    display: block;
    margin: 10px 8px 4px;
    padding: 9px 14px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: default;
}
.split-group:first-child { margin-top: 6px; }
.split-empty {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

/* ログイン画面「ログイン状態を保持する」 */
.login-remember label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: normal;
    cursor: pointer;
}
.login-remember input[type="checkbox"] {
    width: auto;
    margin: 0;
}
.login-remember small {
    display: block;
    margin-top: .25rem;
    color: #52606d;
}

/* ===== 入金明細: 担当・メール・備考の行内編集（Phase 73） ===== */
.deposits-toolbar { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; flex-wrap: wrap; }
.deposits-hint { color: #64748b; font-size: .86rem; display: none; }
body.deposit-editing .deposits-hint { display: inline; }
.deposits-toolbar button.is-active { background: #047857; color: #fff; }

.deposit-add-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  margin: 8px 0 14px; padding: 12px 14px; border: 1px solid #d7dee8; border-radius: 8px; background: #f8fafc; }
.deposit-add-form label { display: flex; flex-direction: column; font-size: .84rem; gap: 3px; }

.deposits-table td.editable { min-width: 5em; }
.deposits-table td.editable.note { min-width: 9em; font-size: .88rem; color: #475569; }
body.deposit-editing .deposits-table td.editable { border-bottom: 1px dotted #047857; cursor: pointer; }
body.deposit-editing .deposits-table td.editable:hover { background: #ecfdf5; }
.deposits-table td.editable input { width: 100%; box-sizing: border-box; }
.deposits-table td.mail-done { color: #047857; }

.review-badge, .manual-badge { display: inline-block; margin-left: 6px; padding: 0 6px;
  border-radius: 4px; font-size: .74rem; vertical-align: middle; white-space: nowrap; }
.review-badge { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.manual-badge { background: #eef2f7; color: #475569; border: 1px solid #cbd5e1; }
.deposits-table tr.needs-review td { background: #fff7f7; }

/* ===== 入金明細: 口座ごとの同期状況パネル ===== */
.deposit-sync { margin: 12px 0 16px; padding: 10px 14px 6px;
  border: 1px solid #d7dee8; border-radius: 8px; background: #f8fafc; }
.deposit-sync__head { font-weight: 600; font-size: .9rem; color: #334155; margin-bottom: 8px; }
.deposit-sync__table { border-collapse: collapse; width: 100%; font-size: .86rem; }
.deposit-sync__table th, .deposit-sync__table td { padding: 5px 10px; text-align: left;
  border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.deposit-sync__table th { color: #64748b; font-weight: 600; }
.deposit-sync__table tr.is-warn td { background: #fffbeb; }
.deposit-sync__table tr.is-stale td { background: #fef2f2; color: #b91c1c; }
.deposit-sync__ago { color: #64748b; }
.deposit-sync__table tr.is-stale .deposit-sync__ago { color: #b91c1c; }
.deposit-sync__none { color: #b91c1c; }
.deposit-sync__note { margin: 8px 0 4px; font-size: .8rem; color: #64748b; line-height: 1.6; white-space: normal; }
@media (max-width: 700px) {
  .deposit-sync { overflow-x: auto; }
}

/* 手入力フォームは JS が組み立てる（BEM 風のクラス名も JS 側の定義に合わせる） */
.deposit-add-form__field { display: flex; flex-direction: column; font-size: .84rem; gap: 3px; }
.deposit-add-form__label { color: #475569; }
.deposit-add-form__actions { display: flex; gap: 8px; align-items: flex-end; }
.deposit-add-form__cancel { background: #e2e8f0; color: #334155; }
.deposit-inline-input { width: 100%; box-sizing: border-box; }

/* 行の操作ボタン。削除は編集モードでのみ効くので、編集モード以外では出さない。 */
.deposit-row-actions { white-space: nowrap; }
.btn-row-action { font-size: .78rem; padding: 2px 8px; }
.btn-row-delete { display: none; background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
body.deposit-editing .btn-row-delete { display: inline-block; }
.deposits-table tr.is-saving td { opacity: .55; }

/* 手入力の行の口座（2026-09-16）。編集モードのときだけセレクトで変更できる。 */
.deposit-account-select { display: none; max-width: 11em; font-size: .82rem; }
body.deposit-editing .deposit-account-select { display: block; margin-top: 4px; }
body.deposit-editing .deposit-account-cell .deposit-account-label { display: none; }
.account-unset-badge { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: .74rem;
  background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; white-space: nowrap; }
.deposits-unassigned-note { margin: 4px 0 10px; padding: 6px 10px; font-size: .84rem;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; color: #78350f; }

.check-inline { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* ===== 入金明細: レイアウト（2026-09-17・owner 選定＝候補03＋07＋10） =====
   左の列＝口座と絞り込み（追従）／上部の帯＝件数・同期状況・編集・追加（固定）。
   --deposits-sticky-top はサイト共通ヘッダーの実測の高さ（deposit-layout.js が入れる）。 */
.container.container--wide { width: min(100% - 40px, 1480px); }

.deposits-layout { display: grid; grid-template-columns: 256px minmax(0, 1fr); gap: 18px; align-items: start; }

/* 左の列 */
.deposits-side {
  position: sticky;
  top: calc(var(--deposits-sticky-top, 0px) + 12px);
  /* 上限は deposit-layout.js が実測して入れる（ページ末尾で左の列がヘッダーの下に押し上げられないように） */
  max-height: var(--deposits-side-max, calc(100vh - var(--deposits-sticky-top, 0px) - 24px));
  overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow-soft);
}
.deposits-filter label { margin: 8px 0 3px; font-size: .82rem; }
.deposits-filter input[type="date"],
.deposits-filter input[type="text"],
.deposits-filter select { padding: 5px 8px; font-size: .88rem; }
.dside-title { margin: 0 0 6px; font-size: .74rem; font-weight: 800; letter-spacing: .1em; color: var(--muted); }
.dside-accounts { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 2px; }
.dside-accounts a { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 8px; color: var(--text-soft); text-decoration: none; font-weight: 700; font-size: .88rem; }
.dside-accounts a > span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dside-accounts a:hover { background: var(--surface-soft); text-decoration: none; }
.dside-accounts a.is-active { background: var(--green-soft); color: var(--green-dark); box-shadow: inset 3px 0 var(--green); }
.dside-count { flex: 0 0 auto; font-size: .74rem; font-weight: 800; background: #e2e8f0; color: #334155;
  border-radius: 999px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.dside-accounts a.is-active .dside-count { background: #a7f3d0; color: #065f46; }
.dside-accounts a.dside-unassigned { color: #92400e; }
.dside-accounts a.dside-unassigned .dside-count { background: #fde68a; color: #78350f; }
.dside-accounts a.dside-unassigned.is-active { background: #fffbeb; box-shadow: inset 3px 0 #f59e0b; }
.dside-date-sep { text-align: center; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.dside-check { margin-top: 10px; font-weight: 700; }
/* 左の列は高さの上限を超えると列の中でスクロールする。ボタンは下端に貼り付けて常に見せる。
   bottom は .deposits-side の padding（14px）ぶん下げて、その余白も白で覆う。 */
.dside-actions { position: sticky; bottom: -14px; margin: 10px -14px -14px; padding: 10px 14px 12px;
  background: var(--surface); border-top: 1px solid var(--line); }
.dside-submit { width: 100%; }
.dside-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px; font-size: .84rem; }

/* 右側と上部の帯 */
.deposits-main { min-width: 0; }
.deposits-stickybar {
  position: sticky; top: var(--deposits-sticky-top, 0px); z-index: 6;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; box-shadow: 0 8px 18px rgba(15, 23, 42, .07);
}
.dbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.dbar-title { margin: 0; font-size: 1.15rem; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.dbar-account { font-size: .86rem; font-weight: 800; color: var(--green-dark); background: var(--green-soft); border-radius: 999px; padding: 1px 10px; }
.deposits-stickybar .deposits-summary { margin: 0; font-weight: 700; color: var(--text-soft); }
.dbar-spacer { flex: 1 1 auto; }
.deposits-stickybar button { min-height: 34px; padding: 6px 13px; }
.deposits-stickybar [data-deposit-edit-toggle] { background: #fff; color: var(--green-dark); border-color: #86efac; }
.deposits-stickybar [data-deposit-edit-toggle]:hover { background: var(--green-soft); color: var(--green-dark); box-shadow: none; }
.deposits-stickybar [data-deposit-edit-toggle].is-active { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }
body.deposit-editing .deposits-stickybar .deposits-hint { display: block; margin-top: 6px; }

/* 同期状況（ボタン＋吹き出し） */
.dbar-sync { position: relative; }
.deposits-stickybar .dbar-sync-btn { background: #f8fafc; color: var(--text-soft); border-color: var(--line-strong); gap: 6px; }
.deposits-stickybar .dbar-sync-btn:hover { background: #f1f5f9; color: var(--text); box-shadow: none; }
.dbar-sync-ago { font-size: .76rem; font-weight: 800; background: #e2e8f0; color: #334155; border-radius: 999px; padding: 0 7px; }
/* 閉じていても止まっている口座に気付けるよう、ボタン自体の色で知らせる */
.deposits-stickybar .dbar-sync-btn.is-warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.deposits-stickybar .dbar-sync-btn.is-warn .dbar-sync-ago { background: #fde68a; color: #78350f; }
.deposits-stickybar .dbar-sync-btn.is-stale { background: #fef2f2; border-color: #fca5a5; color: #b91c1c; }
.deposits-stickybar .dbar-sync-btn.is-stale .dbar-sync-ago { background: #fecaca; color: #991b1b; }
.deposit-sync.deposit-sync-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  width: max-content; max-width: min(920px, calc(100vw - 40px)); overflow-x: auto;
  margin: 0; padding: 12px 14px 8px; background: #fff; border: 1px solid var(--line-strong);
  border-radius: 12px; box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}
.deposit-sync.deposit-sync-pop[hidden] { display: none; }

#deposit-add-slot .deposit-add-form { margin: 12px 0 0; }
.deposits-main .deposits-table { margin-top: 12px; }
.deposits-empty { margin: 16px 4px; color: var(--muted); }

/* 画面が狭いときは縦に積む（左の列は追従させない） */
@media (max-width: 960px) {
  .deposits-layout { grid-template-columns: minmax(0, 1fr); }
  .deposits-side { position: static; max-height: none; }
}

@media print {
  .deposits-toolbar, .deposit-add-form, .deposit-row-actions,
  .deposits-side, .dbar-sync, .deposits-stickybar button { display: none !important; }
  .deposits-layout { display: block; }
  .deposits-stickybar { position: static; box-shadow: none; }
}
