
:root{
    --bg:#f3f4f6;
    --panel:#ffffff;
    --line:#3f3f46;
    --soft-line:#d4d4d8;
    --text:#18181b;
    --muted:#71717a;
    --accent:#2563eb;
    --accent-soft:#dbeafe;
    --ok:#166534;
    --ok-bg:#dcfce7;
    --danger:#b91c1c;
    --tab:#e5e7eb;
}
*{box-sizing:border-box}
html{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Yu Gothic","YuGothic","Meiryo",sans-serif;color:var(--text);background:var(--bg)}
body{margin:0}
button,input,select,textarea{font:inherit}
a{color:#1d4ed8}
button{touch-action:manipulation}

.login-page{min-height:100vh;display:grid;place-items:center;padding:24px;background:#f5f5f5}
.login-card{width:min(430px,100%);background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:30px;box-shadow:0 8px 28px rgba(0,0,0,.08)}
.login-brand{font-weight:800;font-size:18px;margin-bottom:8px}
.login-card h1{font-size:25px;margin:0 0 8px}
.login-subtitle{margin:0 0 22px;color:#52525b;font-size:14px;line-height:1.6}
.login-card label{display:block;font-weight:700;margin:16px 0 6px}
.login-card input{width:100%;border:1px solid #a1a1aa;border-radius:7px;padding:11px 12px;background:#fff;font-size:16px}
.login-card .primary-button{width:100%;margin-top:24px}
.alert{padding:10px 12px;background:#fef2f2;border:1px solid #fecaca;color:#991b1b;border-radius:6px;font-size:14px}

.app-page{min-height:100vh}
.app-header{background:#fff;border-bottom:1px solid #d4d4d8;position:relative;z-index:5}
.app-header-main{display:flex;justify-content:space-between;gap:24px;align-items:center;padding:14px 20px 10px}
.app-brand{font-size:12px;font-weight:800;color:#52525b;letter-spacing:.08em}
.app-header h1{font-size:22px;margin:2px 0 0}
.login-user{display:flex;align-items:center;gap:10px;font-size:13px;white-space:nowrap}
.role-chip{padding:3px 7px;background:#f4f4f5;border:1px solid #d4d4d8;border-radius:999px;font-size:11px}
.trainee-toolbar{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:8px 20px 14px}
.trainee-select-label{font-size:12px;font-weight:700;color:#52525b}
.trainee-select{min-width:230px;padding:7px 9px;border:1px solid #a1a1aa;border-radius:6px;background:#fff}
.trainee-summary{display:flex;align-items:stretch;gap:6px;flex-wrap:wrap}
.trainee-summary>span{min-width:100px;padding:5px 9px;background:#fafafa;border:1px solid #e4e4e7;border-radius:5px;font-size:13px}
.trainee-summary small{display:block;font-size:10px;color:#71717a;margin-bottom:1px}
.empty-message{padding:10px 12px;color:#7c2d12;background:#fff7ed;border:1px solid #fed7aa;border-radius:6px}

.sheet-tabs{display:flex;gap:0;overflow-x:auto;background:#e5e7eb;border-bottom:1px solid #bfc3c9;padding:0 12px;-webkit-overflow-scrolling:touch}
.sheet-tab{flex:0 0 auto;border:0;border-right:1px solid #c7c9ce;background:transparent;padding:10px 14px;cursor:pointer;font-size:13px;color:#3f3f46}
.sheet-tab:hover{background:#f4f4f5}
.sheet-tab.is-active{background:#fff;font-weight:800;color:#111827;border-top:2px solid #111827;padding-top:8px}

.sheet-main{padding:18px}
.sheet-content{min-height:300px}
.loading-message,.fragment-error,.read-only-note{padding:12px 14px;background:#fff;border:1px solid #ddd;border-radius:6px;font-size:13px}
.read-only-note{margin-bottom:10px;background:#fffbeb;border-color:#fde68a;color:#854d0e}

.excel-scroll{overflow:auto;background:#fff;border:1px solid #d4d4d8;box-shadow:0 2px 10px rgba(0,0,0,.04);max-width:100%;-webkit-overflow-scrolling:touch}
.excel-table{border-collapse:collapse;background:#fff;table-layout:fixed;color:#111;font-family:"Yu Gothic","YuGothic","Meiryo",sans-serif;font-size:14px}
.excel-table th,.excel-table td{padding:4px 7px;vertical-align:middle}
.excel-title-row th{font-size:20px;text-align:left;font-weight:800;padding:10px 8px 12px;border:0}
.excel-subtitle-row th{font-size:15px;text-align:left;font-weight:800;padding:8px;border:0}
.excel-section-row th{font-size:15px;text-align:left;font-weight:700;padding:9px 7px 5px;border:0}
.excel-spacer td{height:18px;padding:0;border:0}
.history-col{width:270px}
.history-head{font-weight:500!important;color:#71717a!important;font-size:11px!important;text-align:left!important}

/* Annual */
.annual-table{width:1160px}
.annual-table col.annual-label{width:150px}
.annual-table th,.annual-table td{border:1px solid #555;white-space:pre-wrap;line-height:1.45}
.annual-table .excel-title-row th{border:0}
.annual-side-label{text-align:center;font-weight:700;background:#fafafa}
.annual-wide-text{text-align:left}
.annual-period-row th,.annual-period-row td{text-align:center;font-weight:700}

/* Education */
.education-table{width:1140px}
.education-table col.edu-main{width:270px}
.education-table col.edu-occ{width:190px}
.education-table th,.education-table td{font-weight:400}
.education-occurrence-row>th,.education-occurrence-row>td{border-bottom:1px solid #a1a1aa;padding-top:6px;padding-bottom:6px}
.education-occurrence-row>th{text-align:center;font-weight:500}
.education-item-row .item-cell{border:1px solid #4b5563;border-right:1px solid #4b5563}
.education-item-row .history-cell{border-bottom:1px solid #e5e7eb}
.education-text-row td{padding:2px 8px;border:0;line-height:1.55}
.occurrence-main{display:flex;align-items:center;justify-content:center;gap:8px}
.occurrence-label{white-space:nowrap}
.occurrence-history-block{display:flex;align-items:flex-start;gap:5px;margin:2px 0}
.history-prefix{font-size:10px;color:#52525b;min-width:42px;padding-top:3px}

/* Skills */
.skills-table{width:1120px}
.skills-table col.skill-item{width:850px}
.skill-section-row th{border:0;border-bottom:1px solid #a1a1aa;text-align:left;padding-top:10px;padding-bottom:5px;font-weight:500}
.skill-item-row td{border:1px solid #3f3f46}
.skill-item-cell{text-align:left;position:relative}

/* Procedures */
.procedure-table{width:1120px}
.procedure-table col.procedure-item{width:850px}
.procedure-group-row th{font-size:15px;text-align:left;padding:8px 7px 4px;border:0;font-weight:600}
.procedure-subgroup-row th{font-size:14px;text-align:left;padding:6px 7px 3px;border:0;font-weight:700}
.procedure-item-row .item-cell{border:1px solid #3f3f46}
.procedure-item-row .history-cell{border-bottom:1px solid #e5e7eb}

/* Evaluation controls */
.item-main-line{display:flex;align-items:center;gap:7px;min-height:25px}
.item-text{flex:1;min-width:0}
.eval-target{display:inline-grid;place-items:center;flex:0 0 auto;width:19px;height:19px;border:1px solid #555;border-radius:1px;background:#fff;color:#111;padding:0;cursor:pointer;line-height:1}
.eval-target:hover:not(:disabled){outline:2px solid #bfdbfe;outline-offset:1px}
.eval-target.is-checked{background:#fff;font-weight:900}
.eval-target:disabled{cursor:default;opacity:1}
.eval-mark{font-size:16px;transform:translateY(-1px)}
.occurrence-check{width:17px;height:17px}
.latest-meta{display:flex;flex-direction:column;align-items:flex-end;gap:0;flex:0 0 auto;margin-left:6px;color:#71717a;font-size:9px;line-height:1.25;white-space:nowrap}
.latest-meta time{font-size:8px;color:#a1a1aa}

.history-cell{vertical-align:top!important;padding:3px 6px!important;background:#fafafa}
.history-list{display:flex;flex-wrap:wrap;gap:3px}
.history-entry{display:inline-flex;align-items:center;gap:2px;border:1px solid #d4d4d8;background:#fff;border-radius:4px;padding:2px 5px;font-size:9px;line-height:1.25;color:#52525b;white-space:nowrap}
button.history-entry{cursor:pointer}
button.history-entry:hover{border-color:#60a5fa;background:#eff6ff}
.comment-none{color:#a1a1aa}

/* Modal */
.modal[hidden]{display:none}
.modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:16px}
.modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.38)}
.modal-card{position:relative;z-index:1;width:min(520px,100%);background:#fff;border-radius:10px;padding:22px;box-shadow:0 18px 55px rgba(0,0,0,.25)}
.modal-card h2{margin:0 30px 8px 0;font-size:19px}
.modal-close{position:absolute;top:8px;right:9px;width:32px;height:32px;border:0;background:transparent;font-size:24px;cursor:pointer}
.eval-item-label{margin:0 0 14px;padding:9px 10px;background:#f4f4f5;border-radius:5px;font-size:13px;line-height:1.5}
.eval-value-choices{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 15px}
.value-choice{border:1px solid #a1a1aa;background:#fff;border-radius:6px;padding:9px 16px;cursor:pointer}
.value-choice.is-selected{border-color:#2563eb;background:#dbeafe;color:#1e3a8a;font-weight:800}
.fixed-value{font-size:14px;font-weight:800;padding:8px 10px;background:#f0fdf4;border:1px solid #bbf7d0;color:#166534;border-radius:6px}
.modal-card label{display:block;font-size:13px;font-weight:700;margin-bottom:5px}
.modal-card textarea{width:100%;resize:vertical;border:1px solid #a1a1aa;border-radius:6px;padding:9px;line-height:1.5}
.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}
.primary-button,.secondary-button{border-radius:6px;padding:9px 15px;cursor:pointer}
.primary-button{border:1px solid #1d4ed8;background:#2563eb;color:#fff;font-weight:700}
.secondary-button{border:1px solid #a1a1aa;background:#fff;color:#27272a}
.primary-button:disabled{opacity:.55;cursor:not-allowed}
.modal-error{min-height:18px;color:#b91c1c;font-size:12px;margin-top:8px}

/* Comment bubble */
.comment-popover{position:fixed;z-index:1200;max-width:min(380px,calc(100vw - 24px));background:#111827;color:#fff;border-radius:7px;padding:10px 12px;box-shadow:0 12px 30px rgba(0,0,0,.3);font-size:12px;line-height:1.55;white-space:pre-wrap}
.comment-popover::after{content:"";position:absolute;top:-6px;left:18px;border-width:0 6px 6px;border-style:solid;border-color:transparent transparent #111827}
.comment-popover .comment-meta{display:block;color:#cbd5e1;font-size:9px;margin-top:6px}
.comment-popover[hidden]{display:none}
.save-toast{position:fixed;right:18px;bottom:18px;z-index:1300;padding:8px 12px;background:#166534;color:#fff;border-radius:6px;font-size:12px;box-shadow:0 8px 20px rgba(0,0,0,.18)}
.save-toast[hidden]{display:none}

@media (max-width:700px){
    .app-header-main{align-items:flex-start;padding:12px}
    .app-header h1{font-size:18px}
    .login-user{flex-wrap:wrap;justify-content:flex-end;font-size:11px}
    .trainee-toolbar{padding:8px 12px 12px;gap:8px}
    .trainee-select{width:100%;min-width:0;font-size:16px}
    .trainee-summary{width:100%}
    .trainee-summary>span{flex:1 1 44%;font-size:12px}
    .sheet-tabs{padding:0}
    .sheet-tab{padding:10px 11px;font-size:12px}
    .sheet-main{padding:10px}
    .excel-table{font-size:13px}
    .history-col{width:220px}
    .annual-table{width:1060px}
    .education-table{width:1030px}
    .skills-table{width:1080px}
    .procedure-table{width:1020px}
    .latest-meta{font-size:8px}
}

/* ===== tab color coding ===== */
.sheet-tab[data-sheet="annual"]{background:#fff6d8!important}
.sheet-tab[data-sheet="education"]{background:#eaf0ff!important}
.sheet-tab[data-sheet="skills"]{background:#e9f8ee!important}
.sheet-tab[data-sheet="initial_visit"]{background:#e8f7fb!important}
.sheet-tab[data-sheet="instructions"]{background:#fff1dc!important}
.sheet-tab[data-sheet="transfusion"]{background:#fde7e7!important}
.sheet-tab[data-sheet="ascites_cart"]{background:#fff0df!important}
.sheet-tab[data-sheet="pleural"]{background:#e7f1ff!important}
.sheet-tab[data-sheet="narcotics"]{background:#f2e9ff!important}
.sheet-tab:hover{filter:brightness(.985)}
.sheet-tab.is-active{
    font-weight:800;
    color:#111827;
    border-top:2px solid #111827;
    padding-top:8px;
    box-shadow:inset 0 -2px 0 rgba(17,24,39,.08);
}


/* ===== education: three-stage evaluation ===== */
:root{
    --education-stage-observe:#eeeeee;
    --education-stage-supervised:#e6f7e8;
    --education-stage-independent:#e4f0ff;
}
.education-history-head{
    background:#f4f4f5!important;
    text-align:center!important;
    vertical-align:bottom!important;
    font-weight:800!important;
}
.education-item-row .item-main-line{
    gap:8px;
    min-height:34px;
}
.education-stage-controls{
    display:flex;
    align-items:center;
    gap:3px;
    flex:0 0 auto;
}
.eval-target.education-stage-target{
    width:42px;
    height:29px;
    padding:1px 2px;
    border:1px solid #9ca3af;
    border-radius:3px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:0;
    line-height:1;
}
.education-stage-target.stage-observe{background:var(--education-stage-observe)}
.education-stage-target.stage-supervised{background:var(--education-stage-supervised)}
.education-stage-target.stage-independent{background:var(--education-stage-independent)}
.education-stage-target.is-checked{
    border-color:#111827;
    box-shadow:inset 0 0 0 1px #111827;
}
.education-stage-check{
    display:grid;
    place-items:center;
    width:12px;
    height:12px;
    border:1px solid #52525b;
    background:rgba(255,255,255,.82);
}
.education-stage-check .eval-mark{
    font-size:11px;
    line-height:10px;
    transform:none;
}
.education-stage-label{
    display:block;
    max-width:100%;
    font-size:5.5px;
    line-height:6px;
    letter-spacing:-.05em;
    white-space:nowrap;
    color:#52525b;
    font-weight:500;
}
.education-stage-target.is-checked .education-stage-label{
    color:#111827;
    font-weight:800;
}
.education-history-list{
    display:flex;
    flex-direction:column;
    gap:2px;
    width:100%;
}
.education-history-entry{
    width:100%;
    min-height:22px;
    display:flex;
    align-items:center;
    gap:4px;
    border:1px solid #d4d4d8;
    border-radius:4px;
    padding:2px 4px;
    color:#3f3f46;
    line-height:1.1;
    text-align:left;
}
.education-history-entry.stage-observe{background:var(--education-stage-observe)}
.education-history-entry.stage-supervised{background:var(--education-stage-supervised)}
.education-history-entry.stage-independent{background:var(--education-stage-independent)}
.education-history-entry.stage-neutral{background:#fff}
.education-history-value{
    flex:0 0 auto;
    font-size:6px;
    line-height:7px;
    font-weight:700;
    white-space:nowrap;
    color:#52525b;
}
.education-history-meta{
    flex:1 1 auto;
    min-width:0;
    font-size:9px;
    line-height:1.15;
    color:#27272a;
}
.education-history-comment,.education-history-entry .comment-none{
    margin-left:auto;
    flex:0 0 auto;
}
button.education-history-entry{
    cursor:pointer;
}
button.education-history-entry:hover{
    border-color:#6b7280;
    filter:brightness(.985);
}
@media (max-width:700px){
    .eval-target.education-stage-target{width:39px;height:28px}
    .education-stage-label{font-size:5px;line-height:5.5px}
    .education-history-value{font-size:5.5px}
    .education-history-meta{font-size:8px}
}

/* ===== all checklists: three-stage evaluation ===== */
.skill-item-row .item-main-line,
.procedure-item-row .item-main-line{
    gap:8px;
    min-height:34px;
}
.skill-item-row .education-stage-controls,
.procedure-item-row .education-stage-controls{
    margin-right:1px;
}
.skill-item-row .history-cell,
.procedure-item-row .history-cell{
    vertical-align:top!important;
}

/* ===== tabs: compact two-row sticky layout ===== */
.sheet-tabs{
    position:-webkit-sticky;
    position:sticky;
    top:0;
    z-index:80;
    display:grid;
    grid-template-columns:repeat(20,minmax(0,1fr));
    gap:0;
    overflow:visible;
    padding:0;
    background:#dfe3e8;
    border-top:1px solid #c7cbd1;
    border-bottom:1px solid #aeb4bc;
    box-shadow:0 2px 5px rgba(0,0,0,.10);
}
.sheet-tab{
    grid-column:span 4;
    min-width:0;
    min-height:28px;
    box-sizing:border-box;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    white-space:normal;
    overflow-wrap:anywhere;
    padding:3px 5px;
    border-right:1px solid #c7c9ce;
    border-bottom:1px solid #c7c9ce;
    font-size:11px;
    line-height:1.08;
}
.sheet-tab:nth-child(n+6){
    grid-column:span 5;
}
.sheet-tab.is-active{
    padding-top:2px;
    border-top:2px solid #111827;
}

@media (max-width:700px){
    .sheet-tabs{
        padding:0;
    }
    .sheet-tab{
        min-height:26px;
        padding:2px 2px;
        font-size:9px;
        line-height:1.05;
    }
    .sheet-tab.is-active{
        padding-top:1px;
    }
}


/* ===== compact neutral history entry ===== */
.education-history-entry.stage-neutral{
    width:max-content;
    max-width:100%;
    min-width:0;
    min-height:12px;
    align-self:flex-start;
    gap:1px;
    padding:1px 2px;
    border-radius:3px;
}
.education-history-entry.stage-neutral .education-history-meta-compact{
    flex:0 0 auto;
    min-width:0;
    display:inline-flex;
    align-items:baseline;
    gap:0;
    line-height:1;
    white-space:nowrap;
}
.education-history-entry.stage-neutral .education-history-name{
    flex:0 0 auto;
    font-size:8px;
    line-height:9px;
    font-weight:700;
    color:#27272a;
}
.education-history-entry.stage-neutral .education-history-date{
    flex:0 0 auto;
    font-size:4px;
    line-height:4px;
    font-weight:500;
    color:#71717a;
    letter-spacing:-.04em;
}
.education-history-entry.stage-neutral .education-history-comment-compact{
    margin-left:1px;
    flex:0 0 auto;
    font-size:7px;
    line-height:8px;
}

/* ===== evaluator surname + ultra-compact history date ===== */
.education-history-meta-compact{
    flex:0 0 auto;
    min-width:0;
    display:inline-flex;
    align-items:baseline;
    gap:0;
    line-height:1;
    white-space:nowrap;
}
.education-history-name{
    flex:0 0 auto;
    font-size:8px;
    line-height:9px;
    font-weight:700;
    color:#27272a;
}
.education-history-date{
    flex:0 0 auto;
    font-size:4px;
    line-height:4px;
    font-weight:500;
    color:#71717a;
    letter-spacing:-.04em;
}
.education-history-entry.no-comment .comment-none{display:none}

/* ===== history compact v4: smallest neutral chip + evaluation detail popover ===== */
.education-history-entry.stage-neutral{
    width:max-content!important;
    max-width:100%;
    min-width:0!important;
    min-height:0!important;
    flex:0 0 auto!important;
    padding:0 1px!important;
    gap:0!important;
}
.education-history-entry.stage-neutral .education-history-meta-compact{
    width:max-content;
}
.education-history-entry.stage-neutral .education-history-name{
    font-size:8px;
    line-height:8px;
}
.education-history-entry.stage-neutral .education-history-date{
    font-size:4px;
    line-height:4px;
    letter-spacing:-.08em;
    transform:translateY(1px);
}
.education-history-entry.stage-neutral .education-history-comment-compact{
    margin-left:1px;
    font-size:7px;
    line-height:7px;
}
.comment-popover .comment-evaluation{
    font-weight:800;
    margin-bottom:4px;
}
.comment-popover .comment-body{
    white-space:pre-wrap;
}
.comment-popover .comment-evaluation + .comment-body{
    padding-top:4px;
    border-top:1px solid rgba(255,255,255,.2);
}


/* ===== history compact all stages v6 =====
   全評価共通:
   苗字 + 極小日付 + コメント時のみ吹き出しアイコン
   背景色は stage-* の既存評価色を維持
*/
.education-history-list > .education-history-entry{
    width:max-content!important;
    max-width:100%!important;
    min-width:0!important;
    min-height:0!important;
    flex:0 0 auto!important;
    align-self:flex-start!important;
    padding:0 1px!important;
    gap:0!important;
    border-radius:3px!important;
}

.education-history-list > .education-history-entry .education-history-meta-compact{
    width:max-content!important;
    flex:0 0 auto!important;
    min-width:0!important;
    display:inline-flex!important;
    align-items:baseline!important;
    gap:0!important;
    line-height:1!important;
    white-space:nowrap!important;
}

.education-history-list > .education-history-entry .education-history-name{
    flex:0 0 auto!important;
    font-size:8px!important;
    line-height:8px!important;
    font-weight:700!important;
    white-space:nowrap!important;
}

.education-history-list > .education-history-entry .education-history-date{
    flex:0 0 auto!important;
    font-size:4px!important;
    line-height:4px!important;
    font-weight:500!important;
    letter-spacing:-.08em!important;
    transform:translateY(1px);
    white-space:nowrap!important;
}

.education-history-list > .education-history-entry .education-history-comment-compact{
    margin-left:1px!important;
    flex:0 0 auto!important;
    font-size:7px!important;
    line-height:7px!important;
}

/* ===== history name/date stacked v7 =====
   名前: 項目本文と同じ文字サイズ
   日付: 名前の直下に5px
   コメントアイコン: 右側、名前+日付と同じ高さ
*/
.education-history-list > .education-history-entry{
    align-items:stretch!important;
    gap:2px!important;
}

.education-history-list > .education-history-entry .education-history-meta-compact{
    display:inline-flex!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    justify-content:center!important;
    gap:0!important;
    width:max-content!important;
    line-height:1!important;
}

.education-history-list > .education-history-entry .education-history-name{
    font-size:inherit!important;
    line-height:1em!important;
    font-weight:700!important;
    white-space:nowrap!important;
}

.education-history-list > .education-history-entry .education-history-date{
    font-size:5px!important;
    line-height:5px!important;
    font-weight:500!important;
    letter-spacing:-.04em!important;
    transform:none!important;
    white-space:nowrap!important;
}

.education-history-list > .education-history-entry .education-history-comment-compact{
    margin:0!important;
    align-self:stretch!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:0 0 auto!important;
    aspect-ratio:1 / 1;
    min-width:calc(1em + 5px);
    padding:0!important;
    font-size:inherit!important;
    line-height:1!important;
}

/* ===== LIVE PATCH occurrence inline v2 START ===== */
/* 過去評価: 各チップは内部で「苗字 / 日付」の2段、チップ同士は横1列 */
.education-history-list{
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    align-items:flex-start!important;
    gap:5px!important;
    width:max-content!important;
    min-width:0!important;
}
.education-history-entry{
    width:max-content!important;
    min-width:0!important;
    min-height:0!important;
    flex:0 0 auto!important;
    align-self:flex-start!important;
    display:inline-flex!important;
    align-items:stretch!important;
    gap:3px!important;
    padding:2px 4px!important;
    border-radius:5px!important;
}
.education-history-entry .education-history-value{
    display:none!important;
}
.education-history-entry .education-history-meta-compact{
    width:max-content!important;
    min-width:0!important;
    flex:0 0 auto!important;
    display:inline-flex!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    justify-content:center!important;
    gap:0!important;
    line-height:1!important;
    white-space:nowrap!important;
}
.education-history-entry .education-history-name{
    flex:0 0 auto!important;
    font-size:14px!important;
    line-height:14px!important;
    font-weight:700!important;
    white-space:nowrap!important;
    color:#27272a!important;
}
.education-history-entry .education-history-date{
    flex:0 0 auto!important;
    font-size:6px!important;
    line-height:7px!important;
    font-weight:500!important;
    letter-spacing:-.03em!important;
    transform:none!important;
    white-space:nowrap!important;
    color:#71717a!important;
}
.education-history-entry .education-history-comment-compact,
.education-history-entry .education-history-comment{
    margin:0!important;
    align-self:stretch!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:0 0 21px!important;
    width:21px!important;
    height:21px!important;
    min-width:21px!important;
    padding:0!important;
    font-size:15px!important;
    line-height:1!important;
}
.history-cell{
    overflow-x:auto!important;
}

/* 1回目/2回目/3回目等: そのチェックの直右に当該履歴を配置 */
.education-occurrence-row.occurrence-inline-row > th{
    text-align:center!important;
    vertical-align:middle!important;
}
.education-occurrence-row.occurrence-inline-row > .occurrence-group-cell{
    padding:0!important;
    background:#fff!important;
    border-bottom:1px solid #a1a1aa!important;
}
.occurrence-group-grid{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    width:100%!important;
}
.occurrence-inline-slot{
    min-width:0!important;
    padding:6px 8px!important;
    border-left:1px solid #d4d4d8!important;
}
.occurrence-inline-slot:first-child{
    border-left:0!important;
}
.occurrence-inline-slot.is-empty{
    min-height:1px!important;
}
.occurrence-main{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:6px!important;
    flex-wrap:nowrap!important;
    min-width:0!important;
}
.occurrence-label{
    flex:0 0 auto!important;
    white-space:nowrap!important;
    font-size:14px!important;
    line-height:1.2!important;
}
.occurrence-check{
    flex:0 0 18px!important;
    width:18px!important;
    height:18px!important;
}
.occurrence-history-inline{
    min-width:0!important;
    flex:1 1 auto!important;
    display:flex!important;
    align-items:center!important;
    overflow-x:auto!important;
}
.occurrence-history-inline .education-history-list{
    flex-wrap:nowrap!important;
    gap:4px!important;
}
/* 旧: 右端の薄グレー枠で 1回目/2回目/3回目 を再掲する要素はHTMLから削除済み */
.occurrence-history-block,
.history-prefix{
    display:none!important;
}
@media (max-width:700px){
    .education-history-entry .education-history-name{
        font-size:13px!important;
        line-height:13px!important;
    }
    .education-history-entry .education-history-date{
        font-size:6px!important;
        line-height:7px!important;
    }
    .education-history-entry .education-history-comment-compact,
    .education-history-entry .education-history-comment{
        flex-basis:20px!important;
        width:20px!important;
        height:20px!important;
        min-width:20px!important;
        font-size:14px!important;
    }
}
/* ===== LIVE PATCH occurrence inline v2 END ===== */

/* ===== LIVE PATCH history size v4 START ===== */
/* Independent final override: evaluator name/date +2px from current v2 layout. */
.education-history-entry .education-history-name{
    font-size:16px!important;
    line-height:16px!important;
}
.education-history-entry .education-history-date{
    font-size:8px!important;
    line-height:8px!important;
}
.education-history-entry .education-history-comment-compact,
.education-history-entry .education-history-comment{
    flex:0 0 24px!important;
    width:24px!important;
    height:24px!important;
    min-width:24px!important;
    font-size:17px!important;
}
@media (max-width:700px){
    .education-history-entry .education-history-name{
        font-size:15px!important;
        line-height:15px!important;
    }
    .education-history-entry .education-history-date{
        font-size:8px!important;
        line-height:8px!important;
    }
    .education-history-entry .education-history-comment-compact,
    .education-history-entry .education-history-comment{
        flex:0 0 23px!important;
        flex-basis:23px!important;
        width:23px!important;
        height:23px!important;
        min-width:23px!important;
        font-size:16px!important;
    }
}
/* ===== LIVE PATCH history size v4 END ===== */

/* ===== LIVE PATCH history size v5 START ===== */
/* High-specificity final override. This intentionally matches the old v7 selector specificity. */
.education-history-list > .education-history-entry .education-history-name{
    font-size:16px!important;
    line-height:16px!important;
}
.education-history-list > .education-history-entry .education-history-date{
    font-size:8px!important;
    line-height:8px!important;
    transform:none!important;
}
.education-history-list > .education-history-entry .education-history-comment-compact,
.education-history-list > .education-history-entry .education-history-comment{
    flex:0 0 24px!important;
    flex-basis:24px!important;
    width:24px!important;
    height:24px!important;
    min-width:24px!important;
    font-size:17px!important;
}
@media (max-width:700px){
    .education-history-list > .education-history-entry .education-history-name{
        font-size:15px!important;
        line-height:15px!important;
    }
    .education-history-list > .education-history-entry .education-history-date{
        font-size:8px!important;
        line-height:8px!important;
    }
    .education-history-list > .education-history-entry .education-history-comment-compact,
    .education-history-list > .education-history-entry .education-history-comment{
        flex:0 0 23px!important;
        flex-basis:23px!important;
        width:23px!important;
        height:23px!important;
        min-width:23px!important;
        font-size:16px!important;
    }
}
/* ===== LIVE PATCH history size v5 END ===== */

/* ===== LIVE PATCH education final goal v1 START ===== */
/* 新人指導教育計画書: 最終目標をタイトル右側へコンパクト表示 */
.education-title-cell{
    padding-top:8px!important;
    padding-bottom:8px!important;
}
.education-title-inline{
    display:flex!important;
    align-items:flex-start!important;
    gap:18px!important;
    width:100%!important;
}
.education-title-main{
    flex:0 0 auto!important;
    white-space:nowrap!important;
    font-size:20px!important;
    line-height:1.15!important;
    font-weight:800!important;
}
.education-final-goal{
    flex:1 1 auto!important;
    min-width:0!important;
    display:flex!important;
    align-items:baseline!important;
    gap:6px!important;
    padding-top:2px!important;
    color:#3f3f46!important;
    font-size:13px!important;
    line-height:1.35!important;
    font-weight:400!important;
}
.education-final-goal-label{
    flex:0 0 auto!important;
    white-space:nowrap!important;
    font-size:12px!important;
    font-weight:800!important;
}
.education-final-goal-text{
    flex:1 1 auto!important;
    min-width:0!important;
    font-size:13px!important;
    line-height:1.35!important;
    font-weight:400!important;
}
/* ===== LIVE PATCH education final goal v1 END ===== */

/* ===== LIVE PATCH user management/account v1 START ===== */
.login-user .user-admin-icon{
    width:27px;height:27px;display:inline-grid;place-items:center;flex:0 0 27px;
    border:1px solid #cbd5e1;border-radius:50%;background:#fff;color:#334155;text-decoration:none;
}
.login-user .user-admin-icon:hover{background:#f1f5f9;border-color:#94a3b8}
.login-user .user-admin-icon svg{width:17px;height:17px;fill:currentColor}
.login-user .user-admin-icon.is-current{background:#e2e8f0}
.login-user .account-role-link{text-decoration:none;cursor:pointer}
.login-user .account-role-link:hover{filter:brightness(.96);text-decoration:underline}
.login-user .account-role-link.is-current{outline:1px solid #94a3b8;outline-offset:1px}

.settings-body{background:#f4f6f8;min-height:100vh}
.settings-header{position:relative;z-index:5}
.settings-page{width:min(1180px,calc(100% - 28px));margin:18px auto 44px}
.settings-topbar{margin-bottom:12px}
.settings-back{display:inline-flex;align-items:center;color:#334155;text-decoration:none;font-size:13px;font-weight:700}
.settings-back:hover{text-decoration:underline}
.settings-card{background:#fff;border:1px solid #d8dde4;border-radius:9px;padding:18px;margin-bottom:16px;box-shadow:0 2px 8px rgba(15,23,42,.04)}
.settings-card h1,.settings-card h2{margin:0 0 14px}.settings-card h2{font-size:18px}
.settings-flash{padding:10px 12px;border-radius:6px;margin-bottom:12px;font-size:13px;font-weight:700}
.settings-flash.success{background:#ecfdf5;border:1px solid #a7f3d0;color:#166534}
.settings-flash.error{background:#fef2f2;border:1px solid #fecaca;color:#991b1b}
.settings-section-title{display:flex;align-items:center;justify-content:space-between;gap:10px}
.settings-section-title>span{font-size:12px;color:#64748b}
.user-admin-form,.user-admin-row,.account-password-form{display:grid;gap:10px}
.user-create-form{grid-template-columns:repeat(3,minmax(0,1fr));align-items:end}
.user-admin-form label,.user-admin-row label,.account-password-form label{display:flex;flex-direction:column;gap:4px;min-width:0}
.user-admin-form label>span,.user-admin-row label>span,.account-password-form label>span{font-size:10px;color:#64748b;font-weight:700}
.user-admin-form input,.user-admin-form select,.user-admin-row input,.user-admin-row select,.account-password-form input{
    width:100%;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:5px;background:#fff;padding:8px 9px;font-size:13px;color:#111827;
}
.user-form-actions{display:flex;align-items:end}
.settings-primary{border:1px solid #1d4ed8;background:#2563eb;color:#fff;border-radius:5px;padding:8px 13px;font-weight:800;cursor:pointer;white-space:nowrap}
.settings-primary:hover{background:#1d4ed8}
.user-admin-list{display:flex;flex-direction:column;gap:7px}
.user-admin-row{grid-template-columns:1.05fr 1.2fr .8fr .9fr .9fr 1fr auto auto;align-items:end;padding:10px;border:1px solid #e2e8f0;border-radius:7px;background:#fff}
.user-admin-row.is-inactive{opacity:.58;background:#f8fafc}
.user-active-toggle{align-self:center!important;flex-direction:row!important;align-items:center!important;gap:5px!important;padding-top:14px}
.user-active-toggle input{width:auto!important}
.account-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0}
.account-summary-grid>div{border:1px solid #e2e8f0;border-radius:6px;padding:10px}
.account-summary-grid dt{font-size:10px;color:#64748b;font-weight:700;margin-bottom:4px}
.account-summary-grid dd{margin:0;font-size:14px;font-weight:700;color:#111827}
.account-admin-note{margin:12px 0 0;font-size:13px}
.account-password-form{grid-template-columns:repeat(3,minmax(0,1fr)) auto;align-items:end}
.settings-note{font-size:11px;color:#64748b;margin:10px 0 0}
@media (max-width:900px){
    .user-create-form{grid-template-columns:repeat(2,minmax(0,1fr))}
    .user-admin-row{grid-template-columns:repeat(2,minmax(0,1fr))}
    .account-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .account-password-form{grid-template-columns:1fr 1fr}
}
@media (max-width:600px){
    .settings-page{width:min(100% - 16px,1180px);margin-top:10px}
    .settings-card{padding:12px}
    .user-create-form,.user-admin-row,.account-summary-grid,.account-password-form{grid-template-columns:1fr}
    .login-user .user-admin-icon{width:25px;height:25px;flex-basis:25px}
}
/* ===== LIVE PATCH user management/account v1 END ===== */

/* ===== LIVE PATCH clinic affiliation tabs v1 START ===== */
.clinic-switch-row{
    width:100%;display:flex;align-items:center;gap:8px;min-width:0;
}
.clinic-switch-label{flex:0 0 auto;font-size:11px;font-weight:800;color:#475569}
.clinic-switch-tabs{
    display:flex;align-items:stretch;gap:0;min-width:0;max-width:100%;
    border:1px solid #cbd5e1;border-radius:6px;overflow-x:auto;background:#f8fafc;
}
.clinic-switch-tab{
    flex:0 0 auto;min-width:72px;border:0;border-right:1px solid #cbd5e1;background:#f8fafc;
    padding:6px 11px;font-size:11px;line-height:1.1;color:#475569;cursor:pointer;white-space:nowrap;
}
.clinic-switch-tab:last-child{border-right:0}
.clinic-switch-tab:hover{background:#eef2f7}
.clinic-switch-tab.is-active{background:#334155;color:#fff;font-weight:800}
.trainee-picker-row{display:flex;align-items:center;gap:8px;min-width:260px}
.trainee-summary[hidden],#traineeEmpty[hidden]{display:none!important}
.trainee-summary b{font:inherit;font-weight:700}

.clinic-management-tabs{
    display:flex;align-items:stretch;gap:0;overflow-x:auto;margin:0 0 14px;
    border:1px solid #cbd5e1;border-radius:7px;background:#fff;
}
.clinic-management-tab{
    min-width:82px;padding:8px 13px;border-right:1px solid #cbd5e1;
    text-align:center;text-decoration:none;color:#475569;background:#f8fafc;
    font-size:12px;font-weight:700;white-space:nowrap;
}
.clinic-management-tab:last-child{border-right:0}
.clinic-management-tab:hover{background:#eef2f7}
.clinic-management-tab.is-active{background:#334155;color:#fff}

/* ユーザー管理の列順: 氏名 → ID → 権限 → 所属... */
.user-admin-row{grid-template-columns:1.2fr 1.05fr .8fr .9fr .9fr 1fr auto auto!important}

@media (max-width:700px){
    .clinic-switch-row{align-items:flex-start;flex-direction:column;gap:4px}
    .clinic-switch-tabs{width:100%}
    .clinic-switch-tab{min-width:64px;padding:6px 9px;font-size:10px}
    .trainee-picker-row{width:100%;min-width:0}
    .trainee-picker-row .trainee-select{flex:1 1 auto;width:auto}
    .clinic-management-tab{min-width:70px;padding:7px 10px;font-size:11px}
    .user-admin-row{grid-template-columns:1fr!important}
}
/* ===== LIVE PATCH clinic affiliation tabs v1 END ===== */

/* ===== LIVE PATCH clinic UI north v1 START ===== */
/* Clinic tabs: fixed clinic colors. Active state is a thick BLACK frame, not a background change. */
.clinic-switch-row{
    flex-wrap:wrap!important;
}
.clinic-switch-tabs{
    flex:0 1 auto!important;
    max-width:100%!important;
}
.clinic-switch-tab,
.clinic-management-tab{
    box-sizing:border-box!important;
    transition:filter .12s ease, box-shadow .12s ease!important;
}

.clinic-switch-tab[data-clinic="konan"],
.clinic-management-tab[data-clinic="konan"]{background:#6B7280!important;color:#fff!important}
.clinic-switch-tab[data-clinic="kani"],
.clinic-management-tab[data-clinic="kani"]{background:#D85B7F!important;color:#fff!important}
.clinic-switch-tab[data-clinic="tajimi"],
.clinic-management-tab[data-clinic="tajimi"]{background:#1976D2!important;color:#fff!important}
.clinic-switch-tab[data-clinic="komaki"],
.clinic-management-tab[data-clinic="komaki"]{background:#B8860B!important;color:#fff!important}
.clinic-switch-tab[data-clinic="ichinomiya"],
.clinic-management-tab[data-clinic="ichinomiya"]{background:#2E7D32!important;color:#fff!important}
.clinic-switch-tab[data-clinic="moriyama"],
.clinic-management-tab[data-clinic="moriyama"]{background:#7E57C2!important;color:#fff!important}
.clinic-switch-tab[data-clinic="gifu"],
.clinic-management-tab[data-clinic="gifu"]{background:#E67E22!important;color:#fff!important}
.clinic-switch-tab[data-clinic="kitanagoya"],
.clinic-management-tab[data-clinic="kitanagoya"]{background:#E5E7EB!important;color:#1f2937!important}
.clinic-management-tab[data-clinic=""]{background:#F3F4F6!important;color:#374151!important;min-width:128px!important}

.clinic-switch-tab:hover,
.clinic-management-tab:hover{
    filter:brightness(.94)!important;
}
.clinic-switch-tab.is-active,
.clinic-management-tab.is-active{
    /* Keep each clinic's assigned background color; indicate selection with a thick black frame. */
    box-shadow:inset 0 0 0 3px #000!important;
    font-weight:900!important;
    filter:none!important;
}

.clinic-missing-nurse-link{
    flex:0 0 auto!important;
    display:inline-flex!important;
    align-items:center!important;
    min-height:28px!important;
    padding:5px 10px!important;
    border:1px solid #d97706!important;
    border-radius:6px!important;
    background:#fff7ed!important;
    color:#9a3412!important;
    font-size:11px!important;
    line-height:1.15!important;
    font-weight:800!important;
    text-decoration:none!important;
    white-space:nowrap!important;
}
.clinic-missing-nurse-link:hover{background:#ffedd5!important}

.clinic-management-tabs{
    align-items:stretch!important;
}
.clinic-unset-guidance{
    flex:0 0 auto!important;
    display:inline-flex!important;
    align-items:center!important;
    padding:6px 10px!important;
    background:#fff7ed!important;
    color:#b45309!important;
    border-left:2px solid #f59e0b!important;
    font-size:11px!important;
    line-height:1.2!important;
    font-weight:800!important;
    white-space:nowrap!important;
}

@media (max-width:700px){
    .clinic-missing-nurse-link{font-size:10px!important;padding:5px 8px!important}
    .clinic-unset-guidance{font-size:10px!important}
}
/* ===== LIVE PATCH clinic UI north v1 END ===== */

/* ===== LIVE PATCH ui comments education v2 START ===== */
/* ユーザー管理の所属タブ: トップ画面と同寸法・同色・同じ黒枠選択状態 */
.clinic-management-row{width:100%!important;display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important;margin:0 0 14px!important;flex-wrap:wrap!important}
.clinic-management-tabs{flex:0 1 auto!important;display:flex!important;align-items:stretch!important;gap:0!important;min-width:0!important;max-width:100%!important;margin:0!important;border:1px solid #cbd5e1!important;border-radius:6px!important;overflow-x:auto!important;background:#f8fafc!important}
.clinic-management-tab{flex:0 0 auto!important;min-width:72px!important;padding:6px 11px!important;border:0!important;border-right:1px solid #cbd5e1!important;border-radius:0!important;text-align:center!important;text-decoration:none!important;font-size:11px!important;line-height:1.1!important;font-weight:700!important;white-space:nowrap!important}
.clinic-management-tab:last-child{border-right:0!important}
.clinic-management-tab[data-clinic=""]{min-width:112px!important}
.clinic-unset-guidance{flex:0 0 auto!important;display:inline-flex!important;align-items:center!important;padding:3px 7px!important;border:1px solid #fdba74!important;border-radius:5px!important;background:#fff7ed!important;color:#c2410c!important;font-size:9px!important;line-height:1.15!important;font-weight:700!important;white-space:nowrap!important}

/* 教育計画書: 1〜20回/1〜15回を①診察同行の直上に2区画で集約 */
.education-occurrence-dashboard-row>td{padding:4px 5px!important;background:#f8fafc!important;border-bottom:1px solid #9ca3af!important}
.education-occurrence-dashboard{display:grid!important;grid-template-columns:1fr 1fr!important;gap:5px!important;width:100%!important}
.education-occurrence-panel{min-width:0!important;border:1px solid #b8bec7!important;background:#fff!important}
.education-occurrence-panel-title{padding:2px 5px!important;border-bottom:1px solid #cbd5e1!important;background:#f1f5f9!important;font-size:10px!important;line-height:12px!important;font-weight:800!important;text-align:left!important}
.education-occurrence-top-grid{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:0!important}
.education-occurrence-top-item{min-width:0!important;min-height:31px!important;padding:2px 3px!important;border-right:1px solid #e2e8f0!important;border-bottom:1px solid #e2e8f0!important;box-sizing:border-box!important}
.education-occurrence-top-item:nth-child(5n){border-right:0!important}
.education-occurrence-top-item.is-empty{background:#fafafa!important}
.education-occurrence-top-main{min-width:0!important;display:flex!important;align-items:center!important;gap:2px!important;flex-wrap:nowrap!important}
.education-occurrence-top-label{flex:0 0 auto!important;white-space:nowrap!important;font-size:8px!important;line-height:10px!important;font-weight:600!important}
.education-occurrence-top-check{flex:0 0 14px!important;width:14px!important;height:14px!important}
.education-occurrence-top-check .eval-mark{font-size:12px!important}
.education-occurrence-top-history{min-width:0!important;flex:1 1 auto!important;overflow-x:auto!important}
.education-occurrence-top-history .education-history-list{gap:2px!important}
.education-occurrence-top-history .education-history-entry{padding:1px 2px!important;gap:1px!important}
.education-occurrence-top-history .education-history-name{font-size:9px!important;line-height:9px!important}
.education-occurrence-top-history .education-history-date{font-size:6px!important;line-height:6px!important}
.education-occurrence-top-history .education-history-comment,.education-occurrence-top-history .education-history-comment-compact{flex:0 0 15px!important;width:15px!important;height:15px!important;min-width:15px!important;font-size:10px!important}

/* コメント再編集/追記 */
.comment-popover{min-width:220px}
.comment-body-empty{color:#94a3b8;font-size:10px}
.comment-edit-actions{display:flex;justify-content:flex-end;margin-top:7px}
.comment-edit-open,.comment-edit-save{border:1px solid #93c5fd;background:#eff6ff;color:#1d4ed8;border-radius:5px;padding:4px 8px;font-size:10px;font-weight:800;cursor:pointer}
.comment-edit-box{margin-top:7px;padding-top:7px;border-top:1px solid #374151}
.comment-edit-label{font-size:9px;color:#cbd5e1;margin-bottom:4px}
.comment-edit-textarea{width:100%;box-sizing:border-box;resize:vertical;border:1px solid #64748b;border-radius:4px;background:#fff;color:#111827;padding:6px;font-size:11px;line-height:1.4}
.comment-edit-save-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:5px}
.comment-edit-error{font-size:9px;color:#fecaca}
.comment-edit-save:disabled{opacity:.55;cursor:default}

@media (max-width:700px){
    .clinic-management-row{align-items:flex-start!important;flex-direction:column!important;gap:4px!important}
    .clinic-management-tabs{width:100%!important}
    .clinic-management-tab{min-width:64px!important;padding:6px 9px!important;font-size:10px!important}
    .clinic-management-tab[data-clinic=""]{min-width:104px!important}
    .clinic-unset-guidance{font-size:8px!important;padding:3px 6px!important}
    .education-occurrence-dashboard{grid-template-columns:1fr!important}
}
/* ===== LIVE PATCH ui comments education v2 END ===== */

/* ===== LIVE PATCH sticky cumulative ui v1 START ===== */
/* 教育計画書上部の回数チェック横履歴だけ、僅かにheightを節約 */
.education-occurrence-top-history .education-history-entry{
    padding:0 2px!important;
    gap:1px!important;
}
.education-occurrence-top-history .education-history-name{
    font-size:8.5px!important;
    line-height:9px!important;
}
.education-occurrence-top-history .education-history-date{
    font-size:5.5px!important;
    line-height:5px!important;
}
.education-occurrence-top-history .education-history-comment,
.education-occurrence-top-history .education-history-comment-compact{
    flex:0 0 14px!important;
    width:14px!important;
    height:14px!important;
    min-width:14px!important;
    font-size:9px!important;
}

/* ユーザー管理の所属変更案内: 9pxから少し大きく */
.clinic-unset-guidance{
    font-size:11px!important;
    line-height:1.2!important;
}
@media (max-width:700px){
    .clinic-unset-guidance{
        font-size:10px!important;
    }
}
/* ===== LIVE PATCH sticky cumulative ui v1 END ===== */

/* ===== LIVE PATCH stage toggle search sticky v1 START ===== */
/* キャンセル済み段階: 再チェックできることを僅かに示す */
.education-stage-target.was-cancelled:not(.is-checked){outline:1px dashed rgba(55,65,81,.45);outline-offset:1px}

/* 「チェックのみ / チェック＋評価」選択 */
.stage-recheck-overlay{position:fixed;inset:0;z-index:1600;display:grid;place-items:center;padding:16px}
.stage-recheck-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.38)}
.stage-recheck-card{position:relative;z-index:1;width:min(430px,100%);background:#fff;border-radius:9px;padding:18px;box-shadow:0 18px 55px rgba(0,0,0,.28)}
.stage-recheck-title{font-size:17px;font-weight:800;margin-bottom:6px}
.stage-recheck-label{font-size:12px;line-height:1.45;padding:7px 8px;background:#f8fafc;border-radius:5px;margin-bottom:13px}
.stage-recheck-actions{display:flex;justify-content:flex-end;gap:7px;flex-wrap:wrap}
.stage-recheck-actions button{border:1px solid #94a3b8;background:#fff;border-radius:6px;padding:8px 11px;font-size:12px;font-weight:800;cursor:pointer}
.stage-recheck-only{background:#f0fdf4!important;border-color:#86efac!important;color:#166534!important}
.stage-recheck-evaluate{background:#eff6ff!important;border-color:#93c5fd!important;color:#1d4ed8!important}
.stage-recheck-error{min-height:16px;margin-top:7px;font-size:10px;color:#b91c1c}

/* 回数チェック横の履歴: 名前をもう少し小さく、heightもわずかに節約 */
.education-occurrence-top-history .education-history-entry{padding:0 2px!important;gap:1px!important}
.education-occurrence-top-history .education-history-name{font-size:7.5px!important;line-height:8px!important}
.education-occurrence-top-history .education-history-date{font-size:5.5px!important;line-height:5px!important}
.education-occurrence-top-history .education-history-comment,
.education-occurrence-top-history .education-history-comment-compact{flex:0 0 13px!important;width:13px!important;height:13px!important;min-width:13px!important;font-size:8.5px!important}

/* ユーザー管理: 登録ユーザー見出し右に即時検索 */
.settings-section-title{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap!important}
.settings-section-title h2{margin-right:auto!important}
.user-search-box{display:flex;align-items:center;gap:5px;margin-left:auto}
.user-search-box label{font-size:10px;font-weight:800;color:#475569}
.user-search-box input{width:230px;max-width:42vw;border:1px solid #94a3b8;border-radius:6px;padding:6px 8px;font-size:12px;background:#fff}
.user-admin-row.user-search-hidden{display:none!important}

/* ユーザー管理: 戻るを一番右の明確なボタンへ */
.settings-topbar{display:flex!important;justify-content:flex-end!important;align-items:center!important;width:100%!important}
.settings-topbar .settings-back{margin-left:auto!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;border:1px solid #64748b!important;border-radius:7px!important;background:#f8fafc!important;color:#334155!important;padding:8px 13px!important;font-size:13px!important;line-height:1.1!important;font-weight:800!important;text-decoration:none!important;box-shadow:0 1px 2px rgba(15,23,42,.08)!important}
.settings-topbar .settings-back:hover{background:#e2e8f0!important}

/* 対象選択 + 所属/権限/入職日 + シートタブをまとめてsticky */
.training-sticky-block{position:sticky;top:0;z-index:120;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.12)}
.training-sticky-info{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:5px 14px;background:#f8fafc;border-top:1px solid #e2e8f0;border-bottom:1px solid #cbd5e1}
.training-sticky-info .trainee-picker-row{margin:0!important;min-width:250px!important}
.training-sticky-info .trainee-summary{margin:0!important;flex:1 1 auto!important}
.training-sticky-block .sheet-tabs{position:static!important;top:auto!important;z-index:auto!important;box-shadow:none!important}

@media (max-width:700px){
    .user-search-box{width:100%;margin-left:0}
    .user-search-box input{flex:1 1 auto;width:auto;max-width:none}
    .training-sticky-info{padding:4px 8px;gap:5px}
    .training-sticky-info .trainee-picker-row{width:100%;min-width:0!important}
    .training-sticky-info .trainee-summary{width:100%}
}
/* ===== LIVE PATCH stage toggle search sticky v1 END ===== */

/* ===== LIVE PATCH history search fix v3 START ===== */
/*
   教育計画書上部の「1回目✓ 木下9/3💬」だけを確実に小さくする。
   既存の高詳細度 + !important 規則を上回るため、同じDOM階層まで指定する。
*/
.education-occurrence-top-history .education-history-list > .education-history-entry .education-history-name{
    font-size:8px!important;
    line-height:8px!important;
}
.education-occurrence-top-history .education-history-list > .education-history-entry .education-history-date{
    font-size:5px!important;
    line-height:5px!important;
}
.education-occurrence-top-history .education-history-list > .education-history-entry .education-history-comment,
.education-occurrence-top-history .education-history-list > .education-history-entry .education-history-comment-compact{
    flex:0 0 13px!important;
    width:13px!important;
    height:13px!important;
    min-width:13px!important;
    font-size:8px!important;
}
/* hidden属性とclassの両方で確実に非表示 */
.user-admin-row[hidden],
.user-admin-row.user-search-hidden{
    display:none!important;
}
/* ===== LIVE PATCH history search fix v3 END ===== */

/* ===== LIVE PATCH history search fix v4 START ===== */
/* 回数チェック右の履歴: 8pxは小さすぎたため10pxへ。旧!importantより高い詳細度で最終上書き。 */
.education-occurrence-top-history .education-history-list > .education-history-entry .education-history-name{
    font-size:10px!important;
    line-height:10px!important;
}
.education-occurrence-top-history .education-history-list > .education-history-entry .education-history-date{
    font-size:5.5px!important;
    line-height:5.5px!important;
}
.education-occurrence-top-history .education-history-list > .education-history-entry .education-history-comment,
.education-occurrence-top-history .education-history-list > .education-history-entry .education-history-comment-compact{
    flex:0 0 13px!important;
    width:13px!important;
    height:13px!important;
    min-width:13px!important;
    font-size:8px!important;
}
.user-admin-row.user-search-hidden,
.user-admin-row[hidden]{
    display:none!important;
}
/* ===== LIVE PATCH history search fix v4 END ===== */

/* ===== LIVE PATCH occurrence complete size v1 START ===== */
/* 1〜20回目/1〜15回目: チェック済みセルは淡い緑で完了状態を視覚化。 */
.education-occurrence-top-item:has(.education-occurrence-top-check.is-checked){
    background:#e8f5e9!important;
}

/* 回数チェック行全体の文字を現状から約2px拡大。 */
.education-occurrence-top-label{
    font-size:10px!important;
    line-height:12px!important;
}
.education-occurrence-top-check .eval-mark{
    font-size:14px!important;
}
.education-occurrence-top-history .education-history-list > .education-history-entry .education-history-name{
    font-size:12px!important;
    line-height:12px!important;
}
.education-occurrence-top-history .education-history-list > .education-history-entry .education-history-date{
    font-size:7.5px!important;
    line-height:7.5px!important;
}
.education-occurrence-top-history .education-history-list > .education-history-entry .education-history-comment,
.education-occurrence-top-history .education-history-list > .education-history-entry .education-history-comment-compact{
    flex:0 0 15px!important;
    width:15px!important;
    height:15px!important;
    min-width:15px!important;
    font-size:10px!important;
}
/* ===== LIVE PATCH occurrence complete size v1 END ===== */

/* ===== LIVE PATCH occurrence complete color v2 START ===== */
/*
  回数チェック完了色:
  見学のみ=グレー / 見守り=緑 / 自立=青 と被らないよう、
  完了は淡いゴールド系に統一。
*/
.education-occurrence-top-item:has(.education-occurrence-top-check.is-checked){
    background:#FFF3BF!important;
    box-shadow:inset 0 0 0 1px #D6B85A!important;
}
/* ===== LIVE PATCH occurrence complete color v2 END ===== */

/* ===== LIVE PATCH diagnosis complete blue v1 START ===== */
/*
  診察同行の回数チェック完了色だけを、他より少し濃い青へ。
  訪問看護は既存の完了色（淡いゴールド）を維持する。
*/
.education-occurrence-panel.occurrence-panel-diagnosis
.education-occurrence-top-item:has(.education-occurrence-top-check.is-checked){
    background:#C6DCF4!important;
    box-shadow:inset 0 0 0 1px #5B84B1!important;
}
/* ===== LIVE PATCH diagnosis complete blue v1 END ===== */
