:root {
  color: #17221c;
  background: #eef3ef;
  font-family: Inter, "Noto Sans JP", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

.operator-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 80px;
}

header,
.login-panel,
.console-panel {
  background: #fff;
  border: 1px solid #d5dfd8;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 16px 44px rgb(42 66 51 / 8%);
}

.login-panel,
.console-panel {
  margin-top: 20px;
}

.eyebrow {
  margin: 0;
  color: #35704c;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.private-access-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #d9b04c;
  border-radius: 10px;
  color: #73520d;
  background: #fff8df;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
}

.primary-action,
.operator-identity a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  color: #fff;
  background: #235d3b;
  font-weight: 750;
  text-decoration: none;
}

.operator-identity {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.operator-identity div {
  display: grid;
  gap: 4px;
}

.operator-identity span,
.operator-identity small {
  color: #607066;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.feature-grid article,
.permission-panel,
.llm-gateway-panel,
.dictionary-panel {
  border: 1px solid #dce5df;
  border-radius: 14px;
  padding: 20px;
}

.llm-usage-panel {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.55);
}

.feature-grid h2,
.permission-panel h2 {
  font-size: 1rem;
}

.feature-grid p {
  margin-bottom: 0;
  color: #66756b;
}

.permission-panel {
  margin-top: 14px;
}

.llm-gateway-panel {
  margin-top: 14px;
}

.dictionary-panel {
  margin-top: 14px;
}

.dictionary-filter {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(240px, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
  margin: 1rem 0;
}

.dictionary-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.dictionary-entry-form,
.dictionary-edit-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #cbd8cf;
  border-radius: 12px;
  background: #f7faf8;
}

.dictionary-entry-form h3,
.dictionary-edit-form h3,
.dictionary-entry-form .wide-control,
.dictionary-edit-form .wide-control {
  grid-column: 1 / -1;
}

.dictionary-entry-form label,
.dictionary-edit-form label {
  display: grid;
  gap: 0.35rem;
  color: #46564b;
  font-size: 0.86rem;
  font-weight: 700;
}

.dictionary-entry-form .check-control,
.dictionary-edit-form .check-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dictionary-entry-form .check-control input,
.dictionary-edit-form .check-control input {
  width: auto;
}

.dictionary-edit {
  margin-top: 0.75rem;
  border-top: 1px solid #dce5df;
  padding-top: 0.65rem;
}

.dictionary-edit summary {
  cursor: pointer;
  color: #235d3b;
  font-weight: 750;
}

.dictionary-publication {
  margin-bottom: 0.75rem;
  color: #35644a;
  font-size: 0.88rem;
}

.dictionary-filter label {
  display: grid;
  gap: 0.35rem;
  color: #607066;
  font-size: 0.86rem;
}

.dictionary-filter input,
.dictionary-filter select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd8cf;
  border-radius: 10px;
  background: #fff;
  color: #1d2821;
  padding: 0.6rem 0.7rem;
}

.dictionary-summary {
  color: #35644a;
  margin-bottom: 0.8rem;
}

.dictionary-list {
  display: grid;
  gap: 0.7rem;
}

.dictionary-list article {
  padding: 0.9rem;
  border: 1px solid #dce5df;
  border-radius: 12px;
  background: #fbfdfb;
}

.dictionary-pair {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.dictionary-pair code {
  color: #1d2821;
  font-size: 0.95rem;
}

.dictionary-pair span {
  color: #26734d;
}

.section-heading,
.llm-client-list article > div:first-child,
.api-key-list li,
.client-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading p,
.console-message {
  color: #607066;
}

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

.client-edit {
  margin-top: 0.9rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 0.8rem;
}

.client-edit summary {
  cursor: pointer;
  color: #bae6fd;
  font-weight: 700;
}

.client-edit-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.client-edit-form label,
.usage-filter {
  display: grid;
  gap: 0.35rem;
  color: #cbd5e1;
  font-size: 0.86rem;
}

.client-edit-form input,
.client-edit-form select,
.usage-filter select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  padding: 0.6rem 0.7rem;
}

.client-edit-form button {
  align-self: end;
}

.client-form label {
  display: grid;
  gap: 6px;
  color: #46564b;
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #bdcbc1;
  border-radius: 9px;
  padding: 10px 12px;
  color: #17221c;
  background: #fff;
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.primary-button,
.secondary-action,
.danger-action {
  min-height: 40px;
  border-radius: 9px;
  padding: 0 14px;
}

.primary-button {
  align-self: end;
  color: #fff;
  background: #235d3b;
}

.secondary-action {
  color: #235d3b;
  background: #e4eee7;
}

.danger-action {
  color: #8b2525;
  background: #f9e5e5;
}

.issued-key {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 16px;
  border: 2px solid #d09220;
  border-radius: 12px;
  background: #fff8e8;
}

.issued-key[hidden] {
  display: none;
}

.llm-client-list {
  display: grid;
  gap: 12px;
}

.usage-filter {
  display: flex;
  max-width: 400px;
  align-items: center;
  gap: 10px;
  margin: 0.65rem 0;
  font-weight: 700;
}

.usage-filter select {
  width: 260px;
  padding: 8px 10px;
}

.llm-usage-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.llm-usage-list article {
  padding: 10px 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.7);
}

.usage-log-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 8px;
}

.usage-log-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.usage-log-heading strong {
  color: #f8fafc;
}

.usage-log-heading span {
  color: #94a3b8;
  font-size: 0.8rem;
}

.usage-log-heading .usage-result {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
}

.usage-result-succeeded { color: #24633f !important; background: #dff1e5; }
.usage-result-failed { color: #9b2929 !important; background: #f8dddd; }
.usage-result-cancelled { color: #765f20 !important; background: #f5edcf; }

.usage-log-details {
  display: grid;
  grid-template-columns: minmax(135px, 1.15fr) minmax(125px, 1fr) minmax(115px, .9fr) minmax(260px, 1.8fr) minmax(90px, .7fr);
  gap: 8px 16px;
  margin: 0;
}

.usage-log-metric {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.usage-log-metric span {
  color: #718078;
  font-size: 0.72rem;
}

.usage-log-metric strong {
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  line-height: 1.25;
}

.usage-log-metric-wide {
  grid-column: 1 / -1;
}

.llm-client-list article {
  border: 1px solid #dce5df;
  border-radius: 12px;
  padding: 16px;
}

.llm-client-list h3 {
  margin: 0;
}

.client-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 14px 0;
}

.client-details div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.client-details span {
  color: #607066;
}

.api-key-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.api-key-list li {
  padding-top: 8px;
  border-top: 1px solid #e4ebe6;
}

@media (max-width: 680px) {
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .operator-identity {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-form,
  .client-details,
  .dictionary-filter,
  .dictionary-entry-form,
  .dictionary-edit-form {
    grid-template-columns: 1fr;
  }

  .dictionary-entry-form h3,
  .dictionary-edit-form h3,
  .dictionary-entry-form .wide-control,
  .dictionary-edit-form .wide-control {
    grid-column: auto;
  }

  .section-heading,
  .api-key-list li {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* VoiNote settings-compatible operator layout */
:root {
  color: #162019;
  background: #f5f7f5;
  font-family: Inter, "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body { background: #f5f7f5; }

[hidden] { display: none !important; }

.operator-app { min-height: 100vh; }

.welcome-header,
.login-panel {
  width: min(720px, calc(100% - 32px));
  margin: 32px auto 0;
  padding: 28px;
  border: 1px solid #dce5df;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 44px rgb(42 66 51 / 8%);
}

.operator-login-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.operator-login-form label {
  display: grid;
  gap: 7px;
  color: #526158;
  font-size: .84rem;
  font-weight: 700;
}

.operator-login-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 13px;
  border: 1px solid #cfdad3;
  border-radius: 9px;
  color: #162019;
  background: #fff;
  font: inherit;
}

.operator-login-form .primary-action {
  border: 0;
  cursor: pointer;
}

.console-panel {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f5f7f5;
  box-shadow: none;
}

.settings-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 24px 14px 18px;
  border-right: 1px solid #dde5df;
  background: #fff;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #fff;
  background: #26734d;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.brand-block div { display: grid; gap: 1px; }
.brand-block strong { font-size: 1.05rem; }
.brand-block small { color: #718078; font-size: .74rem; }

.settings-nav { display: grid; gap: 3px; }

.settings-nav p {
  margin: 18px 10px 5px;
  color: #87948d;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.settings-nav button {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  color: #526059;
  background: transparent;
  text-align: left;
  font-size: .88rem;
  font-weight: 650;
}

.settings-nav button:hover { background: #f1f5f2; color: #235d3b; }
.settings-nav button.active { color: #1e6440; background: #eaf4ed; font-weight: 800; }

.settings-workspace {
  min-width: 0;
  padding: 34px clamp(24px, 4vw, 56px) 72px;
}

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  max-width: 1500px;
  margin: 0 auto 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-header h1 { margin: 3px 0 6px; font-size: clamp(1.55rem, 2.5vw, 2rem); letter-spacing: -.025em; }
.workspace-header p:last-child { margin: 0; color: #66756d; }
.access-status { display: flex; align-items: center; gap: 7px; margin-right: 245px; padding-top: 8px; color: #627168; font-size: .75rem; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #3b9b65; box-shadow: 0 0 0 3px rgb(59 155 101 / 12%); }

.settings-workspace > .operator-identity {
  position: absolute;
  top: 22px;
  right: 28px;
  z-index: 2;
  gap: 9px;
  padding: 7px 8px 7px 12px;
  border: 1px solid #dae3dc;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgb(30 54 39 / 5%);
}

.operator-identity div { display: grid; gap: 0; }
.operator-identity span { font-size: .78rem; }
.operator-identity strong { font-size: .84rem; }
.operator-identity small { font-size: .7rem; }
.operator-identity a { min-height: 32px; padding: 0 11px; border-radius: 8px; font-size: .76rem; }

.private-access-note { max-width: 1500px; margin: 0 auto 18px; }

.settings-view,
.dictionary-panel,
.llm-gateway-panel,
.llm-usage-panel,
.permission-panel {
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid #dce4de;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 26px rgb(38 67 48 / 4%);
}

.section-heading { align-items: flex-start; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 5px; font-size: 1.08rem; }
.section-heading p { margin-bottom: 0; font-size: .88rem; }

.summary-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  min-height: 48px;
  margin: 0 0 16px;
  padding: 10px 15px;
  border: 1px solid #e0e8e2;
  border-radius: 11px;
  color: #627169;
  background: #f8faf8;
  font-size: .83rem;
}

.summary-strip strong { color: #21633f; font-size: 1.2rem; }

.primary-button,
.secondary-action,
.ghost-action,
.danger-action {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: .83rem;
  font-weight: 750;
}

.primary-button { color: #fff; background: #26734d; }
.primary-button:hover { background: #1e623f; }
.secondary-action { border: 1px solid #bfcfc4; color: #265f40; background: #fff; }
.secondary-action:hover, .ghost-action:hover { background: #eef5f0; }
.ghost-action { border: 1px solid transparent; color: #52675a; background: transparent; }
.danger-action { color: #9a342e; background: #fff0ee; }

input, select, textarea {
  min-height: 40px;
  border-color: #c9d5cd;
  border-radius: 9px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #4e8b66; box-shadow: 0 0 0 3px rgb(66 132 90 / 12%); }

.dictionary-filter,
.compact-filter {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 14px 0;
}
.compact-filter label { width: min(220px, 100%); }
.dictionary-filter .search-control { flex: 1; min-width: 240px; }

.create-disclosure {
  margin: 0 0 16px;
  border: 1px solid #dbe5de;
  border-radius: 11px;
  background: #fbfcfb;
}
.create-disclosure > summary { padding: 13px 15px; cursor: pointer; color: #256442; font-size: .88rem; font-weight: 800; }
.create-disclosure .dictionary-entry-form,
.create-disclosure .client-form { margin: 0 14px 14px; }

.initial-tabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  margin: 5px 0 14px;
  padding-bottom: 3px;
}
.initial-tabs button { min-width: 38px; height: 34px; padding: 0 9px; border-radius: 8px; color: #68756e; background: #f2f5f3; font-size: .78rem; }
.initial-tabs button.active { color: #fff; background: #347952; }

.table-shell { width: 100%; overflow-x: auto; border: 1px solid #e0e7e2; border-radius: 11px; }
.data-table { width: 100%; border-collapse: collapse; color: #253029; font-size: .79rem; }
.data-table th { padding: 11px 12px; border-bottom: 1px solid #dfe7e1; color: #647169; background: #f6f8f6; text-align: left; white-space: nowrap; }
.data-table td { padding: 12px; border-bottom: 1px solid #edf1ee; vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfb; }
.data-table button.link-button { padding: 0; color: #246d47; background: transparent; text-align: left; font-weight: 800; }
.candidate-table { min-width: 940px; }
.ai-table { min-width: 1120px; }
.generation-table { min-width: 1480px; }
.pair-cell { display: grid; gap: 4px; min-width: 150px; }
.pair-cell code { white-space: normal; overflow-wrap: anywhere; }
.pair-arrow { color: #2e8055; }
.example-cell { min-width: 260px; color: #59685f; line-height: 1.55; }
.candidate-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 190px; }
.muted { color: #7b8981; font-size: .74rem; }
.status-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 999px; color: #506058; background: #edf2ee; font-size: .72rem; font-weight: 750; }
.status-badge.success { color: #1c653f; background: #e4f3e9; }
.status-badge.warning { color: #805b13; background: #fff4d4; }
.empty-row { padding: 28px !important; color: #7b8880; text-align: center; }

.dictionary-list { gap: 9px; }
.dictionary-list article { padding: 0; overflow: hidden; background: #fff; }
.dictionary-group-header { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(170px, 1.2fr) auto; gap: 14px; align-items: center; padding: 14px 16px; }
.dictionary-group-header h3 { margin: 0 0 3px; font-size: .98rem; }
.term-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.term-chip { padding: 4px 8px; border-radius: 999px; color: #52635a; background: #eef3ef; font-size: .72rem; }
.dictionary-group-details { padding: 0 16px 15px; border-top: 1px solid #e8ede9; }
.dictionary-entry-row { padding: 12px 0; border-bottom: 1px solid #edf1ee; }
.dictionary-entry-row:last-child { border-bottom: 0; }

.investigation-detail { margin-top: 18px; padding: 20px; border: 1px solid #dce5df; border-radius: 12px; background: #f9fbf9; }
.investigation-detail audio { width: 100%; margin-bottom: 12px; }
.ai-candidate-section { margin: 18px 0; }
.ai-candidate-section h3, .investigation-detail > h3 { margin: 0 0 10px; font-size: .92rem; }
.ai-candidate-table { min-width: 900px; }
.detail-actions { display: flex; align-items: center; gap: 14px; margin: 10px 0 14px; color: #617168; font-size: .82rem; }
.transcript-content { max-height: 520px; margin: 0; padding: 18px; overflow: auto; border: 1px solid #e0e6e2; border-radius: 10px; color: #26322b; background: #fff; font-family: inherit; font-size: .84rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }

.llm-usage-panel { color: #17221c; background: #fff; }
.llm-client-list { display: grid; gap: 10px; }
.llm-client-list article, .llm-usage-list article { border-color: #dce5df; color: #17221c; background: #fbfdfb; }
.usage-log-heading strong { color: #17221c; }
.usage-log-heading span { color: #718078; }
.usage-log-details { color: #425049; }
.client-edit summary { color: #266c47; }
.client-edit-form label, .usage-filter { color: #526159; }
.client-edit-form input, .client-edit-form select, .usage-filter select { border-color: #c9d5cd; color: #17221c; background: #fff; }

.permission-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; padding: 0; list-style: none; }
.permission-list li { padding: 10px 12px; border: 1px solid #e1e8e3; border-radius: 8px; color: #4e6055; background: #f8faf8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; }

@media (max-width: 900px) {
  .console-panel { grid-template-columns: 1fr; }
  .settings-sidebar { position: sticky; z-index: 5; min-height: auto; padding: 10px 14px; border-right: 0; border-bottom: 1px solid #dde5df; }
  .brand-block { padding: 0 4px 8px; }
  .settings-nav { display: flex; gap: 5px; overflow-x: auto; }
  .settings-nav p { display: none; }
  .settings-nav button { width: auto; min-width: max-content; }
  .settings-workspace { padding: 24px 16px 54px; }
  .settings-workspace > .operator-identity { position: static; margin: -10px 0 16px; }
  .access-status { margin-right: 0; }
  .usage-log-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .workspace-header { padding-right: 0; }
  .dictionary-filter, .compact-filter { align-items: stretch; flex-direction: column; }
  .dictionary-filter .search-control, .compact-filter label { width: 100%; min-width: 0; }
  .dictionary-group-header { grid-template-columns: 1fr; }
  .client-form, .dictionary-entry-form { grid-template-columns: 1fr; }
  .usage-filter { max-width: none; align-items: stretch; flex-direction: column; }
  .usage-filter select { width: 100%; }
  .usage-log-details { grid-template-columns: 1fr; }
}
