.structure-page { max-width: 1440px; margin: auto; padding: 24px 20px 48px; }
.structure-header { position: relative; text-align: center; padding: 40px 20px 32px; border-radius: 20px; background: #173d32; color: #fff; margin-bottom: 24px; }
.structure-header h1 { font-size: clamp(24px, 4vw, 36px); line-height: 1.5; margin: 12px 0; }
.structure-header p { margin: 0; }
.structure-eyebrow { color: #e7c876; font-weight: 700; }
.structure-home { display: inline-block; color: #fff; margin-bottom: 20px; }
.structure-branches { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.structure-branch { --branch-color: #a74b15; background: #fff; border: 1px solid var(--border, #ddd); border-radius: 16px; min-width: 0; overflow: hidden; }
.structure-branch--layman { --branch-color: #345ba0; }
.structure-branch > h2 { margin: 0; padding: 16px 24px; color: var(--branch-color); background: #f7f8f6; border-bottom: 1px solid #e5e8e3; font-size: 21px; }
.structure-chart { overflow-x: auto; padding: 24px 16px 32px; }
.structure-nodes { display: flex; justify-content: center; width: max-content; min-width: 100%; margin: 0; padding: 24px 0 0; list-style: none; position: relative; }
.structure-chart > .structure-nodes { padding-top: 0; }
.structure-nodes > li { list-style: none; padding: 24px 10px 0; position: relative; text-align: center; }
.structure-chart > .structure-nodes > li { padding-top: 0; }
.structure-nodes .structure-nodes::before { content: ""; position: absolute; top: 0; left: 50%; height: 24px; border-left: 2px solid #bbc8be; }
.structure-nodes .structure-nodes > li::before,
.structure-nodes .structure-nodes > li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 24px; border-top: 2px solid #bbc8be; }
.structure-nodes .structure-nodes > li::after { right: auto; left: 50%; border-left: 2px solid #bbc8be; }
.structure-nodes .structure-nodes > li:first-child::before { border-top: 0; }
.structure-nodes .structure-nodes > li:last-child::after { border-top: 0; }
.structure-profile { display: inline-flex; flex-direction: column; align-items: center; width: max-content; min-width: 180px; padding: 12px; border: 1px solid #e1e7e1; border-top: 4px solid var(--branch-color); border-radius: 12px; background: #fff; box-shadow: 0 4px 12px #173d3210; position: relative; }
.structure-photo { width: 90px; height: 120px; object-fit: cover; border-radius: 8px; background: #eef2ef; flex-shrink: 0; }
.structure-placeholder { display: flex; align-items: center; justify-content: center; color: #9aafa2; }
.structure-placeholder svg { width: 60%; height: 70%; }
.structure-profile h3 { font-size: 15px; line-height: 1.6; margin: 10px 0 6px; white-space: nowrap; }
.structure-profile-text { max-width: 100%; }
.structure-profile p { font-size: 13px; line-height: 1.6; color: var(--branch-color); margin: 0; overflow-wrap: anywhere; }
.structure-notice { padding: 20px; text-align: center; }
.structure-member-code { display: inline-block; color: var(--ink-soft); font-size: 12px; font-family: var(--font-body); }
.structure-detail-qr { display: flex; align-items: center; gap: 20px; margin-top: 24px; padding: 16px; background: #f6f8f6; border: 1px solid var(--border); border-radius: 12px; }
.structure-detail-qr > div { min-width: 0; }
.structure-detail-qr p { font-size: 13px; overflow-wrap: anywhere; }
.structure-qr { flex: 0 0 auto; padding: 8px; background: #fff; }
.structure-qr canvas, .structure-qr img { width: 128px; height: 128px; max-width: none; }
.structure-admin-layout { display: block; }
.structure-dialog { width: min(600px, calc(100% - 24px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--ink); }
.structure-dialog::backdrop { background: rgba(10, 30, 20, 0.6); }
.structure-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.structure-contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0 24px; }
.structure-contact-list > div { padding: 12px 14px; background: #f6f8f6; border: 1px solid #e5ece6; border-radius: 10px; }
.structure-contact-list dt { font-size: 13px; color: var(--ink-soft); }
.structure-contact-list dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.structure-detail-hero { display: flex; align-items: center; gap: 20px; padding: 20px; border-radius: 14px; background: linear-gradient(135deg, #fff4e6, #f9f7f2); border: 1px solid #f0dfc8; }
.structure-detail-hero--layman { background: linear-gradient(135deg, #edf3ff, #f3f7f8); border-color: #d8e4f4; }
.structure-detail-identity { min-width: 0; }
.structure-detail-identity h3 { font-size: 23px; line-height: 1.5; margin: 10px 0 4px; overflow-wrap: anywhere; }
.structure-detail-identity p { margin: 0; color: var(--ink-soft); overflow-wrap: anywhere; }
.structure-detail-badge { display: inline-block; border-radius: 20px; padding: 4px 12px; background: #fff; color: #a74b15; font-size: 13px; font-weight: 600; }
.structure-detail-hero--layman .structure-detail-badge { color: #345ba0; }
.structure-detail-section-title { margin: 24px 0 12px; font-size: 17px; }
.structure-contact-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.structure-contact-action { --contact-color: #267552; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 76px; padding: 12px; border: 1px solid #dce7df; border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; }
.structure-contact-action--whatsapp { --contact-color: #158442; }
.structure-contact-action--messenger { --contact-color: #2463c4; }
.structure-contact-action--email { --contact-color: #a54c2c; }
a.structure-contact-action:hover { border-color: var(--contact-color); background: #f6faf7; color: var(--ink); text-decoration: none; }
a.structure-contact-action:focus-visible { outline: 2px solid var(--contact-color); outline-offset: 3px; }
.structure-contact-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 10px; background: #f0f5f2; color: var(--contact-color); }
.structure-contact-icon svg { width: 22px; height: 22px; }
.structure-contact-text { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.structure-contact-text > span { font-size: 12px; color: var(--ink-soft); overflow-wrap: anywhere; }
.structure-contact-arrow { margin-left: auto; color: var(--contact-color); flex-shrink: 0; }
.structure-contact-action.is-empty { background: #f7f8f7; color: var(--ink-soft); }
.structure-contact-action.is-empty .structure-contact-icon { color: #89958d; }
.structure-profile-button { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; border-radius: 8px; }
.structure-profile-button:focus-visible { outline: 2px solid var(--branch-color); outline-offset: 3px; }
.structure-profile-button:hover { text-decoration: underline; }
.structure-detail-photo { width: 90px; height: 120px; object-fit: cover; border-radius: 10px; flex-shrink: 0; box-shadow: 0 4px 12px #173d3215; }
.structure-editor { padding: 20px; }
.structure-editor .field { margin-bottom: 14px; }
.structure-editor-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.structure-editor-photo { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; }
.structure-editor-photo[hidden] { display: none; }
.structure-error { color: #a12828; padding: 12px; border: 1px solid #e8bcbc; border-radius: 8px; background: #fff5f5; }
.structure-admin-toolbar { flex-wrap: wrap; }
.structure-admin-toolbar .input { max-width: 260px; }
.structure-admin-list .structure-member-name { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .structure-page { padding: 12px 10px 28px; }
  .structure-header { padding: 24px 14px; border-radius: 14px; }
  .structure-chart { padding: 16px 12px; }
  .structure-nodes { display: block; width: max-content; min-width: 100%; padding: 0; }
  .structure-nodes > li,
  .structure-chart > .structure-nodes > li { padding: 0; margin: 0 0 14px; text-align: left; }
  .structure-nodes .structure-nodes { margin: 14px 0 0 12px; padding-left: 12px; border-left: 2px solid #bbc8be; }
  .structure-nodes .structure-nodes::before,
  .structure-nodes .structure-nodes > li::after { display: none; }
  .structure-nodes .structure-nodes > li::before,
  .structure-nodes .structure-nodes > li:first-child::before { top: 30px; left: -14px; right: auto; width: 14px; height: 0; border-top: 2px solid #bbc8be; }
  .structure-profile { display: flex; flex-direction: row; width: 100%; min-width: max-content; padding: 12px; gap: 12px; text-align: left; }
  .structure-photo { width: 60px; height: 80px; }
  .structure-profile-text { min-width: 0; }
  .structure-profile h3 { margin-top: 0; }
  .structure-branch > h2 { padding: 14px 16px; }
}
@media (max-width: 380px) {
  .structure-nodes .structure-nodes { margin-left: 4px; padding-left: 8px; }
  .structure-nodes .structure-nodes > li::before,
  .structure-nodes .structure-nodes > li:first-child::before { left: -10px; width: 10px; }
  .structure-photo { width: 45px; height: 60px; }
  .structure-profile { gap: 8px; }
}
@media (max-width: 480px) {
  .structure-detail-qr { flex-direction: column; text-align: center; }
  #structure-detail-dialog { padding: 16px; }
  .structure-detail-hero { padding: 14px; gap: 12px; }
  .structure-detail-photo { width: 66px; height: 88px; }
  .structure-detail-identity h3 { font-size: 19px; }
  .structure-contact-list,
  .structure-contact-actions { grid-template-columns: minmax(0, 1fr); }
}
