:root {
  color-scheme: light;
  --ink: #142936; --green: #0a5945; --muted: #68757c; --line: #d4dfda;
  --header: #eef4f1; --paper: #fff; --danger: #d91d30;
  font-family: "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  color: var(--ink); background: var(--paper); font-synthesis: none;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, select, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled, select:disabled { cursor: wait; opacity: .6; }
button:focus-visible, select:focus-visible, input:focus-visible, .roster-scroll:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.workspace { width: 100%; max-width: 430px; margin: 0 auto; padding: 12px 9px 22px; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 46px; margin: 0 4px 8px; }
.brand { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.wordmark { font-family: Georgia, "Times New Roman", serif; font-size: 35px; color: #00543f; line-height: 1; letter-spacing: -.9px; }
h1 { font-size: 21px; font-weight: 700; line-height: 1.5; letter-spacing: 1px; margin: 0; padding-left: 12px; border-left: 1px solid #899598; }
.import-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 9px; min-height: 42px; border: 1px solid var(--green); border-radius: 3px; background: white; color: var(--green); font-size: 15px; font-weight: 700; white-space: nowrap; }
.import-button img { filter: invert(25%) sepia(21%) saturate(2003%) hue-rotate(117deg) brightness(87%) contrast(101%); }
.roster-meta { display: flex; align-items: center; min-height: 25px; gap: 7px; margin: 0 4px 5px; }
.roster-meta strong { font-size: 21px; line-height: 1.2; font-weight: 500; }
#unanswered { font-size: 11px; color: var(--muted); }
#save-status { font-size: 10px; color: var(--muted); margin-left: auto; max-width: 98px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 3px; background: transparent; padding: 5px; min-width: 28px; min-height: 28px; }
.refresh { padding: 4px; min-width: 24px; min-height: 28px; }
.summary-table, .answers-table { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; font-variant-numeric: tabular-nums; }
.rank-summary { overflow: hidden; border: 1px solid var(--line); border-radius: 4px; }
.summary-table th, .summary-table td { text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 3px; }
.summary-table th:last-child, .summary-table td:last-child { border-right: 0; }
.summary-table tbody tr:last-child > * { border-bottom: 0; }
.summary-table thead { background: var(--header); }
.summary-table thead th { height: 36px; font-size: 15px; font-weight: 600; }
.summary-table tbody th { font-size: 15px; font-weight: 600; width: 19%; }
.summary-table tbody td { font-size: 17px; font-weight: 500; }
.summary-table tbody tr { height: 42px; }
.over-capacity { color: var(--danger); }
.tier-icon { --tier-size: 24px; display: inline-block; width: var(--tier-size); height: var(--tier-size); background-image: url("/static/assets/migration-tiers.png"); background-repeat: no-repeat; background-size: calc(var(--tier-size) * 7.24) calc(var(--tier-size) * 2.413333); vertical-align: middle; background-position-y: calc(var(--tier-size) * -.69); flex-shrink: 0; }
.tier-icon.white { background-position-x: calc(var(--tier-size) * -.406667); }
.tier-icon.blue { background-position-x: calc(var(--tier-size) * -2.216667); }
.tier-icon.purple { background-position-x: calc(var(--tier-size) * -4.026667); }
.tier-icon.gold { background-position-x: calc(var(--tier-size) * -5.836667); }
.answer-summary { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin-top: 14px; }
.answer-summary h2 { background: var(--header); margin: 0; height: 28px; padding: 4px 9px; font-size: 14px; line-height: 20px; font-weight: 700; border-bottom: 1px solid var(--line); }
.answers-table th, .answers-table td { height: 26px; padding: 1px 3px; text-align: center; font-size: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.answers-table th { background: var(--header); font-weight: 600; }
.answers-table td { font-size: 15px; }
.answers-table tr:last-child > * { border-bottom: 0; }
.answers-table th:last-child, .answers-table td:last-child { border-right: 0; }
.roster-section { margin-top: 13px; }
.roster-scroll { overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 4px; height: clamp(228px, calc(100dvh - 480px), 362px); scrollbar-color: #9da8aa #e8ebeb; scrollbar-width: thin; }
.roster-scroll::-webkit-scrollbar { width: 5px; height: 8px; }
.roster-scroll::-webkit-scrollbar-track { background: #e8ebeb; }
.roster-scroll::-webkit-scrollbar-thumb { background: #9da8aa; border-radius: 8px; }
.roster-table { border-spacing: 0; width: calc(100% + 86px); min-width: 446px; table-layout: fixed; font-size: 14px; }
.col-name { width: 75px; }.col-survey { width: 76px; }.col-tier { width: 43px; }.col-policy { width: 86px; }
.roster-table th, .roster-table td { padding: 0 3px; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.roster-table tr > :last-child { border-right: 0; }
.roster-table thead th { position: sticky; top: 0; z-index: 4; background: var(--header); height: 27px; font-size: 13px; font-weight: 600; }
.roster-table thead tr:last-child th { top: 27px; height: 30px; }
.roster-table .commander-heading { left: 0; z-index: 6; }
.roster-table tbody th { position: sticky; left: 0; z-index: 2; background: #fdfcf8; font-weight: 600; text-align: left; padding-left: 7px; }
.roster-table tbody td { background: white; }
.roster-table tbody tr:focus-within > * { background-color: #ecf7f3; }
.roster-table tbody tr { height: 37px; }
.roster-table tbody th, .roster-table tbody td { height: 37px; }
.name-button { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 0; padding: 6px 0; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sort-button { display: flex; align-items: center; justify-content: center; gap: 2px; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; font-size: 12px; font-weight: 700; white-space: nowrap; }
.power-sort { font-size: 11.5px; gap: 2px; white-space: normal; line-height: 1.35; }
.power-sort img { flex-shrink: 0; }
.sort-button img[hidden] { visibility: hidden; display: inline-block !important; }
.cell-select { appearance: none; -webkit-appearance: none; width: 100%; min-height: 28px; padding: 2px 12px 2px 2px; background: #fff url("/static/assets/icons/chevron-down.svg") no-repeat right 3px center / 8px; border: 1px solid #e3e8e5; border-radius: 4px; color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.4; }
.policy-select { font-size: 12px; }
.tier-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 30px; padding: 2px; border: 0; border-radius: 5px; background: #f5f6f5; }
.unset { color: #879096; font-size: 17px; line-height: 1; }
.power-cell { text-align: right !important; padding-right: 7px !important; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 500; }
.unsaved { box-shadow: inset 0 0 0 1px #bd780d; background-color: #fff6df !important; }
.empty-state { height: 160px !important; padding: 25px !important; font-size: 13px; line-height: 1.9; color: var(--muted); }
.scroll-hint { display: flex; align-items: center; justify-content: space-between; margin: 17px 4px 0; gap: 4px; font-size: 12px; font-weight: 600; color: #56636c; }
.scroll-hint .icon-button { min-width: 30px; }
#scroll-arrow.reversed { transform: rotate(180deg); }
.error-panel { margin-top: 12px; padding: 9px; background: #fff3f2; border: 1px solid #e8b9b4; border-radius: 4px; font-size: 12px; line-height: 1.6; }
.error-panel p { margin: 0 0 7px; white-space: pre-wrap; }
.error-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.error-actions button, .dialog-actions button, .name-dialog > button { padding: 7px 10px; border: 1px solid #a7b6af; border-radius: 4px; background: white; font-size: 13px; }
dialog { padding: 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; max-height: 85dvh; overflow: auto; }
dialog::backdrop { background: rgb(15 32 25 / 24%); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dialog-heading h2 { margin: 0; font-size: 16px; line-height: 1.5; }
.tier-picker { width: min(340px, calc(100vw - 24px)); }
.tier-options { display: flex; gap: 6px; justify-content: space-between; }
.tier-choice { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 52px; min-height: 66px; padding: 7px 2px; border: 1px solid var(--line); border-radius: 5px; background: white; font-size: 12px; }
.tier-choice[aria-pressed="true"] { border-color: var(--green); background: #ecf7f2; }
.tier-choice .tier-icon { --tier-size: 28px; }
.name-dialog { width: min(340px, calc(100vw - 24px)); }
.name-dialog h2 { margin: 0 0 16px; font-size: 18px; overflow-wrap: anywhere; white-space: pre-wrap; }
.import-dialog { width: min(410px, calc(100vw - 24px)); font-size: 13px; }
.import-description { line-height: 1.8; margin: 0 0 15px; }
.file-label { display: block; font-weight: 600; font-size: 12px; }
.file-label input { display: block; width: 100%; font-weight: 400; font-size: 12px; margin: 7px 0; }
#import-message { min-height: 20px; line-height: 1.7; white-space: pre-wrap; }
#import-plan { border-top: 1px solid var(--line); padding-top: 10px; }
.plan-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center; }
.plan-counts dt { color: var(--muted); font-size: 12px; }.plan-counts dd { margin: 2px 0; font-size: 20px; }
.plan-changes { max-height: 180px; overflow: auto; line-height: 1.7; }
.plan-changes h3 { font-size: 12px; margin: 12px 0 3px; }
.plan-changes ul { margin: 0; padding-left: 20px; word-break: break-word; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dialog-actions .primary-button { background: var(--green); border-color: var(--green); color: white; font-weight: 600; }
@media (max-width: 359px) { .brand { gap: 8px; }.wordmark { font-size: 30px; } h1 { font-size: 17px; padding-left: 8px; letter-spacing: .2px; } .import-button { font-size: 13px; padding: 0 7px; gap: 5px; } .import-button img { width: 16px; } #save-status { max-width: 78px; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
