/*! RO - Org Chart Designer | Viewer & chart engine styles | Res Opera Solutions */
.ro-ocd, .ro-v, .ro-app, .ro-sheet {
  --ro-primary: #07569a; --ro-accent: #22a8ab; --ro-radius: 14px; --ro-ink: #15324b; --ro-line: #d6e6f0; --ro-soft: #f1f7fb;
  --ro-ui-font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.ro-sheet, .ro-sheet *, .ro-v, .ro-v * { box-sizing: border-box; }

/* ---------- chart sheet ---------- */
.ro-sheet { position: relative; overflow: hidden; text-align: left; -webkit-font-smoothing: antialiased; }
.ro-sheetwrap { position: relative; transform-origin: 0 0; }
.ro-sheetwrap > .ro-sheet--sheet { box-shadow: 0 10px 34px rgba(7, 40, 80, .18); }
.ro-sheetwrap > .ro-sheet--free { box-shadow: 0 6px 24px rgba(7, 40, 80, .10); border-radius: 10px; }
.ro-chart { position: absolute; }
.ro-lines { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; overflow: visible; }
.ro-head, .ro-foot, .ro-legend { position: absolute; }
.ro-head-text { min-width: 0; }
.ro-foot a { color: inherit; }
.ro-bound { position: absolute; border: 1.5px dashed rgba(7, 86, 154, .35); pointer-events: none; z-index: 5; }

.ro-card {
  position: absolute; display: flex; flex-direction: column; justify-content: center; margin: 0; z-index: 1; cursor: pointer; outline: none;
  background: var(--ro-bg, #fff); border-color: var(--ro-bc, #07569a); box-shadow: var(--ro-sh, none);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
}
.ro-card:hover { background: var(--ro-hbg, var(--ro-bg, #fff)); border-color: var(--ro-hbc, var(--ro-bc, #07569a)); box-shadow: var(--ro-hsh, var(--ro-sh, none)); transform: translateY(var(--ro-hlift, 0)) scale(var(--ro-hscale, 1)); z-index: 3; }
.ro-card:focus-visible { outline: 3px solid var(--ro-accent); outline-offset: 4px; z-index: 4; }
.ro-clip { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.ro-accent { position: absolute; }
.ro-gloss { position: absolute; inset: 0; }
.ro-photo { position: absolute; z-index: 2; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ro-photo img { width: 100%; height: 100%; display: block; max-width: none; }
.ro-ini { font-weight: 700; line-height: 1; letter-spacing: .02em; font-family: Inter, system-ui, sans-serif; }
.ro-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.ro-body > div { margin: 0; }
.ro-toggle {
  position: absolute; left: 50%; bottom: -12px; transform: translateX(-50%); min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; z-index: 6;
  border: 2px solid var(--ro-primary); background: #fff; color: var(--ro-primary); font: 700 12px/1 system-ui, sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(7, 40, 80, .2);
}
.ro-toggle:hover { background: var(--ro-primary); color: #fff; }
.ro-toggle:focus-visible { outline: 3px solid var(--ro-accent); outline-offset: 2px; }
.ro-card.ro-hit { outline: 3px solid #f5a623; outline-offset: 4px; z-index: 4; animation: ro-pulse 1.1s ease 2; }
.ro-card.ro-sel { outline: 3px solid var(--ro-accent); outline-offset: 4px; z-index: 4; }
.ro-searching .ro-card:not(.ro-hit) { opacity: .32 !important; }
@keyframes ro-pulse { 50% { outline-offset: 9px; } }
.ro-ghost { pointer-events: none !important; z-index: 2147483000 !important; opacity: .88; box-shadow: 0 14px 34px rgba(7, 40, 80, .35) !important; }
.ro-drop-child { outline: 3px solid var(--ro-accent) !important; outline-offset: 4px; z-index: 6 !important; box-shadow: 0 0 0 10px rgba(34, 168, 171, .22) !important; }
.ro-drop-before::before, .ro-drop-after::after { content: ""; position: absolute; top: -8px; bottom: -8px; width: 6px; border-radius: 3px; background: var(--ro-accent); z-index: 7; }
.ro-drop-before::before { left: -16px; }
.ro-drop-after::after { right: -16px; }
.ro-bad { outline: 3px solid #d93025 !important; outline-offset: 4px; cursor: not-allowed; }

/* ---------- viewer shell ---------- */
.ro-ocd { max-width: 100%; margin: 1.2em 0; }
.ro-v { position: relative; display: flex; flex-direction: column; height: 70vh; min-height: 440px; background: linear-gradient(180deg, #f6fafd, #eaf3f9); border: 1px solid var(--ro-line); border-radius: var(--ro-radius); overflow: hidden; font-family: var(--ro-ui-font); color: var(--ro-ink); }
.ro-v--sheet { height: 100%; min-height: 0; border: 0; border-radius: 0; }
.ro-v--fs, .ro-v:fullscreen { position: fixed; inset: 0; z-index: 99999; height: 100% !important; border-radius: 0; border: 0; }
html.ro-fs-lock { overflow: hidden; }
.ro-vbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; background: #fff; border-bottom: 1px solid var(--ro-line); position: relative; z-index: 20; }
.ro-grp { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.ro-search { position: relative; display: flex; align-items: center; flex: 1 1 220px; max-width: 360px; background: var(--ro-soft); border: 1px solid var(--ro-line); border-radius: 999px; padding: 0 12px; color: #5b7287; }
.ro-search:focus-within { border-color: var(--ro-accent); box-shadow: 0 0 0 3px rgba(34, 168, 171, .2); }
.ro-search-in { flex: 1; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none; padding: 9px 8px; font: 14px var(--ro-ui-font); color: var(--ro-ink); min-width: 0; }
.ro-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--ro-line); border-radius: 14px; box-shadow: 0 14px 34px rgba(7, 40, 80, .18); max-height: 300px; overflow: auto; z-index: 30; }
.ro-results[hidden] { display: none; }
.ro-res { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.ro-res:hover, .ro-res:focus { background: var(--ro-soft); outline: none; }
.ro-res span { color: #5b7287; font-size: 12px; }
.ro-res--none { color: #5b7287; cursor: default; }
.ro-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--ro-line); background: #fff; color: var(--ro-primary); border-radius: 12px; cursor: pointer; font: 600 13px var(--ro-ui-font); transition: background .15s, box-shadow .15s, transform .15s; }
.ro-btn:hover { background: var(--ro-soft); }
.ro-btn:active { transform: translateY(1px); }
.ro-btn:focus-visible { outline: 3px solid var(--ro-accent); outline-offset: 2px; }
.ro-btn--primary { background: linear-gradient(135deg, var(--ro-primary), #0a6fc0); color: #fff; border-color: transparent; padding: 0 14px; }
.ro-btn--primary:hover { background: linear-gradient(135deg, #064a85, var(--ro-primary)); }
.ro-btn.is-busy .ro-btn-t::after { content: "…"; }
.ro-btn[disabled] { opacity: .6; cursor: progress; }
.ro-zl { min-width: 44px; text-align: center; font: 600 12px var(--ro-ui-font); color: #5b7287; }
.ro-scroller { position: relative; flex: 1 1 auto; overflow: auto; padding: 16px; cursor: grab; outline: none; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ro-scroller.ro-grabbing { cursor: grabbing; user-select: none; }
.ro-sizer { position: relative; margin: 0 auto; }
.ro-vstatus { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font: 600 13px var(--ro-ui-font); color: #5b7287; background: rgba(255, 255, 255, .92); padding: 6px 14px; border-radius: 999px; pointer-events: none; }
.ro-vstatus:empty { display: none; }

/* ---------- detail panel ---------- */
.ro-panel { position: absolute; right: 14px; top: 66px; width: 300px; max-height: calc(100% - 84px); overflow: auto; background: #fff; border: 1px solid var(--ro-line); border-radius: 20px; box-shadow: 0 18px 44px rgba(7, 40, 80, .22); padding: 22px 20px 18px; z-index: 25; animation: ro-in .18s ease; }
.ro-panel[hidden] { display: none; }
@keyframes ro-in { from { opacity: 0; transform: translateY(6px); } }
.ro-x { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--ro-soft); color: var(--ro-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ro-x:hover { background: var(--ro-line); }
.ro-pp { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font: 700 26px var(--ro-ui-font); box-shadow: 0 6px 16px rgba(7, 40, 80, .2); }
.ro-pp img { width: 100%; height: 100%; object-fit: cover; }
.ro-pn { margin: 0; text-align: center; font: 700 18px var(--ro-ui-font); color: var(--ro-primary); }
.ro-pt { margin: 2px 0 12px; text-align: center; color: #4a6075; font-size: 14px; }
.ro-pr { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--ro-soft); font-size: 13px; color: #5b7287; }
.ro-pr b { color: var(--ro-ink); font-weight: 600; text-align: right; }
.ro-ph { margin: 12px 0 4px; font: 700 12px var(--ro-ui-font); color: var(--ro-primary); }
.ro-pk { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.ro-pl { border: 0; background: none; padding: 3px 0; color: var(--ro-accent); font: 600 13px var(--ro-ui-font); cursor: pointer; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.ro-pnote { margin: 0; font-size: 13px; color: #4a6075; white-space: pre-wrap; }

/* ---------- builder canvas defaults inside viewer ---------- */
.ro-v--sheet .ro-scroller { background: #dfeaf2; background-image: radial-gradient(#c5d7e4 1px, transparent 1px); background-size: 18px 18px; }
.ro-ocd-draft-banner, .ro-draft-banner { background: #fff4d6; color: #7a5300; border: 1px solid #f1d58a; border-radius: 12px; padding: 10px 14px; font: 600 13px var(--ro-ui-font); margin-bottom: 10px; }
.ro-ocd .ro-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 700px) {
  .ro-v { height: 78vh; min-height: 420px; border-radius: 12px; }
  .ro-search { max-width: none; flex-basis: 100%; }
  .ro-grp { margin-left: 0; width: 100%; justify-content: space-between; }
  .ro-btn-t { display: none; }
  .ro-btn--primary { padding: 0 10px; }
  .ro-panel { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 55%; }
  .ro-scroller { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .ro-card, .ro-btn, .ro-panel { transition: none; animation: none; }
  .ro-card.ro-hit { animation: none; }
}
@media (prefers-contrast: more) { .ro-search, .ro-btn { border-color: var(--ro-primary); } }

/* ---------- print ---------- */
@media print {
  .ro-vbar, .ro-panel, .ro-vstatus, .ro-toggle, .ro-bound, .ro-results { display: none !important; }
  .ro-v { height: auto !important; min-height: 0; border: 0; background: none; overflow: visible; }
  .ro-scroller { overflow: visible; padding: 0; background: none; }
  .ro-sizer { width: auto !important; height: auto !important; }
  .ro-sheetwrap { transform: none !important; }
  .ro-sheetwrap > .ro-sheet { box-shadow: none !important; border-radius: 0; }
  .ro-card { transition: none !important; transform: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- public guidelines ---------- */
.ro-guide { max-width: 100%; margin: 0 0 16px; background: #fff; border: 1px solid var(--ro-line); border-radius: var(--ro-radius); box-shadow: 0 6px 20px rgba(7, 40, 80, .06); font-family: var(--ro-ui-font); color: var(--ro-ink); }
.ro-guide > summary { cursor: pointer; padding: 14px 18px; font-weight: 700; color: var(--ro-primary); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.ro-guide > summary::-webkit-details-marker { display: none; }
.ro-guide > summary::after { content: "▾"; color: #7b92a6; transition: transform .15s; }
.ro-guide[open] > summary::after { transform: rotate(180deg); }
.ro-guide-body { padding: 0 20px 16px; line-height: 1.6; font-size: 15px; }
.ro-guide-body h3 { margin: 4px 0 10px; color: var(--ro-primary); font-size: 18px; }
.ro-guide-body ol, .ro-guide-body ul { margin: 0 0 10px 20px; }
.ro-guide-body li { margin-bottom: 6px; }
.ro-ocd-builder-title { margin: 0 0 6px; color: var(--ro-primary); }

/* ---------- draggable line handles (builder only) ---------- */
.ro-handle { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--ro-primary); box-shadow: 0 1px 4px rgba(7, 40, 80, .35); cursor: ns-resize; z-index: 8; opacity: .35; transition: opacity .15s, transform .15s; touch-action: none; }
.ro-handle--dot { border-color: var(--ro-accent); border-style: dotted; }
.ro-chart:hover .ro-handle { opacity: .75; }
.ro-handle:hover, body.ro-dragging-line .ro-handle { opacity: 1; transform: scale(1.35); }
body.ro-dragging-line, body.ro-dragging-line * { cursor: ns-resize !important; user-select: none; }
@media print { .ro-handle { display: none !important; } }
