:root {
  --page-bg: #f9fafb;
  --panel-bg: #ffffff;
  --line: #e5e7eb;
  --line-soft: #f3f4f6;
  --text: #111827;
  --muted: #6b7280;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --amber: #92400e;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page-bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 0.8125rem; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

.app-header { padding: 0.75rem 1rem; background: var(--panel-bg); border-bottom: 1px solid var(--line); }
.app-header__inner, .page-shell { width: 100%; max-width: 60rem; margin: 0 auto; }
.app-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.app-header__start { display: flex; flex: 1; align-items: center; min-width: 0; gap: 0.75rem; }
.app-header__start > div { min-width: 0; }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.75rem; }
.header-action { padding: 0; color: #4b5563; background: transparent; border: 0; cursor: pointer; font: inherit; font-size: 0.75rem; font-weight: 500; white-space: nowrap; }
.header-action:hover { color: #374151; }
.header-logout { margin: 0; }
.account-menu { position: relative; }
.account-menu__trigger { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2rem; padding: 0.125rem 0; color: #4b5563; cursor: pointer; font-size: 0.75rem; font-weight: 500; list-style: none; }
.account-menu__trigger::-webkit-details-marker { display: none; }
.account-menu__trigger:hover, .account-menu[open] .account-menu__trigger { color: #374151; }
.account-menu__avatar { position: relative; width: 1.75rem; height: 1.75rem; flex: 0 0 auto; overflow: hidden; background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 50%; }
.account-menu__avatar::before { position: absolute; top: 0.3125rem; left: 50%; width: 0.5rem; height: 0.5rem; background: #9ca3af; border-radius: 50%; content: ""; transform: translateX(-50%); }
.account-menu__avatar::after { position: absolute; bottom: -0.1875rem; left: 50%; width: 1rem; height: 0.8125rem; background: #9ca3af; border-radius: 0.625rem 0.625rem 0 0; content: ""; transform: translateX(-50%); }
.account-menu__username { white-space: nowrap; }
.account-menu__popover { position: absolute; top: calc(100% + 0.375rem); right: 0; z-index: 10; width: 7.5rem; padding: 0.25rem; background: #fff; border: 1px solid var(--line); border-radius: 0.5rem; box-shadow: 0 0.5rem 1rem rgba(17, 24, 39, 0.12); }
.account-menu__form { margin: 0; }
.account-menu__item { display: flex; width: 100%; min-height: 2rem; align-items: center; padding: 0.375rem 0.5rem; color: #4b5563; background: transparent; border: 0; border-radius: 0.25rem; cursor: pointer; font: inherit; font-size: 0.75rem; font-weight: 500; text-align: left; }
.account-menu__item:hover { color: #374151; background: #f9fafb; }
.header-back { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.375rem 0.25rem; color: #4b5563; background: transparent; border: 0; cursor: pointer; font-size: 0.75rem; font-weight: 500; white-space: nowrap; }
.header-back:hover { color: #374151; }
.app-title { margin: 0; font-size: 1rem; font-weight: 700; }
.app-subtitle { margin: 0.125rem 0 0; color: var(--muted); font-size: 0.75rem; }
.page-shell { padding: 1rem; }

.panel { overflow: hidden; background: var(--panel-bg); border: 1px solid var(--line); border-radius: 0.5rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.panel + .panel { margin-top: 1rem; }
.panel__header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; background: #f9fafb; border-bottom: 1px solid var(--line-soft); }
.panel__title { margin: 0; font-size: 0.875rem; font-weight: 600; }
.panel__header--period { flex-wrap: wrap; }
.panel__header--period .toolbar { margin-left: auto; }
.period-header__title { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; min-width: 0; }
.panel__body { padding: 0.75rem 1rem; }
.auth-shell { display: grid; min-height: calc(100dvh - 4.5rem); align-items: center; padding: 1rem; }
.auth-panel { width: 100%; max-width: 26rem; margin: 0 auto; }
.auth-panel .panel__body { padding: 1rem; }
.auth-form { display: grid; gap: 0.75rem; }
.auth-form .btn { width: 100%; }
.auth-help { margin: 0; color: var(--muted); font-size: 0.75rem; }

.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.625rem; }
.toolbar--end { margin-left: auto; }
.field-label { display: grid; gap: 0.25rem; color: var(--muted); font-size: 0.75rem; }
.select, .text-input, .textarea, .month-input { width: 100%; min-height: 2.75rem; padding: 0.5rem 0.75rem; color: var(--text); background: #fff; border: 1px solid #d1d5db; border-radius: 0.375rem; font-size: 0.8125rem; }
.textarea { min-height: 5rem; resize: vertical; }
.month-input { max-width: 10rem; }
.period-switcher .select,
.period-creator .month-input,
.period-creator .btn,
.period-action .btn { height: 31px; min-height: 31px; }
.period-switcher .select,
.period-creator .month-input { padding: 0 10px; }
.period-creator .month-input { width: 9rem; max-width: 100%; }
.period-creator .btn,
.period-action .btn { padding: 0 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.375rem 0.75rem; border: 0; border-radius: 0.375rem; cursor: pointer; font-size: 0.75rem; font-weight: 500; line-height: 1.25; white-space: nowrap; }
.btn-primary { color: #fff; background: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { color: #4b5563; background: #fff; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #f9fafb; }
.btn[disabled] { cursor: not-allowed; opacity: 0.5; }

.alert { margin-bottom: 1rem; padding: 0.75rem 1rem; border: 1px solid; border-radius: 0.5rem; font-size: 0.8125rem; }
.alert-success { color: #166534; background: #f0fdf4; border-color: #bbf7d0; }
.alert-error { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.notice { padding: 1.5rem; color: var(--muted); font-size: 0.8125rem; text-align: center; }

.status { display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0.125rem 0.5rem; border-radius: 999px; font-size: 0.6875rem; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.status-done { color: #166534; background: #dcfce7; }
.status-pending { color: var(--amber); background: #fef3c7; }
.status-current { color: #1d4ed8; background: #dbeafe; }
.status-published { color: #5b21b6; background: #ede9fe; }
.bg-purple-100 { background: #f3e8ff; }
.text-purple-800 { color: #6b21a8; }
.bg-green-100 { background: #dcfce7; }
.text-green-800 { color: #166534; }
.bg-blue-100 { background: #dbeafe; }
.text-blue-800 { color: #1e40af; }
.bg-yellow-100 { background: #fef9c3; }
.text-yellow-800 { color: #854d0e; }
.bg-red-100 { background: #fee2e2; }
.text-red-800 { color: #991b1b; }
.bg-gray-100 { background: #f3f4f6; }
.text-gray-800 { color: #1f2937; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.stat-box { padding: 0.75rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 0.5rem; }
.stat-label { color: var(--muted); font-size: 0.75rem; }
.stat-value { margin-top: 0.25rem; font-size: 1.375rem; font-weight: 700; line-height: 1.2; }
.stat-help { margin-top: 0.25rem; color: var(--muted); font-size: 0.75rem; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--line-soft); font-size: 0.8125rem; vertical-align: middle; }
.data-table th { color: #4b5563; background: #f9fafb; font-size: 0.75rem; font-weight: 600; }
.table-wrap { overflow-x: auto; }
.progress-self-cell, .progress-self-mobile { display: grid; justify-items: start; gap: 0.375rem; }
.progress-self-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.text-action { padding: 0; color: #4b5563; background: transparent; border: 0; cursor: pointer; font: inherit; font-size: 0.75rem; font-weight: 500; line-height: 1.5; }
.text-action:hover { color: #374151; }
.link-list { display: grid; gap: 0.75rem; }
.link-stage + .link-stage { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.link-stage__header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.625rem; }
.link-stage__title { margin: 0; color: #374151; font-size: 0.8125rem; font-weight: 600; }
.link-stage__weight { color: var(--muted); font-size: 0.75rem; }
.link-item { padding: 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; }
.link-item__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.8125rem; }
.link-item__meta { margin-top: 0.25rem; color: var(--muted); font-size: 0.75rem; }
.link-item__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.625rem; }

.relationship-tree { display: grid; gap: 1rem; }
.relationship-stage + .relationship-stage { padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.relationship-stage__header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.75rem; }
.relationship-stage__title { margin: 0; color: #374151; font-size: 0.8125rem; font-weight: 600; }
.relationship-stage__weight { color: var(--muted); font-size: 0.75rem; }
.relationship-nodes { position: relative; display: grid; gap: 0.75rem; padding-left: 1rem; }
.relationship-nodes::before { position: absolute; top: 0.75rem; bottom: 0.75rem; left: 0.25rem; border-left: 1px solid var(--line); content: ""; }
.relationship-node { position: relative; min-width: 0; padding: 0.75rem; background: #fff; border: 1px solid var(--line); border-radius: 0.5rem; }
.relationship-node::before { position: absolute; top: 1.25rem; left: -0.75rem; width: 0.75rem; border-top: 1px solid var(--line); content: ""; }
.relationship-node__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.relationship-node__reviewer { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; }
.relationship-role { display: inline-flex; align-items: center; min-height: 1.5rem; padding: 0.125rem 0.5rem; color: #4b5563; background: #f3f4f6; border-radius: 999px; font-size: 0.6875rem; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.relationship-node__count { color: var(--muted); font-size: 0.75rem; }
.relationship-node__body { display: grid; gap: 0.5rem; margin-top: 0.625rem; }
.relationship-node__label { color: var(--muted); font-size: 0.75rem; }
.relationship-targets { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0; padding: 0; list-style: none; }
.relationship-targets li { padding: 0.25rem 0.5rem; color: #374151; background: #f9fafb; border: 1px solid var(--line-soft); border-radius: 0.25rem; font-size: 0.75rem; }
.relationship-scope { margin: 0 0 1rem; padding: 0.625rem 0.75rem; color: var(--muted); background: #f9fafb; border: 1px solid var(--line-soft); border-radius: 0.375rem; font-size: 0.75rem; line-height: 1.5; }
.relationship-editor { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 0.5rem; }
.relationship-editor + .relationship-tree { margin-top: 1rem; }
.relationship-editor__summary { display: flex; min-height: 2.75rem; align-items: center; padding: 0.625rem 0.75rem; color: #4b5563; background: #f9fafb; cursor: pointer; font-size: 0.8125rem; font-weight: 600; }
.relationship-editor__summary::marker { color: var(--muted); }
.relationship-editor[open] .relationship-editor__summary { border-bottom: 1px solid var(--line-soft); }
.relationship-editor--inline { border: 0; border-radius: 0; }
.relationship-editor--create > .relationship-editor__summary { display: none; }
.relationship-editor--inline .relationship-editor__summary { display: inline-flex; min-height: auto; padding: 0; color: #4b5563; background: transparent; font-size: 0.75rem; font-weight: 500; }
.relationship-editor--inline[open] .relationship-editor__summary { margin-bottom: 0.75rem; border-bottom: 0; }
.relationship-form { display: grid; gap: 0.75rem; padding: 0.75rem; }
.relationship-form__fields { display: grid; gap: 0.75rem; }
.relationship-stage-value { display: flex; min-height: 2.75rem; align-items: center; padding: 0.5rem 0.75rem; color: #4b5563; background: #f9fafb; border: 1px solid var(--line); border-radius: 0.375rem; font-size: 0.8125rem; }
.relationship-members { min-width: 0; margin: 0; padding: 0; border: 0; }
.relationship-members legend { margin-bottom: 0.5rem; color: var(--muted); font-size: 0.75rem; }
.relationship-member-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.relationship-member { display: flex; min-width: 0; min-height: 2.75rem; align-items: center; gap: 0.5rem; padding: 0.5rem 0.625rem; background: #fff; border: 1px solid var(--line); border-radius: 0.375rem; cursor: pointer; }
.relationship-member:hover { background: #f9fafb; }
.relationship-member input { width: 1rem; height: 1rem; flex: 0 0 auto; margin: 0; accent-color: var(--blue); }
.relationship-member span { display: grid; min-width: 0; gap: 0.0625rem; }
.relationship-member strong { overflow: hidden; color: #374151; font-size: 0.75rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.relationship-member small { overflow: hidden; color: var(--muted); font-size: 0.6875rem; text-overflow: ellipsis; white-space: nowrap; }
.relationship-form__actions { display: flex; justify-content: flex-end; }
.relationship-node__actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.75rem; margin-top: 0.75rem; padding-top: 0.625rem; border-top: 1px solid var(--line-soft); }
.relationship-node__actions .relationship-editor[open] { flex: 1 0 100%; padding-top: 0.75rem; border-top: 1px solid var(--line-soft); }
.relationship-delete-form { margin: 0; }
.text-action--danger { color: #b91c1c; }
.text-action--danger:hover { color: #991b1b; }
.relationship-empty { margin: 0; padding: 0.75rem; color: var(--muted); font-size: 0.75rem; text-align: center; }

.review-shell { display: grid; gap: 1rem; }
.review-overview { padding: 0.75rem 1rem; background: #fff; border: 1px solid var(--line); border-radius: 0.5rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.review-overview__name { margin: 0; font-size: 1rem; }
.review-overview__meta { margin: 0.125rem 0 0; color: var(--muted); font-size: 0.75rem; }
.member-nav { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.75rem 0; }
.member-nav a { display: grid; flex: 0 0 auto; min-width: 7rem; gap: 0.125rem; padding: 0.5rem 0.625rem; color: #374151; background: #fff; border: 1px solid var(--line); border-radius: 0.375rem; font-size: 0.75rem; }
.member-nav a:hover { border-color: #93c5fd; background: #eff6ff; }
.member-nav small { color: var(--muted); font-size: 0.6875rem; }
.review-form { display: grid; gap: 1rem; }
.member-section { scroll-margin-top: 1rem; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 0.5rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.member-section__header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; background: #f9fafb; border-bottom: 1px solid var(--line-soft); }
.member-section__name { margin: 0; font-size: 0.875rem; }
.member-section__position { margin: 0.125rem 0 0; color: var(--muted); font-size: 0.75rem; }
.dimension { border-bottom: 1px solid var(--line-soft); }
.dimension:last-of-type { border-bottom: 0; }
.dimension__title { margin: 0; padding: 0.625rem 1rem; color: #374151; background: #f9fafb; font-size: 0.875rem; font-weight: 600; }
.review-item { display: grid; gap: 0.75rem; padding: 0.75rem 1rem; border-top: 1px solid var(--line-soft); }
.review-item:first-of-type { border-top: 0; }
.review-item__name { font-size: 0.8125rem; font-weight: 600; }
.review-item__weight { color: var(--muted); font-size: 0.75rem; }
.review-item__score { display: flex; align-items: center; gap: 0.375rem; margin-top: 0.375rem; color: var(--muted); font-size: 0.75rem; }
.review-item__score output { min-width: 3.25rem; padding: 0.125rem 0.375rem; color: #374151; background: #f9fafb; border: 1px solid var(--line); border-radius: 0.25rem; font-weight: 600; line-height: 1.25rem; text-align: center; }
.grade-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.375rem; margin: 0; padding: 0; border: 0; }
.grade-choice { position: relative; }
.grade-choice input { position: absolute; opacity: 0; pointer-events: none; }
.grade-choice span { display: flex; align-items: center; justify-content: center; min-height: 2rem; color: #4b5563; background: #fff; border: 1px solid #d1d5db; border-radius: 0.375rem; font-size: 0.75rem; font-weight: 600; }
.grade-choice input:checked + span { color: #1d4ed8; background: #dbeafe; border-color: #bfdbfe; }
.grade-choice input:focus + span { outline: 2px solid #93c5fd; outline-offset: 2px; }
.grade-choice input:disabled + span { opacity: 0.65; }
.bonus-panel { padding: 0.75rem 1rem; background: #fffbeb; border-top: 1px solid #fde68a; }
.bonus-panel__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem; }
.bonus-panel__title { margin: 0; font-size: 0.875rem; }
.bonus-panel__hint { color: var(--amber); font-size: 0.75rem; }
.bonus-panel__total { margin-left: auto; color: #4b5563; font-size: 0.75rem; font-weight: 600; }
.bonus-options { display: grid; gap: 0.5rem; margin-top: 0.625rem; }
.bonus-option { display: grid; grid-template-columns: 1rem minmax(0, 1fr) auto; align-items: center; gap: 0.625rem; min-height: 2.75rem; padding: 0.5rem 0.625rem; background: #fff; border: 1px solid #fde68a; border-radius: 0.375rem; cursor: pointer; }
.bonus-option.is-selected { background: #eff6ff; border-color: #93c5fd; }
.bonus-option input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--blue); }
.bonus-option input:disabled { cursor: default; }
.bonus-option__content { display: grid; min-width: 0; gap: 0.125rem; }
.bonus-option__type { color: var(--muted); font-size: 0.6875rem; }
.bonus-option__description { color: #374151; font-size: 0.75rem; }
.bonus-option__score { font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.bonus-option__score--positive { color: #166534; }
.bonus-option__score--negative { color: #b91c1c; }
.submit-bar { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line); box-shadow: 0 -0.25rem 0.75rem rgba(17, 24, 39, 0.05); }
.submit-bar__help { color: var(--muted); font-size: 0.75rem; }

.result-signature-page { display: grid; gap: 1rem; }
.signature-score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.result-stage-scores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-stage-scores > div { display: grid; gap: 0.25rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line-soft); }
.result-stage-scores > div:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.result-stage-scores > div:nth-last-child(-n + 2) { border-bottom: 0; }
.result-stage-scores span { color: var(--muted); font-size: 0.75rem; }
.result-stage-scores strong { font-size: 1rem; }
.result-detail-table td { white-space: nowrap; }
.result-detail-table small { display: block; margin-top: 0.1875rem; color: var(--muted); font-size: 0.6875rem; }
.signature-panel { overflow: visible; }
.signature-form { display: grid; gap: 0.75rem; }
.signature-form__notice { margin: 0; color: var(--muted); font-size: 0.75rem; }
.signature-confirm { display: flex; align-items: flex-start; gap: 0.5rem; color: #374151; font-size: 0.75rem; line-height: 1.5; }
.signature-confirm input { width: 1rem; height: 1rem; flex: 0 0 auto; margin: 0.0625rem 0 0; accent-color: var(--blue); }
.signature-pad { width: 100%; height: 10rem; overflow: hidden; background: #fff; border: 1px dashed #9ca3af; border-radius: 0.375rem; }
.signature-pad canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.signature-form__error { min-height: 1.25rem; margin: 0; color: #b91c1c; font-size: 0.75rem; }
.signature-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.signed-result { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.signed-result__image { width: min(100%, 15rem); height: 6rem; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 0.375rem; }
.wecom-settings-page { max-width: 60rem; }
.wecom-settings-form { display: grid; gap: 1rem; }
.wecom-message-panel { margin-top: 1rem; }
.wecom-field-grid, .wecom-role-grid { display: grid; gap: 0.75rem; }
.wecom-settings-actions { display: flex; justify-content: flex-end; }
.wecom-note-list, .wecom-message-list { display: grid; }
.wecom-note, .wecom-message-rule { display: grid; gap: 0.25rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line-soft); }
.wecom-note:first-child, .wecom-message-rule:first-child { padding-top: 0; }
.wecom-note:last-child, .wecom-message-rule:last-child { padding-bottom: 0; border-bottom: 0; }
.wecom-note strong, .wecom-message-rule strong { color: #374151; font-size: 0.8125rem; font-weight: 600; }
.wecom-note span, .wecom-message-rule span, .wecom-panel-help, .field-help { color: var(--muted); font-size: 0.75rem; line-height: 1.5; }
.wecom-match-table-wrap { margin-top: 0.75rem; border-top: 1px solid var(--line-soft); }
.wecom-match-table th:last-child, .wecom-match-table td:last-child { text-align: right; }
.wecom-directory-header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem; }
.wecom-directory-header-actions form { margin: 0; }
.wecom-directory-header-actions .btn { min-height: 2rem; }
.wecom-directory-tree { display: grid; margin-top: 0.75rem; border: 1px solid var(--line-soft); border-radius: 0.375rem; }
.wecom-directory-tree__summary { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; padding: 0.625rem 0.75rem; color: var(--muted); background: #f9fafb; border-bottom: 1px solid var(--line-soft); font-size: 0.75rem; }
.wecom-directory-node { display: flex; min-width: 0; align-items: center; gap: 0.625rem; min-height: 2.5rem; padding: 0.5rem 0.75rem 0.5rem calc(0.75rem + var(--directory-depth) * 1rem); border-bottom: 1px solid var(--line-soft); }
.wecom-directory-node:last-child { border-bottom: 0; }
.wecom-directory-node--department { color: #374151; background: #fff; }
.wecom-directory-node__department { min-width: 0; overflow: hidden; font-size: 0.8125rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.wecom-directory-node__count { margin-left: auto; color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.wecom-directory-node--member { background: #fcfcfd; }
.wecom-directory-node__member { display: grid; min-width: 0; gap: 0.0625rem; }
.wecom-directory-node__member strong { overflow: hidden; color: #374151; font-size: 0.75rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.wecom-directory-node__member small { overflow: hidden; color: var(--muted); font-size: 0.6875rem; text-overflow: ellipsis; white-space: nowrap; }
.wecom-directory-node--member .status { margin-left: auto; }
.wecom-directory-empty { display: grid; gap: 0.25rem; margin-top: 0.75rem; padding: 0.75rem; color: var(--muted); background: #f9fafb; border: 1px solid var(--line-soft); border-radius: 0.375rem; font-size: 0.75rem; line-height: 1.5; }
.wecom-directory-empty strong { color: #4b5563; font-size: 0.8125rem; font-weight: 600; }
.wecom-approval-body { display: grid; gap: 0.75rem; }
.wecom-approval-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-soft); border-radius: 0.375rem; }
.wecom-approval-flow > div { display: grid; gap: 0.25rem; min-width: 0; padding: 0.75rem; border-right: 1px solid var(--line-soft); }
.wecom-approval-flow > div:last-child { border-right: 0; }
.wecom-approval-flow span { color: var(--muted); font-size: 0.75rem; }
.wecom-approval-flow strong { overflow: hidden; color: #374151; font-size: 0.8125rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.field-help { display: block; }
.wecom-panel-help { margin: 0; }
.wecom-period-panel { margin-top: 1rem; }
.wecom-status-grid { display: grid; grid-template-columns: 1fr; }
.wecom-status-item { display: grid; gap: 0.25rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line-soft); }
.wecom-status-item:last-child { border-bottom: 0; }
.wecom-status-item span { color: var(--muted); font-size: 0.75rem; }
.wecom-status-item strong { color: #374151; font-size: 0.8125rem; font-weight: 600; }

@media (min-width: 640px) {
  .page-shell { padding: 1rem; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .review-item { grid-template-columns: minmax(11rem, 1fr) minmax(16rem, 1fr); align-items: center; }
  .relationship-nodes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .relationship-form__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .relationship-member-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .signature-score-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .result-stage-scores { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .result-stage-scores > div, .result-stage-scores > div:nth-last-child(-n + 2) { border-bottom: 0; border-right: 1px solid var(--line-soft); }
  .result-stage-scores > div:last-child { border-right: 0; }
  .wecom-field-grid, .wecom-role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wecom-status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wecom-status-item { border-right: 1px solid var(--line-soft); border-bottom: 0; }
  .wecom-status-item:last-child { border-right: 0; }
}

@media (max-width: 639px) {
  .app-header__inner { align-items: flex-start; }
  .header-actions { gap: 0.5rem; }
  .wecom-directory-header-actions { width: 100%; justify-content: space-between; }
  .wecom-directory-node { padding-left: calc(0.75rem + var(--directory-depth) * 0.75rem); }
  .wecom-directory-node__count { display: none; }
  .wecom-approval-flow { grid-template-columns: 1fr; }
  .wecom-approval-flow > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .wecom-approval-flow > div:last-child { border-bottom: 0; }
}

@media (min-width: 1024px) {
  .review-shell { grid-template-columns: 12rem minmax(0, 1fr); align-items: start; }
  .review-sidebar { position: sticky; top: 1rem; }
  .member-nav { display: grid; overflow: visible; padding: 0; }
  .member-nav a { min-width: 0; }
  .mobile-progress { display: none; }
}

@media (max-width: 1023px) {
  .desktop-progress { display: none; }
}
