:root {
  color-scheme: dark;
  --bg: #0d0e10;
  --bg-soft: #121416;
  --panel: rgba(24, 27, 31, 0.88);
  --panel-solid: #181b1f;
  --panel-2: #20242a;
  --panel-3: #262b32;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(226, 232, 240, 0.22);
  --text: #f7f4ed;
  --text-soft: #d8dde5;
  --muted: #9ca6b5;
  --muted-2: #6f7a89;
  --accent: #f3c451;
  --accent-strong: #ffd970;
  --accent-soft: rgba(243, 196, 81, 0.14);
  --teal: #61d3c5;
  --teal-soft: rgba(97, 211, 197, 0.12);
  --danger: #ef7777;
  --danger-soft: rgba(239, 119, 119, 0.14);
  --shadow-soft: 0 18px 60px rgba(0, 0, 0, 0.38);
  --shadow-tight: 0 12px 32px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --sidebar-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(243, 196, 81, 0.08), transparent 31%),
    linear-gradient(225deg, rgba(97, 211, 197, 0.07), transparent 34%),
    linear-gradient(180deg, #0c0d0f 0%, #111417 52%, #0d0e10 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.52), transparent 72%);
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

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

.login-screen {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  padding: 22px;
  place-items: center;
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 34%),
    rgba(24, 27, 31, 0.95);
  box-shadow: var(--shadow-soft);
}

.login-copy {
  display: grid;
  gap: 5px;
  padding-top: 4px;
}

.login-copy h2 {
  font-size: 24px;
  line-height: 1.08;
  font-weight: 850;
}

.login-copy p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border: 2px solid transparent;
  border-radius: 8px;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.44);
  border: 2px solid transparent;
  background-clip: content-box;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 8px 14px 8px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(27, 30, 34, 0.96), rgba(13, 15, 17, 0.98)),
    #15181c;
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.28);
}

.brand-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 32px;
}

.brand-logo-button {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  background: transparent;
  outline: none;
}

.brand-logo-button:focus-visible {
  box-shadow: 0 0 0 2px rgba(255, 210, 93, 0.78);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 24%, rgba(255, 255, 255, 0.65), transparent 19%),
    linear-gradient(145deg, #ffdc72, #e6ae35);
  box-shadow: 0 12px 28px rgba(243, 196, 81, 0.2);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(23, 18, 10, 0.9);
}

.brand-mark::before {
  width: 18px;
  height: 3px;
  right: -4px;
  top: 7px;
  transform: rotate(-36deg);
}

.brand-mark::after {
  width: 6px;
  height: 6px;
  left: 6px;
  bottom: 6px;
}

.brand-mark span {
  position: relative;
  z-index: 1;
  color: #17120a;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

h1 {
  font-size: 14px;
  line-height: 1.03;
  font-weight: 800;
}

.brand-row p,
.section-label {
  color: var(--muted);
  font-size: 10px;
}

.section-label {
  margin-top: 0;
  text-transform: uppercase;
  font-weight: 750;
}

.sidebar-models {
  display: grid;
  gap: 4px;
  margin-top: 0;
}

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

.model-slot {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 29px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.model-slot:hover {
  transform: translateY(-1px);
  border-color: rgba(243, 196, 81, 0.38);
  background: rgba(255, 255, 255, 0.055);
}

.model-slot strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}

.model-slot.active {
  border-color: rgba(243, 196, 81, 0.95);
  background: linear-gradient(180deg, rgba(243, 196, 81, 0.16), rgba(243, 196, 81, 0.06));
  box-shadow: inset 0 0 0 1px rgba(243, 196, 81, 0.08), 0 12px 26px rgba(0, 0, 0, 0.18);
}

.model-slot.empty,
.model-slot.placeholder {
  grid-template-columns: 1fr;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.model-slot.empty {
  grid-column: 1 / -1;
}

.model-slot.placeholder {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.02);
}

.model-dot {
  width: 8px;
  height: 8px;
  border: 2px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.primary-action,
.send-action,
.secondary-action,
.ghost-action,
.icon-action,
.danger-action,
.message-icon-action,
.copy-button,
.mode-option,
.top-customer-tab,
.top-customer-item,
.platform-row {
  border-radius: var(--radius);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.primary-action,
.send-action,
.secondary-action,
.ghost-action,
.icon-action,
.danger-action {
  min-height: 42px;
  border: 1px solid transparent;
  color: var(--text);
}

.primary-action,
.send-action {
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #17120a;
  font-weight: 850;
  box-shadow: 0 12px 26px rgba(243, 196, 81, 0.18);
}

.sidebar > .primary-action {
  min-height: 32px;
  font-size: 14px;
}

.primary-action:hover,
.send-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(243, 196, 81, 0.25);
}

.secondary-action,
.ghost-action,
.icon-action,
.message-icon-action {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line);
  color: var(--text-soft);
}

.secondary-action:hover,
.ghost-action:hover,
.icon-action:hover,
.message-icon-action:hover {
  border-color: rgba(243, 196, 81, 0.5);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.ghost-action {
  margin-top: 0;
}

.top-customers {
  display: grid;
  gap: 5px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.compact-top-customers {
  position: relative;
  width: fit-content;
  min-width: 104px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.top-customers summary {
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
  list-style: none;
}

.top-customers summary::-webkit-details-marker {
  display: none;
}

.compact-top-customers summary {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 9px 4px 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.028)),
    rgba(10, 12, 14, 0.62);
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1.2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.compact-top-customers summary::before {
  content: "★";
  display: grid;
  width: 13px;
  height: 13px;
  place-items: center;
  border-radius: 50%;
  background: rgba(243, 196, 81, 0.15);
  color: var(--accent-strong);
  font-size: 8px;
  line-height: 1;
}

.compact-top-customers summary:hover {
  border-color: rgba(243, 196, 81, 0.42);
  background:
    linear-gradient(180deg, rgba(243, 196, 81, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.compact-top-customers[open] {
  width: fit-content;
  padding: 0;
  background: transparent;
}

.compact-top-customers[open] summary {
  border-color: rgba(243, 196, 81, 0.72);
  background:
    linear-gradient(180deg, rgba(243, 196, 81, 0.18), rgba(243, 196, 81, 0.07)),
    rgba(255, 255, 255, 0.04);
  color: var(--text);
  margin-bottom: 2px;
}

.compact-top-customers[open] .top-customer-tabs,
.compact-top-customers[open] .top-customer-list {
  position: absolute;
  right: 0;
  z-index: 12;
  width: min(238px, calc(var(--sidebar-width) - 28px));
  padding: 6px;
  border: 1px solid var(--line);
  background: rgba(20, 23, 27, 0.98);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.compact-top-customers[open] .top-customer-tabs {
  top: calc(100% + 5px);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  margin-top: 0;
}

.compact-top-customers[open] .top-customer-list {
  top: calc(100% + 44px);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  margin-top: 0;
}

.top-customer-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 6px;
}

.top-customer-tab {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.top-customer-tab.active {
  border-color: rgba(243, 196, 81, 0.8);
  background: rgba(243, 196, 81, 0.14);
  color: var(--text);
}

.top-customer-list {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}

.top-customer-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--text-soft);
  text-align: left;
}

.top-customer-item:hover {
  border-color: rgba(243, 196, 81, 0.45);
  background: rgba(243, 196, 81, 0.08);
  color: var(--text);
}

.top-customer-rank {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.075);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
}

.top-customer-name,
.top-customer-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.top-customer-value {
  color: var(--muted);
  font-weight: 750;
}

.top-customer-empty {
  padding: 7px;
  color: var(--muted);
  font-size: 12px;
}

.customer-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 26px;
}

.sidebar-platforms {
  display: grid;
  gap: 4px;
}

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

.platform-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px;
  align-items: center;
  min-height: 27px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  text-align: left;
}

.platform-row:hover {
  transform: translateY(-1px);
  border-color: rgba(97, 211, 197, 0.48);
  background: rgba(97, 211, 197, 0.07);
  color: var(--text);
}

.platform-row.active {
  border-color: rgba(97, 211, 197, 0.78);
  background:
    linear-gradient(180deg, rgba(97, 211, 197, 0.18), rgba(97, 211, 197, 0.07)),
    rgba(255, 255, 255, 0.035);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(97, 211, 197, 0.08);
}

.platform-row.empty {
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
  color: var(--muted);
  font-size: 12px;
}

.platform-row-main {
  display: grid;
  min-width: 0;
}

.platform-row-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-row-main strong {
  font-size: 11px;
  font-weight: 850;
}

.platform-row-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.platform-row.active .platform-row-indicator {
  background: var(--accent-cool);
  box-shadow: 0 0 0 3px rgba(97, 211, 197, 0.12);
}

.sidebar-search {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(10, 12, 14, 0.56);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-search::placeholder {
  color: var(--muted);
}

.chat-list {
  --chat-row-height: 56px;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.chat-item {
  position: relative;
  display: grid;
  gap: 2px;
  min-height: var(--chat-row-height);
  padding: 7px 34px 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.038);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.chat-item:hover {
  transform: translateX(2px);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.055);
}

.chat-item.active {
  border-color: rgba(243, 196, 81, 0.94);
  background: linear-gradient(180deg, rgba(243, 196, 81, 0.14), rgba(255, 255, 255, 0.045));
  box-shadow: inset 3px 0 0 rgba(243, 196, 81, 0.95), 0 14px 26px rgba(0, 0, 0, 0.2);
}

.chat-item strong {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  font-size: 13px;
  line-height: 1.12;
  font-weight: 850;
}

.chat-item span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-delete-icon {
  position: absolute;
  right: 7px;
  top: 50%;
  bottom: auto;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  padding: 0;
}

.chat-delete-icon:hover {
  color: #ffd1d1;
  border-color: rgba(239, 119, 119, 0.75);
  background: var(--danger-soft);
}

.chat-delete-icon svg,
.message-icon-action svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% 22%, rgba(97, 211, 197, 0.055), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%),
    rgba(10, 11, 13, 0.58);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 23, 27, 0.86);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
}

.topbar-title-row {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.topbar h2 {
  overflow: hidden;
  font-size: 24px;
  line-height: 1.08;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-info-action {
  display: inline-flex;
  width: auto;
  min-width: 132px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px 0 9px;
  border-color: rgba(97, 211, 197, 0.38);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(97, 211, 197, 0.14), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.055);
  color: var(--text-soft);
  font-weight: 850;
}

.customer-info-action span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(97, 211, 197, 0.55);
  border-radius: 999px;
  background: rgba(97, 211, 197, 0.13);
  color: #d9fffb;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.customer-info-action strong {
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.customer-info-action:hover {
  border-color: rgba(97, 211, 197, 0.78);
  background:
    linear-gradient(180deg, rgba(97, 211, 197, 0.2), rgba(255, 255, 255, 0.065)),
    rgba(255, 255, 255, 0.075);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.logout-action {
  min-width: 96px;
  min-height: 36px;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(9, 11, 14, 0.66);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(97, 211, 197, 0.66);
  background: rgba(12, 15, 18, 0.82);
  box-shadow: 0 0 0 3px rgba(97, 211, 197, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.platform-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 6px 8px;
  justify-content: start;
}

.platform-option {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 850;
}

.platform-option.active {
  border-color: var(--accent-strong);
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #17120a;
  box-shadow: 0 10px 22px rgba(243, 196, 81, 0.2);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  padding: 18px 20px 20px;
  overflow: auto;
  scroll-behavior: smooth;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 44px 44px;
}

.empty-state {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}

.history-note {
  max-width: 820px;
  padding: 8px 10px;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 13px;
}

.history-control {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 820px;
}

.history-control-button {
  width: auto;
  cursor: pointer;
  list-style: none;
}

.history-control-button::-webkit-details-marker {
  display: none;
}

.archived-context-text {
  width: 100%;
  max-height: 280px;
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.message {
  position: relative;
  display: grid;
  gap: 9px;
  width: min(760px, 100%);
  padding: 12px 14px;
  font-size: 15px;
  line-height: 1.42;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(25, 28, 33, 0.88);
  box-shadow: var(--shadow-tight);
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  justify-self: end;
  width: min(660px, 88%);
  border-color: rgba(243, 196, 81, 0.48);
  border-bottom-right-radius: 5px;
  background:
    linear-gradient(180deg, rgba(63, 48, 19, 0.94), rgba(36, 30, 18, 0.94)),
    rgba(31, 28, 22, 0.96);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26), inset 3px 0 0 rgba(243, 196, 81, 0.78);
}

.message.assistant {
  align-self: flex-start;
  justify-self: start;
  width: min(760px, 88%);
  border-color: rgba(97, 211, 197, 0.46);
  border-bottom-left-radius: 5px;
  background:
    linear-gradient(180deg, rgba(18, 39, 39, 0.92), rgba(16, 28, 31, 0.94)),
    rgba(18, 31, 31, 0.94);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24), inset 3px 0 0 rgba(97, 211, 197, 0.74);
}

.message.streaming {
  border-color: rgba(243, 196, 81, 0.62);
  box-shadow: 0 0 0 1px rgba(243, 196, 81, 0.08), var(--shadow-tight);
}

.message.generating {
  position: relative;
}

.thinking-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.thinking-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(243, 196, 81, 0.26);
  border-top-color: var(--accent-strong);
  border-radius: 50%;
  animation: thinking-spin 760ms linear infinite;
}

.generation-indicator,
.deep-generation-indicator {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(243, 196, 81, 0.35);
  border-radius: var(--radius);
  background: rgba(243, 196, 81, 0.09);
}

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

.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0;
}

.message-meta strong {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
}

.message-body {
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.message.user .message-body {
  color: #fff4d2;
}

.message.assistant .message-body {
  color: #e7fffb;
}

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

.message-icon-action {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border-radius: 8px;
}

.message-icon-action.danger:hover {
  border-color: rgba(239, 119, 119, 0.72);
  color: #ffd1d1;
  background: var(--danger-soft);
}

.message-edit-form {
  display: grid;
  gap: 6px;
}

.message-edit-form label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.message-edit-form textarea,
.message-edit-form input {
  width: 100%;
  border: 1px solid rgba(243, 196, 81, 0.42);
  border-radius: 8px;
  background: rgba(10, 13, 17, 0.78);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 6px 8px;
}

.message-edit-form textarea {
  min-height: 44px;
  max-height: 110px;
  resize: vertical;
}

.message-edit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.message-edit-actions .secondary-action,
.message-edit-actions .send-action {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.message-instruction {
  position: relative;
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(243, 196, 81, 0.5);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(243, 196, 81, 0.16), rgba(243, 196, 81, 0.08)),
    rgba(9, 11, 14, 0.42);
  color: #ffe8a6;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  box-shadow: inset 3px 0 0 rgba(243, 196, 81, 0.74), 0 8px 18px rgba(0, 0, 0, 0.16);
}

.message-instruction::before {
  content: "Anweisung";
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.assistant-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.copy-button {
  display: inline-flex;
  width: fit-content;
  min-width: 92px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid rgba(97, 211, 197, 0.56);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(97, 211, 197, 0.18), rgba(97, 211, 197, 0.08)),
    rgba(97, 211, 197, 0.1);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.copy-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.copy-button:hover {
  transform: translateY(-1px);
  border-color: rgba(97, 211, 197, 0.86);
  background:
    linear-gradient(180deg, rgba(97, 211, 197, 0.24), rgba(97, 211, 197, 0.11)),
    rgba(97, 211, 197, 0.16);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.regenerate-button {
  border-color: rgba(243, 196, 81, 0.58);
  background:
    linear-gradient(180deg, rgba(243, 196, 81, 0.2), rgba(243, 196, 81, 0.08)),
    rgba(243, 196, 81, 0.1);
  color: #ffe9a8;
}

.regenerate-button:hover {
  border-color: rgba(243, 196, 81, 0.9);
  background:
    linear-gradient(180deg, rgba(243, 196, 81, 0.28), rgba(243, 196, 81, 0.13)),
    rgba(243, 196, 81, 0.14);
}

.copy-button.copied,
.secondary-action.copied {
  border-color: rgba(97, 211, 197, 0.95);
  background: rgba(97, 211, 197, 0.24);
  color: #ddfffa;
  box-shadow: 0 0 0 1px rgba(97, 211, 197, 0.24);
}

.composer {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 48%),
    rgba(22, 25, 29, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 -16px 42px rgba(0, 0, 0, 0.22);
}

.response-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 420px;
}

.mode-option {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 14px;
  font-weight: 820;
}

.mode-option:hover {
  color: var(--text);
  border-color: rgba(243, 196, 81, 0.38);
}

.mode-option.active {
  border-color: rgba(243, 196, 81, 0.95);
  background: linear-gradient(180deg, rgba(243, 196, 81, 0.24), rgba(243, 196, 81, 0.1));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(243, 196, 81, 0.12), 0 10px 22px rgba(0, 0, 0, 0.18);
}

.composer-context-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(180px, 14vw, 210px);
  gap: 8px;
  align-items: stretch;
}

.instruction-row {
  display: grid;
  min-width: 0;
  align-items: stretch;
}

.instruction-row input {
  height: 42px;
}

.image-drop-zone {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px dashed rgba(97, 211, 197, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(97, 211, 197, 0.08), rgba(243, 196, 81, 0.05)),
    rgba(9, 12, 17, 0.72);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.image-drop-zone:hover,
.image-drop-zone.drag-over {
  border-color: rgba(243, 196, 81, 0.85);
  background:
    linear-gradient(135deg, rgba(97, 211, 197, 0.11), rgba(243, 196, 81, 0.1)),
    rgba(14, 18, 24, 0.92);
}

.image-drop-zone.disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.image-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.image-drop-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.image-drop-copy strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-drop-copy span,
.image-upload-status {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.image-upload-status {
  min-height: 16px;
  padding-left: 2px;
}

.image-upload-status.error {
  color: #ffb7b7;
}

.image-preview-list {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
}

.image-preview-item {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 40px minmax(0, 92px) 22px;
  gap: 6px;
  align-items: center;
  min-width: 144px;
  max-width: 184px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
}

.image-preview-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 5px;
}

.image-preview-item span {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-item button {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: pointer;
}

.image-preview-item button:hover {
  color: var(--text);
  border-color: rgba(243, 196, 81, 0.58);
}

.image-attachment-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 5px 9px;
  border: 1px solid rgba(97, 211, 197, 0.45);
  border-radius: 7px;
  background: rgba(97, 211, 197, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 750;
}

.composer-actions,
.dialog-actions,
.dialog-title-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

dialog {
  width: min(760px, calc(100vw - 24px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0;
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(7px);
}

.dialog-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 32%),
    var(--panel-solid);
}

.dialog-card h3 {
  font-size: 20px;
  font-weight: 850;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.password-field {
  display: block;
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-dialog {
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.admin-commerce {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-commerce-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.admin-commerce-summary::-webkit-details-marker {
  display: none;
}

.admin-commerce-summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.admin-commerce[open] .admin-commerce-summary::after {
  transform: rotate(225deg);
}

.admin-commerce-summary strong,
.commerce-period h5 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.admin-commerce-summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-commerce-body {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.admin-commerce-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 8px;
}

.admin-commerce-controls label {
  display: grid;
  gap: 5px;
  width: min(220px, 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.admin-employee-select {
  min-height: 30px;
  max-width: 220px;
  padding: 5px 8px;
  font-size: 12px;
}

.admin-employee-scope {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(20, 24, 31, 0.82);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.admin-employee-report {
  display: grid;
  gap: 10px;
}

.commerce-period {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.026);
}

.commerce-period-head,
.commerce-money-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.commerce-period-head > strong {
  color: var(--accent-strong);
}

.commerce-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.commerce-metric {
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.16);
}

.commerce-metric span,
.commerce-money-grid,
.commerce-platform-row,
.commerce-platform-summary,
.commerce-model-row {
  color: var(--muted);
  font-size: 12px;
}

.commerce-metric strong {
  color: var(--text);
  font-size: 18px;
}

.commerce-money-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.commerce-money-grid strong,
.commerce-platform-summary span:last-child,
.commerce-model-row span:last-child {
  color: var(--text);
}

.commerce-platform-list {
  display: grid;
  gap: 6px;
}

.commerce-platform-row {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  overflow: hidden;
}

.commerce-platform-row[open] {
  background: rgba(0, 0, 0, 0.12);
}

.commerce-platform-row summary::-webkit-details-marker {
  display: none;
}

.commerce-platform-summary,
.commerce-model-row {
  display: grid;
  gap: 10px;
  align-items: center;
}

.commerce-platform-summary {
  grid-template-columns: minmax(120px, 1fr) minmax(110px, auto) minmax(70px, auto) minmax(80px, auto) 14px;
  cursor: pointer;
  padding: 8px 9px;
}

.commerce-platform-summary::after {
  content: "";
  justify-self: end;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 140ms ease;
}

.commerce-platform-row[open] .commerce-platform-summary::after {
  transform: rotate(225deg);
}

.commerce-model-list {
  display: grid;
  gap: 4px;
  padding: 0 9px 9px;
}

.commerce-model-row {
  grid-template-columns: minmax(120px, 1fr) minmax(110px, auto) minmax(70px, auto) minmax(70px, auto) minmax(80px, auto);
  padding: 7px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.commerce-model-row strong {
  color: var(--text);
}

.commerce-platform-row.empty {
  display: block;
  padding: 8px 9px;
}

.dialog-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
}

.model-save-status {
  grid-column: auto;
  min-height: 28px;
  margin-right: auto;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  align-content: center;
}

.model-save-status:empty {
  display: none;
}

.model-save-status.dirty,
.model-save-status.loading {
  border-color: rgba(243, 196, 81, 0.62);
  color: #f8df96;
}

.model-save-status.success {
  border-color: rgba(97, 211, 197, 0.65);
  color: #ddfffa;
}

.model-save-status.error {
  border-color: rgba(239, 119, 119, 0.75);
  color: #ffd1d1;
}

.hidden {
  display: none !important;
}

.model-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 12px;
}

.model-platform-pricing-dropdown {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.model-platform-pricing-dropdown summary::-webkit-details-marker {
  display: none;
}

.model-platform-pricing-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 9px 11px;
  cursor: pointer;
  list-style: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), transparent),
    rgba(255, 255, 255, 0.028);
}

.model-platform-pricing-summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.model-platform-pricing-summary strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-platform-pricing-summary small {
  color: var(--muted);
  font-size: 11px;
}

.model-platform-pricing-summary::after {
  content: "⌄";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: transform 140ms ease, color 140ms ease;
}

.model-platform-pricing-dropdown[open] .model-platform-pricing-summary {
  border-bottom: 1px solid var(--line);
}

.model-platform-pricing-dropdown[open] .model-platform-pricing-summary::after {
  color: var(--accent-strong);
  transform: rotate(180deg);
}

.model-platform-pricing-body {
  display: grid;
  gap: 12px;
  padding: 10px;
}

.pricing-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.platform-admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.model-platform-pricing-body .platform-admin-form,
.model-platform-pricing-body .pricing-form {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.model-platform-pricing-body .platform-admin-form {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.platform-admin-form legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.platform-admin-row {
  display: grid;
  grid-template-columns: 18px 54px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  font-size: 12px;
}

.platform-admin-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent-cool);
}

.platform-admin-row input:not([type="checkbox"]) {
  min-height: 32px;
  padding: 6px 8px;
}

.platform-admin-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.pricing-form legend {
  padding: 0 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.pricing-platform {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.pricing-platform h4 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--accent-strong);
  font-size: 13px;
}

.pricing-platform label {
  font-size: 12px;
}

.pricing-platform input {
  min-height: 34px;
  padding: 7px 9px;
}

.wide {
  grid-column: 1 / -1;
}

.admin-model-list {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-model {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.admin-model.editing {
  border-color: rgba(243, 196, 81, 0.75);
  background: rgba(243, 196, 81, 0.1);
  box-shadow: inset 3px 0 0 var(--accent-strong);
}

.admin-model-name {
  display: grid;
  gap: 2px;
}

.admin-model-name em {
  color: var(--accent-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-assignment {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-assignment-body,
.admin-assignment-list {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.assignment-model-picker {
  max-width: 320px;
}

.assignment-pricing-heading {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.026);
}

.assignment-pricing-heading strong {
  color: var(--text);
  font-size: 14px;
}

.assignment-pricing-heading span {
  color: var(--muted);
  font-size: 12px;
}

.assignment-platform-reference,
.assignment-pricing-reference {
  background: rgba(255, 255, 255, 0.018);
}

.assignment-user {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.026);
}

.assignment-user-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.assignment-user strong {
  color: var(--text);
  font-size: 14px;
}

.assignment-model-toggle {
  display: inline-grid;
  grid-template-columns: auto 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
}

.assignment-model-toggle input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent-cool);
}

.assignment-platform-editor {
  display: grid;
  gap: 8px;
}

.assignment-platform-editor.disabled {
  opacity: 0.55;
}

.assignment-platform {
  display: block;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.14);
}

.assignment-platform .platform-admin-row strong {
  color: var(--text);
  font-size: 12px;
}

.assignment-platform.disabled {
  opacity: 0.62;
}

.assignment-pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.assignment-pricing-grid label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.assignment-pricing-grid input {
  min-height: 32px;
  padding: 6px 8px;
}

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

.assignment-model-option {
  display: grid;
  grid-template-columns: auto 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.14);
  color: var(--text);
}

.admin-sort-controls {
  display: inline-flex;
  gap: 6px;
}

.admin-sort-action {
  width: 34px;
  min-height: 34px;
}

.admin-sort-action:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.danger-action {
  min-height: 36px;
  border-color: rgba(239, 119, 119, 0.5);
  background: var(--danger-soft);
  color: var(--text);
}

.danger-action:hover {
  border-color: rgba(239, 119, 119, 0.85);
  color: #ffd1d1;
}

.profile-readonly {
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 15, 19, 0.72);
}

.profile-readonly div {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.43;
}

.profile-readonly strong {
  color: var(--text);
}

.profile-readonly span {
  white-space: pre-line;
}

.app-status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 18, 21, 0.96);
  color: var(--text);
  box-shadow: var(--shadow-tight);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
  font-size: 14px;
  line-height: 1.35;
}

.app-status.visible {
  opacity: 1;
  transform: translateY(0);
}

.app-status.success {
  border-color: rgba(97, 211, 197, 0.65);
}

.app-status.error {
  border-color: rgba(239, 119, 119, 0.75);
  color: #ffd1d1;
}

.app-status.loading {
  border-color: rgba(243, 196, 81, 0.75);
  color: #f8df96;
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 300px;
  }

  .messages,
  .composer,
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 820px) {
  .composer-context-row {
    grid-template-columns: minmax(0, 1fr) 170px;
  }

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

  .sidebar {
    height: auto;
    min-height: auto;
    max-height: 48vh;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    height: 100vh;
  }

  .topbar,
  .composer-actions,
  .admin-login,
  .commerce-metric-grid,
  .commerce-money-grid,
  .commerce-platform-summary,
  .commerce-model-row,
  .assignment-model-grid,
  .assignment-pricing-grid,
  .model-form,
  .pricing-form,
  .pricing-platform,
  .admin-commerce-controls {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .admin-employee-select {
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

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

  .message {
    width: 100%;
  }

  .message.user,
  .message.assistant {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .composer-context-row {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .messages,
  .composer,
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .model-slot-grid,
  .response-mode,

  .composer-actions {
    gap: 8px;
  }
}
