.dept-intro { border-left: 4px solid #b78245; padding: 1rem 1.2rem; background: #f7f2fb; border-radius: 0 10px 10px 0; margin-bottom: 1.25rem; }
.dept-intro h1 { font-size: 1.55rem; font-weight: 600; color: #4a1d72; margin: 0 0 .3rem; }
.dept-intro p { color: #536071; margin: 0; }
.dept-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; }
.dept-unit-card { border: 1px solid #ddd5e6; border-top: 3px solid #68378f; border-radius: 10px; background: #fff; padding: 1rem 1.1rem; }
.dept-unit-card h2 { font-size: 1.12rem; line-height: 1.5; margin: 0 0 .35rem; color: #2f2440; }
.dept-unit-card p { margin: .25rem 0; font-size: .9rem; color: #536071; }
.dept-unit-card a { display: inline-flex; gap: .4rem; margin-top: .6rem; color: #593082; font-weight: 500; }
.dept-unit-card a:focus-visible, .dept-action:focus-visible, .dept-form :focus-visible { outline: 3px solid #c18a32; outline-offset: 2px; }
.dept-badge { display: inline-block; border-radius: 99px; background: #f0e8f8; color: #593082; padding: .18rem .65rem; font-size: .78rem; }
.dept-badge--muted { background: #edf0f3; color: #485567; }
.dept-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .9fr); gap: 1.25rem; align-items: start; }
.dept-card { background: #fff; border: 1px solid #e5ddeb; border-radius: 12px; padding: 1.15rem; margin-bottom: 1.25rem; box-shadow: 0 2px 10px rgba(38,20,55,.04); min-width: 0; }
.dept-card h2 { margin: 0 0 .8rem; color: #352645; font-size: 1.1rem; }
.dept-card p { color: #586476; }
.dept-node-list { list-style: none; padding: 0; margin: 0; }
.dept-node-row { display: flex; align-items: center; justify-content: space-between; gap: .7rem; border-bottom: 1px solid #ebe6ef; padding: .58rem .2rem; }
.dept-node-name { min-width: 0; overflow-wrap: anywhere; line-height: 1.45; }
.dept-node-name small { color: #6a7380; display: block; }
.dept-node-actions { display: flex; flex-wrap: wrap; gap: .5rem; flex: none; }
.dept-action { border: 1px solid #c9b7d9; color: #51306f; border-radius: 7px; background: #fff; padding: .3rem .6rem; text-decoration: none; cursor: pointer; font: inherit; font-size: .82rem; }
.dept-action:hover { background: #f3ecf8; }
.dept-action--primary { color: #fff; background: #593082; border-color: #593082; }
.dept-action--primary:hover { background: #49216f; color: #fff; }
.dept-action--danger { color: #a1253d; border-color: #d9a9b4; }
.dept-form { display: grid; gap: .8rem; }
.dept-form label { display: grid; gap: .25rem; color: #364053; font-size: .9rem; }
.dept-form input[type=text], .dept-form input[type=number], .dept-form select { width: 100%; border: 1px solid #cbd3dc; border-radius: 7px; padding: .55rem .65rem; font: inherit; background: #fff; color: #1e293b; }
.dept-form textarea { width: 100%; min-height: 19rem; border: 1px solid #cbd3dc; border-radius: 7px; padding: .75rem; font: inherit; line-height: 1.7; resize: vertical; }
.dept-prose { white-space: pre-line; line-height: 1.9; color: #303947; overflow-wrap: anywhere; }
.dept-form .dept-check { display: flex; align-items: center; gap: .45rem; }
.dept-form .dept-check input { width: 1.1rem; height: 1.1rem; }
.dept-alert { padding: .8rem 1rem; margin: 0 0 1rem; border-radius: 8px; background: #eaf7ef; color: #145936; }
.dept-alert--error { background: #fff0f1; color: #8a1c2e; }
.dept-muted { color: #667485; font-size: .88rem; }
.department-chart-scroll { overflow: auto; max-width: 100%; container-type: inline-size; padding: .5rem .75rem 1.5rem; background: #faf8fc; border: 1px solid #e9e1ef; border-radius: 10px; }
.department-chart-scroll:focus-visible { outline: 3px solid #c18a32; }
.department-chart { width: 100%; font-family: 'Kanit', sans-serif; }
.department-chart-level { list-style: none; padding: 0; margin: 0; }
.department-chart-item { position: relative; min-width: 0; }
.department-chart > .department-chart-level > .department-chart-item > .department-chart-box { width: min(280px, 100%); margin: 0 auto; font-size: 1.05rem; }
.department-chart > .department-chart-level > .department-chart-item > .department-chart-level { display: grid; grid-template-columns: repeat(var(--department-top-children, 4), minmax(190px, 1fr)); width: max(100%, calc(var(--department-top-children, 4) * 205px)); gap: .8rem; padding-top: 2rem; margin-top: .5rem; position: relative; }
.department-chart > .department-chart-level > .department-chart-item > .department-chart-level::before { content: ''; position: absolute; left: 50cqw; top: -.5rem; height: 1.5rem; border-left: 2px solid #b7a8c6; }
.department-chart > .department-chart-level > .department-chart-item > .department-chart-level::after { content: ''; position: absolute; left: calc(50% / var(--department-top-children, 4)); right: calc(50% / var(--department-top-children, 4)); top: 1rem; border-top: 2px solid #b7a8c6; }
.department-chart > .department-chart-level > .department-chart-item > .department-chart-level > .department-chart-item::before { content: ''; position: absolute; left: 50%; top: -1rem; height: 1rem; border-left: 2px solid #b7a8c6; }
.department-chart-level .department-chart-level { margin: .65rem 0 0 .65rem; padding-left: .65rem; border-left: 2px solid #cabbd6; }
.department-chart > .department-chart-level > .department-chart-item > .department-chart-level { margin-left: 0; padding-left: 0; border-left: 0; }
.department-chart-level .department-chart-level .department-chart-item { padding: .35rem 0; }
.department-chart-level .department-chart-level .department-chart-level .department-chart-item::before { content: ''; position: absolute; left: -1.3rem; top: 1.45rem; width: .65rem; border-top: 2px solid #cabbd6; }
.department-chart-box { width: 100%; min-height: 2.8rem; display: flex; align-items: center; justify-content: center; padding: .55rem .8rem; border-radius: 1.2rem; color: #fff; font-size: .89rem; line-height: 1.35; text-align: center; box-shadow: 0 3px 8px rgba(42,27,61,.11); overflow-wrap: anywhere; }
.department-chart-box--purple { background: #68378f; }
.department-chart-box--orange { background: #aa5b16; }
.department-chart-box--magenta { background: #923b9d; }
.department-chart-box--blue { background: #176b98; }
.department-chart-empty { margin: 0; padding: 1rem; color: #586476; }
@media (max-width: 900px) { .dept-layout { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .department-chart > .department-chart-level > .department-chart-item > .department-chart-level { grid-template-columns: 1fr; width: 100%; padding-top: .8rem; }
  .department-chart > .department-chart-level > .department-chart-item > .department-chart-level::before,
  .department-chart > .department-chart-level > .department-chart-item > .department-chart-level::after,
  .department-chart > .department-chart-level > .department-chart-item > .department-chart-level > .department-chart-item::before { display: none; }
  .department-chart-level .department-chart-level { margin-left: .4rem; padding-left: .55rem; }
  .department-chart-box { min-height: 2.6rem; border-radius: 9px; }
  .dept-node-row { align-items: flex-start; }
}
.dept-position-row { display: grid; grid-template-columns: 52px minmax(0,1fr) auto; gap: .75rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid #ebe6ef; }
.dept-position-row img { width: 52px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid #d7dce3; }
.dept-position-row strong, .dept-position-row small { display: block; overflow-wrap: anywhere; }
.dept-position-row strong { color: #342542; }
.dept-position-row small { color: #657181; margin: .12rem 0 .3rem; }
.dept-person-links { display: flex; gap: .45rem; flex-wrap: wrap; }
.dept-person-links a { color: #593082; padding: .2rem .5rem; border: 1px solid #ddd5e6; border-radius: 5px; }
.department-page { background: #f7f5f9; min-height: 75vh; color: #2e2538; }
.department-hero { background: linear-gradient(115deg,#32163f,#623c83); color: #fff; padding: 3.4rem 0 3rem; border-bottom: 3px solid #bf9e51; }
.department-hero span { display: block; font: 600 .72rem Inter, sans-serif; color: #e7c881; letter-spacing: .16em; margin-bottom: .35rem; }
.department-hero a { color: #f3dbad; text-decoration: none; }
.department-hero h1 { font-size: clamp(2rem,4vw,3rem); line-height: 1.2; margin: .4rem 0; color: #fff; }
.department-hero p { margin: .4rem 0 0; color: #e9dff1; }
.department-public-wrap { padding-top: 2.25rem; padding-bottom: 4rem; }
.department-directory { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); gap: 1rem; }
.department-directory-card { background: #fff; border: 1px solid #e4dbea; border-top: 3px solid #68408a; border-radius: 10px; padding: 1.25rem; box-shadow: 0 7px 22px rgba(48,25,68,.05); }
.department-directory-card > span { color: #a17d39; font: 700 .83rem Inter,sans-serif; }
.department-directory-card h2 { color: #32223f; font-size: 1.2rem; line-height: 1.45; margin: .6rem 0; }
.department-directory-card p { color: #5e6671; font-size: .9rem; margin-bottom: .9rem; }
.department-directory-card a { display: inline-flex; gap: .6rem; align-items: center; color: #5a2b80; font-weight: 600; text-decoration: none; }
.department-public-layout { display: grid; grid-template-columns: 205px minmax(0,1fr); gap: 1.5rem; align-items: start; }
.department-side { display: grid; gap: .4rem; position: sticky; top: 110px; background: #fff; border: 1px solid #e4dbea; border-radius: 10px; padding: .6rem; }
.department-side a { display: block; padding: .65rem .8rem; border-radius: 6px; color: #53465c; text-decoration: none; }
.department-side a[aria-current="page"] { background: #5b2f7e; color: #fff; }
.department-side a:hover:not([aria-current="page"]) { background: #f3ecf8; color: #4d2670; }
.department-side .department-side-back { border-top: 1px solid #e7dfec; border-radius: 0; margin-top: .35rem; }
.department-main { min-width: 0; background: #fff; border: 1px solid #e4dbea; border-radius: 12px; padding: clamp(1rem,2.5vw,2rem); box-shadow: 0 7px 24px rgba(48,25,68,.05); }
.department-main h2 { font-size: 1.6rem; color: #392248; padding-bottom: .65rem; margin: 0 0 1rem; border-bottom: 2px solid #d8b775; }
.department-source-note { color: #5b6675; font-size: .89rem; margin-bottom: 1rem; }
.department-duties-text { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.9; color: #303946; }
.department-people-group { margin: 1.8rem 0 2.3rem; }
.department-people-group h3 { background: #633b82; border-left: 4px solid #d7b36b; color: #fff; font-size: 1.07rem; padding: .6rem 1rem; margin-bottom: 1rem; }
.department-people-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,190px),230px)); justify-content: center; gap: .9rem; }
.department-person-card { min-width: 0; text-align: center; padding: 1rem .75rem 1.2rem; border: 1px solid #e8e1ec; border-radius: 9px; background: #fcfbfd; }
.department-person-card img { display: block; width: 122px; height: 150px; margin: 0 auto .75rem; border-radius: 6px; border: 3px solid white; box-shadow: 0 2px 8px #4b315140; object-fit: cover; }
.department-person-card h4 { color: #2c2041; font-size: 1rem; line-height: 1.45; margin: 0 0 .3rem; overflow-wrap: anywhere; }
.department-person-card p { color: #5a2b80; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
.department-person-card small { display: block; color: #687181; line-height: 1.45; margin-top: .35rem; overflow-wrap: anywhere; }
.department-person-card h4, .department-person-card p, .department-person-card small { text-align: center; }
.department-public-notice { padding: 1.5rem; background: #fff; border-radius: 8px; }
.department-page a:focus-visible { outline: 3px solid #b98a28; outline-offset: 3px; }
html.nsm-color-dark .department-page { background: #17141d; color: #e9e1f0; }
html.nsm-color-dark .department-directory-card, html.nsm-color-dark .department-side, html.nsm-color-dark .department-main, html.nsm-color-dark .department-public-notice { background: #261e2d; border-color: #584668; color: #e9e1f0; }
html.nsm-color-dark .department-directory-card h2, html.nsm-color-dark .department-main h2, html.nsm-color-dark .department-person-card h4 { color: #fff; }
html.nsm-color-dark .department-directory-card p, html.nsm-color-dark .department-source-note, html.nsm-color-dark .department-duties-text, html.nsm-color-dark .department-side a, html.nsm-color-dark .department-person-card small { color: #d0c6d9; }
html.nsm-color-dark .department-person-card { background: #302639; border-color: #584668; }
html.nsm-color-dark .department-side a[aria-current="page"] { color: #fff; }
html.nsm-color-dark .department-chart-scroll { background: #211a29; border-color: #584668; }
html.nsm-color-dark .department-person-card p, html.nsm-color-dark .department-directory-card a { color: #e6c6f5; }
html.nsm-color-dark .department-side a:hover:not([aria-current="page"]) { background: #392d43; color: #fff; }
@media (max-width: 720px) { .department-public-layout { grid-template-columns: 1fr; } .department-side { display: flex; flex-wrap: wrap; position: static; } .department-side a { flex: 1 1 auto; text-align: center; } }

/* Personnel hierarchy: weight and scale remain distinct in mourning mode. */
.department-people-group--head h3 {
  background: #49245f; border-left: 6px solid #c59a49;
  font-size: 1.25rem; font-weight: 600; padding: .85rem 1.1rem;
}
.department-people-group--head .department-people-grid {
  grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),340px));
}
.department-people-group--head .department-person-card {
  background: #faf6ef; border: 1px solid #d9bd82; border-top: 5px solid #b18737;
  padding: 1.5rem 1.1rem; box-shadow: 0 6px 18px #49245f12;
}
.department-people-group--head .department-person-card img { width: 150px; height: 184px; }
.department-people-group--head .department-person-card h4 { font-size: 1.18rem; font-weight: 600; }
.department-people-group--head .department-person-card p { font-weight: 500; color: #49245f; }
.department-people-group--section h3 {
  background: #fbf0dd; border-left: 4px solid #b57622; color: #754315;
  font-size: 1.12rem; font-weight: 500; padding: .7rem 1rem;
}
.department-people-group--section .department-people-grid {
  grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),255px));
}
.department-people-group--section .department-person-card {
  background: #fffdf8; border-color: #e8d8bb; border-top: 3px solid #bd8537;
}
.department-people-group--section .department-person-card img { width: 130px; height: 160px; }
.department-people-group--section .department-person-card h4 { font-size: 1.06rem; }
.department-people-group--section .department-person-card p { color: #845019; font-weight: 500; }
.department-people-group--division h3 {
  background: #eef6f5; border-left: 3px solid #398477; color: #245e55;
  font-size: 1rem; font-weight: 500;
}
.department-people-group--division .department-person-card {
  background: #fafdfc; border-color: #d6e5e1; border-top: 2px solid #74a79c;
}
.department-people-group--division .department-person-card img { width: 112px; height: 138px; }
.department-people-group--division .department-person-card p { color: #296759; font-size: .95rem; }
html.nsm-color-dark .department-people-group--head .department-person-card {
  background: #33283a; border-color: #a98b50; border-top-color: #dbb969;
}
html.nsm-color-dark .department-people-group--head .department-person-card p { color: #edd39b; }
html.nsm-color-dark .department-people-group--section h3 { background: #403221; color: #f1d39f; border-color: #c89a55; }
html.nsm-color-dark .department-people-group--section .department-person-card { background: #302b26; border-color: #79623d; border-top-color: #c89a55; }
html.nsm-color-dark .department-people-group--section .department-person-card p { color: #edc994; }
html.nsm-color-dark .department-people-group--division h3 { background: #223b36; color: #b6e1d5; border-color: #73b9a7; }
html.nsm-color-dark .department-people-group--division .department-person-card { background: #24322f; border-color: #446d61; border-top-color: #73b9a7; }
html.nsm-color-dark .department-people-group--division .department-person-card p { color: #b5dfcf; }
