:root {
  --bg: #f2f6f9;
  --panel: #ffffff;
  --line: #d7e1e9;
  --text: #102a43;
  --muted: #5b6f80;
  --brand: #0072bc;
  --brand-deep: #00457c;
  --brand-soft: #e9f5fb;
  --accent: #00a5c8;
  --ok: #16845b;
  --warn: #d99518;
  --bad: #d64545;
  --logic-flow-panel-width: min(390px, calc(100vw - 46px));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans KR", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  padding-right: 0;
  transition: padding-right .24s ease;
}

/* 열린 리뷰 패널의 공간을 문서 레이아웃에서 확보해 우측 콘텐츠가 가려지지 않게 한다. */
body.logic-flow-expanded { padding-right: var(--logic-flow-panel-width); }

/* 패널을 펼친 동안 고정 채팅 버튼도 같은 폭만큼 이동시켜 리뷰 패널 아래에 숨지 않게 한다. */
body.logic-flow-expanded .codex-chat-launcher { right: calc(var(--logic-flow-panel-width) + 24px); }

.portal-header {
  position: relative;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(20, 62, 91, 0.06);
}

.portal-header-main {
  min-height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.portal-brand {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--text);
  text-decoration: none;
}

.portal-brand img {
  display: block;
  width: clamp(112px, 13.8vw, 155px);
  flex: 0 1 auto;
  align-self: flex-end;
  height: auto;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: #cdd9e2;
}

.portal-brand strong {
  min-width: 0;
  min-height: 39px;
  display: inline-flex;
  align-self: flex-end;
  align-items: center;
  font-size: clamp(15px, 1.86vw, 21px);
  font-weight: 750;
  line-height: 1;
  color: var(--brand-deep);
  white-space: nowrap;
}

.integration-status {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 14px; background: #f7fafc;
  color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap;
}

.integration-status-light {
  width: 9px; height: 9px; border-radius: 50%; background: #d99518;
  box-shadow: 0 0 0 3px rgba(217, 149, 24, .14);
}

.integration-status.online { color: var(--ok); border-color: #a9d9c5; background: #f0faf6; }
.integration-status.online .integration-status-light {
  background: var(--ok);
  animation: integration-online-pulse 1.8s ease-out infinite;
}
.integration-status.offline { color: var(--bad); border-color: #efbaba; background: #fff4f4; }
.integration-status.offline .integration-status-light {
  background: var(--bad);
  animation: integration-offline-pulse 1.2s ease-out infinite;
}

@keyframes integration-online-pulse {
  0% { box-shadow: 0 0 0 0 rgba(22, 132, 91, .5), 0 0 7px rgba(22, 132, 91, .65); }
  70% { box-shadow: 0 0 0 7px rgba(22, 132, 91, 0), 0 0 12px rgba(22, 132, 91, .3); }
  100% { box-shadow: 0 0 0 0 rgba(22, 132, 91, 0), 0 0 7px rgba(22, 132, 91, .65); }
}

@keyframes integration-offline-pulse {
  0% { box-shadow: 0 0 0 0 rgba(214, 69, 69, .5), 0 0 7px rgba(214, 69, 69, .65); }
  70% { box-shadow: 0 0 0 7px rgba(214, 69, 69, 0), 0 0 12px rgba(214, 69, 69, .3); }
  100% { box-shadow: 0 0 0 0 rgba(214, 69, 69, 0), 0 0 7px rgba(214, 69, 69, .65); }
}

@media (prefers-reduced-motion: reduce) {
  .integration-status.online .integration-status-light,
  .integration-status.offline .integration-status-light {
    animation: none;
  }
}

.portal-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.utility-button,
.login-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 16px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
  font-size: clamp(12px, 1.25vw, 14px);
  line-height: 1.2;
  white-space: nowrap;
}

.login-button {
  border-color: var(--brand-deep);
  background: var(--brand-deep);
  color: #fff;
  padding-inline: 22px;
}

.login-button:hover {
  background: #00345e;
}

.login-screen { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #eef5fa 0%, #fff 55%, #e5f1f8 100%); }
.login-screen.hidden { display: none; }
.login-panel { width: min(430px, 100%); padding: 38px; border: 1px solid #d9e4ec; border-radius: 12px; background: #fff; box-shadow: 0 24px 70px rgba(0, 48, 85, .18); }
.login-brand { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 38px; color: var(--brand-deep); font-weight: 750; }
.login-brand img { display: block; width: 112px; height: auto; }
.login-brand span { transform: translateY(-2px); }
.login-panel h1 { margin: 5px 0 8px; color: var(--brand-deep); font-size: 30px; }
.login-panel p { color: var(--muted); }
.login-account-help { margin: 14px 0 0; font-size: 12px; line-height: 1.6; }
.account-settings-dialog { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 24px 70px rgba(15, 23, 42, .24); }
.account-settings-dialog::backdrop { background: rgba(15, 23, 42, .58); backdrop-filter: blur(2px); }
.account-settings-dialog > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 24px; border-bottom: 1px solid var(--line); }
.account-settings-dialog h2, .account-settings-dialog h3 { margin: 4px 0 6px; color: var(--brand-deep); }
.account-settings-dialog header p, .account-settings-section > div > p { margin: 0; color: var(--muted); }
.account-settings-dialog > .database-message { margin: 16px 24px 0; }
.account-settings-section { padding: 24px; border-bottom: 1px solid var(--line); }
.account-password-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 12px; }
.account-password-form label { display: grid; gap: 6px; color: var(--text); font-size: 12px; font-weight: 600; }
.account-password-form input { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.account-password-form small { color: var(--muted); font-weight: 400; }
.oauth-connection-list { display: grid; gap: 10px; margin-top: 18px; }
.oauth-connection-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.oauth-connection-card.connected { border-color: #9ad6bd; background: #f3fbf7; }
.oauth-connection-card strong { margin-right: 10px; color: var(--brand-deep); }
.oauth-connection-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.oauth-status { padding: 3px 8px; border-radius: 999px; background: #f3f4f6; color: #64748b; font-size: 11px; }
.connected .oauth-status { background: #dff5e9; color: #147a4b; }
@media (max-width: 800px) { .account-password-form { grid-template-columns: 1fr; } .oauth-connection-card { align-items: flex-start; } }
.login-backend-status { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; margin-top: 10px; padding: 5px 10px; border: 1px solid #d9e4ec; border-radius: 999px; color: #476173; background: #f8fbfd; font-size: 12px; font-weight: 700; }
.login-backend-light { width: 8px; height: 8px; border-radius: 50%; background: #9aa9b5; box-shadow: 0 0 0 3px rgba(154, 169, 181, .15); }
.login-backend-status.connected { color: #087443; border-color: #b9e4cf; background: #f1fbf5; }
.login-backend-status.connected .login-backend-light { background: #17a669; box-shadow: 0 0 0 3px rgba(23, 166, 105, .15); }
.login-backend-status.checking { color: #856000; border-color: #f2dba2; background: #fffaf0; }
.login-backend-status.checking .login-backend-light { background: #e0a100; box-shadow: 0 0 0 3px rgba(224, 161, 0, .15); animation: login-backend-pulse 1.1s ease-in-out infinite; }
.login-backend-status.disconnected { color: #b42318; border-color: #f3c4be; background: #fff5f4; }
.login-backend-status.disconnected .login-backend-light { background: #df3d32; box-shadow: 0 0 0 3px rgba(223, 61, 50, .14); }
@keyframes login-backend-pulse { 50% { opacity: .38; transform: scale(.82); } }
.login-form { display: grid; gap: 16px; margin-top: 28px; }
.login-form label { display: grid; gap: 7px; color: var(--brand-deep); font-size: 13px; font-weight: 750; }
.login-form input { height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 5px; font: inherit; }
.login-form input:focus { outline: 2px solid rgba(0, 114, 188, .18); border-color: var(--brand); }
.login-submit, .gitlab-sso-button { min-height: 46px; border: 1px solid var(--brand-deep); border-radius: 5px; cursor: pointer; font: inherit; font-weight: 750; }
.login-submit { background: var(--brand-deep); color: #fff; }
.gitlab-sso-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #292961; border-color: #c9c6de; }
.gitlab-sso-button img { width: 24px; height: 24px; object-fit: contain; }
.login-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login-message { min-height: 18px; color: #b42318; font-size: 13px; }

.portal-nav-row {
  min-height: 50px;
  padding: 0 28px;
  display: flex;
  align-items: stretch;
  border-top: 1px solid #edf2f6;
}

.portal-nav {
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 28px;
}

.portal-nav button {
  position: relative;
  border: 0;
  padding: 0 4px;
  background: transparent;
  color: #334e68;
  cursor: pointer;
  font-size: clamp(13px, 1.34vw, 15px);
  font-weight: 650;
}

.portal-nav button:hover,
.portal-nav button.active {
  color: var(--brand);
}

.portal-nav button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
}

.shell {
  height: calc(100vh - 123px);
  min-height: 0;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 18px;
  padding: 20px 24px 24px;
  overflow: hidden;
}

.shell.admin-mode,
.shell.guide-mode,
.shell.catalog-mode,
.shell.templates-mode,
.shell.personal-mode {
  grid-template-columns: minmax(0, 1fr);
}

.shell.admin-mode .sidebar,
.shell.guide-mode .sidebar,
.shell.catalog-mode .sidebar,
.shell.templates-mode .sidebar,
.shell.personal-mode .sidebar {
  display: none;
}

.shell.admin-mode .main,
.shell.guide-mode .main,
.shell.catalog-mode .main,
.shell.templates-mode .main,
.shell.personal-mode .main {
  width: 100%;
  min-width: 0;
}

.sidebar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  box-shadow: 0 4px 14px rgba(30, 64, 90, 0.05);
}

.catalog-wrap { min-height: 0; height: 100%; overflow: auto; display: grid; align-content: start; gap: 16px; padding-right: 2px; }
.templates-wrap { width: 100%; height: 100%; min-height: 560px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.templates-wrap iframe { display: block; width: 100%; height: 100%; min-height: 560px; border: 0; background: #fff; }
.personal-work-wrap { min-height: 0; height: 100%; overflow: auto; padding: 22px; border: 1px solid var(--line); border-top: 3px solid var(--brand); border-radius: 6px; background: #fff; }
.personal-work-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 360px); align-items: end; gap: 24px; }
.personal-work-header h1 { margin: 4px 0; }
.personal-work-header p { margin: 0; color: var(--muted); }
.personal-work-header label { display: grid; gap: 7px; color: var(--brand-deep); font-size: 13px; font-weight: 750; }
.personal-work-header input { width: 100%; height: 44px; margin: 0; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; font: inherit; }
.personal-work-header input:focus { outline: 2px solid rgba(0, 114, 188, .18); border-color: var(--brand); }
.personal-work-summary { margin-top: 22px; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 700; }
.personal-work-list { margin-top: 16px; padding-bottom: 2px; }
.personal-work-detail-host { margin-top: 20px; }
.personal-work-detail-host:empty { display: none; }
.personal-work-detail-host .detail-wrap { padding: 18px; text-align: left; }
.personal-work-list .work-card { grid-template-rows: auto minmax(30px, auto) auto auto minmax(0, 1fr) auto; gap: 4px; padding: 10px; }
.personal-work-list .work-date-range div { padding: 5px 6px; }
.personal-work-list .work-metrics div { padding-block: 4px; }
.personal-work-organization { min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .personal-work-wrap { padding: 16px; }
  .personal-work-header { grid-template-columns: 1fr; gap: 18px; }
}
.catalog-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px; border: 1px solid #c9e3f1; border-radius: 6px; background: linear-gradient(120deg, #f5fbff, #e8f5fb); }
.catalog-header p { margin: 4px 0 0; color: var(--muted); }
.catalog-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.catalog-toolbar label { font-size: 13px; font-weight: 700; white-space: nowrap; }
.catalog-toolbar input,
.catalog-toolbar select { box-sizing: border-box; height: 40px; margin: 0; border: 1px solid var(--line); border-radius: 4px; font: inherit; }
.catalog-toolbar input { width: auto; min-width: 160px; flex: 1 1 320px; padding: 0 11px; }
.catalog-toolbar select { width: 160px; min-width: 130px; flex: 0 0 160px; padding: 0 32px 0 11px; background: #fff; }
.catalog-toolbar strong { min-width: 48px; text-align: right; color: var(--brand); }
.catalog-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 16px; min-height: 0; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.catalog-card { min-width: 0; min-height: 150px; padding: 17px; text-align: left; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: inherit; cursor: pointer; }
.catalog-card:hover, .catalog-card.active { border-color: var(--accent); box-shadow: 0 5px 16px rgba(20, 91, 128, .12); }
.catalog-card strong, .catalog-card p, .catalog-card small { display: block; }
.catalog-card strong { margin-top: 12px; font-size: 16px; color: var(--brand-deep); overflow-wrap: anywhere; }
.catalog-card p { min-height: 38px; margin: 8px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.catalog-card small { color: var(--brand); overflow-wrap: anywhere; }
.catalog-kind { display: inline-flex; padding: 4px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.catalog-detail { align-self: start; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.catalog-detail-heading h2 { margin: 12px 0 6px; overflow-wrap: anywhere; }
.catalog-detail-heading p { color: var(--muted); line-height: 1.55; }
.catalog-detail dl { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 9px 12px; margin: 20px 0; }
.catalog-detail dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.catalog-detail dd { margin: 0; overflow-wrap: anywhere; }
.catalog-detail h3 { margin: 20px 0 8px; font-size: 14px; }
.catalog-detail ul { margin: 0 0 20px; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.catalog-link { display: inline-flex; text-decoration: none; }

h1 {
  margin: 0 0 6px;
  font-size: clamp(18px, 1.86vw, 21px);
  color: var(--brand-deep);
}

.subtitle {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.search-row {
  font-weight: 600;
  display: inline-block;
  margin-bottom: 6px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 12px;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px;
  background: #fff;
  color: var(--text);
}

.searchable-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.searchable-select > select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.searchable-select-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 8px 34px 8px 10px;
  color: var(--text);
  background: #fff;
}

.searchable-select::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 11px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-55%);
}

.searchable-select-options {
  /* body 직속 고정 레이어로 표시해 스크롤 패널의 경계에 잘리거나 패널 스크롤을 만들지 않는다. */
  position: fixed;
  box-sizing: border-box;
  z-index: 1000;
  max-height: 240px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.searchable-select-option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 3px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.searchable-select-option:hover,
.searchable-select-option.active {
  background: #eaf4fb;
}

.searchable-select-option:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.searchable-select-empty {
  display: block;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
}

.assignee-select {
  margin-top: 6px;
}

.org-tree {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}

.tree-node {
  display: grid;
  gap: 2px;
}

.tree-node .child {
  margin-left: 9px;
  padding-left: 13px;
  border-left: 1px solid #d9e4eb;
}

.tree-node.depth-0 > .org-btn {
  font-weight: 800;
}

.tree-node.depth-1 > .org-btn {
  font-weight: 700;
}

.tree-node.depth-2 > .org-btn {
  font-weight: 600;
}

.org-btn {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  padding: 5px 4px;
  color: #334e68;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: clamp(12px, 1.25vw, 14px);
}

.org-btn:hover {
  color: var(--brand);
  background: #f2f8fb;
}

.org-btn .tree-marker {
  position: relative;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.org-btn.branch .tree-marker::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #698296;
  border-bottom: 1.5px solid #698296;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.org-btn.branch.expanded .tree-marker::before {
  top: 1px;
  transform: rotate(45deg);
}

.org-btn.leaf .tree-marker::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9cb1bf;
}

.org-btn .tree-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.org-btn .tree-count {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 8px;
  color: #8498a7;
  font-size: 11px;
  font-weight: 600;
}

.org-btn.active .tree-count {
  color: var(--brand);
}

.work-btn {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
}

.org-btn.active {
  color: var(--brand-deep);
  background: transparent;
  box-shadow: none;
}

.org-btn.active .tree-label {
  font-weight: 800;
}

.org-btn.active.leaf .tree-marker::before {
  background: var(--accent);
}

.work-btn.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.integration-hint {
  margin-top: 16px;
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.integration-hint ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.integration-hint li {
  margin: 6px 0;
}

.jira-board-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.jira-board-card {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-deep);
  background: #f8fbfd;
  text-decoration: none;
}

.jira-board-card:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.jira-board-card span,
.jira-board-card small,
.empty-jira-board {
  color: var(--muted);
}

.empty-jira-board {
  margin: 0;
}

/* 티켓 목록만 스크롤되게 분리해 패널 제목과 보드 정보는 유지하고, 열 제목은 목록 상단에 고정한다. */
.detail-grid article[data-detail-panel="jira"] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ticket-table-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  scrollbar-gutter: stable;
}

.ticket-table-scroll th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
}

.main {
  display: grid;
  gap: 16px;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  padding-right: 4px;
}

.guide-wrap {
  min-height: 0;
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(30, 64, 90, 0.05);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: #9eb3c3 #edf3f7;
  scrollbar-width: thin;
}

.guide-wrap::-webkit-scrollbar {
  width: 10px;
}

.guide-wrap::-webkit-scrollbar-track {
  background: #edf3f7;
}

.guide-wrap::-webkit-scrollbar-thumb {
  border: 2px solid #edf3f7;
  border-radius: 5px;
  background: #9eb3c3;
}

.guide-header {
  min-height: 156px;
  padding: 30px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 4px solid var(--accent);
  color: #fff;
  background: var(--brand-deep);
}

.guide-header h1 {
  margin: 6px 0 8px;
  color: #fff;
  font-size: 28px;
}

.guide-header p {
  max-width: 680px;
  margin: 0;
  color: #dbeaf4;
  line-height: 1.6;
}

.guide-kicker {
  color: #7ad9e8;
  font-size: 11px;
  font-weight: 800;
}

.guide-header .primary-btn {
  border-color: #fff;
  background: #fff;
  color: var(--brand-deep);
  white-space: nowrap;
}

.guide-section {
  padding: 28px 34px;
  border-bottom: 1px solid var(--line);
}

.guide-section-title {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 13px;
  align-items: start;
  margin-bottom: 20px;
}

.guide-section-title > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.guide-section-title h2,
.guide-section-title p {
  margin: 0;
}

.guide-section-title h2 {
  color: var(--brand-deep);
  font-size: 20px;
}

.guide-section-title p {
  margin-top: 5px;
  color: var(--muted);
}

.guide-steps {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  counter-reset: guide-step;
}

.guide-steps li {
  position: relative;
  min-height: 126px;
  padding: 18px 18px 12px;
  border-top: 2px solid #bed1df;
  counter-increment: guide-step;
}

.guide-steps li::before {
  content: counter(guide-step);
  position: absolute;
  top: -14px;
  left: 18px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.guide-steps strong,
.guide-steps span {
  display: block;
}

.guide-steps span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.guide-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.guide-feature-grid > div {
  min-height: 108px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.guide-feature-grid strong {
  color: var(--brand-deep);
}

.guide-feature-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.guide-table-wrap {
  overflow-x: auto;
}

.guide-table {
  margin-top: 0;
}

.guide-table th {
  color: var(--brand-deep);
  background: #eef5f9;
}

.integration-modal {
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.integration-modal::backdrop { background: rgba(15,23,42,.62); backdrop-filter: blur(2px); }
.integration-modal[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.integration-modal-head { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.integration-modal-head > div:first-child { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.integration-modal-head .guide-kicker { flex: 0 0 auto; }
.integration-modal-head h2 { margin: 2px 0; color: var(--brand-deep); }
.integration-modal-head p { min-width: 0; margin: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.integration-modal-head > div:last-child { display: flex; align-items: center; gap: 8px; }
.integration-modal-head a { text-decoration: none; }
.integration-modal-status { z-index: 1; grid-area: 2 / 1; align-self: start; padding: 8px 20px; background: var(--brand-soft); color: var(--brand); font-size: 12px; }
.integration-modal iframe { display: block; grid-area: 2 / 1; width: 100%; min-width: 0; height: 100%; min-height: 0; border: 0; background: #fff; }

.worklist-wrap,
.detail-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  box-shadow: 0 4px 14px rgba(30, 64, 90, 0.05);
}

.worklist-wrap {
  border-top: 3px solid var(--brand);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.toolbar h2 {
  margin: 0 0 6px;
}

.toolbar p {
  margin: 0;
  color: var(--muted);
}

.work-status-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
}

/* 내비게이션 공통 투명 버튼 규칙보다 우선해 비호버 상태에서도 생성 버튼의 강조색과 흰 글씨를 유지한다. */
.portal-nav .work-create-nav-action {
  flex: 0 0 auto;
  align-self: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
}

.portal-nav .work-create-nav-action:hover,
.portal-nav .work-create-nav-action:focus-visible {
  border-color: var(--brand-deep);
  background: var(--brand-deep);
  color: #fff;
}

.work-status-tab {
  position: relative;
  min-width: 96px;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 10px 14px 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.work-status-tab:hover {
  color: var(--brand-deep);
  background: #f5f9fc;
}

.work-status-tab.active {
  border-bottom-color: var(--brand);
  color: var(--brand-deep);
}

.tab-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 5px;
  place-items: center;
  border-radius: 11px;
  background: #e9f2f8;
  color: var(--brand-deep);
  font-size: 11px;
}

.work-status-tab.active .tab-count {
  background: var(--brand);
  color: #fff;
}

.worklist {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(184px, 100%), 224px));
  gap: 14px;
  align-items: start;
  justify-content: start;
}

.worklist.archive-list-mode {
  display: block;
}

.archived-work-table-wrap {
  width: 100%;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.archived-work-table {
  width: 100%;
  min-width: 0;
  margin: 0;
  table-layout: fixed;
}

.archived-work-table th,
.archived-work-table td {
  min-width: 0;
  padding: clamp(6px, 0.8vw, 10px);
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: keep-all;
  white-space: normal;
}

.archived-work-table th {
  background: #f6f9fb;
  color: var(--muted);
  font-size: clamp(11px, 1vw, 13px);
}

.archived-work-table td {
  vertical-align: middle;
  font-size: clamp(11px, 1.08vw, 14px);
}

.archived-work-table th:nth-child(1) { width: 36%; }
.archived-work-table th:nth-child(2) { width: 32%; }
.archived-work-table th:nth-child(3) { width: 18%; }
.archived-work-table th:nth-child(4) { width: 14%; }

.archived-work-table.hold-work-table th:nth-child(1) { width: 52%; }
.archived-work-table.hold-work-table th:nth-child(2) { width: 30%; }
.archived-work-table.hold-work-table th:nth-child(3) { width: 18%; }

.archived-work-table tbody tr:hover {
  background: #f7fbfd;
}

.archived-work-link {
  min-height: 0;
  margin: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--brand-deep);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.archived-work-link:hover,
.archived-work-link.active {
  color: var(--brand);
  text-decoration: underline;
}

.archived-work-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
}

.archived-work-page-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

@media (max-width: 620px) {
  .archived-work-table th:nth-child(1) { width: 34%; }
  .archived-work-table th:nth-child(2) { width: 34%; }
  .archived-work-table th:nth-child(3) { width: 18%; }
  .archived-work-table th:nth-child(4) { width: 14%; }
  .archived-work-table.hold-work-table th:nth-child(1) { width: 50%; }
  .archived-work-table.hold-work-table th:nth-child(2) { width: 32%; }
  .archived-work-table.hold-work-table th:nth-child(3) { width: 18%; }
  .archived-work-page-controls { margin-left: auto; }
}

.archived-work-page-controls button {
  min-height: 32px;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.archived-work-page-controls button:disabled {
  color: #9aa8b4;
  background: #f4f6f8;
  cursor: default;
}

.work-card {
  width: 100%;
  max-width: 224px;
  min-width: 0;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  border-radius: 5px;
  padding: 14px;
  background: #fff;
  cursor: pointer;
  display: grid;
  grid-template-rows: auto minmax(36px, auto) auto 1fr auto;
  gap: 8px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.work-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 18px rgba(30, 64, 90, 0.11);
}

.work-card-head,
.work-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.work-kind {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
}

.work-code {
  max-width: 112px;
  overflow: hidden;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-card .title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.work-date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #e7edf2;
  background: #f8fafc;
}

.work-date-range div {
  min-width: 0;
  padding: 8px 7px;
}

.work-date-range div + div {
  border-left: 1px solid #e7edf2;
}

.work-date-range span,
.work-date-range strong {
  display: block;
}

.work-date-range span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
}

.work-date-range strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-metrics {
  display: grid;
  grid-template-columns: repeat(var(--workflow-status-count, 3), minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  border-top: 1px solid #e9eef2;
  border-bottom: 1px solid #e9eef2;
}

.work-metrics div {
  min-width: 0;
  padding: 7px 1px;
  text-align: center;
  border-right: 1px solid #e9eef2;
}

.work-metrics strong,
.work-metrics span {
  display: block;
}

.work-metrics strong {
  color: var(--brand-deep);
  font-size: clamp(12px, calc(18px - var(--workflow-status-count, 3) * 1px), 16px);
}

.work-metrics span {
  margin-top: 2px;
  color: var(--muted);
  font-size: clamp(7px, calc(13px - var(--workflow-status-count, 3) * 0.7px), 10px);
  line-height: 1.15;
  overflow-wrap: anywhere;
  white-space: normal;
}

.work-metrics .workflow-message {
  grid-column: 1 / -1;
  border-right: 0;
}

.work-metrics .workflow-error span { color: var(--bad); }

.work-card-footer {
  margin-top: auto;
  color: var(--muted);
  font-size: 10px;
}

.work-card-footer span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-dot {
  width: 7px;
  height: 7px;
  margin-right: 4px;
  display: inline-block;
  border-radius: 50%;
  background: var(--warn);
}

.state-dot.state-ok { background: var(--ok); }
.state-dot.state-warn { background: var(--warn); }
.state-dot.state-bad { background: var(--bad); }

.meta {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.badge {
  font-size: 12px;
  color: var(--muted);
}

.detail h2,
.detail h3,
.detail h4 {
  margin-top: 0;
}

.detail .empty {
  color: var(--muted);
  padding: 18px 0;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.detail-title-block {
  min-width: 0;
  flex: 1;
}

/* 제목부터 상태와 상태 변경 동작을 한 흐름으로 읽고, 편집은 헤더 최우측에 독립 배치한다. */
.detail-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-title-line h3 { margin: 0; }
.detail-edit-button { flex: 0 0 auto; }

.lifecycle-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.lifecycle-active {
  border-color: #9dcbe4;
  background: #eaf6fc;
  color: #086b9f;
}

.lifecycle-completed {
  border-color: #a9d8c5;
  background: #edf8f3;
  color: #18754f;
}

.lifecycle-hold {
  border-color: #ead19b;
  background: #fff8e8;
  color: #936515;
}

.lifecycle-actions {
  display: flex;
  gap: 6px;
}

.lifecycle-actions button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 11px;
  background: #fff;
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
}

.lifecycle-actions button:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-deep);
  background: #f3f9fc;
}

.lifecycle-actions button:disabled {
  background: #eef2f5;
  color: #8a98a5;
  cursor: default;
}

.detail p {
  margin: 6px 0 0;
  color: var(--muted);
}

.detail-grid {
  --detail-panel-unit-height: 220px;
  margin-top: 14px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: var(--detail-panel-unit-height);
  grid-auto-flow: dense;
}

.detail-grid article {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 38px 12px 12px;
  background: #fff;
  font-size: 14px;
  line-height: 1.45;
  transition: opacity 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  grid-column: span var(--detail-panel-columns, 1);
  grid-row: span var(--detail-panel-rows, 1);
  min-height: 0;
  overflow: auto;
}

/* 모든 카드는 같은 높이 단위와 열 단위를 사용해 이동 후에도 경계가 정확히 맞는다. */

.detail-grid article[data-detail-panel="integrations"] #integrationLinks {
  padding-right: 6px;
}

/* 연계 여부 상태 도형은 유지하되 항목은 기존 상세 패널과 같은 블릿 목록으로 읽히게 한다. */
#integrationLinks,
#qualityDelivery {
  display: grid;
  gap: 2px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.detail-status-row {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  /* 전역 li 여백이 항목마다 중첩되지 않도록 제거하고 목록의 2px 간격만 사용한다. */
  margin: 0;
  padding: 0 4px 0 16px;
}

.detail-status-row::before {
  position: absolute;
  left: 2px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #000;
  content: "";
  transform: translateY(-50%);
}

.detail-status-label { flex: 0 0 auto; font-weight: 650; }

.detail-status-content {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
}

.detail-state-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.detail-state-badge::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.detail-state-badge.is-assigned { background: #ecf9f1; color: var(--ok); }
.detail-state-badge.is-unassigned { background: #eef2f5; color: #758491; }

.detail-status-description {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-panel-handle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7fafc;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}

.detail-panel-handle:hover,
.detail-panel-handle:focus-visible {
  border-color: var(--brand);
  color: var(--brand-deep);
  background: var(--brand-soft);
  outline: none;
}

.detail-panel-handle:active { cursor: grabbing; }

.detail-panel-resize-controls {
  position: absolute;
  top: 8px;
  right: 44px;
  z-index: 2;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(30, 64, 90, 0.1);
}

.detail-panel-resize-controls button {
  width: 22px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--brand);
  line-height: 1;
  cursor: pointer;
}

.detail-panel-resize-controls button:hover:not(:disabled),
.detail-panel-resize-controls button:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
  outline: none;
}

.detail-panel-resize-controls button:disabled { color: #b8c2ca; cursor: default; }

.detail-panel-size-status {
  min-width: 28px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.detail-grid article.detail-panel-dragging {
  opacity: 0.45;
  border-color: var(--brand);
  box-shadow: 0 8px 20px rgba(30, 64, 90, 0.16);
}

.detail-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.detail-section-head h4,
.detail-section-head p {
  margin: 0;
}

.detail-section-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.architecture-preview {
  min-height: 116px;
  margin-top: 14px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background-color: #f8fbfd;
  background-image: radial-gradient(#cbd9e3 1px, transparent 1px);
  background-size: 18px 18px;
}

.architecture-node {
  min-width: 132px;
  padding: 14px 12px;
  border: 1px solid #9db3c3;
  border-radius: 4px;
  background: #fff;
  text-align: center;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(30, 64, 90, 0.09);
}

.architecture-node.accent-node {
  border-color: var(--brand);
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.architecture-node.database-node {
  border-color: #18a1a8;
  background: #e9f8f8;
}

.architecture-arrow {
  color: var(--brand);
  font-size: 24px;
  font-weight: 700;
}

ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

li {
  margin: 8px 0;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--brand-deep);
  font-size: 12px;
  background: #f2f5ff;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

th,
td {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid #eef1f7;
  font-size: 14px;
}

.status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.status-ok {
  background: #ecf9f1;
  color: var(--ok);
}

.status-warn {
  background: #fff3da;
  color: #ad7c0a;
}

.status-info {
  background: #e9f2ff;
  color: #0c66e4;
}

.status-bad {
  background: #feecec;
  color: var(--bad);
}

.hidden {
  display: none !important;
}

.admin-wrap {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.admin-sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(30, 64, 90, 0.05);
}

.admin-sidebar h2 {
  margin: 0 6px 14px;
  color: var(--brand-deep);
  font-size: 18px;
}

.admin-sidebar button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 5px;
  padding: 0 12px;
  background: transparent;
  color: #334e68;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.admin-sidebar button:hover {
  background: #f2f7fb;
}

.admin-sidebar button.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.admin-sidebar .restart-servers-button {
  margin-top: auto;
  min-width: 0;
  min-height: 38px;
  justify-content: center;
  padding: 7px 8px;
  border: 1px solid #b42318;
  background: #c62828;
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-sidebar .restart-servers-button:hover {
  background: #a91f1f;
  color: #fff;
}

.admin-sidebar .restart-servers-button:disabled {
  cursor: wait;
  opacity: 0.65;
}
.custom-admin-menu-list { display: grid; gap: 6px; }
.admin-menu-group { display: grid; gap: 2px; }
.admin-sidebar .admin-menu-parent { display: flex; align-items: center; justify-content: space-between; font-weight: 800; }
.admin-sidebar .admin-menu-parent .admin-menu-chevron { transition: transform .15s ease; }
.admin-sidebar .admin-menu-parent[aria-expanded="false"] .admin-menu-chevron { transform: rotate(-90deg); }
/* 하위 메뉴는 계층 기호 대신 은은한 배경으로 상위 메뉴와의 관계를 구분한다. */
.admin-menu-children { display: grid; gap: 2px; padding: 4px; border-radius: 5px; background: #f4f6f8; }
.admin-sidebar .admin-menu-children > button { padding-left: 12px; font-size: 13px; }
.admin-menu-row { display: grid; grid-template-columns: minmax(0, 1fr) 24px 24px; gap: 1px; align-items: center; border-radius: 4px; transition: background .15s ease; }
.admin-menu-row:hover { background: #eef6fa; }
.admin-menu-row:hover .admin-menu-main,
.admin-menu-row:hover .admin-menu-icon { color: var(--brand); background: transparent; }
.admin-menu-row.active { background: var(--brand-soft); }
.admin-sidebar .admin-menu-row.active .admin-menu-main { color: var(--brand); background: transparent; }
.admin-sidebar .admin-menu-row > button { margin: 0; min-width: 0; }
.admin-sidebar .admin-menu-row .admin-menu-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-sidebar .admin-menu-row .admin-menu-icon { display: grid; place-items: center; justify-self: end; width: 24px; height: 26px; min-height: 0; padding: 0; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #667085; line-height: 1; }
.admin-sidebar .admin-menu-row .admin-menu-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-sidebar .admin-menu-row .admin-menu-icon:hover { border-color: #b9c8d3; background: #eef6fa; color: var(--brand); }
.admin-sidebar .admin-menu-row .admin-menu-icon.danger:hover { border-color: #f4b4b4; background: #fff1f1; color: #b42318; }
.admin-sidebar .add-admin-menu-button { margin-top: 10px; justify-content: center; border: 1px dashed #98a2b3; background: #f8fafc; color: #344054; text-align: center; }
.admin-menu-dialog { width: min(560px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 24px 70px rgba(16,24,40,.28); }
.admin-menu-dialog::backdrop { background: rgba(15,23,42,.55); }
.admin-menu-dialog form { display: grid; gap: 16px; padding: 24px; }
.admin-menu-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.admin-menu-dialog h2 { margin: 4px 0 0; }
.admin-menu-dialog label { display: grid; gap: 7px; font-weight: 700; }
.admin-menu-dialog input, .admin-menu-dialog select { box-sizing: border-box; width: 100%; min-height: 42px; margin: 0; padding: 0 12px; }
.integration-credential-dialog .muted { margin: 0; color: var(--muted); line-height: 1.5; }
.credential-fields-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.credential-field-row { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(150px, 1fr) minmax(180px, 1.3fr) auto; gap: 8px; align-items: center; }
.credential-field-row input { min-width: 0; }
.credential-guide { display: block; margin-top: -8px; color: var(--muted); line-height: 1.5; }
@media (max-width: 720px) { .credential-field-row { grid-template-columns: 1fr; } }
.credential-key-list { display: grid; gap: 6px; margin-top: 8px; }
.credential-key-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; padding: 5px 8px 5px 12px; border: 1px solid var(--line); border-radius: 6px; background: #f8fafc; }
.credential-key-row code { overflow-wrap: anywhere; }
.credential-key-row .secondary-btn { width: auto; min-height: 30px; padding: 4px 10px; }
.delete-admin-menu-dialog p { margin: 0; line-height: 1.55; }
.delete-admin-menu-dialog .muted { color: var(--muted); font-size: 13px; }

.admin-content {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}
.administrator-management-wrap { display: grid; gap: 18px; }
.administrator-card-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .65fr); gap: 18px; align-items: start; }
.administrator-card-grid > .database-data-panel { margin: 0; min-width: 0; }
.administrator-count { display: inline-grid; place-items: center; min-width: 25px; height: 25px; margin-left: 5px; padding: 0 7px; border-radius: 999px; background: #e8f3f8; color: var(--brand); font-size: 13px; vertical-align: 2px; }
.administrator-add-form { display: grid; gap: 12px; padding: 18px; }
.administrator-add-form label { font-weight: 700; }
.administrator-add-form .searchable-select { width: 100%; }
@media (max-width: 980px) { .administrator-card-grid { grid-template-columns: 1fr; } }

.embedded-admin-wrap {
  width: 100%;
  height: 100%;
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.embedded-admin-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  background: #fff;
}

.database-wrap, .console-wrap { display: grid; gap: 16px; min-height: 0; }
.database-header, .database-panel-title, .database-editor-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.database-header {
  padding: 22px 24px; border-radius: 6px;
  background: linear-gradient(120deg, #f5fbff, #e8f5fb); border: 1px solid #c9e3f1;
}
.database-header p, .database-panel-title p { margin: 4px 0 0; color: var(--muted); }
.database-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.database-summary article { padding: 14px 18px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.database-summary span, .database-summary strong { display: block; }
.database-summary span { color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.database-layout {
  display: grid; grid-template-columns: minmax(380px, .9fr) minmax(420px, 1.1fr);
  gap: 16px; min-height: 0;
}
.database-view-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.database-search { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.database-search label { display: inline-flex; align-items: center; align-self: stretch; flex: 0 0 auto; margin: 0; font-size: 13px; font-weight: 700; line-height: 1; white-space: nowrap; }
.database-search input { box-sizing: border-box; min-width: 0; height: 42px; flex: 1; margin: 0; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; font: inherit; line-height: 42px; }
.database-search .secondary-btn { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; height: 42px; min-height: 42px; margin: 0; padding-block: 0; line-height: 1; }
.database-view-tabs button {
  padding: 10px 16px; border: 0; border-bottom: 3px solid transparent;
  color: var(--muted); background: transparent; cursor: pointer; font-weight: 700;
}
.database-view-tabs button.active { color: var(--brand); border-bottom-color: var(--accent); }
.database-data-panel {
  padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 6px; min-width: 0;
}
.database-data-panel .database-table td:nth-child(3) {
  max-width: 560px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.45;
}
.database-list-panel, .database-editor-panel {
  padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 6px; min-width: 0;
}
.database-panel-title h2 { margin: 0; font-size: 18px; }
.database-table-scroll { overflow: auto; margin-top: 14px; }
/* DB 조회 표는 상단에서도 좌우 이동할 수 있게 하고, 세로 이동 중에는 열 제목을 틀 고정한다. */
#databaseWrap .database-table-scroll.has-top-scroll {
  max-height: min(60vh, 640px);
  margin-top: 0;
  scrollbar-gutter: stable;
}
#databaseWrap .database-table-top-scroll {
  display: none;
  overflow-x: auto;
  overflow-y: hidden;
  height: 15px;
  margin-top: 14px;
}
#databaseWrap .database-table-top-scroll.is-scrollable { display: block; }
#databaseWrap .database-table-top-scroll-content { height: 1px; }
#databaseWrap .database-table-scroll.has-top-scroll .database-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 0 1px 0 var(--line);
}
.database-table { width: 100%; border-collapse: collapse; }
.database-table th, .database-table td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); }
/* 한국어 컬럼명이 줄바꿈되지 않도록 내용 너비를 보장하고, 초과 폭은 조회 영역의 가로 스크롤로 제공한다. */
#databaseWrap .database-table { width: max-content; min-width: 100%; }
/* 일반 값과 JSON 값의 표현 방식이 달라도 조회 항목의 글자 크기는 동일하게 유지한다. */
#databaseWrap .database-table th,
#databaseWrap .database-table td { font-size: 14px; }
#databaseWrap .database-table th { white-space: nowrap; }
#databaseWrap .database-table td .json-tree-compact { font-size: inherit; }
.database-pagination {
  display: flex; align-items: center; justify-content: flex-end; gap: 16px; min-height: 38px; margin-top: 12px;
  color: var(--muted); font-size: 13px;
}
.database-pagination label, .database-pagination-navigation { display: flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0; }
.database-pagination select { min-width: 82px; padding: 7px 28px 7px 9px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font: inherit; }
.database-pagination-status { margin-left: auto; }
.database-pagination-navigation .secondary-btn { min-width: 58px; }
.database-pagination button:disabled { opacity: .45; cursor: not-allowed; }
.database-row-dialog {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}
.database-row-dialog::backdrop { background: rgba(15, 23, 42, .48); }
.database-row-dialog form { padding: 20px; }
.database-row-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  max-height: calc(100dvh - 230px);
  overflow: auto;
  padding: 2px 4px 12px 2px;
}
.database-row-field { display: grid; align-content: start; gap: 6px; min-width: 0; font-weight: 700; }
.database-row-field > span { overflow-wrap: anywhere; }
.database-row-field input,
.database-row-field select,
.database-row-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.database-row-field textarea { min-height: 108px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.database-row-field small { color: var(--muted); font-size: 11px; font-weight: 500; }
.database-row-dialog-actions { margin-top: 18px; }
.database-row-dialog-actions .danger-btn { margin-right: auto; }
.database-row { cursor: pointer; }
.database-row:hover, .database-row.active { background: var(--brand-soft); }
.database-editor-panel label { display: block; margin: 16px 0 6px; font-size: 13px; font-weight: 700; }
.database-value-heading {
  display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 16px;
}
.database-value-heading label { margin: 0; }
.database-value-tabs { display: flex; gap: 6px; }
.database-editor-panel input, .database-editor-panel textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 10px; font: inherit;
}
.database-editor-panel textarea {
  min-height: 330px; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5;
}
.database-editor-actions { justify-content: flex-end; margin-top: 12px; }
.secondary-btn {
  min-height: 36px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px;
  color: #334e68; background: #fff; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700;
}
.secondary-btn:hover { color: var(--brand); border-color: #8cbdd8; background: #f2f8fb; }
.secondary-btn.active { color: #fff; border-color: var(--brand); background: var(--brand); }
.database-editor-actions .primary-btn,
.database-editor-actions .danger-btn { min-height: 36px; padding: 8px 12px; border: 1px solid transparent; border-radius: 4px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; }
.json-tree {
  min-height: 330px; max-height: 520px; overflow: auto; margin-top: 6px; padding: 12px;
  border: 1px solid var(--line); border-radius: 4px; color: #334e68; background: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.65;
}
.json-tree-row { min-width: max-content; }
.json-tree-branch > summary { cursor: pointer; user-select: none; }
.json-tree-branch > summary:hover .json-key { color: var(--brand); }
.json-tree-children { margin-left: 8px; padding-left: 15px; border-left: 1px solid #cddbe5; }
.json-key { margin-right: 6px; color: var(--brand-deep); font-weight: 700; }
.json-collection, .json-empty { color: var(--muted); }
.json-string { color: #087f5b; }
.json-number { color: #9c4c00; }
.json-boolean { color: #6f42c1; }
.json-null { color: var(--bad); font-style: italic; }
.json-tree-invalid { color: var(--bad); white-space: pre-wrap; overflow-wrap: anywhere; }
.json-tree-compact { min-height: 0; max-height: 320px; margin: 0; padding: 8px; font-size: 12px; }
.database-message { padding: 10px 14px; border-radius: 4px; }
.database-message.success { color: var(--ok); background: #eaf8f2; }
.database-message.error, .database-warning { color: var(--bad); }
.database-message.error { background: #fff0f0; }
.database-warning { margin: 12px 0 0; font-size: 12px; }
.danger-btn { color: #fff; border-color: var(--bad) !important; background: var(--bad) !important; }
/* 테이블용 제거 버튼에는 공통 버튼 테두리가 없어 브라우저의 outset 테두리가 남으므로, 크기는 유지하고 재기동 버튼과 같은 평면 테두리를 명시한다. */
.administrator-remove-button {
  appearance: none;
  border: 1px solid #b42318 !important;
  border-radius: 5px;
  background: #c62828 !important;
  background-image: none !important;
  box-shadow: none;
  text-shadow: none;
}
.administrator-remove-button:hover {
  color: #fff;
  background: #a91f1f !important;
  box-shadow: none;
}
@media (max-width: 720px) {
  .database-pagination { flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; }
  .database-pagination-status { margin-left: 0; }
  .database-pagination-navigation { width: 100%; justify-content: flex-end; }
}
.console-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.console-toolbar label {
  width: min(220px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.console-toolbar select {
  margin-top: 6px;
}
.console-table td:nth-child(4),
.console-table td:nth-child(5) {
  max-width: 380px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.console-log-level-warn td {
  background: #fffaf0;
}
.console-log-level-error td {
  background: #fff4f4;
}
.empty-console {
  color: var(--muted);
  text-align: center !important;
}

.codex-chat-launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  /* 데스크톱과 모바일에서 동일한 원형 AI 실행 버튼을 사용한다. */
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  overflow: hidden; border: 0; border-radius: 50%; color: #fff; background: var(--brand-deep);
  box-shadow: 0 8px 24px rgba(0, 42, 78, .28); cursor: pointer; font-weight: 750;
  transition: right .24s ease;
}
.codex-chat-launcher-icon {
  display: grid; place-items: center; width: 100%; height: 100%;
  color: #fff; background: transparent; font-size: 11px; line-height: 1;
}
.codex-chat-panel {
  position: fixed; right: 24px; bottom: 82px; z-index: 100;
  width: min(420px, calc(100vw - 32px)); height: min(620px, calc(100vh - 120px));
  /* 헤더와 입력 폼은 고정하고 대화 내역만 남은 높이에서 스크롤한다. */
  display: flex; flex-direction: column; min-height: 280px;
  overflow: hidden; border: 1px solid #b9cbd8; border-radius: 12px; background: #fff;
  box-shadow: 0 18px 50px rgba(15, 46, 68, .3);
}
.codex-chat-panel > * {
  /* 긴 URL이나 작업 로그의 intrinsic 폭이 패널 자체를 밀어내지 못하게 한다. */
  min-width: 0;
  max-width: 100%;
}
.codex-chat-panel.dragging {
  user-select: none;
}
.codex-chat-header {
  flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 15px 16px;
  color: #fff; background: var(--brand-deep);
  cursor: move; touch-action: none;
}
.codex-chat-header div, .codex-chat-header span { display: block; }
.codex-chat-header span { margin-top: 2px; font-size: 11px; opacity: .75; }
.codex-chat-header span.connected { color: #8ff0c4; opacity: 1; }
.codex-chat-header button { border: 0; color: #fff; background: transparent; font-size: 24px; cursor: pointer; }
.codex-chat-messages {
  width: 100%; min-width: 0; max-width: 100%; flex: 1 1 0; min-height: 0;
  overflow-y: auto; overflow-x: hidden; padding: 16px; background: #f4f8fb;
}
.codex-message {
  position: relative;
  width: auto; max-width: 88%; min-width: 0; margin-right: auto; margin-bottom: 10px; padding: 10px 12px;
  border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; line-height: 1.45; font-size: 13px;
  color: var(--text); background: #fff; border: 1px solid var(--line);
}
.codex-message.assistant, .codex-message.error { padding-right: 34px; }
.codex-message.assistant { color: #176b4a; background: #eaf8f2; border-color: #9ed7bf; }
.codex-message.user { margin-right: 0; margin-left: auto; color: #fff; background: var(--brand); border-color: var(--brand); }
.codex-message.error { color: var(--bad); background: #fff0f0; border-color: #f2c4c4; }
.codex-message.pending { color: var(--muted); font-style: italic; }
.codex-message-body {
  min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-break: break-word;
}
.codex-message-close {
  position: absolute; top: 5px; right: 6px; width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: 50%; color: currentColor; background: transparent;
  font: 700 18px/24px sans-serif; cursor: pointer; opacity: .65;
}
.codex-message-close:hover, .codex-message-close:focus-visible { background: rgba(15, 46, 68, .09); opacity: 1; }
.codex-message time {
  display: block; margin-top: 6px; color: currentColor; opacity: .7; font-size: 10px; text-align: right;
}
.codex-message.user time { color: #fff; }
.codex-live-status { width: 94%; color: var(--muted); }
.codex-live-status strong, .codex-live-status span { display: block; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.codex-live-status strong { margin-bottom: 7px; color: var(--brand-deep); }
.codex-live-status span { position: relative; padding: 3px 0 3px 15px; font-size: 12px; }
.codex-live-status span::before {
  content: ""; position: absolute; left: 1px; top: 9px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--accent);
}
.codex-live-status.completed { border-color: #9ed7bf; background: #f0faf6; }
.codex-live-status.failed { border-color: #f2c4c4; background: #fff0f0; }
.codex-chat-form textarea {
  display: block; width: 100%; min-width: 0; max-width: 100%; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 5px; font: inherit;
}
.codex-chat-form {
  position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr);
  width: 100%; min-width: 0; max-width: 100%; flex: 0 0 auto; gap: 8px;
  padding: 10px 12px 54px; border-top: 1px solid var(--line); background: #fff;
}
.codex-chat-form > * { min-width: 0; max-width: 100%; }
.codex-chat-form textarea { min-height: 58px; max-height: 88px; resize: vertical; }
.codex-chat-actions {
  position: absolute; z-index: 5; right: 12px; bottom: 10px; left: 12px;
  display: flex; gap: 6px; width: auto; min-width: 0; max-width: calc(100% - 24px);
  padding: 0; overflow: hidden; background: #fff;
}
.codex-chat-actions button:not(.hidden) {
  display: flex; align-items: center; justify-content: center; visibility: visible;
  width: 0; min-width: 0; max-width: 100%; min-height: 34px; flex: 1 1 0; padding: 6px 8px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; opacity: 1;
}
.codex-figma-context {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; max-width: 100%;
  padding: 7px 9px; overflow: hidden; border: 1px solid #a7d2c1; border-radius: 5px;
  color: #176b4a; background: #eef9f5; font-size: 12px;
}
.codex-figma-context span { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codex-figma-context button { border: 0; color: inherit; background: transparent; font-size: 18px; cursor: pointer; }
.figma-connection-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 12px; box-shadow: 0 24px 70px rgba(16,24,40,.28); }
.figma-connection-dialog::backdrop { background: rgba(15,23,42,.55); }
.figma-connection-dialog form { display: grid; gap: 10px; padding: 22px; }
.figma-connection-dialog header { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.figma-connection-dialog header small { color: var(--muted); }
.figma-connection-dialog header h2 { margin: 3px 0; color: var(--brand-deep); }
.figma-connection-dialog header p { margin: 0; color: var(--muted); font-size: 13px; }
.figma-connection-dialog header button { align-self: start; border: 0; background: transparent; font-size: 24px; cursor: pointer; }
.figma-connection-dialog label { color: var(--brand-deep); font-size: 13px; font-weight: 750; }
.figma-connection-dialog input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; font: inherit; }
.figma-connection-status { margin: 2px 0; color: var(--muted); font-size: 12px; }
.figma-connection-status.connected { color: #176b4a; }
.figma-connection-status.error { color: var(--bad); }
.figma-plugin-worker {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; margin-top: 4px;
  padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #f7fafc;
}
.figma-plugin-worker strong { color: var(--brand-deep); font-size: 13px; }
.figma-plugin-worker p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.figma-plugin-worker code { font-size: 11px; }
.figma-plugin-worker textarea {
  display: block; width: 100%; min-width: 0; max-width: 100%; padding: 8px; resize: none;
  overflow-wrap: anywhere; word-break: break-all; border: 1px solid var(--line); border-radius: 5px; font: 11px/1.4 monospace;
}
#figmaPluginTokenPanel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.figma-connection-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.git-push-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 12px; box-shadow: 0 24px 70px rgba(16,24,40,.28); }
.git-push-dialog::backdrop { background: rgba(15,23,42,.55); }
.git-push-dialog form { display: grid; gap: 12px; padding: 22px; }
.git-push-dialog header { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.git-push-dialog header h2 { margin: 3px 0; color: var(--brand-deep); }
.git-push-dialog header p { margin: 0; color: var(--muted); font-size: 13px; }
.git-push-dialog header button { align-self: start; border: 0; background: transparent; font-size: 24px; cursor: pointer; }
.git-push-dialog label { color: var(--brand-deep); font-size: 13px; font-weight: 750; }
.git-push-dialog input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 5px; font: inherit; }
.git-push-warning { margin: 0; padding: 10px 12px; border-radius: 5px; color: #8a5a00; background: #fff8e7; font-size: 12px; }

@media (max-width: 1000px) {
  .admin-wrap {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 10px;
  }

  .admin-sidebar h2 {
    flex: 0 0 auto;
    margin: 0 8px 0 4px;
  }

  .admin-sidebar button {
    width: auto;
    flex: 0 0 auto;
    padding-inline: 14px;
  }

  /* 모바일 가로 메뉴에서 하위 메뉴 그룹이 압축되어 연계 서비스 버튼이 찌그러지지 않게 한다. */
  .admin-sidebar .admin-menu-group {
    flex: 0 0 auto;
  }

  .admin-sidebar .admin-menu-parent {
    min-width: max-content;
    white-space: nowrap;
  }

  .admin-sidebar .admin-menu-row {
    flex: 0 0 auto;
    grid-template-columns: max-content 24px 24px;
  }

  .admin-sidebar .admin-menu-row .admin-menu-main {
    overflow: visible;
    text-overflow: clip;
  }

  .admin-sidebar .custom-admin-menu-list {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .admin-sidebar .add-admin-menu-button {
    margin-top: 0;
  }

  .admin-sidebar .restart-servers-button {
    margin-top: 0;
    margin-left: auto;
    max-width: 158px;
  }

  .embedded-admin-wrap,
  .embedded-admin-wrap iframe {
    min-height: 680px;
  }

  .database-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  /* 모바일에서는 관리자 메뉴를 한눈에 조작할 수 있도록 가로 스크롤 대신 중앙 정렬된 1열로 배치한다. */
  .admin-sidebar {
    flex-direction: column;
    align-items: center;
    overflow-x: visible;
  }

  .admin-sidebar h2 {
    margin: 0 0 6px;
    text-align: center;
  }

  .admin-sidebar > button,
  .admin-sidebar .admin-menu-group,
  .admin-sidebar .admin-menu-row,
  .admin-sidebar .custom-admin-menu-list {
    width: 100%;
  }

  .admin-sidebar button,
  .admin-sidebar .admin-menu-parent,
  .admin-sidebar .admin-menu-row .admin-menu-main {
    justify-content: center;
    text-align: center;
  }

  /* 연계 서비스 화살표는 전체 폭의 맨 오른쪽에 두고, 추가 메뉴명은 조작 아이콘과 무관하게 행 중앙에 맞춘다. */
  .admin-sidebar .admin-menu-parent {
    position: relative;
    width: 100%;
    min-width: 0;
  }

  .admin-sidebar .admin-menu-parent .admin-menu-chevron {
    position: absolute;
    right: 14px;
  }

  .admin-sidebar .admin-menu-row {
    position: relative;
    display: block;
  }

  .admin-sidebar .admin-menu-row .admin-menu-main {
    width: 100%;
    padding-right: 62px;
    padding-left: 62px;
  }

  .admin-sidebar .admin-menu-row .admin-menu-icon {
    position: absolute;
    top: 50%;
    right: 27px;
    transform: translateY(-50%);
  }

  .admin-sidebar .admin-menu-row .admin-menu-icon.danger {
    right: 2px;
  }

  .admin-sidebar .custom-admin-menu-list {
    display: grid;
    align-items: stretch;
    gap: 6px;
  }

  .admin-sidebar .add-admin-menu-button,
  .admin-sidebar .restart-servers-button {
    margin-left: 0;
    max-width: none;
  }

  .database-row-fields { grid-template-columns: 1fr; }
  .database-value-heading { align-items: stretch; flex-direction: column; }
  .database-value-tabs { width: 100%; }
  .database-value-tabs .secondary-btn { flex: 1; }
  .database-editor-actions { align-items: stretch; flex-direction: column; }

  .codex-chat-launcher {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .codex-chat-panel {
    right: 12px;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 24px);
    height: min(620px, calc(100vh - 92px));
    height: min(620px, calc(100dvh - 92px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    min-height: min(280px, calc(100vh - 92px));
    max-height: calc(100vh - 92px);
    max-height: calc(100dvh - 92px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

  /* 작은 화면에서도 입력 버튼 행을 고정하고 메시지 목록만 남은 높이에 맞춰 줄인다. */
  .codex-chat-header { padding: 11px 12px; }
  .codex-chat-messages { min-height: 0; padding: 10px; }
  .codex-chat-form { gap: 6px; padding: 8px 9px calc(51px + env(safe-area-inset-bottom, 0px)); }
  .codex-chat-form textarea { min-height: 48px; max-height: 64px; }
  .codex-chat-actions { right: 9px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); left: 9px; width: auto; }
  .codex-chat-actions button { width: 100%; padding: 5px 4px; font-size: 12px; }
}

@media (max-width: 380px) {
  .codex-chat-panel { right: 6px; width: calc(100vw - 12px); }
  .codex-chat-actions { gap: 4px; }
  .codex-chat-actions button { font-size: 11px; letter-spacing: -.03em; }
}

@media (max-height: 480px) {
  .codex-chat-panel {
    top: 6px !important; right: 6px; bottom: 6px !important; left: 6px !important;
    width: auto; height: auto; min-height: 0; max-height: none;
  }
  .codex-chat-header { padding: 7px 10px; }
  .codex-chat-header span { display: none; }
  .codex-chat-form { gap: 4px; padding: 5px 7px calc(43px + env(safe-area-inset-bottom, 0px)); }
  .codex-chat-form textarea { min-height: 38px; max-height: 42px; }
  .codex-chat-actions button { min-height: 30px; padding-block: 3px; }
  .codex-chat-actions { right: 7px; bottom: calc(5px + env(safe-area-inset-bottom, 0px)); left: 7px; }
}

.logic-flow-panel { position: fixed; z-index: 90; top: 0; right: 0; bottom: 0; width: var(--logic-flow-panel-width); transition: transform .24s ease; filter: drop-shadow(-8px 0 28px rgba(16,24,40,.22)); }
.logic-flow-panel.collapsed { transform: translateX(100%); }
.logic-flow-panel.resizing { transition: none; }
/* 왼쪽 경계의 넓은 투명 손잡이는 시각적 경계선을 유지하면서 드래그 조작을 쉽게 한다. */
.logic-flow-resize-handle { position: absolute; z-index: 4; top: 0; bottom: 0; left: -5px; width: 10px; cursor: ew-resize; touch-action: none; }
.logic-flow-resize-handle::after { position: absolute; top: 0; bottom: 0; left: 5px; width: 2px; background: transparent; content: ""; transition: background .15s ease; }
.logic-flow-resize-handle:hover::after,
.logic-flow-resize-handle:focus-visible::after,
.logic-flow-panel.resizing .logic-flow-resize-handle::after { background: #53b1fd; }
/* 로그아웃 영역과 겹치지 않도록 펼침 손잡이를 좁히고 헤더 아래로 내려 배치한다. */
.logic-flow-toggle { position: absolute; top: 104px; left: -28px; width: 30px; height: 46px; border: 0; border-radius: 10px 0 0 10px; background: #173b78; color: #fff; font-size: 24px; cursor: pointer; box-shadow: -5px 7px 16px rgba(16,24,40,.18); }
.logic-flow-body { display: flex; flex-direction: column; height: 100%; overflow: hidden; padding: 0 18px; border-left: 1px solid #344054; background: #101828; color: #f2f4f7; }
.logic-flow-body header { z-index: 2; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; margin: 0 -18px 12px; padding: 18px; border-bottom: 1px solid #344054; background: #101828; }
.logic-flow-body header span { color: #53b1fd; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.logic-flow-body h2 { margin: 3px 0 0; font-size: 20px; }
.logic-flow-body header button { padding: 7px 10px; border: 1px solid #475467; border-radius: 8px; background: #1d2939; color: #d0d5dd; cursor: pointer; }
.logic-flow-guide { margin: 0 0 10px; color: #98a2b3; font-size: 12px; line-height: 1.55; }
.logic-flow-content { min-height: 0; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; }
.logic-flow-connection { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; margin: 10px -18px 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #344054; color: #6ce9a6; background: #101828; font-size: 11px; font-weight: 700; }
.logic-flow-connection::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; box-shadow: 0 0 9px currentColor; }
.logic-flow-connection.error { color: #fdb022; }
.logic-flow-svg { display: block; width: 100%; overflow: visible; }
.logic-flow-arrow { fill: none; stroke: #53b1fd; stroke-width: 2; stroke-dasharray: 5 5; animation: logic-flow-dash .7s linear infinite; }
.logic-flow-node { box-sizing: border-box; height: 100%; padding: 12px 14px; overflow: hidden; border: 1px solid #475467; border-left: 4px solid #53b1fd; border-radius: 12px; background: #1d2939; color: #f2f4f7; font: 12px/1.35 system-ui, sans-serif; }
.logic-flow-node.running { animation: logic-flow-pulse 1.4s ease-in-out infinite; }
.logic-flow-node.success { border-left-color: #32d583; }
.logic-flow-node.error { border-left-color: #f97066; }
.logic-flow-node-head { display: flex; justify-content: space-between; color: #84caff; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.logic-flow-node-head em { color: #98a2b3; font-style: normal; }
.logic-flow-node strong { display: block; margin-top: 3px; font: 700 14px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
.logic-flow-node code { display: block; margin-top: 2px; color: #98a2b3; font-size: 10px; }
.logic-flow-node-detail { margin-top: 6px; color: #fdb022; font: 700 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; }
.logic-flow-node p { margin: 7px 0 0; color: #d0d5dd; line-height: 1.45; }
.logic-flow-empty { padding: 28px 12px; color: #667085; text-align: center; font-size: 12px; }
@keyframes logic-flow-dash { to { stroke-dashoffset: -10; } }
@keyframes logic-flow-pulse { 50% { border-color: #84caff; box-shadow: 0 0 14px rgba(83,177,253,.28); } }
@media (max-width: 700px) {
  :root { --logic-flow-panel-width: calc(100vw - 46px); }
  body.logic-flow-expanded .codex-chat-launcher { right: calc(var(--logic-flow-panel-width) + 8px); }
}

.inline-link {
  color: var(--brand);
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.primary-btn,
.dialog-actions button,
.icon-btn {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  padding: 9px 12px;
  cursor: pointer;
}

.primary-btn,
.dialog-actions .primary-btn {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}

.primary-btn:hover,
.dialog-actions .primary-btn:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

.primary-btn:disabled,
.dialog-actions .primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.work-dialog {
  width: min(980px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0;
}

.work-dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

.work-dialog form {
  padding: 18px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.dialog-head h2,
.dialog-head p {
  margin: 0;
}

.dialog-head p {
  color: var(--muted);
  margin-top: 6px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dialog-grid label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.dialog-grid input,
.dialog-grid select {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  line-height: normal;
}

.assignee-builder {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.required-label {
  margin-left: 4px;
  color: var(--brand-deep);
  font-size: 10px;
  font-weight: 700;
}

.team-results {
  display: grid;
  gap: 8px;
  max-height: 160px;
  margin-top: 8px;
  overflow: auto;
}

.team-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 10px;
}

.team-result-row button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px;
  background: #fff;
  cursor: pointer;
}

.team-result-row button:disabled,
.team-chip button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.selected-teams {
  margin-top: 8px;
}

.employee-results {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.employee-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px;
}

.employee-row button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
}

.selected-people {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.selected-people article {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px;
}

.selected-people h4 {
  margin: 0 0 8px;
}

.optional-label {
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.person-slot,
.person-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin: 4px;
}

.empty-slot {
  color: var(--muted);
  border-style: dashed;
}

.person-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--bad);
}

.role-assignment {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

#basicInfo .role-assignment {
  /* 기본 정보 안의 역할별 선택 UI는 목록 레이아웃을 유지해 좁은 패널에서도 자연스럽게 줄바꿈한다. */
  display: list-item;
}

#basicInfo .role-assignment-nested {
  /* 담당자 블릿 아래의 업무·개발·운영 메뉴는 하위 제어이므로 별도 블릿을 표시하지 않는다. */
  margin-left: 18px;
  list-style: none;
}

#basicInfo .role-assignment-nested .person-list {
  /* 지정된 담당자와 아래 선택 메뉴가 붙어 보이지 않도록 역할별 영역 안에서만 간격을 둔다. */
  margin-bottom: 8px;
}

.role-assignment .person-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.role-assignment .person-chip {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  margin: 0;
}

.role-assignment .person-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
}

.role-assignment .person-chip button {
  flex: 0 0 auto;
}

.role-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

.role-add-row select {
  min-width: 0;
  margin: 0;
}

.role-add-row button {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px;
  background: #fff;
  cursor: pointer;
}

.person-chip button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

@media (max-width: 1100px) {
  .portal-header-main,
  .portal-nav-row {
    padding-inline: 18px;
  }

  .portal-header-main { gap: 12px; }
  .portal-brand { gap: 12px; }
  .portal-brand img { width: clamp(108px, 15vw, 132px); }
  .portal-brand strong { font-size: clamp(14px, 2vw, 18px); }
  .portal-actions { gap: 7px; }
  .utility-button,
  .login-button { min-height: 34px; padding-inline: 12px; }

  .portal-nav {
    gap: 18px;
    overflow-x: auto;
  }

  .portal-nav button {
    flex: 0 0 auto;
  }

  .shell {
    height: auto;
    min-height: calc(100vh - 123px);
    grid-template-columns: 1fr;
    overflow: auto;
    padding: 16px;
  }

  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-detail { position: static; }

  .sidebar {
    height: auto;
    max-height: none;
  }

  .main {
    height: auto;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .guide-wrap {
    height: calc(100vh - 155px);
    height: calc(100dvh - 155px);
  }

  .guide-steps {
    grid-template-columns: 1fr 1fr;
    gap: 16px 0;
  }

  .toolbar,
  .dialog-head {
    flex-direction: column;
  }

  .dialog-grid,
  .selected-people {
    grid-template-columns: 1fr;
  }

  .employee-row {
    grid-template-columns: 1fr 1fr;
  }

  .employee-row > span {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .portal-header-main { gap: 8px; }
  .portal-brand { gap: 9px; overflow: hidden; }
  .brand-divider { display: none; }
  .portal-brand strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .integration-status {
    min-width: 29px;
    min-height: 29px;
    justify-content: center;
    padding: 5px;
  }
  .integration-status > span:last-child { display: none; }
  .portal-nav-row { overflow-x: auto; scrollbar-width: thin; }
  .portal-nav { gap: clamp(12px, 2.5vw, 18px); }
  .sidebar,
  .worklist-wrap,
  .detail-wrap { padding: clamp(12px, 2.2vw, 18px); }
  .codex-chat-launcher {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 700px) {
  .portal-header-main {
    min-height: 66px;
    padding: 10px 14px;
  }

  .portal-brand {
    gap: 10px;
  }

  .portal-brand img {
    width: 118px;
  }

  .brand-divider,
  .utility-button {
    display: none;
  }

  .portal-brand strong {
    max-width: 150px;
    min-height: 0;
    font-size: 14px;
    line-height: 1.25;
    white-space: normal;
  }

  .integration-status {
    padding: 6px;
  }

  .integration-status > span:last-child {
    display: none;
  }

  .login-button {
    min-height: 34px;
    padding-inline: 12px;
    white-space: nowrap;
  }

  .portal-nav-row {
    min-height: 46px;
    padding-inline: 14px;
    overflow: hidden;
  }

  .portal-nav {
    gap: 18px;
  }

  .detail-section-head {
    flex-direction: column;
  }

  .detail-head {
    flex-direction: column;
  }

  .detail-edit-button { align-self: flex-end; }

  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
  }

  .detail-grid article[data-detail-panel] {
    grid-row: auto;
    grid-column: auto;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .ticket-table-scroll {
    max-height: min(55vh, 420px);
  }

  .detail-panel-resize-controls {
    display: none;
  }

  .work-status-tabs {
    overflow-x: auto;
  }

  .work-status-tab {
    flex: 1 0 auto;
  }

  .architecture-preview {
    justify-content: flex-start;
  }

  .guide-header {
    padding: 24px 20px;
    align-items: flex-start;
    flex-direction: column;
  }

  .guide-wrap {
    height: calc(100vh - 144px);
    height: calc(100dvh - 144px);
  }

  .guide-header h1 {
    font-size: 24px;
  }

  .guide-section {
    padding: 24px 20px;
  }

  .guide-steps,
  .guide-feature-grid {
    grid-template-columns: 1fr;
  }

  .admin-wrap {
    gap: 12px;
  }

  .admin-sidebar h2 {
    display: none;
  }

  .database-header,
  .database-panel-title,
  .database-editor-actions,
  .console-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .database-summary {
    grid-template-columns: 1fr;
  }

  .console-toolbar label {
    width: 100%;
  }

  .worklist {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }

  .work-card {
    width: 100%;
  }
}
.work-form-message {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--text-muted, #64748b);
  font-size: 0.9rem;
}

.work-form-message.error {
  color: #b42318;
}

.agent-settings-wrap { padding: 28px; overflow: auto; height: 100%; }
.agent-settings-layout { display: grid; grid-template-columns: 240px minmax(0, 680px); gap: 24px; margin-top: 22px; }
.agent-provider-list { display: flex; flex-direction: column; gap: 8px; }
.agent-provider-list button { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid #d8dee9; border-radius: 12px; background: #fff; text-align: left; cursor: pointer; }
.agent-provider-list button.active { border-color: #155eef; box-shadow: 0 0 0 2px rgba(21,94,239,.12); }
.agent-provider-list span { color: #667085; font-size: 12px; }
.agent-settings-form { display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 1px solid #e4e7ec; border-radius: 16px; background: #fff; }
.agent-settings-form label { display: flex; flex-direction: column; gap: 7px; font-weight: 700; }
.agent-settings-form input[type="text"], .agent-settings-form input[type="url"], .agent-settings-form input[type="number"] { min-height: 42px; padding: 0 12px; border: 1px solid #d0d5dd; border-radius: 8px; }
.agent-settings-form small { color: #667085; font-weight: 400; }
.agent-settings-form .agent-check {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 30px;
  margin: 0;
  font-weight: 600;
  cursor: pointer;
}
.agent-settings-form .agent-check input[type="checkbox"] {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  accent-color: #155eef;
  cursor: pointer;
}
.agent-number-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.configuration-files-wrap { padding: 28px; height: 100%; overflow: auto; }
.configuration-files-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 24px; margin-top: 22px; }
.configuration-file-viewer { min-width: 0; padding: 20px; border: 1px solid #e4e7ec; border-radius: 16px; background: #fff; }
.configuration-file-viewer textarea { width: 100%; min-height: 520px; max-height: calc(100vh - 300px); margin: 16px 0 0; padding: 18px; resize: vertical; overflow: auto; border: 1px solid #344054; border-radius: 10px; background: #101828; color: #d0d5dd; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.configuration-file-viewer textarea:disabled { opacity: .72; cursor: not-allowed; }
.help-guide-dialog { width: min(680px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); padding: 0; overflow: hidden; border: 0; border-radius: 18px; box-shadow: 0 24px 70px rgba(16,24,40,.28); }
.help-guide-dialog::backdrop { background: rgba(15,23,42,.55); backdrop-filter: blur(2px); }
.help-guide-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid #e4e7ec; }
.help-guide-head h2 { margin: 4px 0 0; color: #101828; }
.help-guide-body { display: grid; gap: 12px; max-height: calc(100vh - 150px); padding: 22px 24px 28px; overflow-y: auto; }
.help-guide-body section { padding: 16px; border: 1px solid #e4e7ec; border-radius: 12px; background: #f9fafb; }
.help-guide-body strong { color: #173b78; }
.help-guide-body p { margin: 7px 0 0; color: #475467; line-height: 1.65; }

@media (max-width: 800px) {
  .agent-settings-layout { grid-template-columns: 1fr; }
  .configuration-files-layout { grid-template-columns: 1fr; }
  .agent-provider-list { flex-direction: row; overflow-x: auto; }
  .agent-provider-list button { min-width: 150px; }
}

.dialog-actions button:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 700px) {
  .codex-chat-launcher {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }
  .codex-chat-launcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 11px;
    line-height: 1;
  }
  .codex-chat-launcher-label { display: none; }
}
