/* 管理画面 — Figma node: 1:2 寄せ */

body.admin-page {
  background: #f8f8fc;
  min-height: 100vh;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 210px;
  flex-shrink: 0;
  background: #111318;
  color: rgba(255, 255, 255, 0.88);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.admin-brand {
  padding: 22.5px 18.75px 18.75px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand small {
  display: block;
  font-size: 13.125px;
  font-weight: 600;
  line-height: 18.75px;
  letter-spacing: 0;
  text-transform: none;
  color: #fff;
  margin-bottom: 1.875px;
}

.admin-brand strong {
  display: block;
  font-size: 11.25px;
  font-weight: 400;
  line-height: 15px;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0;
}

.admin-nav {
  flex: 1;
  padding: 11.25px 9.375px;
  overflow-y: auto;
  overflow-x: hidden;
}

.admin-nav-item,
.admin-nav-item.tab {
  display: flex;
  align-items: center;
  width: 191.25px;
  margin: 0 0 1.875px;
  padding: 9.375px 11.25px;
  border: none;
  border-radius: 3.625px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13.125px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  border-left: 0;
  justify-content: flex-start;
  gap: 0;
  min-height: 37.5px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  text-decoration: none;
  box-sizing: border-box;
  line-height: 18.75px;
}

.admin-nav-icon {
  width: 15px;
  height: 15px;
  margin-right: 11.25px;
  color: currentColor;
  opacity: 0.95;
  flex-shrink: 0;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.admin-nav-item span,
.admin-nav-item.tab span {
  flex: 1;
  min-width: 0;
  display: block;
  line-height: 18.75px;
}

.admin-nav-item:hover,
.admin-nav-item.tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.96);
}

.admin-nav-item.on,
.admin-nav-item.tab.on {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 500;
}

.admin-nav-item.on .admin-nav-icon,
.admin-nav-item.tab.on .admin-nav-icon {
  opacity: 1;
}

.admin-nav-item.on::after,
.admin-nav-item.tab.on::after {
  content: "";
  width: 3.75px;
  height: 3.75px;
  border-radius: 999px;
  background: #5b5bd6;
  margin-left: auto;
  flex-shrink: 0;
}

.admin-nav-item:focus-visible,
.admin-nav-item.tab:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.admin-nav-item[hidden],
.admin-nav-item.tab[hidden] {
  display: none;
}

.admin-sidebar-footer {
  margin-top: auto;
  padding: 11.25px 9.375px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
}

.admin-user-label {
  display: block;
  font-size: 11.25px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 1.875px;
  line-height: 15px;
}

.admin-user-mail {
  display: block;
  font-family: "DM Mono", ui-monospace, Menlo, monospace;
  font-size: 11.25px;
  color: rgba(255, 255, 255, 0.32);
  margin-bottom: 1.875px;
  line-height: 15px;
}

.admin-logout-btn.btn {
  width: 191.25px;
  min-height: 0;
  border-radius: 3.625px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13.125px;
  font-weight: 500;
  padding: 7.5px 11.25px;
  display: inline-flex;
  align-items: center;
  gap: 11.25px;
  text-decoration: none;
  justify-content: flex-start;
  line-height: 18.75px;
}

.admin-logout-btn.btn:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
}

.admin-logout-btn .logout-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
  color: rgba(255, 255, 255, 0.6);
}

.admin-logout-btn .logout-label {
  letter-spacing: 0.01em;
}

/* Main area */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--paper);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}

.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  cursor: pointer;
  color: var(--brand-deep);
  flex-shrink: 0;
}

.admin-nav-toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.admin-topbar .demo-banner-inline {
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0;
  font-size: 12px;
  line-height: 1.4;
}

.admin-topbar .demo-banner-inline strong {
  color: var(--orange);
}

.admin-topbar .demo-banner-inline a {
  color: var(--green);
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.admin-content {
  flex: 1;
  padding: 0;
  max-width: none;
  width: 100%;
}

.admin-content.main-content {
  max-width: none;
}

/* Page header (Figma) */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 0;
  flex-wrap: wrap;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 18px 16px;
}

.admin-page-header-text h1 {
  font-size: 15px;
  font-weight: 600;
  color: #111318;
  letter-spacing: 0;
  margin: 0 0 4px;
  line-height: 1.5;
}

.admin-page-desc {
  margin: 0;
  font-size: 13px;
  color: #6b6b80;
  line-height: 1.45;
  max-width: 56ch;
}

.admin-page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-panel-body {
  padding: 22.5px 30px;
}

#panel-sets .admin-panel-body {
  padding: 22px 16px 28px;
}

#panel-sets .admin-card {
  max-width: 930px;
}

/* Cards in admin */
.admin-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 5.625px;
  padding: 0;
  box-shadow: none;
  overflow: hidden;
}

.admin-card-body {
  padding: 0;
}

.admin-card .table-wrap {
  border-radius: 0;
}

.admin-card.card-section {
  padding: 20px 24px;
}

/* Sets table */
table.data.admin-sets-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
  font-size: 13px;
}

.set-title-cell strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #111318;
  margin-bottom: 4px;
  line-height: 1.4;
}

.set-token {
  display: inline-block;
  font-size: 11px;
  font-family: "DM Mono", ui-monospace, Menlo, monospace;
  color: rgba(107, 107, 128, 0.7);
  background: transparent;
  padding: 0;
  border-radius: 0;
  word-break: break-all;
}

.col-publish {
  width: 90px;
  text-align: center;
}

.publish-switch {
  width: 33.75px;
  height: 18.75px;
  display: inline-block;
  border: none;
  border-radius: 999px;
  background: #e5e7eb;
  padding: 0;
  position: relative;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  vertical-align: middle;
}

.publish-switch[aria-checked="true"] {
  background: #5b5bd6;
}

.publish-switch-knob {
  position: absolute;
  top: 50%;
  left: 1.875px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.1), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transform: translateY(-50%);
  transition: left 0.18s var(--ease), transform 0.18s var(--ease);
  pointer-events: none;
}

.publish-switch[aria-checked="true"] .publish-switch-knob {
  left: 18.875px;
}

.publish-switch:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  align-content: flex-start;
  justify-content: flex-start;
}

.admin-link-actions a,
.admin-link-actions button.link-action {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 3.75px 9.375px;
  border-radius: 3.625px;
  font-size: 11.25px;
  font-weight: 500;
  color: #111318;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  gap: 5.625px;
  flex: 0 0 auto;
}

.admin-link-actions a:hover,
.admin-link-actions button.link-action:hover {
  background: #f9fafb;
}

.admin-link-actions .link-sep {
  display: none;
}

.admin-action-icon {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  color: currentColor;
}

.admin-muted-note {
  font-size: 11.25px;
  color: rgba(107, 107, 128, 0.5);
}

.btn-edit-link {
  display: inline-block;
  font-size: 11.25px;
  font-weight: 500;
  color: #111318;
  text-decoration: none;
  padding: 3.75px 9.375px;
  border-radius: 3.625px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  white-space: nowrap;
  line-height: 1.3;
}

.btn-edit-link:hover {
  background: #f9fafb;
  border-color: rgba(0, 0, 0, 0.14);
}

.set-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.btn-delete-link {
  color: #b42318;
  border-color: #f4c6c3;
  background: #fff;
  cursor: pointer;
}

.btn-delete-link:hover {
  background: #fff5f5;
  border-color: #e9a9a4;
}

table.data.admin-sets-table thead th {
  background: rgba(0, 0, 0, 0.02);
  color: #6b6b80;
  font-size: 11.25px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px 14px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

table.data.admin-sets-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  vertical-align: middle;
}

table.data.admin-sets-table th:first-child,
table.data.admin-sets-table td:first-child {
  width: 29%;
}

table.data.admin-sets-table th:nth-child(2),
table.data.admin-sets-table td:nth-child(2) {
  width: 14%;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

table.data.admin-sets-table th:nth-child(3),
table.data.admin-sets-table td:nth-child(3) {
  width: 8%;
}

table.data.admin-sets-table th:nth-child(4),
table.data.admin-sets-table td:nth-child(4) {
  width: 29%;
}

table.data.admin-sets-table th:nth-child(5),
table.data.admin-sets-table td:nth-child(5) {
  width: 12%;
  white-space: normal;
}

table.data.admin-sets-table th:nth-child(6),
table.data.admin-sets-table td:nth-child(6) {
  width: 8%;
}

table.data.admin-sets-table tbody tr:last-child td {
  border-bottom: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  word-break: keep-all;
  line-height: 1;
}

.status-badge.is-published {
  background: #ecfdf5;
  border-color: #a4f4cf;
  color: #007a55;
}

.status-badge.is-draft {
  background: #fffbeb;
  border-color: #fee685;
  color: #bb4d00;
}

.status-badge.is-archived {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: #6a7282;
}

.status-badge.is-completed {
  background: #ecfdf5;
  border-color: #a4f4cf;
  color: #007a55;
}

.status-badge.is-in-progress {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.admin-page .btn {
  min-height: 33.75px;
  border-radius: 3.625px;
  padding: 7.5px 15px;
  font-size: 13.125px;
  font-weight: 500;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.admin-page .btn-solid {
  background: #5b5bd6;
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

.admin-page .btn-orange {
  font-weight: 700;
}

.admin-page .btn-danger {
  font-weight: 700;
}

.admin-page .btn-solid:hover {
  background: #4f4fc3;
}

.admin-page .btn-ghost {
  background: #fff;
  color: #111318;
}

.admin-page .btn-ghost:hover {
  background: #f9fafb;
}

.admin-page .btn-sm {
  min-height: 30px;
  padding: 6px 11px;
  font-size: 11.25px;
}

/* List tables: keep within page width */
.admin-page .table-wrap {
  overflow-x: hidden;
}

.admin-page table.data {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.admin-page table.data th,
.admin-page table.data td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  padding: 10px 8px;
}

.admin-page table.data th.col-actions,
.admin-page table.data td.col-actions {
  min-width: 0;
  width: 11%;
  white-space: normal;
}

.admin-page table.data th.col-url,
.admin-page table.data td.col-url,
.admin-page table.data th.col-embed,
.admin-page table.data td.col-embed {
  min-width: 0;
}

.admin-page .admin-action-group {
  width: 100%;
  max-width: none;
  flex-wrap: wrap;
}

/* Users table: compact and no horizontal slider */
.admin-users-table-wrap {
  overflow-x: hidden;
}

table.data.admin-users-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
  font-size: 13px;
}

table.data.admin-users-table thead th {
  padding: 11px 14px;
  white-space: nowrap;
  word-break: keep-all;
}

table.data.admin-users-table tbody td {
  padding: 12px 14px;
  vertical-align: middle;
}

#panel-users .admin-user-self {
  color: #6b6b80;
  font-size: 12px;
}

#panel-users .admin-user-role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

#panel-users .admin-user-role-badge.is-admin {
  color: #5247cc;
  background: #f4f0ff;
  border-color: #d8cbff;
}

#panel-users .admin-user-role-badge.is-member {
  color: #5f6475;
  background: #f5f6f8;
  border-color: #e3e6ec;
}

#panel-users .admin-user-role-badge.is-chat-viewer {
  color: #0f6b8a;
  background: #e8f6fb;
  border-color: #b8e3f0;
}

#panel-users .admin-user-role-badge.is-session-viewer {
  color: #8a5a0f;
  background: #fff6e8;
  border-color: #f0ddb8;
}

.admin-user-scope-cell {
  font-size: 12px;
  color: #5f6475;
  line-height: 1.45;
}

.admin-user-scope-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 3.625px;
  background: #fafbfd;
}

.admin-user-scope-item {
  margin: 0;
}

#user-add-modal #ua-scope-row.is-hidden {
  display: none;
}

table.data.admin-users-table th:nth-child(1),
table.data.admin-users-table td:nth-child(1) {
  width: 28%;
}

table.data.admin-users-table th:nth-child(2),
table.data.admin-users-table td:nth-child(2) {
  width: 14%;
}

table.data.admin-users-table th:nth-child(3),
table.data.admin-users-table td:nth-child(3) {
  width: 12%;
}

table.data.admin-users-table th:nth-child(4),
table.data.admin-users-table td:nth-child(4) {
  width: 26%;
  white-space: normal;
}

table.data.admin-users-table th:nth-child(5),
table.data.admin-users-table td:nth-child(5) {
  width: 20%;
}

#panel-users .admin-user-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#panel-users .admin-user-actions .btn {
  min-height: 27px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

#panel-users .admin-user-edit-btn {
  color: #2a2f3a;
}

#panel-users .admin-user-delete-btn {
  color: #d04167;
  border-color: #f3b8c7;
  background: #fff;
}

#panel-users .admin-user-actions .btn svg {
  width: 12px;
  height: 12px;
  margin-right: 4px;
}

#btn-add-user {
  min-width: 132px;
  font-weight: 700;
}

/* AI / Drive / Area panel form shape tuning (Figma node 1:1725) */
#settings-sub-ai .admin-card.card-section,
#settings-sub-drive .admin-card.card-section,
#settings-sub-area-pref .admin-card.card-section,
#settings-sub-area-muni .admin-card.card-section {
  border-radius: 5.625px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 15px 18.75px;
}

#settings-sub-ai .ai-prompt-actions {
  display: flex;
  justify-content: flex-end;
}

#settings-sub-ai .ai-prompt-table-wrap {
  margin-bottom: 12px;
}

#settings-sub-ai .ai-prompt-table .ai-prompt-row-actions {
  white-space: nowrap;
}

#settings-sub-ai .ai-prompt-table .ai-prompt-row-actions .btn {
  min-height: 28px;
  margin-right: 6px;
}

#settings-sub-ai .ai-prompt-table .ai-prompt-row-actions .btn:last-child {
  margin-right: 0;
}

#settings-sub-ai .ai-prompt-table tbody tr.is-selected {
  background: #eef1ff;
}

#settings-sub-ai .ai-prompt-editor {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 5.625px;
  padding: 12px;
  background: #fafbff;
}

#settings-sub-ai .ai-prompt-editor.is-editing {
  border-color: #bfc6eb;
  box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.12);
}

#settings-sub-ai .ai-prompt-table tbody tr {
  cursor: pointer;
}

#settings-sub-ai .ai-route-section {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 5.625px;
  padding: 12px;
  background: #fafbff;
}

.settings-page-header {
  margin-bottom: 0;
  border-bottom: none;
}

.settings-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px 14px;
  margin: 0;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

#panel-settings .settings-subheader {
  padding: 0 16px;
  margin: 16px 0;
}

#panel-settings .admin-panel-body {
  padding: 16px 16px 28px;
}

.settings-subtab {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  color: #646b82;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  min-height: 32px;
  padding: 0 12px;
  cursor: pointer;
  font-family: inherit;
}

.settings-subtab.is-active {
  border-color: #bfc6eb;
  background: #eef1ff;
  color: #4f59d8;
}

.settings-subpanel {
  display: none;
}

.settings-subpanel.is-on {
  display: block;
}

.settings-subheader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  margin-bottom: 16px;
}

.settings-subheader-text h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.3;
}

.settings-subheader-actions {
  flex-shrink: 0;
}

#settings-sub-security .admin-card.card-section,
#settings-sub-ai .admin-card.card-section,
#settings-sub-drive .admin-card.card-section,
#settings-sub-area-pref .admin-card.card-section,
#settings-sub-area-muni .admin-card.card-section {
  border-radius: 5.625px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 15px 18.75px;
}

#settings-sub-security .section-title,
#settings-sub-security .section-title-lg {
  font-size: 13.125px;
  font-weight: 600;
  line-height: 18.75px;
  margin: 13.125px 0 7.5px;
}

#settings-sub-security .form-row label {
  display: block;
  font-size: 11.25px;
  font-weight: 600;
  color: #646b82;
  margin-bottom: 4px;
}

.security-status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.security-status-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 12px;
  line-height: 1.45;
}
.security-status-item.is-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.security-status-item.is-warn {
  background: #fffbeb;
  border-color: #fde68a;
}
.security-status-mark {
  font-weight: 700;
  font-size: 11px;
}
.security-status-item.is-ok .security-status-mark { color: #047857; }
.security-status-item.is-warn .security-status-mark { color: #b45309; }
.security-status-label { font-weight: 600; color: #1c1810; }
.security-status-detail {
  grid-column: 2;
  color: #646b82;
  font-size: 11px;
  word-break: break-all;
}
.security-setup-steps {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.65;
}
.security-setup-steps li { margin-bottom: 6px; }
.security-setup-steps code {
  font-size: 11px;
  background: #f3f4f6;
  padding: 1px 4px;
  border-radius: 4px;
}

#settings-sub-ai .section-title,
#settings-sub-ai .section-title-lg,
#settings-sub-drive .section-title,
#settings-sub-drive .section-title-lg,
#settings-sub-area-pref .section-title,
#settings-sub-area-pref .section-title-lg,
#settings-sub-area-muni .section-title,
#settings-sub-area-muni .section-title-lg {
  font-size: 13.125px;
  font-weight: 600;
  line-height: 18.75px;
  margin: 13.125px 0 7.5px;
}

#settings-sub-ai .section-title-sm {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 8px;
}

#ai-settings-error:empty,
#security-settings-error:empty,
#drive-settings-error:empty,
#area-pref-settings-error:empty,
#area-muni-settings-error:empty {
  display: none;
}

#settings-sub-ai .form-row,
#settings-sub-drive .form-row,
#settings-sub-area-pref .form-row,
#settings-sub-area-muni .form-row {
  margin-bottom: 15px;
}

#settings-sub-ai .form-row label,
#settings-sub-drive .form-row label,
#settings-sub-area-pref .form-row label,
#settings-sub-area-muni .form-row label {
  font-size: 13.125px;
  font-weight: 500;
  color: #111318;
  line-height: 18.75px;
  margin-bottom: 5.625px;
}

#settings-sub-ai .form-row input,
#settings-sub-ai .form-row select,
#settings-sub-drive .form-row input,
#settings-sub-drive .form-row select,
#settings-sub-area-pref .form-row input,
#settings-sub-area-pref .form-row select,
#settings-sub-area-muni .form-row input,
#settings-sub-area-muni .form-row select {
  min-height: 35.75px;
}

#settings-sub-ai .form-row input,
#settings-sub-ai .form-row select,
#settings-sub-ai .form-row textarea,
#settings-sub-drive .form-row input,
#settings-sub-drive .form-row select,
#settings-sub-drive .form-row textarea,
#settings-sub-area-pref .form-row input,
#settings-sub-area-pref .form-row select,
#settings-sub-area-pref .form-row textarea,
#settings-sub-area-muni .form-row input,
#settings-sub-area-muni .form-row select,
#settings-sub-area-muni .form-row textarea {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 3.625px;
  padding: 7.5px 11.25px;
  font-size: 13.125px;
  line-height: 18.75px;
  background: #fff;
  color: #111318;
}

#settings-sub-ai .form-row textarea,
#settings-sub-drive .form-row textarea,
#settings-sub-area-pref .form-row textarea,
#settings-sub-area-muni .form-row textarea {
  min-height: 96px;
}

#settings-sub-ai .form-row input:focus,
#settings-sub-ai .form-row select:focus,
#settings-sub-ai .form-row textarea:focus,
#settings-sub-drive .form-row input:focus,
#settings-sub-drive .form-row select:focus,
#settings-sub-drive .form-row textarea:focus,
#settings-sub-area-pref .form-row input:focus,
#settings-sub-area-pref .form-row select:focus,
#settings-sub-area-pref .form-row textarea:focus,
#settings-sub-area-muni .form-row input:focus,
#settings-sub-area-muni .form-row select:focus,
#settings-sub-area-muni .form-row textarea:focus {
  border-color: #b9c2d6;
  box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.12);
}

/* User add modal: align with admin form design */
#user-add-modal .modal {
  max-width: 520px;
  border-radius: 5.625px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 15px 18.75px;
}

#user-add-modal .modal h2 {
  font-size: 15px;
  font-weight: 700;
  color: #22395b;
  margin-bottom: 14px;
}

#user-add-modal .form-row {
  margin-bottom: 14px;
}

#user-add-modal .form-row > label {
  font-size: 13.125px;
  font-weight: 600;
  color: #22395b;
  line-height: 1.4;
  margin-bottom: 6px;
}

#user-add-modal .form-row > input,
#user-add-modal .form-row > select {
  min-height: 35.75px;
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 3.625px;
  padding: 7.5px 11.25px;
  font-size: 13.125px;
  line-height: 18.75px;
  background: #fff;
  color: #111318;
}

#user-add-modal .admin-user-scope-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  color: #374151;
  line-height: 1.45;
  margin: 0;
  cursor: pointer;
}

#user-add-modal .admin-user-scope-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  min-width: 16px;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  border-radius: 3px;
  accent-color: #5b5bd6;
}

#user-add-modal #ua-scope-row > .text-muted-xs {
  margin: 6px 0 0;
}

#user-add-modal #ua-role {
  border-radius: 3.625px;
}

#user-add-modal .form-row > input:focus,
#user-add-modal .form-row > select:focus {
  outline: none;
  border-color: #b9c2d6;
  box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.12);
}

#user-add-modal .modal-actions {
  margin-top: 16px;
  gap: 8px;
}

#user-add-modal .modal-actions .btn {
  min-height: 36px;
  padding: 0 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
}

.admin-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 7.5px;
  font-weight: 700;
}

.admin-create-btn::before {
  content: "+";
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  margin-right: 1px;
}

/* Sidebar overlay (mobile) */
.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 90;
}

body.admin-sidebar-open .admin-sidebar-backdrop {
  display: block;
}

body.admin-sidebar-open {
  overflow: hidden;
}

/* Editor in admin shell */
.admin-content .editor-layout {
  margin-top: 0;
}

.admin-editor-toolbar {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
    box-shadow: var(--shadow-lg);
  }

  body.admin-sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-nav-toggle {
    display: inline-flex;
  }

  .admin-topbar {
    display: flex;
  }

  .admin-content {
    padding: 0;
  }

  .admin-page-header {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .admin-panel-body {
    padding: 16px 12px 48px;
  }

  .settings-subtabs {
    padding: 10px 12px 12px;
  }

  .settings-subheader {
    padding: 0 12px;
  }

  .admin-page-header-actions {
    width: 100%;
  }

  .admin-page-header-actions .btn {
    width: 100%;
  }

  .admin-topbar {
    padding: 10px 12px;
  }

  table.data.admin-sets-table {
    min-width: 0;
    font-size: 13px;
  }

  .admin-sidebar-footer .admin-user-mail {
    word-break: break-all;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-sidebar {
    transition: none;
  }
}

/* ===== Editor look (Figma screenshot寄せ) ===== */
#panel-editor.tab-panel.on {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
}

#panel-editor .editor-workbench {
  flex: 1;
}

.editor-main {
  background: #f5f5fa;
}

.editor-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid #e5e7ef;
}

.editor-title-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.editor-back-link {
  flex-shrink: 0;
}

.editor-nav-label {
  flex-shrink: 0;
}

.editor-set-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #667085;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(420px, 40vw);
}

.editor-flow-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 18px;
  border-top: 1px solid #e7e9f1;
  border-bottom: 1px solid #e2e4ee;
  background: #f3f4f8;
}

.editor-flow-tab {
  position: relative;
  border: none;
  background: transparent;
  color: #71768a;
  font-size: 13.125px;
  font-weight: 600;
  line-height: 1.2;
  padding: 6px 14px;
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
}

.editor-flow-tab:not(:last-child) {
  margin-right: 18px;
}

.editor-flow-tab:not(:last-child)::after {
  content: "›";
  position: absolute;
  right: -13px;
  top: 50%;
  transform: translateY(-50%);
  color: #aeb3c3;
  font-size: 18px;
  font-weight: 500;
}

.editor-flow-tab.is-active {
  color: #5b5bd6;
  background: #e8e9f8;
}

.editor-workbench {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  min-height: calc(100vh - 104px);
}

#panel-editor[data-flow-step="1"] .editor-workbench,
#panel-editor[data-flow-step="3"] .editor-workbench,
#panel-editor[data-flow-step="4"] .editor-workbench,
#main-content[data-flow-step="1"] .editor-workbench,
#main-content[data-flow-step="3"] .editor-workbench,
#main-content[data-flow-step="4"] .editor-workbench {
  grid-template-columns: minmax(0, 1fr);
}

#panel-editor[data-flow-step="1"] .editor-left-pane,
#panel-editor[data-flow-step="3"] .editor-left-pane,
#panel-editor[data-flow-step="4"] .editor-left-pane,
#main-content[data-flow-step="1"] .editor-left-pane,
#main-content[data-flow-step="3"] .editor-left-pane,
#main-content[data-flow-step="4"] .editor-left-pane {
  display: none;
}

.editor-left-pane {
  background: #f5f6fa;
  border-right: 1px solid #e5e7ef;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.editor-pane-title {
  font-size: 15px;
  font-weight: 600;
  color: #646a82;
  margin: 0;
  padding: 14px 12px 10px;
  border-bottom: 1px solid #e5e7ef;
}

.editor-step-list-wrap {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
}

.editor-step-add {
  padding: 6px 0 2px;
  margin-top: 6px;
}

.editor-page .editor-step-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px dashed #b8c0d4;
  border-radius: 8px;
  background: #fff;
  color: #49516a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.editor-page .editor-step-add-btn:hover {
  border-color: #5b5bd6;
  background: #eef1ff;
  color: #4f4fc3;
}

.editor-page .editor-step-add-btn:active {
  background: #e4e8ff;
}

.editor-page .editor-step-add-btn:focus-visible {
  outline: 2px solid #5b5bd6;
  outline-offset: 2px;
}

.editor-center-pane {
  padding: 0;
  min-width: 0;
  background: #fff;
}

.editor-question-wrap {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.editor-question-add {
  margin-top: 12px;
  background: #fff;
  border: 1px solid #e6e8f1;
  border-radius: 6px;
  padding: 10px 12px;
}

.editor-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.editor-add-row .btn {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #d8dbe8;
  background: #fff;
  color: #1d2233;
  font-size: 12px;
  font-weight: 600;
}

.editor-add-row #btn-add-q {
  border-color: #b9c6ff;
  color: #4456db;
  background: #f5f7ff;
}

.editor-right-pane {
  border-left: 1px solid #e5e7ef;
  background: #fff;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.editor-side-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7ef;
}

.editor-side-tab {
  flex: 1;
  border: none;
  background: #fff;
  color: #72758c;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 6px;
  border-bottom: 2px solid transparent;
}

.editor-side-tab.is-on {
  color: #5b5bd6;
  border-bottom-color: #5b5bd6;
}

.editor-settings-panel {
  display: none;
  padding: 12px 16px;
  overflow-y: auto;
}

.editor-settings-panel.is-on {
  display: block;
}

.editor-settings-panel[data-settings-step="2"] {
  padding: 16px;
}

.editor-settings-panel .form-row {
  margin-bottom: 10px;
}

.editor-settings-panel .form-row-label-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.editor-settings-panel .label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.editor-settings-panel .help-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #c8cddd;
  color: #7a8198;
  font-size: 11px;
  line-height: 1;
  cursor: help;
  background: #fff;
}

.editor-settings-panel .help-tooltip {
  position: absolute;
  left: 22px;
  top: -6px;
  z-index: 20;
  width: 320px;
  max-width: calc(100vw - 80px);
  padding: 8px 10px;
  border-radius: 6px;
  background: #1f2433;
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.editor-settings-panel .help-icon:hover .help-tooltip,
.editor-settings-panel .help-icon:focus .help-tooltip,
.editor-settings-panel .help-icon:focus-visible .help-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.editor-settings-panel .domain-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.editor-settings-panel .domain-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-settings-panel .domain-item .setting-allowed-domain {
  flex: 1 1 auto;
  min-width: 0;
}

.editor-settings-panel label {
  font-size: 12px;
  font-weight: 600;
  color: #5e637a;
  margin-bottom: 4px;
}

.editor-settings-panel input,
.editor-settings-panel select,
.editor-settings-panel textarea {
  font-size: 12px;
  padding: 8px 9px;
  border-radius: 4px;
  border: 1px solid #d9dce8;
}

.editor-settings-panel .eq-header select,
.editor-settings-panel .eq-header .eq-header-select {
  padding: 0 20px 0 7px;
  font-size: 11px;
  border-radius: 4px;
  min-height: 24px;
}

.editor-settings-panel[data-settings-step="1"] .form-row .flex-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.editor-settings-panel[data-settings-step="1"] .form-row .input-flex {
  flex: 1 1 auto;
  min-width: 0;
}

.editor-settings-panel[data-settings-step="1"] .form-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 31px;
  padding: 0 10px;
}

.editor-settings-panel[data-settings-step="1"] .editor-advanced {
  margin-top: 10px;
}

.editor-settings-panel .embed-copy-btn {
  min-height: 28px;
  padding: 0 8px;
  font-weight: 600;
}

.editor-settings-panel .embed-copy-icon {
  width: 13px;
  height: 13px;
  margin-right: 4px;
  vertical-align: middle;
}

.editor-settings-panel .embed-tag-readonly {
  background: #f8f9fc;
  color: #555d74;
  cursor: default;
}

.editor-settings-title {
  font-size: 13px;
  font-weight: 700;
  color: #4f566f;
  margin: 0 0 10px;
}

.editor-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  border-bottom: 1px solid #e6e8f1;
  padding-bottom: 6px;
}

.editor-subtab {
  border: 1px solid #d9dce8;
  background: #fff;
  color: #646b82;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  min-height: 28px;
  padding: 0 10px;
  cursor: pointer;
}

.editor-subtab.is-active {
  border-color: #bfc6eb;
  background: #eef1ff;
  color: #4f59d8;
}

.editor-subtab-panel {
  display: none;
}

.editor-subtab-panel.is-on {
  display: block;
}
.form-fieldset {
  border: 1px solid var(--line, #dde3ec);
  border-radius: 12px;
  padding: 12px 14px 4px;
  margin: 0 0 14px;
}
.form-fieldset legend {
  font-size: 13px;
  font-weight: 700;
  padding: 0 6px;
}
.form-note {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin: 0 0 12px;
  line-height: 1.5;
}
.form-note strong {
  color: var(--text, #111827);
}

.color-chip-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.color-chip {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  padding: 0;
  cursor: pointer;
}

.color-chip.chip-black { background: #000000; }
.color-chip.chip-violet { background: #5b5bd6; }
.color-chip.chip-blue { background: #4f6593; }
.color-chip.chip-green { background: #0f766e; }
.color-chip.chip-orange { background: #d97706; }

.color-chip.is-active {
  box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.22);
  border-color: #5b5bd6;
}

.goal-rule-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.goal-rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #e0e3ee;
  border-radius: 6px;
  background: #f8f9fd;
}

.goal-rule-name {
  font-size: 12px;
  color: #596078;
}

.goal-rule-empty {
  font-size: 12px;
  color: #8a90a5;
  padding: 6px 0;
}

.goal-editor-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.goal-editor-card {
  border: 1px solid var(--line, #dde3ec);
  border-radius: 12px;
  padding: 12px 14px 4px;
  background: #fbfcfe;
}
.goal-editor-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.goal-editor-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #3a4257;
}
.goal-editor-empty {
  font-size: 12px;
  color: #8a90a5;
  padding: 6px 0;
}

.editor-side-placeholder {
  margin-top: 10px;
  padding: 12px;
  border: 1px dashed #d4d7e5;
  border-radius: 6px;
  color: #6b6f84;
  font-size: 12px;
}

.editor-advanced {
  margin-top: 8px;
  border: 1px solid #e1e4ef;
  border-radius: 6px;
  padding: 7px 9px;
  background: #fafbff;
}

.editor-advanced > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #323954;
}

/* flow-step specific layout handled by .editor-settings-panel toggles */

.editor-page .step-list-item {
  margin-bottom: 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 10px 10px;
  background: transparent;
  font-size: 12px;
  color: #666b82;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.editor-page .step-list-item[draggable="true"] {
  cursor: grab;
}

.editor-page .step-list-item.is-dragging {
  opacity: 0.55;
}

.editor-page .step-list-item.is-drag-over {
  border-color: #bcc4ea;
  background: #eef1ff;
}

.editor-page .step-list-item.on {
  background: #e8eaf7;
  border-color: #e2e5f1;
  color: #313854;
}

.editor-page .step-list-item .step-drag {
  color: #c5cada;
  font-size: 12px;
  line-height: 1;
  letter-spacing: -1px;
  margin-top: 2px;
}

.editor-page .step-list-item .step-meta {
  flex: 1;
  min-width: 0;
}

.editor-page .step-list-item .step-title-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #4f59d8;
  line-height: 1.25;
  padding: 0;
  margin-bottom: 2px;
  outline: none;
}

.editor-page .step-list-item .step-title-input:focus {
  border-bottom-color: #4f59d8;
}

.editor-page .step-list-item .step-count {
  font-size: 12px;
  color: #81889e;
  line-height: 1.2;
}

.editor-page .eq-card {
  border: 1px solid #e3e6ef;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 10px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 24, 40, 0.04);
}

.editor-page .eq-card.is-dragging {
  opacity: 0.65;
  box-shadow: 0 4px 14px rgba(91, 91, 214, 0.12);
}

.editor-page .eq-card.is-drag-over {
  border-color: #bcc4ea;
  background: #eef1ff;
}

.editor-page .eq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: #fff;
  border-bottom: 1px solid #eceef5;
  min-height: 40px;
}

.editor-page .eq-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.editor-page .eq-drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 18px;
  height: 26px;
  margin-left: -2px;
  border-radius: 4px;
  color: #b8bfd0;
  font-size: 12px;
  line-height: 1;
  letter-spacing: -2px;
  cursor: grab;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.editor-page .eq-drag:hover {
  background: #f3f4f8;
  color: #7a8498;
}

.editor-page .eq-drag:active {
  cursor: grabbing;
}

.editor-page .eq-qid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 26px;
  height: 20px;
  border-radius: 4px;
  background: #eef0f6;
  color: #6a7282;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0 6px;
}

.editor-page .eq-question-input {
  border: none;
  border-radius: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: #1a2033;
  min-width: 0;
  flex: 1 1 auto;
  background: transparent;
  line-height: 1.35;
}

.editor-page .eq-question-input::placeholder {
  color: #b4bac8;
  font-weight: 500;
}

.editor-page .eq-question-input:focus {
  outline: none;
}

.editor-page .eq-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.editor-page .eq-header-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: 6px;
  background: #f6f7fb;
  border: 1px solid #eceef5;
}

.editor-page .eq-header-right .eq-header-select,
.editor-page .eq-header-right select.eq-header-select,
.editor-page .eq-header-right .js-q-cat,
.editor-page .eq-header-right .js-q-type {
  min-height: 24px;
  height: 24px;
  max-height: 24px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 0 20px 0 7px;
  border: 1px solid transparent;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%239aa3b5' d='M2.5 3.75 5 6.25 7.5 3.75'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  color: #4a5268;
  cursor: pointer;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.2;
}

.editor-page .eq-header-right .js-q-cat {
  min-width: 58px;
  max-width: none;
}

.editor-page .eq-header-right .js-q-type {
  min-width: 72px;
  max-width: 108px;
}

.editor-page .eq-header-right .eq-header-select:hover,
.editor-page .eq-header-right select.eq-header-select:hover {
  background-color: #fff;
  border-color: #dfe3ee;
}

.editor-page .eq-header-right .eq-header-select:focus,
.editor-page .eq-header-right select.eq-header-select:focus {
  outline: none;
  background-color: #fff;
  border-color: #c5c9f5;
  box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.1);
}

.editor-page .eq-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.editor-page .eq-order-btns {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #dbe0ec;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.editor-page .eq-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 2px 5px;
  border: none;
  background: #fff;
  color: #6a7282;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.editor-page .eq-order-btns .eq-action-btn {
  border-right: 1px solid #dbe0ec;
}

.editor-page .eq-order-btns .eq-action-btn:last-child {
  border-right: none;
}

.editor-page .eq-action-btn:hover:not(:disabled) {
  background: #f3f4f8;
  color: #5b5bd6;
}

.editor-page .eq-action-btn:active:not(:disabled) {
  background: #ebedf3;
}

.editor-page .eq-action-btn:focus-visible {
  outline: 2px solid #5b5bd6;
  outline-offset: 1px;
  z-index: 1;
}

.editor-page .eq-action-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.editor-page .eq-action-icon {
  font-size: 11px;
  line-height: 1;
}

.editor-page .eq-fold-btn {
  border: 1px solid #dbe0ec;
  border-radius: 4px;
  padding: 2px 5px;
  min-width: 24px;
  min-height: 24px;
  background: #fff;
}

.editor-page .eq-fold-btn:hover:not(:disabled) {
  background: #f3f4f8;
  border-color: #c8cedc;
}

.editor-page .eq-fold-icon {
  font-size: 10px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.editor-page .eq-fold-btn.is-collapsed .eq-fold-icon {
  transform: rotate(-90deg);
}

.editor-page .eq-card.is-collapsed > :not(.eq-header) {
  display: none;
}

.editor-page .eq-card.is-collapsed .eq-header {
  border-bottom: none;
}

.editor-page .eq-card.is-collapsed .eq-question-input {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-page .eq-card.is-collapsed .eq-order-btns {
  display: none;
}

.editor-page .eq-subtext-row {
  padding: 10px 12px 12px;
  border-bottom: 1px solid #eceef5;
  background: #fafbfd;
}

.editor-page .eq-subtext-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #49516a;
}

.editor-page .eq-field-optional {
  font-size: 11px;
  font-weight: 500;
  color: #9ca3b5;
}

.editor-page .eq-subtext-hint {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.45;
  color: #8b91a4;
}

.editor-page .eq-subtext-input {
  width: 100%;
  border: 1px solid #dbe0ec;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: #161a26;
  padding: 8px 10px;
  box-sizing: border-box;
}

.editor-page .eq-subtext-input::placeholder {
  color: #a0a6b8;
}

.editor-page .eq-subtext-input:focus {
  outline: none;
  border-color: #5b5bd6;
  box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.12);
}

.editor-page .eq-question-input:focus {
  outline: none;
}

.editor-page .eq-card .eq-opt-row,
.editor-page .eq-card .eq-panel,
.editor-page .eq-card .form-row {
  margin-left: 12px;
  margin-right: 12px;
}

.editor-page .eq-card .eq-opt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #eef0f6;
}

.editor-page .eq-opt-order-btns {
  display: inline-flex;
  align-items: stretch;
  flex-shrink: 0;
  border: 1px solid #dbe0ec;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.editor-page .eq-opt-order-btns .eq-action-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 4px 8px;
}

.editor-page .eq-opt-order-btns .eq-action-btn:first-child {
  border-right: 1px solid #dbe0ec;
}

.editor-page .eq-opt-dot {
  color: #c0c5d4;
  font-size: 13px;
  line-height: 1;
  flex-shrink: 0;
}

.editor-page .eq-card .eq-opt-row .input-flex {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 14px;
}

.editor-page .eq-card .eq-opt-row .input-flex:focus {
  outline: none;
}

.editor-page .eq-card .js-opt-del {
  border: none;
  background: transparent;
  color: #b8bece;
  padding: 0;
  width: 16px;
  height: 16px;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  font-size: 14px;
  line-height: 1;
}

.editor-page .eq-card .js-opt-del:hover {
  color: #8b93a8;
  background: transparent;
}

.editor-page .eq-card .js-add-opt,
.editor-page .eq-card .eq-add-opt-btn {
  margin: 8px 12px 0;
  min-height: 26px;
  height: auto;
  padding: 4px 10px;
  border: 1px solid #dbe0ec;
  border-radius: 5px;
  background: #fff;
  color: #5b5bd6;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: none;
}

.editor-page .eq-card .js-add-opt:hover,
.editor-page .eq-card .eq-add-opt-btn:hover {
  background: #f5f6ff;
  border-color: #c5c9f5;
  color: #4f4fc3;
}

.editor-page .eq-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #eceef5;
  margin: 0;
}

.editor-page .eq-toolbar .btn {
  min-height: 30px;
  border-radius: 4px;
  font-size: 12px;
}

.editor-page .eq-toolbar-left {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.editor-page .js-toggle-cond {
  cursor: pointer;
}

.editor-page .eq-cond-trigger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 26px;
  min-width: 0;
  padding: 4px 10px;
  border: 1px solid #e07a2f;
  border-radius: 5px;
  background: #fff;
  color: #c2410c;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.editor-page .eq-cond-trigger-btn:hover {
  background: #fff1e8;
  border-color: #d97706;
  color: #9a3412;
  box-shadow: none;
}

.editor-page .eq-cond-trigger-btn:active {
  background: #ffedd5;
}

.editor-page .eq-cond-trigger-btn:focus-visible {
  outline: 2px solid #fb923c;
  outline-offset: 2px;
}

.editor-page .eq-cond-trigger-btn.is-set {
  border-color: #d97706;
  background: #fff7ed;
  color: #9a3412;
}

.editor-page .eq-cond-panel .eq-cond-trigger-btn {
  min-height: 26px;
  padding: 4px 10px;
  font-size: 11px;
}

.editor-page .btn.btn-sm.eq-cond-trigger-btn {
  min-height: 26px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
}

.editor-page .btn.btn-sm.eq-add-opt-btn {
  min-height: 26px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
}

.editor-page .eq-required-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #535a70;
}

.editor-page .eq-required-inline input[type="checkbox"] {
  accent-color: #5b5bd6;
}

.editor-page .eq-panel {
  margin-top: 8px;
  margin-bottom: 8px;
  border: 1px solid #dfe3ee;
  border-radius: 6px;
  padding: 8px 10px;
  background: #f7f8fc;
  font-size: 12px;
}

.editor-page .eq-panel-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #49516a;
}

.editor-page .js-cond-panel .cond-label {
  font-size: 12px;
  color: #535a70;
}

.editor-page .js-service-area-panel .pref-grid {
  max-height: 220px;
}

.editor-page .area-chip-pick-panel {
  max-height: 240px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 5.625px;
  background: #fafbff;
}

.editor-page .area-chip-pick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.editor-page .area-chip-pick-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: #334155;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  min-height: 36px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.editor-page .area-chip-pick-chip:hover {
  border-color: #5b5bd6;
  background: #f4f0ff;
}

.editor-page .area-chip-pick-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.2);
}

.editor-page .area-chip-pick-chip.is-selected {
  border-color: #5b5bd6;
  background: #eef1ff;
  color: #4338ca;
  box-shadow: inset 0 0 0 1px rgba(91, 91, 214, 0.12);
}

.editor-page .area-chip-pick-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  background: #5b5bd6;
  color: #fff;
  flex-shrink: 0;
}

.editor-page .area-chip-pick-order[hidden] {
  display: none;
}

.editor-page .area-chip-pick-label {
  white-space: nowrap;
}

/* Area master tables — match admin-sets-table / set-row-actions */
table.data.area-master-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
  font-size: 13px;
}

table.data.area-master-table thead th {
  background: rgba(0, 0, 0, 0.02);
  color: #6b6b80;
  font-size: 11.25px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px 14px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

table.data.area-master-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  vertical-align: middle;
}

table.data.area-master-table tbody tr:last-child td {
  border-bottom: 0;
}

table.data.area-master-table .col-move {
  width: 88px;
  white-space: nowrap;
}

table.data.area-master-table .col-visible {
  width: 96px;
  text-align: center;
}

table.data.area-master-table .col-name {
  width: 24%;
  color: #535a70;
}

table.data.area-master-table.area-master-muni-table .col-actions {
  width: 88px;
}

.area-master-move {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.area-master-move .btn-edit-link {
  min-width: 28px;
  padding: 3.75px 7px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
}

.area-master-move .btn-edit-link:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.area-master-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.area-master-row-actions .btn-delete-link {
  cursor: pointer;
  font-family: inherit;
}

.area-master-field {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 3.625px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.4;
  background: #fff;
  color: #111318;
  min-height: 32px;
  font-family: inherit;
}

.area-master-field:focus {
  border-color: #b9c2d6;
  box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.12);
  outline: none;
}

.area-master-visible-cell {
  justify-content: center;
  margin: 0;
}

#settings-sub-area-pref .area-master-table-wrap,
#settings-sub-area-muni .area-master-table-wrap {
  margin: 0;
}

#settings-sub-area-muni .area-master-muni-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0;
}

#settings-sub-area-muni .admin-panel-body > .admin-card + .admin-card {
  margin-top: 12px;
}

#settings-sub-area-pref .admin-panel-body > .text-muted-xs,
#settings-sub-area-muni .admin-panel-body > .auth-gate-error {
  margin-bottom: 12px;
}

table.data.area-master-table tbody tr.area-master-empty td {
  text-align: center;
  color: rgba(107, 107, 128, 0.85);
  padding: 24px 16px;
}

.chat-widget .area-select-ranked {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-widget .area-select-ranked label {
  font-size: 13px;
  font-weight: 600;
  color: #49516a;
}

.chat-widget .area-muni-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px 10px;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #e5e8f2;
  border-radius: 8px;
  background: #fafbfd;
}

.chat-widget .area-muni-check-grid label {
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.editor-page .js-cond-panel {
  border-style: solid;
}

.editor-page .eq-cond-panel {
  border-color: #f0d4b8;
  background: #fff8f2;
}

.editor-page .eq-cond-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.editor-page .eq-cond-section {
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid #f0d4b8;
}

.editor-page .eq-cond-panel > .eq-cond-answer-section {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.editor-page .eq-cond-section-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #9a3412;
}

.editor-page .eq-cond-answer-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.editor-page .eq-cond-clear {
  color: #c2410c;
}

.editor-page .eq-cond-logic {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #535a70;
}

.editor-page .eq-cond-rules {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.editor-page .eq-cond-rule {
  border: 1px solid #ead6c4;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}

.editor-page .eq-cond-rule-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.editor-page .eq-cond-rule-head .field-select-full {
  flex: 1;
  min-width: 180px;
}

.editor-page .eq-cond-rule-options,
.editor-page .eq-cond-rule-number {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.editor-page .eq-cond-unit {
  font-size: 12px;
  color: #737b92;
}

.editor-page .js-cond-panel .js-cond-qid {
  margin-bottom: 6px;
}

.editor-page .js-img-panel {
  border-style: solid;
}

.editor-page .js-img-panel .img-pick-controls {
  gap: 8px;
  margin-bottom: 8px;
}

.editor-page .js-img-panel .img-asset-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.editor-page .js-img-panel .img-asset-card {
  border-radius: 6px;
  padding: 6px;
  cursor: grab;
}

.editor-page .js-img-panel .img-asset-card .btn {
  min-height: 26px;
  font-size: 11px;
}

.editor-page .js-img-panel .img-asset-card.is-dragging {
  opacity: 0.6;
}

.editor-page .js-img-panel .img-asset-card.is-drag-over {
  border-color: #b9c2e4;
  background: #eef1ff;
}

.editor-page .eq-card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 10px 12px 12px;
  border-top: 1px solid #eceef5;
  background: #fafbfd;
}

.editor-page .eq-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff;
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.editor-page .eq-remove-btn:hover {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #b91c1c;
}

.editor-page .eq-remove-btn:active {
  background: #fee2e2;
}

.editor-page .eq-remove-btn:focus-visible {
  outline: 2px solid #f87171;
  outline-offset: 2px;
}

.editor-page .js-img-panel .img-asset-card .js-img-alt {
  width: 100%;
  margin-top: 2px;
  font-size: 12px;
}

.editor-page .img-asset-alt-label {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #49516a;
}

.editor-page .img-asset-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.editor-page .img-asset-actions .eq-remove-btn,
.editor-page .img-asset-actions .eq-img-change-btn {
  flex: 1;
  min-width: 0;
}

.editor-page .eq-img-change-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #dbe0ec;
  border-radius: 6px;
  background: #fff;
  color: #49516a;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.editor-page .eq-img-change-btn:hover {
  border-color: #5b5bd6;
  background: #eef1ff;
  color: #4f4fc3;
}

.editor-page .eq-img-change-btn:focus-visible {
  outline: 2px solid #5b5bd6;
  outline-offset: 2px;
}

.editor-page .js-img-panel .img-asset-card .eq-remove-btn {
  width: auto;
  margin-top: 0;
}

.editor-page .eq-del-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.editor-page .eq-del-label {
  font-size: 12px;
  line-height: 1;
}

@media (max-width: 1280px) {
  .editor-workbench {
    grid-template-columns: 170px minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .editor-workbench {
    grid-template-columns: 170px minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .editor-titlebar {
    padding: 8px 12px;
    min-height: 48px;
  }

  .editor-set-title {
    font-size: 13px;
    max-width: 100%;
  }

  .editor-flow-tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding: 8px 10px;
  }

  .editor-workbench {
    display: block;
  }

  .editor-left-pane,
  .editor-center-pane {
    border: none;
  }

  .editor-center-pane {
    padding: 10px;
  }
}

/* Session list — align with admin-sets-table */
#panel-sessions .admin-panel-body {
  padding: 22px 16px 28px;
}

#panel-sessions .session-toolbar .session-count {
  font-size: 13px;
  font-weight: 500;
  color: #6b6b80;
  white-space: nowrap;
}

table.data.session-list-table .th-filter-wrap {
  position: relative;
  display: inline-block;
}

table.data.session-list-table .th-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease;
}

table.data.session-list-table .th-filter-btn:hover {
  color: #111318;
  border-color: rgba(0, 0, 0, 0.32);
  background: #f5f6f8;
}

table.data.session-list-table .th-filter-btn:focus-visible {
  outline: none;
  border-color: #2f6df6;
  box-shadow: 0 0 0 2px rgba(47, 109, 246, 0.25);
}

table.data.session-list-table .th-filter-btn[aria-expanded="true"],
table.data.session-list-table .th-filter-btn.is-active {
  color: #111318;
  border-color: #2f6df6;
  background: #eef3ff;
}

table.data.session-list-table .th-filter-caret {
  flex: none;
  opacity: 0.6;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

table.data.session-list-table .th-filter-btn:hover .th-filter-caret {
  opacity: 1;
}

table.data.session-list-table .th-filter-btn[aria-expanded="true"] .th-filter-caret {
  opacity: 1;
  transform: rotate(180deg);
}

table.data.session-list-table .th-filter-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 240px;
  max-height: 320px;
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  padding: 10px;
}

table.data.session-list-table .th-filter-panel-head {
  font-size: 12px;
  font-weight: 600;
  color: #2e3140;
  margin-bottom: 8px;
}

table.data.session-list-table .th-filter-options {
  display: grid;
  gap: 6px;
  max-height: 210px;
  overflow: auto;
  margin-bottom: 10px;
}

table.data.session-list-table .th-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #2e3140;
}

table.data.session-list-table .th-filter-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

table.data.session-list-table .th-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
  white-space: nowrap;
}

table.data.session-list-table .th-sort-btn:hover {
  color: #111318;
}

table.data.session-list-table th.is-sorted .th-sort-btn {
  color: #111318;
  font-weight: 600;
}

table.data.session-list-table .th-sort-indicator {
  font-size: 10px;
  opacity: 0.45;
  min-width: 0.75em;
}

table.data.session-list-table th.is-sorted .th-sort-indicator.is-active {
  opacity: 1;
}

table.data.session-list-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
  font-size: 13px;
}

table.data.session-list-table thead th {
  background: rgba(0, 0, 0, 0.02);
  color: #6b6b80;
  font-size: 11.25px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 12px 14px;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

table.data.session-list-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  vertical-align: middle;
  color: #535a70;
}

table.data.session-list-table tbody tr:last-child td {
  border-bottom: 0;
}

table.data.session-list-table th:nth-child(1),
table.data.session-list-table td:nth-child(1),
table.data.session-list-table .col-check {
  width: 3%;
  padding-left: 10px;
  padding-right: 6px;
  text-align: center;
  white-space: nowrap;
}

table.data.session-list-table th:nth-child(2),
table.data.session-list-table td:nth-child(2) {
  width: 25%;
}

table.data.session-list-table th:nth-child(3),
table.data.session-list-table td:nth-child(3) {
  width: 13%;
  white-space: nowrap;
}

table.data.session-list-table th.col-pref-filter {
  overflow: visible;
}

table.data.session-list-table th:nth-child(4),
table.data.session-list-table td:nth-child(4) {
  width: 20%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.data.session-list-table th:nth-child(5),
table.data.session-list-table td:nth-child(5) {
  width: 16%;
  white-space: nowrap;
}

table.data.session-list-table th.col-actions,
table.data.session-list-table td.col-actions {
  width: 22%;
  min-width: 112px;
  white-space: nowrap;
}

table.data.session-list-table td.col-actions .set-row-actions {
  flex-wrap: nowrap;
}

@media (max-width: 640px) {
  table.data.session-list-table td.col-actions .set-row-actions {
    flex-wrap: wrap;
  }
}

/* --- セッション詳細ページ --- */
.session-detail-page .admin-content {
  max-width: none;
  padding: 0;
}

#panel-session-detail {
  padding: 22px 16px 28px;
  box-sizing: border-box;
}

#panel-session-detail .session-detail-state {
  padding: 48px 16px;
}

#panel-session-detail .session-detail-header {
  margin-bottom: 18px;
  padding-top: 2px;
}

#panel-session-detail .session-detail-grid {
  gap: 16px;
  margin-bottom: 16px;
}

#panel-session-detail .session-detail-card--wide {
  margin-bottom: 16px;
}

.session-detail-page .demo-banner-inline {
  display: none;
}

.session-detail-page .admin-topbar {
  min-height: 48px;
  border-bottom: 1px solid #eceef4;
}

.session-detail-page .admin-card {
  border: 1px solid #e8ebf2;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  background: #fff;
}

.session-detail-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.session-detail-state--error {
  color: #b91c1c;
}

.session-detail-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.session-detail-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.session-detail-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #667085;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e4e7ef;
  flex-shrink: 0;
}

.session-detail-back:hover {
  background: #f8f9fc;
  color: var(--brand-deep);
}

.session-detail-nav-label {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand-deep);
  letter-spacing: -0.01em;
}

.session-detail-id {
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #667085;
  background: transparent;
  padding: 0;
}

.session-detail-status-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
}

.session-detail-header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.session-detail-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #667085;
  white-space: nowrap;
}

.session-detail-meta-item svg {
  color: #98a2b3;
  flex-shrink: 0;
}

.session-detail-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.session-detail-grid--top {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
}

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

.session-detail-card {
  padding: 18px 20px 20px;
}

.session-detail-card--wide {
  margin-bottom: 14px;
}

.session-detail-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #1f2937;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

.session-detail-card-title--icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.session-detail-card-title--icon svg {
  color: #667085;
}

.session-detail-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.session-detail-card-head .session-detail-card-title {
  margin-bottom: 0;
}

.session-detail-count {
  font-size: 12px;
  color: #98a2b3;
  font-weight: 600;
}

.session-detail-dl {
  margin: 0;
}

.session-detail-dl-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px 16px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f7;
  font-size: 13px;
  align-items: start;
}

.session-detail-dl-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.session-detail-dl-row dt {
  margin: 0;
  color: #98a2b3;
  font-weight: 600;
}

.session-detail-dl-row dd {
  margin: 0;
  color: #1f2937;
  font-weight: 600;
  word-break: break-word;
}

.session-detail-dl-row--source dd a {
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
  word-break: break-all;
}

.session-detail-dl-row--source dd a:hover {
  text-decoration: underline;
}

.session-goal-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.session-goal-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 13px;
  font-weight: 800;
}

.session-goal-cta-done {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #059669;
}

.session-detail-chat-wrap {
  border: 1px solid #eceef4;
  border-radius: 10px;
  background: #fafbfc;
  padding: 14px;
  min-height: 280px;
  max-height: 360px;
  overflow: hidden;
}

.session-detail-chat {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 332px;
  overflow-y: auto;
  padding-right: 6px;
}

.session-chat-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.session-chat-row.is-user {
  flex-direction: row-reverse;
}

.session-chat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.session-chat-row.is-ai .session-chat-avatar {
  background: #eef0f6;
  color: #475467;
}

.session-chat-row.is-user .session-chat-avatar {
  background: #dbeafe;
  color: #1d4ed8;
}

.session-chat-content {
  max-width: 78%;
  min-width: 0;
}

.session-chat-row.is-user .session-chat-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.session-chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
}

.session-chat-row.is-ai .session-chat-bubble {
  background: #fff;
  color: #1f2937;
  border: 1px solid #eceef4;
  border-top-left-radius: 4px;
}

.session-chat-row.is-user .session-chat-bubble {
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #dbeafe;
  border-top-right-radius: 4px;
}

.session-chat-bubble p {
  margin: 0;
}

.session-chat-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  font-size: 11px;
  color: #98a2b3;
}

.session-chat-row.is-user .session-chat-meta {
  justify-content: flex-end;
}

.session-chat-qid {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #b0b8c6;
}

.session-detail-answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-answer-item {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8f9fc;
  border: 1px solid #eceef4;
}

.session-answer-q {
  font-size: 12px;
  font-weight: 700;
  color: #98a2b3;
  margin-bottom: 6px;
}

.session-answer-a-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.session-answer-a {
  font-size: 15px;
  font-weight: 800;
  color: #1f2937;
  line-height: 1.4;
}

.session-answer-required {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.session-detail-empty,
.session-detail-empty-cell {
  color: #98a2b3;
  font-size: 13px;
}

table.data.session-candidates-table {
  border-collapse: separate;
  border-spacing: 0;
}

table.data.session-candidates-table thead th {
  background: #fafbfc;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid #eceef4;
  padding: 10px 12px;
}

table.data.session-candidates-table tbody td {
  font-size: 13px;
  padding: 14px 12px;
  vertical-align: top;
  border-bottom: 1px solid #f0f2f7;
  color: #344054;
}

table.data.session-candidates-table tbody tr:last-child td {
  border-bottom: none;
}

table.data.session-candidates-table .session-candidate-text {
  color: #1f2937;
  font-weight: 500;
  line-height: 1.55;
}

table.data.session-candidates-table th:nth-child(1),
table.data.session-candidates-table td:nth-child(1) {
  width: 40%;
}

table.data.session-candidates-table th:nth-child(2),
table.data.session-candidates-table td:nth-child(2) {
  width: 30%;
}

table.data.session-candidates-table th:nth-child(3),
table.data.session-candidates-table td:nth-child(3) {
  width: 14%;
  white-space: nowrap;
}

table.data.session-candidates-table th:nth-child(4),
table.data.session-candidates-table td:nth-child(4) {
  width: 16%;
  white-space: nowrap;
}

.status-badge.is-review-pending {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fde68a;
}

.session-detail-raw {
  margin-bottom: 24px;
}

.session-detail-raw-summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-deep);
  padding: 4px 0;
}

.session-detail-raw-pre {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #111318;
  color: #e5e7eb;
  font-size: 11px;
  line-height: 1.5;
  overflow: auto;
  max-height: 320px;
}

@media (max-width: 960px) {
  .session-detail-grid--top,
  .session-detail-grid--middle {
    grid-template-columns: 1fr;
  }

  .session-detail-header-meta {
    width: 100%;
  }

  .session-detail-dl-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* 予約設定（管理画面） */
.booking-hours-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.booking-hours-row {
  display: grid;
  grid-template-columns: 72px 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}
.booking-hours-day {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
@media (max-width: 640px) {
  .booking-hours-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .session-chat-content {
    max-width: 88%;
  }
}
