:root {
  color-scheme: light;
  --tone-h: 215;
  --tone-s: 82%;
  --bg: hsl(var(--tone-h) 18% 94%);
  --panel: hsl(var(--tone-h) 26% 99%);
  --panel-glass: hsl(var(--tone-h) 32% 99% / 0.78);
  --surface: hsl(var(--tone-h) 22% 96%);
  --surface-glass: hsl(var(--tone-h) 24% 98% / 0.74);
  --surface-strong: hsl(var(--tone-h) 20% 91%);
  --text: hsl(var(--tone-h) 22% 13%);
  --muted: hsl(var(--tone-h) 12% 44%);
  --line: hsl(var(--tone-h) 18% 82% / 0.88);
  --line-soft: hsl(var(--tone-h) 22% 91% / 0.9);
  --glass-line: hsl(0 0% 100% / 0.78);
  --primary: hsl(var(--tone-h) var(--tone-s) 46%);
  --primary-dark: hsl(var(--tone-h) var(--tone-s) 35%);
  --primary-line: hsl(var(--tone-h) 54% 82%);
  --primary-soft: hsl(var(--tone-h) 72% 95%);
  --primary-softer: hsl(var(--tone-h) 68% 97%);
  --primary-text: hsl(var(--tone-h) 62% 30%);
  --primary-shadow: hsl(var(--tone-h) var(--tone-s) 45% / 0.2);
  --hover-line: hsl(var(--tone-h) 20% 72%);
  --hover-bg: hsl(var(--tone-h) 32% 98%);
  --danger: #c23b4a;
  --ok: #16835a;
  --warning: #a15c07;
  --warning-soft: #fff7e8;
  --danger-soft: #fff1f3;
  --ok-soft: #edfdf6;
  --radius: 8px;
  --radius-sm: 6px;
  --control-h: 40px;
  --shadow: 0 1px 1px hsl(var(--tone-h) 18% 12% / 0.04), 0 14px 34px hsl(var(--tone-h) 22% 16% / 0.09);
  --shadow-strong: 0 1px 1px hsl(var(--tone-h) 18% 12% / 0.05), 0 24px 58px hsl(var(--tone-h) 22% 16% / 0.14);
  --inner-highlight: inset 0 1px 0 hsl(0 0% 100% / 0.78);
  --glass-highlight: inset 0 1px 0 hsl(0 0% 100% / 0.86), inset 0 0 0 1px hsl(0 0% 100% / 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, hsl(var(--tone-h) 40% 99%) 0, hsl(calc(var(--tone-h) + 24) 42% 98%) 36%, hsl(calc(var(--tone-h) - 18) 34% 96%) 100%),
    linear-gradient(180deg, hsl(var(--tone-h) 32% 99%) 0, var(--bg) 360px),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app.auth-shell {
  background: hsl(var(--tone-h) 42% 98%);
}

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

button {
  min-height: var(--control-h);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.9), hsl(var(--tone-h) 28% 96% / 0.82));
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 680;
  box-shadow: var(--inner-highlight), 0 1px 1px hsl(var(--tone-h) 20% 18% / 0.05);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
  backdrop-filter: blur(14px) saturate(1.08);
}

button:hover {
  border-color: var(--hover-line);
  background: linear-gradient(180deg, #fff, var(--hover-bg));
  box-shadow: var(--inner-highlight), 0 4px 12px hsl(var(--tone-h) 20% 18% / 0.08);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px hsl(var(--tone-h) 24% 16% / 0.1);
}

button:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-shadow);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.primary {
  background: linear-gradient(180deg, hsl(var(--tone-h) var(--tone-s) 56%), var(--primary));
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--inner-highlight), 0 7px 18px var(--primary-shadow);
}

.primary:hover {
  background: linear-gradient(180deg, hsl(var(--tone-h) var(--tone-s) 50%), var(--primary-dark));
  border-color: var(--primary-dark);
}

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

.ghost {
  background: hsl(0 0% 100% / 0.34);
}

.full {
  width: 100%;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: hsl(var(--tone-h) 36% 99% / 0.78);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  box-shadow: inset 0 1px 1px hsl(var(--tone-h) 20% 16% / 0.04), 0 1px 0 hsl(0 0% 100% / 0.65);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input,
select {
  min-height: var(--control-h);
}

select {
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    hsl(var(--tone-h) 36% 99% / 0.78);
  padding-right: 36px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: hsl(0 0% 100% / 0.92);
  box-shadow: 0 0 0 3px var(--primary-shadow), 0 1px 0 hsl(0 0% 100% / 0.74);
}

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

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

h1 {
  font-size: 38px;
  line-height: 1.1;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 15px;
  margin-top: 8px;
}

.auth-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: calc(100vh - 54px);
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(45, 126, 210, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 126, 210, 0.09) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.8;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 80%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 80%, transparent);
}

.auth-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.auth-panel {
  position: relative;
  z-index: 2;
  width: min(460px, 100%);
  display: grid;
  gap: 22px;
  padding: 32px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(246, 250, 255, 0.64));
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: var(--radius);
  color: hsl(var(--tone-h) 22% 13%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 0 0 1px rgba(65, 128, 230, 0.06),
    0 24px 70px rgba(23, 72, 128, 0.16),
    0 0 46px rgba(78, 168, 255, 0.16);
  backdrop-filter: blur(30px) saturate(1.28);
}

.auth-panel p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.auth-panel h1 {
  color: hsl(var(--tone-h) 24% 14%);
  font-size: 42px;
  letter-spacing: 0;
  text-shadow: 0 8px 28px rgba(61, 142, 230, 0.14);
}

.auth-panel .eyebrow {
  margin-bottom: 10px;
  color: hsl(var(--tone-h) var(--tone-s) 42%);
}

.auth-panel label {
  color: hsl(var(--tone-h) 16% 36%);
}

.auth-panel input,
.auth-panel select {
  border-color: rgba(117, 160, 214, 0.28);
  background: rgba(255, 255, 255, 0.92);
  color: hsl(var(--tone-h) 22% 13%);
  box-shadow: inset 0 1px 1px rgba(23, 72, 128, 0.06), 0 1px 0 rgba(255, 255, 255, 0.86);
}

.auth-panel .tabs {
  border-color: rgba(117, 160, 214, 0.26);
  background: rgba(220, 235, 252, 0.72);
  box-shadow: inset 0 1px 2px rgba(23, 72, 128, 0.08), 0 1px 0 rgba(255, 255, 255, 0.86);
}

.auth-panel .tabs button {
  color: hsl(var(--tone-h) 18% 34%);
}

.auth-panel .tabs button:hover {
  background: rgba(255, 255, 255, 0.78);
  color: hsl(var(--tone-h) 24% 14%);
}

.auth-panel .tabs .active {
  color: #ffffff;
}

.auth-shell .site-footer {
  color: rgba(51, 82, 120, 0.68);
}

.auth-shell .site-footer a {
  color: rgba(51, 82, 120, 0.72);
}

.auth-shell .site-footer a:hover {
  color: hsl(var(--tone-h) var(--tone-s) 42%);
}

.eyebrow,
.subtle,
.meta,
small {
  color: var(--muted);
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border: 1px solid hsl(var(--tone-h) 18% 78% / 0.84);
  border-radius: var(--radius);
  background: hsl(var(--tone-h) 18% 88% / 0.76);
  box-shadow: inset 0 1px 2px hsl(var(--tone-h) 25% 20% / 0.1), 0 1px 0 hsl(0 0% 100% / 0.8);
}

.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.tabs .active {
  background: linear-gradient(180deg, hsl(var(--tone-h) var(--tone-s) 56%), var(--primary));
  color: #fff;
  box-shadow: var(--inner-highlight), 0 7px 18px var(--primary-shadow), 0 1px 2px hsl(var(--tone-h) 30% 18% / 0.18);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 30px;
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.78), hsl(var(--tone-h) 28% 96% / 0.66));
  border-bottom: 1px solid hsl(var(--tone-h) 20% 78% / 0.78);
  box-shadow: 0 1px 0 hsl(0 0% 100% / 0.76), 0 10px 28px hsl(var(--tone-h) 20% 16% / 0.08);
  backdrop-filter: blur(30px) saturate(1.48);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-menu {
  position: relative;
  width: auto;
  min-width: 122px;
  border: 1px solid hsl(var(--tone-h) 18% 78% / 0.84);
  border-radius: var(--radius);
  background: var(--surface-glass);
  color: var(--muted);
  box-shadow: var(--inner-highlight);
}

.theme-menu summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.theme-menu summary::-webkit-details-marker {
  display: none;
}

.theme-menu summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid #7a89aa;
  border-bottom: 2px solid #7a89aa;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.18s ease;
}

.theme-menu[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.theme-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  z-index: 8;
  width: min(320px, calc(100vw - 36px));
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid hsl(var(--tone-h) 18% 78% / 0.84);
  border-radius: var(--radius);
  background: var(--panel-glass);
  box-shadow: var(--shadow-strong), var(--glass-highlight);
  backdrop-filter: blur(26px) saturate(1.18);
  -webkit-backdrop-filter: blur(26px) saturate(1.18);
}

.theme-menu-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.theme-menu-field select {
  width: 100%;
  min-height: 36px;
  padding: 4px 34px 4px 10px;
  border-radius: 6px;
  color: var(--text);
}

.theme-range-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.theme-range-row input {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  accent-color: var(--primary);
  background: transparent;
  box-shadow: none;
}

.theme-range-row #themeSaturationValue {
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.view-switch {
  display: flex;
  gap: 3px;
  padding: 5px;
  border: 1px solid hsl(var(--tone-h) 18% 76% / 0.88);
  border-radius: var(--radius);
  background: hsl(var(--tone-h) 18% 88% / 0.78);
  box-shadow: inset 0 1px 2px hsl(var(--tone-h) 25% 20% / 0.12), 0 1px 0 hsl(0 0% 100% / 0.84);
}

.view-switch button {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: hsl(var(--tone-h) 14% 32%);
  padding: 0 14px;
  font-size: 14px;
  font-weight: 760;
  white-space: nowrap;
  box-shadow: none;
}

.view-switch button:hover {
  background: linear-gradient(180deg, hsl(var(--tone-h) 42% 100% / 0.95), hsl(var(--tone-h) 24% 91% / 0.92));
  color: hsl(var(--tone-h) 34% 16%);
  box-shadow: var(--inner-highlight), 0 2px 7px hsl(var(--tone-h) 25% 20% / 0.1);
}

.view-switch .active {
  background: linear-gradient(180deg, hsl(var(--tone-h) var(--tone-s) 58%), var(--primary));
  color: #fff;
  text-shadow: 0 1px 1px hsl(var(--tone-h) 45% 18% / 0.22);
  box-shadow: var(--inner-highlight), 0 8px 20px var(--primary-shadow), 0 1px 3px hsl(var(--tone-h) 35% 20% / 0.18);
}

.view-switch .active:hover {
  background: linear-gradient(180deg, hsl(var(--tone-h) var(--tone-s) 60%), var(--primary));
  color: #fff;
}

.brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.shell {
  width: min(1240px, calc(100% - 36px));
  margin: 22px auto 48px;
  flex: 1 0 auto;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  flex: 0 0 auto;
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto 18px;
  padding: 12px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  text-decoration: none;
}

.site-footer img {
  width: 18px;
  height: 20px;
  object-fit: contain;
}

.site-footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.notice {
  width: min(1240px, calc(100% - 36px));
  margin: 16px auto 0;
  padding: 12px 14px;
  border: 1px solid var(--primary-line);
  border-radius: var(--radius);
  background: hsl(var(--tone-h) 70% 96% / 0.82);
  color: var(--primary-text);
  font-weight: 600;
  box-shadow: var(--inner-highlight), 0 8px 22px var(--primary-shadow);
  backdrop-filter: blur(18px) saturate(1.1);
}

.auth-panel .notice {
  width: 100%;
  margin: 0;
}

.panel {
  background: var(--panel-glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow), var(--glass-highlight);
  backdrop-filter: blur(22px) saturate(1.2);
}

.grid {
  display: grid;
  gap: 18px;
}

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

.user-grid {
  grid-template-columns: 340px 1fr;
  align-items: stretch;
}

.user-tabs {
  display: inline-flex;
  gap: 3px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid hsl(var(--tone-h) 18% 78% / 0.84);
  border-radius: var(--radius);
  background: hsl(var(--tone-h) 18% 88% / 0.72);
  box-shadow: inset 0 1px 2px hsl(var(--tone-h) 25% 20% / 0.1), 0 1px 0 hsl(0 0% 100% / 0.82);
}

.user-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  padding: 0 15px;
  font-weight: 760;
  box-shadow: none;
}

.user-tabs button:hover {
  background: hsl(var(--tone-h) 36% 100% / 0.7);
  color: var(--text);
}

.user-tabs .active {
  background: linear-gradient(180deg, hsl(var(--tone-h) var(--tone-s) 56%), var(--primary));
  color: #fff;
  box-shadow: var(--inner-highlight), 0 7px 18px var(--primary-shadow), 0 1px 2px hsl(var(--tone-h) 30% 18% / 0.18);
}

.user-tabs .active:hover {
  color: #fff;
}

.history-page {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

.result-panel {
  margin-top: 18px;
}

.form {
  display: grid;
  gap: 16px;
}

.compact {
  gap: 12px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr 150px 130px auto;
  gap: 10px;
  margin: 16px 0;
}

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

.row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.72), hsl(var(--tone-h) 28% 97% / 0.62));
  box-shadow: var(--inner-highlight), 0 1px 2px hsl(var(--tone-h) 25% 20% / 0.04);
}

.row:hover {
  border-color: hsl(var(--tone-h) 20% 74% / 0.92);
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.86), hsl(var(--tone-h) 30% 98% / 0.74));
}

.user-row {
  grid-template-columns: 1fr 130px 120px 130px 1fr auto auto;
}

.creator-toolbar {
  grid-template-columns: 1fr 1fr 130px auto;
}

.creator-user-row {
  grid-template-columns: 1.1fr 130px 120px 130px 1fr auto auto;
}

.creator-user-row > strong,
.creator-user-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-panel {
  max-width: 560px;
}

.profile-form {
  margin-top: 16px;
}

.usage-filter {
  min-width: 240px;
}

.usage-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.usage-controls .usage-filter {
  display: grid;
  gap: 5px;
}

.history-pager {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: end;
  margin-top: 16px;
  max-width: 100%;
}

.history-pager label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.history-pager select {
  width: 100%;
}

.history-arrow {
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 28px;
  line-height: 1;
  font-weight: 760;
}

.history-arrow:disabled {
  opacity: 0.38;
}

.usage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.usage-card {
  height: auto;
  min-height: 96px;
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 12px;
  text-align: left;
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.72), hsl(var(--tone-h) 28% 97% / 0.62));
  box-shadow: var(--inner-highlight), 0 1px 2px hsl(var(--tone-h) 25% 20% / 0.04);
}

.usage-card.selected {
  border-color: var(--primary);
  background: var(--primary-softer);
  box-shadow: 0 0 0 3px var(--primary-shadow);
}

.usage-card em {
  color: var(--primary);
  font-style: normal;
  font-size: 22px;
  font-weight: 800;
}

.usage-row {
  grid-template-columns: 1.1fr 1.45fr 1.35fr auto 1fr auto;
}

.usage-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.usage-row.selected {
  border-color: var(--primary);
  background: var(--primary-softer);
}

.usage-detail .conversation {
  margin-top: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 13px;
  font-weight: 800;
}

.status-pill.done {
  border-color: hsl(154 44% 80%);
  background: var(--ok-soft);
  color: var(--ok);
}

.status-pill.error {
  border-color: hsl(350 58% 85%);
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.running,
.status-pill.pending {
  border-color: var(--primary-line);
  background: var(--primary-soft);
  color: var(--primary);
}

.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline input,
.check input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
}

.project-list {
  display: grid;
  gap: 8px;
}

.project-list button {
  display: grid;
  gap: 5px;
  height: auto;
  padding: 12px;
  text-align: left;
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.72), hsl(var(--tone-h) 28% 97% / 0.62));
}

.project-list .selected {
  border-color: var(--primary);
  background: var(--primary-softer);
  box-shadow: 0 0 0 3px var(--primary-shadow);
}

.editor {
  min-height: 620px;
}

.split-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.split-title > div {
  display: flex;
  gap: 8px;
}

.compact-title {
  margin-top: 4px;
}

.compact-title button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

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

.check,
.option-list .check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.7), hsl(var(--tone-h) 28% 97% / 0.62));
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--inner-highlight), 0 1px 2px hsl(var(--tone-h) 25% 20% / 0.04);
}

.check:hover,
.option-list .check:hover {
  border-color: var(--hover-line);
  background: var(--panel);
}

.check span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.toggle {
  justify-content: start;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

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

.prompt-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.72), hsl(var(--tone-h) 28% 97% / 0.62));
  box-shadow: var(--inner-highlight);
}

.prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.controls,
.work {
  display: grid;
  align-content: start;
  gap: 16px;
}

.work {
  grid-template-rows: auto minmax(420px, 1fr) auto;
}

.option-list,
.model-list {
  display: grid;
  gap: 8px;
  grid-auto-rows: minmax(38px, auto);
}

.setting-block {
  display: grid;
  gap: 8px;
}

.setting-block h3 {
  margin: 0;
}

.setting-block > select {
  height: var(--control-h);
  min-height: var(--control-h);
  padding: 0 36px 0 12px;
  line-height: var(--control-h);
  box-shadow: var(--inner-highlight), 0 1px 2px hsl(var(--tone-h) 25% 20% / 0.04);
}

.dropdown-control {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.72), hsl(var(--tone-h) 28% 97% / 0.62));
  box-shadow: var(--inner-highlight), 0 1px 2px hsl(var(--tone-h) 25% 20% / 0.04);
}

.dropdown-control summary {
  position: relative;
  height: var(--control-h);
  min-height: var(--control-h);
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0 36px 0 12px;
  line-height: 1.2;
  color: var(--text);
  cursor: pointer;
  font-weight: 760;
}

.controls .dropdown-control > summary {
  height: var(--control-h);
  min-height: var(--control-h);
  align-items: center;
  padding: calc(var(--control-h) * 0.2 + 0.5px) 36px 0 12px;
}

.controls .dropdown-control > summary::after {
  top: 60%;
}

.dropdown-control summary::marker {
  content: "";
}

.dropdown-control summary::-webkit-details-marker {
  display: none;
}

.dropdown-control summary::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-62%) rotate(45deg);
  transition: transform 0.16s ease;
}

.dropdown-control[open] summary::after {
  transform: translateY(-35%) rotate(225deg);
}

.dropdown-control[open] {
  padding-bottom: 12px;
}

.dropdown-control .model-list,
.dropdown-control .option-list,
.dropdown-control label {
  margin: 0 12px;
}

.dropdown-control textarea {
  margin-top: 7px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  height: auto;
  min-height: 72px;
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 10px 12px;
  text-align: left;
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.72), hsl(var(--tone-h) 28% 97% / 0.62));
}

.history-item:hover {
  border-color: var(--primary);
  background: var(--primary-softer);
}

.history-item.selected {
  border-color: var(--primary);
  background: var(--primary-softer);
  box-shadow: 0 0 0 3px var(--primary-shadow);
}

.history-item strong,
.history-item span,
.history-item small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-list-page {
  margin-top: 14px;
  max-height: calc(100vh - 240px);
  overflow: auto;
  padding-right: 2px;
}

.history-detail {
  min-height: 520px;
}

.attachment-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 16px;
}

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

.attachment-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.72), hsl(var(--tone-h) 28% 97% / 0.62));
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--inner-highlight);
}

.attachment-card:hover {
  border-color: var(--primary);
  background: var(--primary-softer);
}

.attachment-card img,
.file-badge {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.attachment-card img {
  object-fit: contain;
}

.file-badge {
  display: grid;
  place-items: center;
  color: var(--primary);
  font-weight: 900;
}

.attachment-card strong,
.attachment-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone {
  position: relative;
  min-height: 420px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--primary-line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 0.7), hsl(var(--tone-h) 70% 96% / 0.72));
  text-align: center;
  box-shadow: var(--inner-highlight), inset 0 0 0 1px hsl(var(--tone-h) 70% 92% / 0.9), 0 1px 2px hsl(var(--tone-h) 25% 20% / 0.04);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.drop-copy {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100% - 48px, 900px);
}

.dropzone:hover {
  border-color: var(--primary);
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.82), hsl(var(--tone-h) 74% 97% / 0.78));
  box-shadow: 0 0 0 3px var(--primary-shadow), var(--inner-highlight);
}

.pending-upload {
  display: grid;
  gap: 10px;
}

.pending-upload .split-title span {
  display: flex;
  gap: 8px;
}

.pending-grid {
  display: grid;
  gap: 10px;
}

.pending-card {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.72), hsl(var(--tone-h) 28% 97% / 0.62));
  box-shadow: var(--inner-highlight);
}

.pending-card img,
.pending-card .file-badge {
  width: 74px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
}

.pending-card img {
  border: 1px solid var(--line-soft);
  object-fit: contain;
  background: var(--panel);
}

.pending-card > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.pending-card strong,
.pending-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-card > span {
  display: flex;
  gap: 8px;
}

.conversation-uploads {
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.dropzone.dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px var(--primary-shadow);
}

.dropzone input {
  display: none;
}

.drop-title {
  font-size: 22px;
  font-weight: 800;
}

.busy {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid #f4d8a8;
}

.hidden {
  display: none;
}

.screenshot-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: hsl(var(--tone-h) 30% 10% / 0.68);
}

.screenshot-panel {
  width: min(1120px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-glass);
  box-shadow: 0 20px 60px hsl(var(--tone-h) 30% 10% / 0.28), var(--glass-highlight);
  backdrop-filter: blur(24px) saturate(1.2);
}

.screenshot-stage {
  position: relative;
  overflow: auto;
  max-height: calc(100vh - 180px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.screenshot-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

.screenshot-selection {
  position: absolute;
  border: 2px solid var(--primary);
  background: hsl(var(--tone-h) var(--tone-s) 50% / 0.16);
  box-shadow: 0 0 0 9999px hsl(var(--tone-h) 30% 10% / 0.32);
  pointer-events: none;
}

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

.conversation {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-glass);
  overflow: hidden;
  box-shadow: var(--inner-highlight), 0 8px 22px hsl(var(--tone-h) 22% 16% / 0.07);
}

.conversation-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.68), hsl(var(--tone-h) 24% 98% / 0.56));
}

.conversation-head > div {
  display: grid;
  gap: 4px;
}

.conversation-head > span {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  text-align: right;
}

.conversation-head > span button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.conversation.done .conversation-head span {
  color: var(--ok);
}

.conversation.error .conversation-head span {
  color: var(--danger);
}

.progress-wrap {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: hsl(0 0% 100% / 0.58);
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: hsl(var(--tone-h) 18% 86% / 0.76);
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), hsl(calc(var(--tone-h) + 18) var(--tone-s) 58%));
  transition: width 0.35s ease;
}

.progress-wrap.done .progress-bar {
  background: var(--ok);
}

.progress-wrap.error .progress-bar {
  background: var(--danger);
}

.progress-text {
  color: var(--muted);
  font-size: 13px;
}

.summary-block {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, hsl(var(--tone-h) 68% 98% / 0.72), hsl(0 0% 100% / 0.54));
}

.summary-title {
  font-weight: 800;
}

.model-results {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: hsl(var(--tone-h) 20% 95% / 0.46);
}

.model-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: hsl(var(--tone-h) 36% 99% / 0.88);
  box-shadow: var(--inner-highlight);
}

.model-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, hsl(0 0% 100% / 0.72), hsl(var(--tone-h) 22% 96% / 0.58));
}

.model-result.done .model-result-head span {
  color: var(--ok);
}

.model-result.running .model-result-head span {
  color: var(--primary);
}

.model-result.pending .model-result-head span {
  color: var(--muted);
}

.model-result.error .model-result-head span {
  color: var(--danger);
}

.markdown-body {
  padding: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 0.6em 0 0.35em;
  line-height: 1.3;
}

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child,
.markdown-body p:first-child,
.markdown-body ul:first-child,
.markdown-body ol:first-child,
.markdown-body blockquote:first-child,
.markdown-body table:first-child,
.markdown-body pre:first-child {
  margin-top: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body table,
.markdown-body pre {
  margin: 0.65em 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.35em;
}

.markdown-body blockquote {
  padding: 8px 12px;
  border-left: 4px solid var(--primary-line);
  color: var(--muted);
  background: hsl(var(--tone-h) 30% 97% / 0.68);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.markdown-body th,
.markdown-body td {
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  background: hsl(var(--tone-h) 24% 96% / 0.9);
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: var(--radius-sm);
  background: hsl(var(--tone-h) 24% 92% / 0.84);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.equation-block {
  margin: 0.8em 0;
  overflow-x: auto;
}

.equation-block .katex-display {
  margin: 0;
  text-align: left;
}

.equation-inline,
.equation-block {
  user-select: text;
}

.katex {
  font-size: 1.06em;
}

.markdown-body pre.code-block {
  overflow-x: auto;
  padding: 12px;
  border-radius: var(--radius);
  background: hsl(220 26% 12%);
  color: #f8fafc;
}

.markdown-body pre.code-block code {
  padding: 0;
  background: transparent;
  color: inherit;
}

pre {
  margin: 0;
  padding: 14px;
  white-space: pre-wrap;
  line-height: 1.7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: hsl(var(--tone-h) 20% 96% / 0.62);
}

::selection {
  background: hsl(var(--tone-h) var(--tone-s) 72% / 0.34);
}

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

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

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: hsl(var(--tone-h) 14% 62% / 0.42);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--tone-h) 18% 48% / 0.52);
  background-clip: padding-box;
}

.tall {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
}

@media (max-width: 860px) {
  .two,
  .user-grid,
  .history-page,
  .workspace,
  .toolbar,
  .row,
  .user-row,
  .creator-toolbar,
  .creator-user-row,
  .usage-row,
  .usage-summary,
  .attachment-grid,
  .check-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 12px 18px;
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .view-switch {
    flex-wrap: wrap;
  }

  .theme-menu {
    width: 100%;
  }

  .theme-menu-panel {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .theme-range-row {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .usage-controls {
    justify-content: stretch;
  }

  .usage-controls,
  .usage-controls .usage-filter,
  .history-pager {
    width: 100%;
  }

  .user-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }

  .user-tabs button {
    flex: 1 0 auto;
  }

  .shell,
  .notice {
    width: min(100% - 24px, 1240px);
  }

  .shell {
    margin-top: 14px;
  }

  .auth-panel {
    padding: 22px;
  }

  .split-title {
    align-items: stretch;
    flex-direction: column;
  }

  .split-title > div {
    flex-wrap: wrap;
  }

  .work {
    grid-template-rows: auto minmax(300px, auto) auto;
  }

  .dropzone {
    min-height: 300px;
  }

  h1 {
    font-size: 30px;
  }

  .pending-card {
    grid-template-columns: 64px 1fr;
  }

  .pending-card > span {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

/* Reference-style glass pass: panels first, background second, controls last. */
:root {
  --tone-h: 221;
  --tone-s: 86%;
  --bg-main-h: 188;
  --bg-accent-h: 276;
  --bg-soft-alpha: 0.52;
  --bg-wash-alpha: 0.55;
  --bg-detail-alpha: 0.16;
  --bg-extra-alpha: 0.08;
  --bg-grid-alpha: 0.1;
  --bg-pattern-alpha: 0.035;
  --bg-grid-size: 64px;
  --bg-pattern-size: 32px;
  --bg: #eef4ff;
  --panel: hsl(0 0% 100% / 0.62);
  --panel-glass: hsl(0 0% 100% / 0.52);
  --surface: hsl(220 100% 98% / 0.54);
  --surface-glass: hsl(0 0% 100% / 0.42);
  --surface-strong: hsl(221 62% 92% / 0.62);
  --text: #182257;
  --muted: #7a88aa;
  --line: hsl(220 72% 82% / 0.38);
  --line-soft: hsl(221 72% 90% / 0.42);
  --glass-line: hsl(0 0% 100% / 0.74);
  --primary: hsl(var(--tone-h) var(--tone-s) 54%);
  --primary-dark: hsl(var(--tone-h) var(--tone-s) 44%);
  --primary-line: hsl(var(--tone-h) var(--tone-s) 76% / 0.68);
  --primary-soft: hsl(var(--tone-h) var(--tone-s) 96% / 0.56);
  --primary-softer: hsl(var(--tone-h) var(--tone-s) 97% / 0.66);
  --primary-text: hsl(var(--tone-h) var(--tone-s) 38%);
  --primary-shadow: hsl(var(--tone-h) var(--tone-s) 48% / 0.2);
  --hover-line: hsl(var(--tone-h) var(--tone-s) 70% / 0.62);
  --hover-bg: hsl(0 0% 100% / 0.62);
  --shadow: 0 20px 58px hsl(221 70% 42% / 0.1), 0 4px 16px hsl(277 82% 70% / 0.07);
  --shadow-strong: 0 30px 92px hsl(221 70% 38% / 0.16), 0 10px 28px hsl(277 82% 70% / 0.1);
  --inner-highlight: inset 0 1px 0 hsl(0 0% 100% / 0.84);
  --glass-highlight: inset 0 1px 0 hsl(0 0% 100% / 0.92), inset 0 0 0 1px hsl(0 0% 100% / 0.36);
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 22%, hsl(calc(var(--bg-main-h) + 34) 100% 92% / var(--bg-detail-alpha)) 0 14%, transparent 30%),
    radial-gradient(circle at 86% 18%, hsl(calc(var(--bg-accent-h) - 36) 100% 92% / var(--bg-extra-alpha)) 0 16%, transparent 34%),
    linear-gradient(125deg, hsl(var(--bg-main-h) 100% 94% / var(--bg-soft-alpha)) 0%, transparent 28%),
    linear-gradient(145deg, transparent 42%, hsl(var(--bg-accent-h) 100% 92% / var(--bg-wash-alpha)) 72%, transparent 100%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 47%, #f6f7ff 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.72;
  background-image:
    linear-gradient(hsl(var(--bg-accent-h) 78% 78% / var(--bg-grid-alpha)) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--bg-accent-h) 78% 78% / var(--bg-grid-alpha)) 1px, transparent 1px),
    radial-gradient(circle, hsl(var(--bg-main-h) 88% 72% / var(--bg-pattern-alpha)) 1px, transparent 1px);
  background-size: var(--bg-grid-size) var(--bg-grid-size), var(--bg-grid-size) var(--bg-grid-size), var(--bg-pattern-size) var(--bg-pattern-size);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 84%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 84%, transparent 100%);
}

#app.auth-shell,
.auth-page {
  background:
    radial-gradient(circle at 16% 22%, hsl(calc(var(--bg-main-h) + 34) 100% 92% / var(--bg-detail-alpha)) 0 14%, transparent 30%),
    radial-gradient(circle at 86% 18%, hsl(calc(var(--bg-accent-h) - 36) 100% 92% / var(--bg-extra-alpha)) 0 16%, transparent 34%),
    linear-gradient(125deg, hsl(var(--bg-main-h) 100% 94% / var(--bg-soft-alpha)) 0%, transparent 32%),
    linear-gradient(145deg, transparent 42%, hsl(var(--bg-accent-h) 100% 92% / var(--bg-wash-alpha)) 72%, transparent 100%);
}

.panel,
.topbar,
.auth-panel,
.notice,
.tabs,
.user-tabs,
.view-switch,
.theme-picker,
.theme-menu,
.theme-menu-panel,
.row,
.usage-card,
.project-list button,
.history-item,
.check,
.option-list .check,
.prompt-item,
.dropdown-control,
.attachment-card,
.pending-card,
.conversation,
.model-result,
.summary-block,
.progress-wrap,
.conversation-uploads,
.screenshot-panel,
.screenshot-stage,
.empty,
.busy,
.status-pill {
  border-color: var(--glass-line);
  background:
    linear-gradient(145deg, hsl(0 0% 100% / 0.58), hsl(218 100% 98% / 0.36)),
    linear-gradient(120deg, hsl(188 100% 88% / 0.11), transparent 43%, hsl(276 100% 90% / 0.13));
  box-shadow: var(--shadow), var(--glass-highlight);
  backdrop-filter: blur(24px) saturate(1.22);
  -webkit-backdrop-filter: blur(24px) saturate(1.22);
}

.panel,
.auth-panel,
.screenshot-panel {
  position: relative;
  overflow: hidden;
}

.panel::before,
.auth-panel::before,
.screenshot-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, hsl(190 100% 86% / 0.12), transparent 38%),
    linear-gradient(140deg, transparent 46%, hsl(276 100% 90% / 0.11));
}

.topbar {
  top: 10px;
  width: min(1300px, calc(102% - 36px));
  margin: 10px auto 0;
  border: 1px solid var(--glass-line);
  border-radius: 40px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 4px;
  padding: 0 14px;
  border: 1px solid hsl(0 0% 100% / 0.46);
  border-radius: 999px;
  background: linear-gradient(180deg, hsl(var(--tone-h) var(--tone-s) 66%), var(--primary));
  color: #fff;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 1px hsl(222 70% 28% / 0.22);
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.36), 0 10px 22px var(--primary-shadow);
}

.shell {
  width: min(1240px, calc(100% - 36px));
  margin-top: 24px;
}

.auth-panel {
  width: min(720px, 100%);
  border-radius: 8px;
}

.auth-panel h1 {
  color: #172058;
  font-size: clamp(40px, 5vw, 58px);
  font-weight: 880;
  line-height: 1.08;
  text-shadow: 0 12px 32px hsl(222 70% 40% / 0.12);
}

.auth-panel .eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin-bottom: 14px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, hsl(var(--tone-h) var(--tone-s) 66%), var(--primary));
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.36), 0 10px 22px var(--primary-shadow);
}

.auth-panel::after {
  content: "";
  position: absolute;
  right: 54px;
  top: 114px;
  z-index: 0;
  width: 172px;
  height: 172px;
  pointer-events: none;
  opacity: 0.42;
  background:
    linear-gradient(150deg, hsl(0 0% 100% / 0.74), hsl(214 100% 96% / 0.42)),
    linear-gradient(60deg, hsl(188 100% 76% / 0.36), transparent 50%, hsl(258 100% 80% / 0.34));
  clip-path: polygon(50% 0%, 92% 25%, 92% 75%, 50% 100%, 8% 75%, 8% 25%);
  filter: blur(0.2px) drop-shadow(0 22px 32px hsl(217 70% 48% / 0.12));
}

.auth-panel > * {
  position: relative;
  z-index: 1;
}

button,
input,
select,
textarea {
  border-color: hsl(220 70% 82% / 0.38);
}

button {
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 0.78), hsl(216 100% 97% / 0.48));
  color: #243064;
  font-weight: 760;
  box-shadow: var(--inner-highlight), 0 9px 20px hsl(220 58% 42% / 0.07);
}

button:hover {
  border-color: var(--hover-line);
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 0.9), hsl(215 100% 96% / 0.62));
  box-shadow: var(--inner-highlight), 0 13px 28px hsl(217 72% 44% / 0.11);
}

.primary,
.tabs .active,
.view-switch .active,
.user-tabs .active {
  border-color: hsl(var(--tone-h) var(--tone-s) 66% / 0.88);
  background:
    linear-gradient(180deg, hsl(var(--tone-h) var(--tone-s) 66%) 0%, var(--primary) 54%, var(--primary-dark) 100%);
  color: #fff;
  text-shadow: 0 1px 1px hsl(222 70% 28% / 0.22);
  box-shadow:
    inset 0 1px 0 hsl(0 0% 100% / 0.36),
    0 12px 26px hsl(var(--tone-h) var(--tone-s) 48% / 0.24);
}

.primary:hover,
.tabs .active:hover,
.view-switch .active:hover,
.user-tabs .active:hover {
  background:
    linear-gradient(180deg, hsl(var(--tone-h) var(--tone-s) 70%) 0%, hsl(var(--tone-h) var(--tone-s) 58%) 56%, var(--primary-dark) 100%);
  color: #fff;
}

.danger {
  color: #d84b73;
}

input,
select,
textarea {
  background: hsl(0 0% 100% / 0.5);
  color: var(--text);
  box-shadow: inset 0 1px 1px hsl(221 64% 24% / 0.04), inset 0 1px 0 hsl(0 0% 100% / 0.7);
  backdrop-filter: blur(18px) saturate(1.18);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
}

select {
  background:
    linear-gradient(45deg, transparent 50%, #7a89aa 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #7a89aa 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    hsl(0 0% 100% / 0.5);
}

input:focus,
select:focus,
textarea:focus {
  border-color: hsl(217 100% 62% / 0.82);
  background: hsl(0 0% 100% / 0.72);
  box-shadow: 0 0 0 4px hsl(217 100% 62% / 0.14), inset 0 1px 0 hsl(0 0% 100% / 0.84);
}

h1,
h2,
h3,
.drop-title {
  color: #182257;
}

h2 {
  font-weight: 840;
}

.tabs,
.user-tabs,
.view-switch {
  padding: 5px;
}

.tabs button,
.user-tabs button,
.view-switch button {
  color: #7685a8;
}

.tabs button:hover,
.user-tabs button:hover,
.view-switch button:hover {
  background: hsl(0 0% 100% / 0.42);
  color: #1f2b61;
}

.controls .setting-block > #projectSelect {
  height: 52px;
  min-height: 52px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, transparent 50%, #7a89aa 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #7a89aa 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    linear-gradient(145deg, hsl(0 0% 100% / 0.58), hsl(218 100% 98% / 0.36)),
    linear-gradient(120deg, hsl(188 100% 88% / 0.11), transparent 43%, hsl(276 100% 90% / 0.13));
  color: var(--text);
  font-weight: 760;
  line-height: 52px;
  box-shadow: var(--shadow), var(--glass-highlight);
  backdrop-filter: blur(24px) saturate(1.22);
  -webkit-backdrop-filter: blur(24px) saturate(1.22);
}

.controls .setting-block > #projectSelect:hover {
  border-color: hsl(217 100% 72% / 0.55);
  background:
    linear-gradient(45deg, transparent 50%, #5d6f94 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #5d6f94 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    linear-gradient(180deg, hsl(0 0% 100% / 0.68), hsl(216 100% 97% / 0.42));
}

.row:hover,
.usage-card:hover,
.project-list button:hover,
.history-item:hover,
.check:hover,
.option-list .check:hover,
.prompt-item:hover,
.attachment-card:hover,
.pending-card:hover,
.dropdown-control:hover {
  border-color: hsl(217 100% 72% / 0.55);
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 0.68), hsl(216 100% 97% / 0.42));
}

.usage-card.selected,
.usage-row.selected,
.project-list .selected,
.history-item.selected {
  border-color: hsl(217 100% 62% / 0.78);
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 0.74), hsl(214 100% 96% / 0.56));
  box-shadow: 0 0 0 4px hsl(217 100% 62% / 0.12), var(--inner-highlight);
}

.dropzone {
  border: 1px dashed hsl(217 100% 72% / 0.7);
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 0.42), hsl(214 100% 96% / 0.38)),
    linear-gradient(120deg, hsl(188 100% 88% / 0.14), transparent 42%, hsl(276 100% 90% / 0.16));
  box-shadow: var(--shadow), var(--glass-highlight);
  backdrop-filter: blur(24px) saturate(1.22);
  -webkit-backdrop-filter: blur(24px) saturate(1.22);
}

.dropzone::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(50% - 164px);
  width: 120px;
  height: 104px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    linear-gradient(150deg, hsl(0 0% 100% / 0.74), hsl(214 100% 96% / 0.42)),
    linear-gradient(60deg, hsl(188 100% 76% / 0.36), transparent 50%, hsl(258 100% 80% / 0.32));
  clip-path: polygon(50% 0%, 92% 25%, 92% 75%, 50% 100%, 8% 75%, 8% 25%);
  filter: drop-shadow(0 18px 24px hsl(217 70% 48% / 0.12));
}

.dropzone:hover,
.dropzone.dragging {
  border-color: hsl(217 100% 60% / 0.86);
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 0.58), hsl(214 100% 96% / 0.5)),
    linear-gradient(120deg, hsl(188 100% 88% / 0.18), transparent 42%, hsl(276 100% 90% / 0.2));
  box-shadow: 0 0 0 4px hsl(217 100% 62% / 0.12), var(--shadow);
}

.conversation-head,
.progress-wrap,
.summary-block,
.model-result-head,
.conversation-uploads,
.model-results {
  border-color: hsl(220 72% 82% / 0.3);
  background: hsl(0 0% 100% / 0.34);
}

.progress-bar {
  background: linear-gradient(90deg, var(--primary), hsl(calc(var(--tone-h) + 20) var(--tone-s) 62%) 52%, hsl(calc(var(--tone-h) + 48) var(--tone-s) 68%));
}

.status-pill.done {
  border-color: hsl(158 52% 78% / 0.7);
  background: hsl(158 74% 95% / 0.58);
}

.status-pill.error {
  border-color: hsl(342 74% 82% / 0.7);
  background: hsl(342 100% 96% / 0.58);
}

.status-pill.running,
.status-pill.pending {
  border-color: var(--primary-line);
  background: var(--primary-soft);
}

.file-badge,
.attachment-card img,
.pending-card img,
.pending-card .file-badge {
  border-color: hsl(0 0% 100% / 0.68);
  background: hsl(0 0% 100% / 0.42);
}

.markdown-body blockquote,
.markdown-body th,
.markdown-body code,
.empty {
  background: hsl(0 0% 100% / 0.34);
}

.site-footer,
.site-footer a {
  color: #8491b0;
}

html {
  background:
    radial-gradient(circle at 16% 22%, hsl(calc(var(--bg-main-h) + 34) 100% 92% / var(--bg-detail-alpha)) 0 14%, transparent 30%),
    radial-gradient(circle at 86% 18%, hsl(calc(var(--bg-accent-h) - 36) 100% 92% / var(--bg-extra-alpha)) 0 16%, transparent 34%),
    linear-gradient(125deg, hsl(var(--bg-main-h) 100% 94% / var(--bg-soft-alpha)) 0%, transparent 28%),
    linear-gradient(145deg, transparent 42%, hsl(var(--bg-accent-h) 100% 92% / var(--bg-wash-alpha)) 72%, transparent 100%),
    linear-gradient(180deg, #f8fbff 0%, #eef5ff 47%, #f6f7ff 100%);
  background-attachment: fixed, fixed, fixed, fixed, fixed;
}

body {
  background-attachment: fixed, fixed, fixed, fixed, fixed;
  background-position: center top, center top, center top, center top, center top;
  background-repeat: no-repeat;
  background-size: cover, cover, cover, cover, cover;
}

#app.auth-shell,
.auth-page {
  background-attachment: fixed, fixed, fixed, fixed;
  background-position: center top, center top, center top, center top;
  background-repeat: no-repeat;
  background-size: cover, cover, cover, cover;
}

@media (max-width: 860px) {
  .topbar,
  .shell,
  .notice,
  .site-footer {
    width: min(100% - 24px, 1240px);
  }

  .topbar {
    top: 8px;
    margin-top: 8px;
  }

  .brand {
    align-self: flex-start;
    margin-bottom: 2px;
  }
}

/* Colorless glass: glass layers stay transparent and blurred without blue/purple tint. */
:root {
  --panel: hsl(0 0% 100% / 0.58);
  --panel-glass: hsl(0 0% 100% / 0.5);
  --surface: hsl(0 0% 100% / 0.46);
  --surface-glass: hsl(0 0% 100% / 0.4);
  --surface-strong: hsl(0 0% 100% / 0.62);
  --line: hsl(0 0% 100% / 0.48);
  --line-soft: hsl(0 0% 100% / 0.36);
  --glass-line: hsl(0 0% 100% / 0.72);
  --hover-bg: hsl(0 0% 100% / 0.58);
  --shadow: 0 20px 58px hsl(225 18% 28% / 0.09), 0 4px 16px hsl(225 18% 28% / 0.04);
  --shadow-strong: 0 30px 92px hsl(225 18% 24% / 0.14), 0 10px 28px hsl(225 18% 24% / 0.07);
}

.panel,
.topbar,
.auth-panel,
.notice,
.tabs,
.user-tabs,
.view-switch,
.theme-picker,
.theme-menu,
.theme-menu-panel,
.row,
.usage-card,
.project-list button,
.history-item,
.check,
.option-list .check,
.prompt-item,
.dropdown-control,
.attachment-card,
.pending-card,
.conversation,
.model-result,
.summary-block,
.progress-wrap,
.conversation-uploads,
.screenshot-panel,
.screenshot-stage,
.empty,
.busy,
.status-pill,
.dropzone {
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 0.58), hsl(0 0% 100% / 0.34));
  box-shadow: var(--shadow), var(--glass-highlight);
}

.panel::before,
.auth-panel::before,
.screenshot-panel::before {
  background:
    linear-gradient(120deg, hsl(0 0% 100% / 0.16), transparent 42%, hsl(0 0% 100% / 0.1));
}

button {
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 0.78), hsl(0 0% 100% / 0.46));
  box-shadow: var(--inner-highlight), 0 9px 20px hsl(225 18% 28% / 0.07);
}

button:hover {
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 0.88), hsl(0 0% 100% / 0.56));
  box-shadow: var(--inner-highlight), 0 13px 28px hsl(225 18% 28% / 0.1);
}

input,
select,
textarea {
  background: hsl(0 0% 100% / 0.5);
}

select {
  background:
    linear-gradient(45deg, transparent 50%, #7a8293 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #7a8293 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    hsl(0 0% 100% / 0.5);
}

input:focus,
select:focus,
textarea:focus {
  background: hsl(0 0% 100% / 0.68);
}

.controls .setting-block > #projectSelect {
  background:
    linear-gradient(45deg, transparent 50%, #7a8293 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #7a8293 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    linear-gradient(180deg, hsl(0 0% 100% / 0.58), hsl(0 0% 100% / 0.34));
}

.controls .setting-block > #projectSelect:hover {
  background:
    linear-gradient(45deg, transparent 50%, #606a7b 50%) right 17px center / 6px 6px no-repeat,
    linear-gradient(135deg, #606a7b 50%, transparent 50%) right 12px center / 6px 6px no-repeat,
    linear-gradient(180deg, hsl(0 0% 100% / 0.68), hsl(0 0% 100% / 0.44));
}

.row:hover,
.usage-card:hover,
.project-list button:hover,
.history-item:hover,
.check:hover,
.option-list .check:hover,
.prompt-item:hover,
.attachment-card:hover,
.pending-card:hover,
.dropdown-control:hover,
.dropzone:hover,
.dropzone.dragging {
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 0.68), hsl(0 0% 100% / 0.44));
}

.usage-card.selected,
.usage-row.selected,
.project-list .selected,
.history-item.selected {
  background:
    linear-gradient(180deg, hsl(0 0% 100% / 0.72), hsl(0 0% 100% / 0.48));
}

.conversation-head,
.progress-wrap,
.summary-block,
.model-result-head,
.conversation-uploads,
.model-results,
.markdown-body blockquote,
.markdown-body th,
.markdown-body code,
.empty,
.file-badge,
.attachment-card img,
.pending-card img,
.pending-card .file-badge {
  background: hsl(0 0% 100% / 0.36);
}

.auth-panel::after,
.dropzone::before {
  background:
    linear-gradient(150deg, hsl(0 0% 100% / 0.72), hsl(0 0% 100% / 0.32));
  filter: blur(0.2px) drop-shadow(0 18px 26px hsl(225 18% 28% / 0.1));
}

.status-pill.done,
.status-pill.error,
.status-pill.running,
.status-pill.pending {
  background: hsl(0 0% 100% / 0.42);
}
