@font-face {
  font-family: "Pretendard Variable";
  src: url("./assets/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #eef2f5;
  --panel: #ffffff;
  --panel-soft: #f4f7f9;
  --soft: #f6f8fa;
  --ink: #17212b;
  --muted: #687684;
  --line: #dde5eb;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-strong: #0b5f59;
  --accent-soft: #e8f5f3;
  --gold: #b88723;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(23, 33, 43, 0.1);
  --radius: 8px;
  --font-sans: "Pretendard Variable", "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
select,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

button.is-busy {
  cursor: progress;
  opacity: 0.82;
}

button.is-busy::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 999px;
  background: currentColor;
  vertical-align: middle;
  animation: busy-pulse 850ms ease-in-out infinite;
}

@keyframes busy-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.86);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.app-shell {
  width: min(1460px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar .eyebrow {
  margin: 0 0 3px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.topbar h1 {
  font-size: 22px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.ghost-link {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #344557;
  font-weight: 800;
  text-decoration: none;
}

.ghost-link.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.ghost-link:hover {
  border-color: rgba(15, 118, 110, 0.5);
  color: var(--accent-strong);
}

.ghost-link.active:hover {
  color: #fff;
}

.server-monitor {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafb;
}

.server-monitor span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #fff;
  color: #465769;
  font-size: 12px;
  font-weight: 900;
}

.server-monitor .status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.server-monitor .status-dot.warning::before,
.server-monitor .status-dot.offline::before {
  background: var(--danger);
}

.workspace {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  height: calc(100vh - 180px);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(207, 218, 226, 0.95);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: #f8fafb;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 2px 6px;
}

.brand-mark {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  background: var(--accent);
  border-radius: var(--radius);
  color: #fff;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  letter-spacing: 0;
}

.brand-block h2 {
  margin: 0;
  font-size: 20px;
}

.brand-block p,
.chat-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.side-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.section-title {
  color: #465769;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stats-grid div {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.stats-grid strong {
  display: block;
  font-size: 22px;
  letter-spacing: 0;
}

.stats-grid span {
  color: var(--muted);
  font-size: 13px;
}

.server-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.server-status-grid div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.server-status-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.server-status-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-status-grid strong.warning {
  color: var(--danger);
}

.server-ip-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
}

.server-ip-status.warning {
  color: var(--danger);
  font-weight: 700;
}

.field-label {
  margin-top: 0;
  color: #344557;
  font-size: 13px;
  font-weight: 700;
}

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

.field-help {
  margin-top: -4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

select {
  min-height: 42px;
  padding: 0 12px;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 106, 114, 0.12);
}

input {
  min-height: 40px;
  padding: 0 12px;
}

.primary-menu-button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.primary-menu-button:hover {
  background: var(--accent-strong);
}

.secondary-menu-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #344557;
  font-weight: 800;
  cursor: pointer;
}

.secondary-menu-button:hover {
  border-color: rgba(18, 106, 114, 0.5);
  color: var(--accent-strong);
}

.auth-status {
  margin-top: -6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-status.admin {
  color: var(--accent-strong);
}

.hidden {
  display: none !important;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10000;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: #fff;
  box-shadow: 0 14px 36px rgba(21, 34, 47, 0.18);
  pointer-events: auto;
  animation: toast-in 160ms ease-out;
}

.toast.success {
  border-left-color: var(--accent);
}

.toast.error {
  border-left-color: var(--danger);
}

.toast strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.toast p {
  color: #344557;
  font-size: 13px;
  line-height: 1.45;
}

.toast button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.toast.closing {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.data-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.data-tools button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #344557;
  cursor: pointer;
  font-weight: 800;
}

.data-tools button:hover {
  border-color: rgba(18, 106, 114, 0.5);
  color: var(--accent-strong);
}

.data-tools #syncSheet {
  grid-column: 1 / -1;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.data-tools #viewLogs {
  grid-column: 1 / -1;
}

.data-tools #manageClientNames {
  background: #fff;
  color: #344557;
}

.primary-actions {
  display: grid;
  gap: 8px;
}

.secondary-action-button {
  min-height: 40px;
  border: 1px solid rgba(15, 118, 110, 0.32);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 800;
}

.secondary-action-button:hover {
  border-color: rgba(15, 118, 110, 0.55);
  background: #dff0ed;
}

.data-tools button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.sync-status {
  margin-top: -4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.hint-panel {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.hint-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.suggestion {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: #263644;
  text-align: left;
  cursor: pointer;
}

.suggestion:hover {
  border-color: rgba(18, 106, 114, 0.5);
  color: var(--accent-strong);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  background: #f4f7f9;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.chat-header h2 {
  font-size: 21px;
  letter-spacing: 0;
}

#clearButton {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

#clearButton:hover {
  color: var(--accent);
  border-color: rgba(18, 106, 114, 0.5);
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 22px 24px;
}

.message {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  width: min(100%, 1120px);
  max-width: 1120px;
}

.message.user {
  align-self: flex-end;
  grid-template-columns: minmax(0, 1fr) 36px;
}

.message.user .avatar {
  grid-column: 2;
  grid-row: 1;
  background: #263644;
}

.message.user .bubble {
  grid-column: 1;
  grid-row: 1;
  background: #263644;
  color: #fff;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  background: var(--accent);
  border-radius: var(--radius);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.bubble {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  line-height: 1.6;
}

.bubble.plain {
  white-space: pre-line;
}

.answer-title {
  margin-bottom: 8px;
  font-weight: 800;
}

.source-line {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.answer-section {
  margin-top: 12px;
}

.answer-section strong {
  display: block;
  margin-bottom: 4px;
}

.answer-section ul {
  margin: 0;
  padding-left: 18px;
}

.case-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.result-shell {
  display: grid;
  gap: 14px;
}

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

.issue-browser {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.45fr);
  gap: 14px;
  min-height: 0;
  max-height: min(620px, calc(100vh - 270px));
}

.issue-browser-list,
.issue-detail-panel {
  min-height: 0;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.issue-browser-list {
  display: grid;
  align-content: start;
}

.issue-row {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.issue-row:hover,
.issue-row.active {
  background: #eef7f6;
}

.issue-row.learned {
  background: #fffaf0;
}

.issue-row.learned.active,
.issue-row.learned:hover {
  background: #fff3d8;
}

.issue-row strong {
  font-size: 14px;
}

.issue-row span {
  color: var(--muted);
  font-size: 12px;
}

.issue-row em {
  color: #344557;
  font-style: normal;
  line-height: 1.4;
}

.issue-detail-panel {
  padding: 16px;
}

.case-card {
  padding: 12px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: #f6faf9;
}

.case-card.learned {
  border-left-color: var(--gold);
  background: #fffaf0;
}

.case-card strong {
  display: block;
  margin-bottom: 4px;
}

.case-card span {
  color: var(--muted);
  font-size: 13px;
}

.detail-button {
  min-height: 34px;
  margin-top: 10px;
  padding: 0 12px;
  border: 1px solid rgba(18, 106, 114, 0.35);
  background: #fff;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 800;
}

.detail-button:hover {
  border-color: var(--accent);
  background: #eef7f6;
}

.detail-section p {
  white-space: pre-line;
}

.score {
  color: var(--gold);
  font-weight: 700;
}

.empty {
  color: var(--danger);
  font-weight: 700;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
  padding: 16px 24px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

textarea {
  min-height: 58px;
  max-height: 170px;
  resize: vertical;
  padding: 13px 14px;
  line-height: 1.45;
}

.composer button {
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.composer button:hover {
  background: var(--accent-strong);
}

.issue-dialog,
.auth-dialog,
.manage-dialog,
.client-name-dialog,
.all-issues-dialog,
.copy-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.issue-dialog::backdrop,
.auth-dialog::backdrop,
.manage-dialog::backdrop,
.client-name-dialog::backdrop,
.all-issues-dialog::backdrop,
.copy-dialog::backdrop {
  background: rgba(21, 34, 47, 0.42);
}

.issue-dialog form,
.auth-dialog form {
  display: grid;
  max-height: inherit;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.all-issues-dialog {
  width: min(1480px, calc(100vw - 24px));
}

.client-name-dialog {
  width: min(980px, calc(100vw - 32px));
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.dialog-header {
  border-radius: var(--radius) var(--radius) 0 0;
}

.dialog-header h2 {
  font-size: 20px;
}

.dialog-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.all-issues-header {
  align-items: flex-start;
}

.all-issues-body {
  display: grid;
  grid-template-columns: 280px minmax(390px, 0.92fr) minmax(520px, 1.2fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  height: min(780px, calc(100vh - 118px));
  min-height: 560px;
  padding: 12px;
  background: #eef2f5;
}

.all-issues-filterbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 120px 110px 130px auto minmax(220px, 1fr);
  grid-column: 1 / -1;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.all-issues-filterbar label {
  display: grid;
  gap: 5px;
  color: #344557;
  font-size: 12px;
  font-weight: 800;
}

.all-issues-filterbar select,
.all-issues-filterbar input {
  min-height: 38px;
}

.all-issues-filterbar button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: #344557;
  cursor: pointer;
  font-weight: 800;
}

.all-issues-filterbar button:hover {
  border-color: rgba(18, 106, 114, 0.5);
  color: var(--accent-strong);
}

.all-issues-filterbar p {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.client-filter-panel,
.all-issue-list-panel,
.all-issue-detail-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.client-filter-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  padding: 16px;
  background: #fff;
}

.client-filter-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.client-filter-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.client-filter-item:hover,
.client-filter-item.active {
  border-color: rgba(18, 106, 114, 0.55);
  background: #eef7f6;
}

.client-filter-item strong {
  font-size: 14px;
}

.client-filter-item span {
  color: var(--muted);
  font-size: 12px;
}

.all-issue-list-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: #fff;
}

.issue-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.issue-pagination button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.issue-pagination span {
  min-width: 72px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.mobile-browser-tabs {
  display: none;
}

.all-issue-list-panel .issue-browser-list {
  grid-row: 3;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  border: 0;
  padding: 12px;
  background: #f8fafb;
}

.all-issue-list-panel > .panel-mini-header {
  grid-row: 1;
}

.all-issue-list-panel > .raw-filter-strip {
  grid-row: 2;
}

.all-issue-list-panel > .issue-pagination {
  grid-row: 4;
}

.panel-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.panel-mini-header strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-mini-header span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.raw-filter-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.raw-filter-strip:empty {
  display: none;
}

.raw-filter-chip {
  flex: 0 0 auto;
  min-height: 32px;
  max-width: 220px;
  padding: 0 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  color: #344557;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.raw-filter-chip span {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 700;
}

.raw-filter-chip:hover,
.raw-filter-chip.active {
  border-color: rgba(18, 106, 114, 0.55);
  background: #eef7f6;
  color: var(--accent-strong);
}

.all-issue-detail-panel {
  overflow-y: auto;
  padding: 16px;
  background: #fff;
}

.all-issue-list-panel .issue-row {
  display: grid;
  gap: 9px;
  width: 100%;
  margin: 0 0 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.all-issue-list-panel .issue-row:hover,
.all-issue-list-panel .issue-row.active {
  border-color: rgba(15, 118, 110, 0.55);
  background: #eef7f6;
}

.issue-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.issue-row-top strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.35;
}

.issue-row-top small {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f8;
  color: #465769;
  font-size: 11px;
  font-weight: 900;
}

.issue-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.issue-row-meta b {
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.all-issue-list-panel .issue-row em {
  display: -webkit-box;
  overflow: hidden;
  color: #263848;
  font-size: 13px;
  font-style: normal;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.issue-detail-card {
  display: grid;
  gap: 14px;
}

.issue-detail-card header {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.issue-detail-card header span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

.issue-detail-card h3 {
  margin: 5px 0 6px;
  font-size: 22px;
  letter-spacing: 0;
}

.issue-detail-card header p {
  color: var(--muted);
  font-size: 13px;
}

.issue-detail-sections {
  display: grid;
  gap: 12px;
}

.issue-detail-sections .answer-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.issue-detail-sections .answer-section strong {
  color: #263848;
  font-size: 13px;
}

.issue-detail-sections .answer-section p {
  margin-top: 8px;
  color: #2f4152;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.empty-detail {
  display: grid;
  align-content: center;
  min-height: 100%;
  color: var(--muted);
  text-align: center;
}

.empty-detail strong {
  color: #344557;
}

.empty-detail p {
  margin-top: 6px;
  font-size: 13px;
}

#closeIssueForm,
#closeAuthForm,
#closeManageDialog,
#closeClientNameDialog,
#closeAllIssuesDialog,
#closeCopyDialog {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.client-name-body {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  min-height: 460px;
  max-height: min(680px, calc(100vh - 130px));
  background: #f8fafb;
}

.client-name-editor,
.client-name-rules {
  min-width: 0;
  min-height: 0;
}

.client-name-editor {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.client-name-editor label {
  display: grid;
  gap: 6px;
  color: #344557;
  font-size: 13px;
  font-weight: 800;
}

.client-name-preview {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6faf9;
  color: #344557;
  font-size: 13px;
  line-height: 1.45;
}

.client-name-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.client-name-actions button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #344557;
  cursor: pointer;
  font-weight: 800;
}

.client-name-actions #saveClientNameAlias {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.client-name-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.client-name-status {
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.client-name-rules {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fbfcfd;
}

.alias-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.alias-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.alias-item:hover,
.alias-item:focus-visible {
  border-color: rgba(18, 106, 114, 0.55);
  background: #eef7f6;
}

.alias-item strong {
  font-size: 14px;
}

.alias-item span {
  color: var(--muted);
  font-size: 12px;
}

.issue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  overflow-y: auto;
  padding: 20px;
}

.issue-grid label {
  display: grid;
  gap: 6px;
  color: #344557;
  font-size: 13px;
  font-weight: 700;
}

.issue-grid label:nth-child(n + 4) {
  grid-column: 1 / -1;
}

.issue-grid textarea {
  min-height: auto;
  max-height: none;
}

.dialog-status {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dialog-status.ready {
  color: var(--accent-strong);
}

.dialog-status.error {
  color: var(--danger);
}

.auth-body {
  padding: 20px;
}

.auth-body label {
  display: grid;
  gap: 6px;
  color: #344557;
  font-size: 13px;
  font-weight: 700;
}

.form-error {
  margin-top: 10px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.issue-list {
  display: grid;
  gap: 10px;
  max-height: min(680px, calc(100vh - 150px));
  overflow-y: auto;
  padding: 20px;
}

.issue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.issue-item strong {
  display: block;
  margin-bottom: 5px;
}

.issue-item p {
  color: #344557;
  line-height: 1.45;
}

.issue-actions {
  display: flex;
  gap: 8px;
}

.issue-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #344557;
  cursor: pointer;
  font-weight: 700;
}

.issue-actions button[data-action="delete"] {
  color: var(--danger);
}

.copy-body {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.copy-tabs {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  background: #fff;
}

.copy-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: #344557;
  cursor: pointer;
  font-weight: 800;
}

.copy-tabs button:last-child {
  border-right: 0;
}

.copy-tabs button.active {
  background: var(--accent);
  color: #fff;
}

#copyOutput {
  min-height: 280px;
  max-height: min(520px, calc(100vh - 300px));
  resize: vertical;
  white-space: pre;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
}

.empty-list {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
}

.dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.dialog-actions button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #344557;
  cursor: pointer;
  font-weight: 700;
}

.dialog-actions button[type="submit"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.dialog-actions button[type="submit"]:hover {
  background: var(--accent-strong);
}

@media (max-width: 860px) {
  .app-shell {
    padding: 0;
  }

  .topbar {
    align-items: flex-start;
    grid-template-columns: 1fr;
    margin: 10px;
  }

  .topbar-actions {
    justify-content: flex-start;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .topbar-actions::-webkit-scrollbar {
    display: none;
  }

  .topbar-actions > * {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .topbar-actions .compact-link {
    display: none;
  }

  .server-monitor {
    width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    border: 0;
  }

  .sidebar {
    order: 2;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chat-panel {
    order: 1;
    min-height: 620px;
  }

  .brand-block {
    display: none;
  }

  .hint-panel {
    margin-top: 4px;
  }

  .chat-header,
  .chat-log,
  .composer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .composer button {
    min-height: 46px;
  }

  .issue-grid {
    grid-template-columns: 1fr;
  }

  .issue-item {
    grid-template-columns: 1fr;
  }

  .issue-browser {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .issue-browser-list,
  .issue-detail-panel {
    max-height: 360px;
  }

  .all-issues-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    height: min(760px, calc(100vh - 110px));
    min-height: 0;
    overflow-y: auto;
  }

  .mobile-browser-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-column: 1 / -1;
    gap: 6px;
  }

  .mobile-browser-tabs button {
    min-height: 38px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-weight: 800;
  }

  .mobile-browser-tabs button.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
  }

  .all-issues-body.mobile-view-clients .all-issue-list-panel,
  .all-issues-body.mobile-view-clients .all-issue-detail-panel,
  .all-issues-body.mobile-view-issues .client-filter-panel,
  .all-issues-body.mobile-view-issues .all-issue-detail-panel,
  .all-issues-body.mobile-view-detail .client-filter-panel,
  .all-issues-body.mobile-view-detail .all-issue-list-panel {
    display: none;
  }

  .all-issues-filterbar {
    grid-template-columns: 1fr 1fr;
  }

  .all-issues-filterbar .keyword-filter {
    grid-column: 1 / -1;
  }

  .all-issues-filterbar button,
  .all-issues-filterbar p {
    grid-column: 1 / -1;
  }

  .all-issues-filterbar p {
    text-align: left;
  }

  .client-name-body {
    grid-template-columns: 1fr;
    max-height: min(760px, calc(100vh - 110px));
    overflow-y: auto;
  }

  .client-name-editor {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .client-name-rules {
    min-height: 320px;
  }

  .client-filter-panel,
  .all-issue-list-panel,
  .all-issue-detail-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .client-filter-panel {
    max-height: 260px;
  }

  .all-issue-list-panel .issue-browser-list {
    max-height: 340px;
  }

  .all-issue-detail-panel {
    max-height: none;
  }
}
