:root {
  color-scheme: dark;
  --app: #181818;
  --chrome: #1f1f1f;
  --rail: #202020;
  --rail-soft: #242424;
  --surface: #121212;
  --panel: #242424;
  --panel-hover: #2d2d2d;
  --field: #151515;
  --line: #303030;
  --line-soft: #262626;
  --hairline: 0.5px;
  --text: #f4f4f4;
  --text-soft: #c8c8c8;
  --muted: #8d8d8d;
  --muted-2: #686868;
  --accent: #339cff;
  --accent-soft: #1f6fb8;
  --green: #0ea55f;
  --red: #ef4444;
  --amber: #d99a1e;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--app);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1 {
  font-size: 22px;
  line-height: 1.3;
  font-weight: 680;
}

h2 {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 660;
}

h3 {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 650;
}

button,
.button {
  min-height: 32px;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-hover);
  color: var(--text);
  padding: 0 13px;
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
}

button:hover,
.button:hover {
  background: #343434;
}

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

button.ghost,
.button.ghost {
  background: transparent;
  color: var(--text-soft);
}

button.small,
.button.small {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

button.danger {
  background: #3a1d1d;
  border-color: #593030;
  color: #ffb4b4;
}

.button-reset {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

input,
textarea {
  width: 100%;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--text);
  padding: 10px 11px;
  font: inherit;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(51, 156, 255, 0.25);
}

textarea {
  min-height: 74px;
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.field-label {
  gap: 8px;
}

.windowbar {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 16px;
  background: var(--chrome);
  border-bottom: var(--hairline) solid #2a2a2a;
  color: var(--muted);
  user-select: none;
}

.brand {
  color: var(--text-soft);
  font-weight: 650;
}

.menu {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
}

.menu a,
.menu span {
  font-size: 13px;
}

.window-spacer,
.spacer {
  flex: 1;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: var(--hairline) solid var(--line);
  border-radius: 999px;
  background: #191919;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.app-shell {
  height: calc(100vh - 38px);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  background: var(--app);
}

.admin-shell {
  height: calc(100vh - 38px);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: var(--surface);
}

.admin-nav {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: 18px 12px;
  background: #202020;
  border-right: var(--hairline) solid #2b2b2b;
}

.admin-nav-head {
  display: grid;
  gap: 7px;
  padding: 4px 10px 12px;
  border-bottom: var(--hairline) solid var(--line-soft);
}

.admin-nav-head strong {
  color: var(--text);
  font-size: 15px;
}

.admin-nav-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-nav nav {
  display: grid;
  align-content: start;
  gap: 3px;
}

.admin-nav form {
  margin: 0;
}

.admin-nav-item {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--text-soft);
  font-weight: 610;
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background: #343434;
  color: var(--text);
}

.admin-nav-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 560;
}

.admin-content {
  min-width: 0;
  overflow: auto;
  background: var(--surface);
}

.rail {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  padding: 10px 8px;
  background: linear-gradient(90deg, #202020 0%, #1d2020 100%);
  border-right: var(--hairline) solid #282828;
}

.rail-actions {
  display: grid;
  gap: 2px;
}

.rail-group {
  margin-top: 22px;
  padding: 0 8px;
}

.rail-label {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 8px;
}

.rail-item {
  min-height: 32px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: var(--radius);
  color: var(--text-soft);
  font-weight: 590;
}

.rail-item:hover,
.rail-item.active {
  background: #343434;
  color: var(--text);
}

.rail-icon {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 14px;
  text-align: center;
}

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

.rail-badge {
  color: var(--text-soft);
  font-weight: 650;
}

.rail-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.rail-bottom {
  align-self: end;
}

.rail-bottom form {
  margin: 0;
}

.content-frame {
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: auto;
  background: var(--surface);
  border: var(--hairline) solid #2c2c2c;
  border-top-left-radius: 10px;
  box-shadow: var(--shadow);
}

.auth-main {
  min-height: calc(100vh - 38px);
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 0%, #242424 0%, var(--surface) 35%, var(--app) 100%);
}

.auth-panel {
  width: min(430px, 100%);
  background: var(--panel);
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  margin-bottom: 10px;
}

.stack {
  display: grid;
  gap: 15px;
}

.muted {
  color: var(--muted);
}

.error {
  color: #ff8b8b;
}

.success {
  color: #87e3ac;
}

.dashboard,
.settings-page {
  width: min(860px, calc(100% - 48px));
  margin: 72px auto;
  display: grid;
  gap: 26px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-head h1 {
  margin-bottom: 8px;
}

.panel {
  background: var(--panel);
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.codex-accounts-panel {
  overflow: visible;
}

.panel > h2,
.panel > .section-head,
.panel > p,
.panel > .button-row,
.panel > .event-list,
.panel > .table-wrap,
.panel > .service-card,
.panel > .terminal {
  margin-left: 0;
}

.panel:not(.wide) {
  padding: 0;
}

.panel h2 {
  margin: 0;
  padding: 16px 16px 8px;
}

.panel.wide {
  width: min(880px, calc(100% - 48px));
  margin: 72px auto;
  padding: 18px;
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.service-card,
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: var(--hairline) solid var(--line-soft);
  background: transparent;
  padding: 14px 16px;
}

.service-card:first-of-type,
.file-row:first-child {
  border-top: 0;
}

.service-card:hover,
.file-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.service-card h3 {
  margin: 0 0 5px;
}

.service-card p {
  margin: 0;
  font-size: 12px;
}

.codex-account-card {
  align-items: center;
  gap: 18px;
  position: relative;
  z-index: 1;
}

.codex-account-card:has(.codex-account-menu:not([hidden])) {
  z-index: 80;
}

.codex-account-title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.codex-account-title h3 {
  flex: 0 0 min(220px, 32%);
  margin: 0;
  min-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-account-quotas {
  flex: 1 1 520px;
  width: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(170px, 1fr));
  gap: 0 16px;
  align-items: center;
}

.codex-quota-row {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.codex-quota-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.codex-quota-name {
  color: var(--text-soft);
  font-weight: 650;
}

.codex-quota-value {
  color: var(--muted);
  white-space: nowrap;
}

.codex-quota-track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #1b1b1b;
}

.codex-quota-track span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: #f4f4f4;
}

.codex-quota-row.unavailable .codex-quota-track span {
  min-width: 0;
  background: #555;
}

.codex-quota-reset {
  min-width: 0;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.codex-account-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.codex-more-wrap {
  position: relative;
}

.codex-more-button {
  width: 30px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  text-align: center;
}

.codex-more-button:hover,
.codex-more-button[aria-expanded="true"] {
  background: #343434;
  color: var(--text);
}

.codex-account-menu {
  position: absolute;
  top: 34px;
  right: 0;
  width: 176px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: var(--hairline) solid #454545;
  border-radius: 10px;
  background: rgba(42, 42, 42, 0.98);
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.44);
  z-index: 90;
}

.codex-account-menu[hidden] {
  display: none;
}

.codex-account-menu form {
  margin: 0;
}

.codex-menu-item {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border-radius: 7px;
  padding: 0 9px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 610;
  text-align: left;
}

.codex-menu-item:hover {
  background: #393939;
  color: var(--text);
}

.codex-menu-item:disabled {
  opacity: 0.45;
}

.codex-menu-item.danger-item {
  color: #ffb4b4;
}

.account-info-content {
  display: grid;
}

.account-info-section {
  display: grid;
  gap: 12px;
  padding: 16px 0;
  border-top: var(--hairline) solid #3a3a3a;
}

.account-info-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.account-info-section:last-child {
  padding-bottom: 0;
}

.account-info-section h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
}

.account-info-section-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-info-badge,
.account-info-renew {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.account-info-badge {
  padding: 3px 8px;
  border: var(--hairline) solid #444;
  border-radius: 999px;
  background: #202020;
}

.account-info-subscription-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.account-info-subscription-summary > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.account-info-label,
.account-info-inline-list span,
.account-info-path span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.account-info-subscription-summary strong {
  min-width: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.account-info-inline-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.account-info-inline-list.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-info-inline-list > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.account-info-inline-list strong {
  min-width: 0;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.account-info-quota-list {
  display: grid;
  gap: 12px;
}

.account-info-quota {
  padding: 10px 0 0;
}

.account-info-quota:first-child {
  padding-top: 0;
}

.account-info-quota .codex-quota-track {
  height: 6px;
  background: #1c1c1c;
}

.account-info-path {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.account-info-path code {
  display: block;
  min-width: 0;
  padding: 9px 10px;
  border: var(--hairline) solid #3b3b3b;
  border-radius: 8px;
  background: #202020;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.panel-empty {
  margin: 0;
  padding: 14px 16px;
}

.button-row,
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 16px;
}

.actions {
  padding: 0;
}

.actions form {
  margin: 0;
}

.status,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: var(--hairline) solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  background: #191919;
}

.status.active {
  color: #a7f3c2;
  border-color: #1d7345;
}

.status.pending,
.status.unconfigured {
  color: #ffd98a;
  border-color: #664a13;
}

.status.suspended,
.status.error {
  color: #ffb2b2;
  border-color: #603030;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-top: var(--hairline) solid var(--line-soft);
  padding: 13px 16px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

td {
  color: var(--text-soft);
}

.event-list {
  display: grid;
  list-style: none;
  padding: 0;
  margin: 0;
}

.event-list li {
  display: grid;
  gap: 4px;
  padding: 13px 16px;
  border-top: var(--hairline) solid var(--line-soft);
}

.event-list li:first-child {
  border-top: 0;
}

.event-list span {
  color: var(--muted);
}

.event-list em {
  color: var(--muted-2);
  font-style: normal;
  font-size: 12px;
}

.terminal {
  min-height: 420px;
  max-height: 65vh;
  overflow: auto;
  background: #0d0d0d;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  color: #d5d5d5;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.modal-backdrop {
  position: fixed;
  inset: 38px 0 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.42);
  z-index: 50;
}

.modal-backdrop[hidden] {
  display: none;
}

.device-modal {
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  padding: 18px;
  border: var(--hairline) solid #454545;
  border-radius: 14px;
  background: rgba(42, 42, 42, 0.98);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.52);
}

.account-info-modal {
  width: min(600px, calc(100% - 32px));
  max-height: calc(100vh - 72px);
  overflow: auto;
}

.device-login-step {
  display: grid;
  gap: 16px;
}

.device-login-step[hidden],
.device-complete-step[hidden] {
  display: none;
}

.device-complete-step {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 8px 4px;
  text-align: center;
}

.complete-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #1f6f45;
  color: #d7ffe5;
  font-size: 22px;
  font-weight: 800;
}

.device-complete-step h3,
.device-complete-step p {
  margin: 0;
}

.device-complete-step .button {
  margin-top: 8px;
}

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

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

.modal-head h2 {
  margin-bottom: 6px;
  font-size: 17px;
}

.modal-head h2:last-child {
  margin-bottom: 0;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  background: #343434;
  color: var(--text);
}

.device-code-copy {
  min-height: 54px;
  display: grid;
  place-items: center;
  border: var(--hairline) solid #4c4c4c;
  border-radius: 10px;
  background: #1c1c1c;
  color: var(--text);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 720;
  letter-spacing: 0;
}

.device-code-copy:not(:disabled):hover {
  background: #202020;
}

.device-code-copy:disabled {
  color: var(--muted);
}

.device-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toast-region {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1200;
  min-height: 34px;
  max-width: min(360px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border: var(--hairline) solid #454545;
  border-radius: 9px;
  background: rgba(42, 42, 42, 0.98);
  color: var(--text);
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.44);
  font-size: 13px;
  font-weight: 610;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.toast-region.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

input[aria-invalid="true"] {
  border-color: rgba(239, 68, 68, 0.68);
}

.workspace-shell {
  height: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 0;
}

.workspace-root {
  height: 100vh;
  overflow: hidden;
  background: var(--app);
}

.threadbar,
.chat {
  min-height: 0;
}

.threadbar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 27px;
  background: linear-gradient(90deg, #202020 0%, #1d2020 100%);
  border-right: var(--hairline) solid #2f2f2f;
  padding: 13px 6px 13px;
}

.threadbar h2 {
  padding: 0;
  margin: 0 0 12px;
}

.sidebar-primary {
  display: grid;
  gap: 2px;
}

.sidebar-action,
.sidebar-settings {
  min-height: 29px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 11px;
  border-radius: 7px;
  color: #dedede;
  font-size: 13px;
  font-weight: 610;
  text-align: left;
}

.sidebar-action:hover,
.sidebar-settings:hover {
  background: #303030;
}

.side-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: #d7d7d7;
  overflow: visible;
}

.sidebar-chats {
  min-height: 0;
  overflow: hidden;
}

.sidebar-label {
  color: #777;
  font-size: 11px;
  font-weight: 670;
  margin: 0 9px 7px;
}

.sidebar-chat-list {
  display: grid;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar-chat {
  min-height: 29px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-radius: 7px;
  padding: 0 10px;
  color: #dbdbdb;
  font-size: 13px;
  font-weight: 590;
}

.sidebar-chat:hover,
.sidebar-chat.active {
  background: #393939;
}

.sidebar-chat-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-chat-date {
  color: #8f8f8f;
  font-size: 11px;
  font-weight: 620;
}

.chat-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #5b5b5b;
  border-top-color: #9b9b9b;
  border-radius: 999px;
  animation: sidebar-spin 0.9s linear infinite;
}

@keyframes sidebar-spin {
  to {
    transform: rotate(360deg);
  }
}

.sidebar-empty {
  padding: 7px 10px;
  color: #737373;
  font-size: 12px;
  line-height: 1.45;
}

.sidebar-settings-wrap {
  position: relative;
  align-self: end;
}

.sidebar-settings {
  align-self: end;
  width: 100%;
  justify-content: flex-start;
  color: #dedede;
}

.settings-popover {
  position: absolute;
  left: 0;
  bottom: 36px;
  width: 272px;
  padding: 6px 0;
  border: var(--hairline) solid #454545;
  border-radius: 12px;
  background: rgba(42, 42, 42, 0.97);
  box-shadow: 0 16px 58px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
  z-index: 30;
}

.settings-popover[hidden] {
  display: none;
}

.settings-popover form {
  margin: 0;
}

.settings-popover-row {
  width: calc(100% - 14px);
  min-height: 36px;
  margin: 0 7px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 10px;
  border-radius: 7px;
  color: #ededed;
  font-size: 14px;
  font-weight: 630;
  line-height: 1;
  text-align: left;
}

.settings-popover-row:hover {
  background: #393939;
}

.settings-popover-row .side-icon {
  width: 16px;
  height: 16px;
  color: #cfcfcf;
  overflow: visible;
  justify-self: center;
}

.settings-popover-row span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-popover-row.muted-row {
  color: #9b9b9b;
}

.settings-divider {
  height: var(--hairline);
  margin: 5px 13px;
  background: #454545;
}

.settings-chevron {
  color: #9a9a9a;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  justify-self: center;
  transform: translateY(-1px);
}

.full {
  width: 100%;
}

.empty {
  margin-top: 18px;
  font-size: 13px;
}

.chat {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--surface);
  border: var(--hairline) solid #2f2f2f;
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: 8px;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border-bottom: 0;
}

.chat-head h1,
.chat-head p {
  margin: 0;
}

.chat-head h1 {
  font-size: 14px;
  font-weight: 700;
}

.chat-more {
  width: 28px;
  min-height: 28px;
  color: var(--muted);
  padding: 0;
  justify-content: center;
}

.chat-head .status {
  margin-left: auto;
}

.message-list {
  width: min(790px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 24px;
  overflow: auto;
}

.message {
  max-width: 100%;
  border: var(--hairline) solid var(--line);
  border-radius: var(--radius);
  background: #1f1f1f;
  padding: 15px;
}

.message strong {
  display: block;
  margin-bottom: 8px;
}

.message p {
  margin-bottom: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: min(790px, calc(100% - 48px));
  margin: 0 auto 18px;
  padding: 10px 11px;
  border: var(--hairline) solid #343434;
  border-radius: 16px;
  background: #2b2b2b;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.composer textarea {
  min-height: 62px;
  background: transparent;
  border-color: transparent;
  padding: 8px 4px;
}

.composer textarea:focus {
  border-color: transparent;
  box-shadow: none;
}

.composer button {
  align-self: end;
  min-width: 56px;
  min-height: 38px;
}

.service-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
}

.file-list {
  display: grid;
  gap: 0;
  border: var(--hairline) solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.file-row {
  justify-content: flex-start;
  margin: 0;
  padding: 10px 12px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #3b3b3b;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
  background-clip: padding-box;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .admin-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .admin-nav {
    border-right: 0;
    border-bottom: var(--hairline) solid var(--line);
  }

  .rail {
    position: static;
    border-right: 0;
    border-bottom: var(--hairline) solid var(--line);
  }

  .content-frame {
    border-radius: 0;
    min-height: calc(100vh - 38px);
  }

  .dashboard,
  .settings-page,
  .panel.wide {
    width: calc(100% - 24px);
    margin: 24px auto;
  }

  .grid.two,
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .codex-account-title {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .codex-account-title h3 {
    flex: none;
    min-width: 0;
  }

  .codex-account-quotas {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .account-info-inline-list {
    grid-template-columns: 1fr;
  }

  .account-info-inline-list.compact {
    grid-template-columns: 1fr;
  }

  .account-info-subscription-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .threadbar {
    border: 0;
    border-bottom: var(--hairline) solid var(--line-soft);
    min-height: 520px;
  }

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

  .menu {
    gap: 12px;
  }
}
