:root {
  color-scheme: light;
  --ink: #121714;
  --ink-soft: #3d4741;
  --muted: #707a74;
  --muted-2: #929b96;
  --canvas: #f0f3f1;
  --surface: #ffffff;
  --surface-soft: #f7f9f8;
  --surface-tint: #edf7f2;
  --line: #dce2de;
  --line-strong: #c9d1cc;
  --sidebar: #101513;
  --sidebar-soft: #1a211e;
  --sidebar-line: #2a332f;
  --brand: #07845e;
  --brand-strong: #006d4d;
  --brand-soft: #dff2e9;
  --blue: #2f6fe4;
  --blue-soft: #e8effc;
  --amber: #b97812;
  --amber-soft: #fff2d9;
  --red: #c63d4d;
  --red-soft: #fdebed;
  --shadow-sm: 0 1px 2px rgba(18, 23, 20, 0.05), 0 6px 18px rgba(18, 23, 20, 0.04);
  --shadow-lg: 0 24px 60px rgba(9, 16, 12, 0.18);
  --radius: 8px;
  --sidebar-width: 238px;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

body.drawer-open,
body.detail-open {
  overflow: hidden;
}

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

button,
select {
  cursor: pointer;
}

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

button,
input,
select,
textarea {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

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

.login-view {
  position: fixed;
  inset: 0;
  z-index: 100;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #bdaea2;
}

.login-stage {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #bdaea2;
}

.login-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  min-width: 0;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #bdaea2;
}

.login-carousel-track {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.login-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  background: #bdaea2;
  transition: opacity 760ms ease;
}

.login-slide-model {
  position: absolute;
  display: block;
}

.login-slide-model {
  --login-model-edge: 94%;
  z-index: 2;
  inset: 0 auto 0 0;
  width: 59%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 14%;
  transform: scale(0.93);
  transform-origin: left top;
  -webkit-mask-image:
    linear-gradient(to right, #000 0%, #000 var(--login-model-edge), transparent 100%),
    linear-gradient(to bottom, #000 0%, #000 93%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, #000 0%, #000 var(--login-model-edge), transparent 100%),
    linear-gradient(to bottom, #000 0%, #000 93%, transparent 100%);
  mask-composite: intersect;
}

.login-slide--right-subject .login-slide-model {
  --login-model-edge: 98.5%;
  object-position: 100% 14%;
}

.login-slide.is-active {
  z-index: 1;
  opacity: 1;
}

.login-visual figcaption {
  position: absolute;
  right: auto;
  bottom: clamp(24px, 4vw, 46px);
  left: clamp(24px, 4vw, 52px);
  z-index: 2;
  width: auto;
  display: flex;
  align-items: center;
  gap: 30px;
  min-height: 0;
  padding: 0;
  color: #f8f7f2;
  background: transparent;
  text-shadow: 0 1px 16px rgba(24, 21, 18, 0.62);
}

.login-visual-brand strong,
.login-visual-brand span {
  display: block;
}

.login-visual-brand strong {
  font-size: 15px;
  font-weight: 750;
}

.login-visual-brand span {
  margin-top: 2px;
  color: rgba(248, 247, 242, 0.76);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.login-carousel-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.login-carousel-dot {
  position: relative;
  width: 26px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

.login-carousel-dot::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 9px;
  width: 7px;
  height: 4px;
  border-radius: 2px;
  background: rgba(248, 247, 242, 0.5);
  box-shadow: 0 1px 8px rgba(28, 24, 20, 0.24);
  transition: width 180ms ease, left 180ms ease, background 180ms ease;
}

.login-carousel-dot:hover::before {
  background: #d7d2c8;
}

.login-carousel-dot.is-active::before {
  left: 4px;
  width: 17px;
  background: #c6a66c;
}

.login-panel {
  position: absolute;
  top: 50%;
  right: clamp(16px, 2.5vw, 36px);
  z-index: 3;
  width: min(340px, calc(100% - 44px));
  min-width: 0;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  isolation: isolate;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: 0;
  border-radius: 8px;
  background: rgba(189, 174, 162, 0.72);
  filter: blur(10px);
  pointer-events: none;
}

.login-panel-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 24px 24px 22px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  background: rgba(248, 248, 245, 0.74);
  box-shadow: 0 28px 72px rgba(31, 26, 21, 0.24);
  -webkit-backdrop-filter: blur(22px) saturate(0.88);
  backdrop-filter: blur(22px) saturate(0.88);
}

.login-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.login-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  color: #f5f3ec;
  border-radius: 7px;
  background: #1c201e;
}

.login-brand-mark svg {
  width: 18px;
  height: 18px;
  color: #c6a66c;
}

.login-lockup strong,
.login-lockup span {
  display: block;
}

.login-lockup strong {
  color: #1c201e;
  font-size: 14px;
  font-weight: 800;
}

.login-lockup span {
  margin-top: 1px;
  color: #8b8c87;
  font-size: 10px;
  font-weight: 650;
}

.login-system-state {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #666a66;
  font-size: 10px;
  font-weight: 650;
}

.login-system-state > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #18815f;
  box-shadow: 0 0 0 3px rgba(24, 129, 95, 0.12);
}

.login-intro {
  margin: 28px 0 20px;
}

.login-intro > p {
  margin: 0 0 7px;
  color: #9a7742;
  font-size: 10px;
  font-weight: 800;
}

.login-intro h1 {
  margin: 0;
  color: #1a1d1b;
  font-size: 31px;
  font-weight: 660;
  line-height: 1.18;
}

.login-intro-copy {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.login-intro-copy strong {
  color: #3e423e;
  font-size: 13px;
  font-weight: 680;
}

.login-intro-copy span {
  color: #737670;
  font-size: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  color: #ffffff;
  border: 1px solid #18a77d;
  border-radius: 7px;
  background: var(--brand);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
}

.login-form {
  display: grid;
  gap: 13px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: #434743;
  font-size: 12px;
  font-weight: 700;
}

.login-field {
  position: relative;
  display: block;
}

.login-field > svg {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: #8d908b;
  pointer-events: none;
}

.login-form input {
  width: 100%;
  height: 46px;
  padding: 0 42px;
  color: #202421;
  border: 1px solid #d5d7d1;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(28, 32, 30, 0.02);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.login-form input:focus {
  border-color: #a27f48;
  background: #fffefa;
  box-shadow: 0 0 0 3px rgba(162, 127, 72, 0.12);
}

.login-field:focus-within > svg {
  color: #9a7742;
}

.password-field {
  display: block;
}

.password-field input {
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #81857f;
  border: 0;
  border-radius: 5px;
  background: transparent;
}

.password-toggle:hover {
  color: #1c201e;
  background: #f0f0eb;
}

.form-error {
  min-height: 16px;
  margin: -4px 0 -2px;
  color: #b93243;
  font-size: 12px;
}

.primary-button.login-submit {
  width: 100%;
  min-height: 46px;
  border-color: #1c201e;
  background: #1c201e;
  box-shadow: 0 10px 24px rgba(28, 32, 30, 0.18);
}

.primary-button.login-submit:hover {
  border-color: #2d332f;
  background: #2d332f;
}

.login-submit:disabled {
  opacity: 0.78;
}

.login-submit svg {
  width: 18px;
  height: 18px;
}

.login-loading-icon {
  display: none;
}

.login-submit.is-loading .login-default-icon {
  display: none;
}

.login-submit.is-loading .login-loading-icon {
  display: block;
  animation: login-spin 800ms linear infinite;
}

.login-footer {
  margin: 22px 0 0;
  color: #a1a29d;
  font-size: 9px;
  font-weight: 700;
}

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

@media (max-width: 820px) {
  .login-stage {
    min-height: 100svh;
  }

  .login-visual {
    position: absolute;
    inset: 0;
    min-height: 100%;
  }

  .login-carousel-track {
    inset: 0;
  }

  .login-slide {
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .login-slide-model {
    inset: 0 0 auto;
    width: 100%;
    height: 62svh;
    object-fit: contain;
    object-position: 50% 0;
    transform: none;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .login-slide--right-subject .login-slide-model {
    object-position: 50% 0;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .login-visual figcaption {
    top: max(16px, env(safe-area-inset-top));
    right: 18px;
    bottom: auto;
    left: 18px;
    width: auto;
    justify-content: space-between;
    gap: 16px;
    padding: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .login-panel {
    top: auto;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    max-height: calc(100svh - 78px);
    overflow: auto;
    transform: none;
    scrollbar-width: none;
  }

  .login-panel::before { display: none; }

  .login-panel::-webkit-scrollbar { display: none; }

  .login-panel-inner {
    width: 100%;
    padding: 14px 16px;
    background: rgba(248, 248, 245, 0.54);
    box-shadow: 0 22px 54px rgba(31, 26, 21, 0.2);
    -webkit-backdrop-filter: blur(13px) saturate(0.92);
    backdrop-filter: blur(13px) saturate(0.92);
  }

  .login-brand-mark {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .login-brand-mark svg { width: 16px; height: 16px; }
  .login-lockup strong { font-size: 13px; }
  .login-lockup span { font-size: 9px; }
  .login-system-state { font-size: 9px; }

  .login-intro {
    margin: 12px 0 10px;
  }

  .login-intro > p { display: none; }

  .login-intro h1 {
    font-size: 24px;
  }

  .login-intro-copy {
    gap: 2px;
    margin-top: 5px;
  }

  .login-intro-copy strong { font-size: 12px; }
  .login-intro-copy span { display: none; }
  .login-form { gap: 8px; }
  .login-form label { gap: 4px; font-size: 11px; }
  .login-form input { height: 42px; background: rgba(255, 255, 255, 0.62); }
  .login-field > svg { top: 12px; }
  .password-toggle { top: 1px; }
  .form-error { min-height: 12px; font-size: 11px; }
  .primary-button.login-submit { min-height: 42px; }

  .login-footer {
    display: none;
  }
}

/* Browser resource queue */
.browser-queue-board {
  margin-top: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.browser-queue-board[hidden] {
  display: none;
}

.queue-board-header {
  min-height: 82px;
  display: grid;
  grid-template-columns: 42px minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfd;
}

.queue-board-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #365bd8;
  border: 1px solid #d9e1ff;
  border-radius: 8px;
  background: var(--blue-soft);
}

.queue-board-icon svg {
  width: 19px;
  height: 19px;
}

.queue-board-title,
.queue-board-title small,
.queue-board-title strong,
.queue-board-title span,
.queue-board-stats,
.queue-board-stats span,
.queue-board-stats small,
.queue-board-stats strong {
  min-width: 0;
  display: block;
}

.queue-board-title small {
  color: var(--brand);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0;
}

.queue-board-title strong {
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.2;
}

.queue-board-title > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-board-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  align-self: stretch;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.queue-board-stats > span {
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-right: 1px solid var(--line);
}

.queue-board-stats > span:last-child {
  border-right: 0;
}

.queue-board-stats small {
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.queue-board-stats strong {
  margin-top: 2px;
  font-size: 18px;
  line-height: 1;
}

.queue-board-stats > span:nth-child(1) strong { color: var(--blue); }
.queue-board-stats > span:nth-child(2) strong { color: var(--amber); }
.queue-board-stats > span:nth-child(3) strong { color: var(--emerald); }

.queue-board-actions {
  display: flex;
  gap: 6px;
}

.queue-board-actions .icon-button {
  width: 34px;
  height: 34px;
  color: var(--ink-soft);
  border-color: var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.queue-board-actions .icon-button:hover {
  color: var(--brand);
  border-color: #d7cffb;
  background: var(--brand-soft);
}

.queue-resource-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #fdfdfe;
}

.queue-resource-cell {
  min-width: 0;
  min-height: 82px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 11px 12px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.queue-resource-cell::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--emerald);
}

.queue-resource-cell.state-running::before { background: var(--blue); }
.queue-resource-cell.state-queued::before { background: var(--amber); }
.queue-resource-cell.state-warning::before { background: var(--red); }

.queue-resource-top,
.queue-resource-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.queue-resource-top strong {
  min-width: 0;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-state-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(18, 169, 124, 0.1);
}

.state-running .queue-state-dot {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(76, 111, 255, 0.1);
}

.state-queued .queue-state-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(237, 132, 62, 0.1);
}

.state-warning .queue-state-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(210, 75, 111, 0.1);
}

.queue-resource-holder {
  min-width: 0;
  margin-top: 7px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-resource-cell.state-idle .queue-resource-holder {
  color: var(--emerald);
}

.queue-resource-meta {
  justify-content: space-between;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 8px;
}

.queue-resource-meta span,
.queue-resource-meta time {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-board-jobs {
  padding: 0 15px 10px;
}

.queue-board-jobs-heading {
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.queue-board-jobs-heading > span {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.queue-board-jobs-heading strong {
  font-size: 11px;
}

.queue-board-jobs-heading small,
.queue-board-jobs-heading time {
  color: var(--muted);
  font-size: 8px;
}

.queue-job-list {
  border-top: 1px solid var(--line);
}

.queue-job-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 31px minmax(180px, 1fr) auto minmax(88px, auto) 14px;
  align-items: center;
  gap: 10px;
  padding: 8px 3px;
  color: inherit;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.queue-job-row:hover {
  background: #faf9ff;
}

.queue-job-icon {
  width: 29px;
  height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  border-radius: 6px;
  background: var(--blue-soft);
}

.queue-job-row.state-queued .queue-job-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.queue-job-row.state-warning .queue-job-icon {
  color: var(--red);
  background: var(--red-soft);
}

.queue-job-icon svg {
  width: 14px;
  height: 14px;
}

.queue-job-copy,
.queue-job-copy strong,
.queue-job-copy span,
.queue-job-state,
.queue-job-state strong,
.queue-job-state time {
  min-width: 0;
  display: block;
}

.queue-job-copy strong {
  font-size: 10px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-job-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-job-resources {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.queue-job-resources span {
  padding: 3px 5px;
  color: var(--ink-soft);
  font-size: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  white-space: nowrap;
}

.queue-job-state {
  text-align: right;
}

.queue-job-state strong {
  color: var(--blue);
  font-size: 9px;
}

.queue-job-row.state-queued .queue-job-state strong { color: var(--amber); }
.queue-job-row.state-warning .queue-job-state strong { color: var(--red); }

.queue-job-state time {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  white-space: nowrap;
}

.queue-job-arrow {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
}

.queue-inline-empty {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 9px;
}

.queue-inline-empty svg {
  width: 15px;
  height: 15px;
  color: var(--emerald);
}

.queue-more-button {
  width: 100%;
  min-height: 32px;
  color: var(--brand);
  font-size: 9px;
  border: 0;
  background: transparent;
}

.business-queue-note {
  min-width: 0;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding: 7px 9px;
  color: #365bd8;
  border-left: 3px solid var(--blue);
  border-radius: 4px;
  background: var(--blue-soft);
}

.business-queue-note.state-queued {
  color: #a85b25;
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.business-queue-note.state-warning {
  color: #bd3457;
  border-left-color: var(--red);
  background: var(--red-soft);
}

.business-queue-note > svg {
  width: 16px;
  height: 16px;
  justify-self: center;
}

.business-queue-note > span,
.business-queue-note strong,
.business-queue-note small {
  min-width: 0;
  display: block;
}

.business-queue-note strong {
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business-queue-note small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-panel > .business-queue-note {
  margin: 12px 16px 0;
}

.queue-detail-resources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.queue-detail-resources .queue-resource-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.queue-job-list-detail .queue-job-row {
  grid-template-columns: 31px minmax(0, 1fr) minmax(82px, auto) 14px;
}

.queue-job-list-detail .queue-job-resources {
  display: none;
}

.status-badge.status-queued {
  color: #a85b25;
  border-color: #f3cfb4;
  background: var(--amber-soft);
}

.status-badge.status-queued .status-dot,
.status-dot.status-queued {
  background: var(--amber);
}

@media (max-width: 980px) {
  .queue-board-header {
    grid-template-columns: 42px minmax(180px, 1fr) auto;
  }

  .queue-board-stats {
    display: none;
  }

  .queue-resource-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .browser-queue-board {
    margin-top: 10px;
  }

  .queue-board-header {
    min-height: 74px;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px;
  }

  .queue-board-icon {
    width: 35px;
    height: 35px;
  }

  .queue-board-title strong {
    font-size: 14px;
  }

  .queue-board-title > span {
    font-size: 8px;
  }

  .queue-board-actions {
    gap: 4px;
  }

  .queue-board-actions .icon-button {
    width: 32px;
    height: 32px;
  }

  .queue-board-actions [data-browser-queue-action="detail"] {
    display: none;
  }

  .queue-resource-strip {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .queue-resource-strip::-webkit-scrollbar {
    display: none;
  }

  .queue-resource-cell {
    min-width: 132px;
    flex: 0 0 132px;
    scroll-snap-align: start;
    border-bottom: 0;
  }

  .queue-board-jobs {
    padding: 0 10px 8px;
  }

  .queue-board-jobs-heading {
    min-height: 42px;
  }

  .queue-job-row {
    min-height: 60px;
    grid-template-columns: 29px minmax(0, 1fr) minmax(72px, auto) 12px;
    gap: 8px;
  }

  .queue-job-resources {
    display: none;
  }

  .queue-job-copy strong {
    font-size: 9px;
  }

  .queue-job-copy span {
    font-size: 8px;
  }

  .queue-job-state strong,
  .queue-job-state time {
    font-size: 8px;
  }

  .business-queue-note {
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 7px 8px;
  }

  .queue-detail-resources {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .queue-detail-resources::-webkit-scrollbar {
    display: none;
  }

  .queue-detail-resources .queue-resource-cell {
    min-width: 142px;
    flex: 0 0 142px;
  }
}

@media (max-width: 360px) {
  .queue-board-title small {
    display: none;
  }

  .queue-board-title strong {
    margin-top: 0;
  }

  .queue-board-actions .icon-button {
    width: 30px;
    height: 30px;
  }

  .queue-job-row {
    grid-template-columns: 27px minmax(0, 1fr) 66px 10px;
    gap: 6px;
  }
}

.primary-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid var(--brand);
  border-radius: 6px;
  color: #ffffff;
  background: var(--brand);
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease;
}

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

.primary-button:active {
  transform: translateY(1px);
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px 20px;
  color: #d7ded9;
  border-right: 1px solid #252d29;
  background: var(--sidebar);
}

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

.brand > div:last-child {
  min-width: 0;
}

.brand strong {
  display: block;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.brand span {
  display: block;
  margin-top: 1px;
  color: #77847d;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.main-nav {
  display: grid;
  gap: 5px;
}

.main-nav::before {
  content: "工作区";
  display: block;
  padding: 0 11px 8px;
  color: #69756f;
  font-size: 10px;
  font-weight: 800;
}

.nav-button {
  position: relative;
  width: 100%;
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  color: #98a39d;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-weight: 650;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.nav-button::before {
  content: "";
  position: absolute;
  left: -19px;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}

.nav-button:hover {
  color: #ffffff;
  background: #171e1b;
}

.nav-button.active {
  color: #ffffff;
  border-color: #29332e;
  background: #1d2622;
}

.nav-button.active::before {
  background: #28b384;
}

.nav-button.active svg {
  color: #5bd2a9;
}

.nav-icon-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.nav-badge {
  position: absolute;
  top: -7px;
  right: -12px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  color: #ffffff;
  border: 2px solid var(--sidebar);
  border-radius: 9px;
  background: var(--red);
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
}

.nav-badge[hidden] {
  display: none;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.sidebar-system-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--sidebar-line);
  border-radius: 7px;
  background: var(--sidebar-soft);
}

.sidebar-system-label {
  color: #718079;
  font-size: 10px;
  font-weight: 800;
}

.sidebar-system-card strong {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #eaf0ec;
  font-size: 12px;
}

.sidebar-system-card > span:last-child {
  color: #7d8983;
  font-size: 10px;
  line-height: 1.45;
}

.connection-state {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  color: #8d9993;
  font-size: 11px;
}

.connection-state.online {
  color: #a7d9c7;
}

.connection-dot,
.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #8b9590;
}

.connection-state.online .connection-dot,
.sidebar-system-card .connection-dot,
.mobile-connection-state.online .connection-dot,
.status-dot.status-healthy,
.status-dot.status-success {
  background: #26a878;
  box-shadow: 0 0 0 3px rgba(38, 168, 120, 0.12);
}

.status-dot.status-running {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 228, 0.12);
}

.status-dot.status-warning {
  background: var(--amber);
}

.status-dot.status-error {
  background: var(--red);
}

.sidebar-action {
  width: 100%;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 11px;
  color: #87928c;
  border-color: transparent;
  background: transparent;
}

.sidebar-action:hover {
  color: #ffffff;
  border-color: #303a35;
  background: #1a211e;
}

.main-content {
  min-width: 0;
  padding: 0 32px 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 -32px 0;
  padding: 15px 32px;
  border-bottom: 1px solid rgba(201, 209, 204, 0.82);
  background: rgba(240, 243, 241, 0.96);
  backdrop-filter: blur(14px);
}

.page-context {
  min-width: 180px;
}

.eyebrow,
.operations-kicker,
.detail-overline {
  margin: 0 0 2px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.page-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.access-badge {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: #215d99;
  border: 1px solid #bed7ef;
  border-radius: 5px;
  background: #edf6ff;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.access-badge[hidden] {
  display: none;
}

.access-badge.readonly {
  color: #725619;
  border-color: #e5d39b;
  background: #fff8e4;
}

.access-badge svg {
  width: 13px;
  height: 13px;
}

.global-search {
  width: min(28vw, 330px);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 1px 1px rgba(18, 23, 20, 0.03);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.global-search:focus-within,
.global-search.focused {
  border-color: #71a894;
  box-shadow: 0 0 0 3px rgba(7, 132, 94, 0.1);
}

.global-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 13px;
}

.global-search input::placeholder {
  color: #9ca5a0;
}

.global-search kbd {
  min-width: 27px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #7e8882;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
  font-family: inherit;
  font-size: 10px;
}

.global-search-trigger {
  display: none;
}

.last-refresh {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.mobile-connection-state {
  display: none;
}

.icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.icon-button:hover {
  color: var(--brand);
  border-color: #a9c8bb;
  background: var(--surface-tint);
}

.icon-button.spinning svg {
  animation: spin 700ms linear infinite;
}

.sidebar .sidebar-action {
  width: 100%;
  height: 42px;
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 11px;
  color: #87928c;
  border-color: transparent;
  background: transparent;
}

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

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  color: #ffffff;
  border: 2px solid var(--canvas);
  border-radius: 10px;
  background: var(--red);
  font-size: 9px;
  font-weight: 800;
}

.view {
  display: none;
  width: min(100%, 1500px);
  margin: 0 auto;
  padding-top: 24px;
}

.view.active {
  display: block;
  animation: view-in 180ms ease-out;
}

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

.operations-banner {
  min-height: 124px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 24px 26px;
  color: #e9f1ed;
  border: 1px solid #26302b;
  border-radius: var(--radius);
  background: #151c19;
  box-shadow: var(--shadow-sm);
}

.operations-banner.has-attention {
  border-color: #4c3d26;
  background: #1c1b17;
}

.operations-status-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #73ddba;
  border: 1px solid #315b4c;
  border-radius: 7px;
  background: #1d2c26;
}

.has-attention .operations-status-icon {
  color: #e5b65f;
  border-color: #58482d;
  background: #292318;
}

.operations-status-icon svg {
  width: 26px;
  height: 26px;
}

.operations-copy h2 {
  margin: 1px 0 4px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 680;
}

.operations-copy p {
  margin: 0;
  color: #91a19a;
  font-size: 13px;
}

.operations-kicker {
  color: #6dc9aa;
}

.has-attention .operations-kicker {
  color: #d6a44b;
}

.banner-action {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  color: #eaf2ee;
  border: 1px solid #3a4741;
  border-radius: 6px;
  background: #202925;
  font-weight: 650;
}

.banner-action:hover {
  border-color: #5c6d65;
  background: #28322e;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.summary-cell {
  position: relative;
  min-width: 0;
  min-height: 116px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 19px 20px;
  border-right: 1px solid var(--line);
}

.summary-cell:last-child {
  border-right: 0;
}

.summary-cell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--brand);
}

.summary-cell.tone-running::before { background: var(--blue); }
.summary-cell.tone-attention::before { background: var(--amber); }
.summary-cell.tone-conversation::before { background: #287f9b; }
.summary-cell.tone-device::before { background: #6d7771; }

.summary-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  color: var(--brand);
  border-radius: 6px;
  background: var(--brand-soft);
}

.tone-running .summary-icon { color: var(--blue); background: var(--blue-soft); }
.tone-attention .summary-icon { color: var(--amber); background: var(--amber-soft); }
.tone-conversation .summary-icon { color: #1d728d; background: #e5f3f7; }
.tone-device .summary-icon { color: #56615b; background: #edf0ee; }

.summary-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 8px;
}

.summary-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.summary-value {
  grid-row: 2;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.12;
  font-weight: 700;
}

.summary-meta {
  grid-row: 3;
  grid-column: 1 / -1;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smart-pulse-band {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(320px, 1.22fr);
  margin-top: 8px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.smart-pulse-item {
  min-width: 0;
  min-height: 66px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: inherit;
  border: 0;
  background: transparent;
  text-align: left;
}

.smart-pulse-item + .smart-pulse-item {
  border-left: 1px solid var(--line);
}

button.smart-pulse-item:hover {
  background: #f7faf9;
}

.smart-pulse-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #287f9b;
  border-radius: 6px;
  background: #e8f3f6;
}

.smart-pulse-icon svg {
  width: 16px;
  height: 16px;
}

.smart-pulse-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.smart-pulse-copy small,
.smart-pulse-copy strong,
.smart-pulse-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-pulse-copy small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.smart-pulse-copy strong {
  color: var(--ink-soft);
  font-size: 11px;
}

.smart-pulse-copy span {
  color: var(--muted-2);
  font-size: 9px;
}

.smart-pulse-arrow {
  width: 15px;
  height: 15px;
  color: var(--muted-2);
}

.smart-pulse-item.tone-danger .smart-pulse-icon { color: var(--red); background: var(--red-soft); }
.smart-pulse-item.tone-warning .smart-pulse-icon { color: var(--amber); background: var(--amber-soft); }
.smart-pulse-item.tone-active .smart-pulse-icon { color: var(--blue); background: var(--blue-soft); }
.smart-pulse-item.tone-healthy .smart-pulse-icon { color: var(--brand); background: var(--brand-soft); }

.machine-band {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
}

.machine-band-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.machine-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.machine-pill strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.attention-bar {
  min-height: 58px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 14px;
  color: #69470f;
  border: 1px solid #eed7ac;
  border-radius: 7px;
  background: #fff9ed;
}

.attention-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--amber);
  border-radius: 6px;
  background: var(--amber-soft);
}

.attention-bar div {
  min-width: 0;
  display: grid;
}

.attention-bar strong {
  font-size: 12px;
}

.attention-bar div span {
  color: #96733b;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attention-bar button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: #765114;
  border: 0;
  border-radius: 5px;
  background: #f5e4c2;
  font-size: 11px;
  font-weight: 700;
}

.attention-bar button svg {
  width: 14px;
  height: 14px;
}

.dashboard-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(330px, 0.76fr) minmax(420px, 1.24fr);
  gap: 18px;
  margin-top: 22px;
  align-items: start;
}

.task-column,
.detail-panel,
.log-catalog,
.log-panel,
.thread-browser,
.command-composer,
.device-list,
.activity-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.task-column {
  min-width: 0;
  overflow: hidden;
}

.section-heading,
.section-toolbar,
.log-panel-header,
.detail-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-heading {
  min-height: 72px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.section-toolbar h2,
.log-panel-header h3,
.detail-section-heading h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.section-heading > div:first-child > span,
.detail-section-heading > span,
.log-panel-actions > span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.segmented-control button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.segmented-control button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(18, 23, 20, 0.1);
}

.task-tools {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 17px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 10px;
}

.compact-select {
  position: relative;
  display: flex;
  align-items: center;
}

.compact-select select {
  height: 32px;
  padding: 0 29px 0 10px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  appearance: none;
  font-size: 10px;
}

.compact-select svg {
  position: absolute;
  right: 9px;
  width: 13px;
  height: 13px;
  pointer-events: none;
}

.task-list {
  display: grid;
}

.task-card {
  position: relative;
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 16px 17px;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background 150ms ease;
}

.task-card:last-child {
  border-bottom: 0;
}

.task-card::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}

.task-card:hover {
  background: #fafcfb;
}

.task-card.selected {
  background: #f2f8f5;
}

.task-card.selected::before {
  background: var(--brand);
}

.task-card-top,
.task-identity,
.task-card-state,
.task-card-footer {
  min-width: 0;
  display: flex;
  align-items: center;
}

.task-card-top,
.task-card-footer {
  justify-content: space-between;
  gap: 10px;
}

.task-identity {
  gap: 11px;
}

.task-icon {
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.task-identity > span:last-child {
  min-width: 0;
}

.task-identity strong,
.task-identity > span:last-child > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-identity strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.task-identity > span:last-child > span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.task-card-state {
  flex: 0 0 auto;
  gap: 5px;
}

.task-card-state > svg {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 13px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge .status-dot {
  width: 6px;
  height: 6px;
  flex-basis: 6px;
}

.status-healthy,
.status-success {
  color: #076945;
  background: var(--brand-soft);
}

.status-running {
  color: #2257aa;
  background: var(--blue-soft);
}

.status-warning,
.status-idle {
  color: #81560f;
  background: var(--amber-soft);
}

.status-error {
  color: #9f2938;
  background: var(--red-soft);
}

.status-unknown {
  color: #5e6963;
  background: #ecefed;
}

.task-headline {
  display: block;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 2px;
  background: #e6ebe8;
  appearance: none;
  -webkit-appearance: none;
}

.progress-track::-webkit-progress-bar {
  border-radius: inherit;
  background: #e6ebe8;
}

.progress-track::-webkit-progress-value {
  border-radius: inherit;
  background: var(--brand);
  transition: width 300ms ease;
}

.progress-track::-moz-progress-bar {
  border-radius: inherit;
  background: var(--brand);
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 300ms ease;
}

.task-card-footer {
  color: var(--muted-2);
  font-size: 10px;
}

.task-card-footer span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card-footer span:last-child {
  flex: 0 0 auto;
}

.detail-panel {
  min-width: 0;
  overflow: hidden;
}

.detail-header {
  padding: 20px 22px 18px;
  color: #eaf1ed;
  background: #161d1a;
}

.detail-title-row,
.detail-title-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-title-actions {
  justify-content: flex-end;
}

.detail-overline {
  color: #64c8a6;
}

.detail-title-row h2 {
  margin: 3px 0 0;
  color: #ffffff;
  font-size: 19px;
  font-weight: 680;
}

.detail-close {
  display: none;
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  color: #c2cdc7;
  border-color: #39453f;
  background: #202925;
}

.detail-headline {
  margin: 13px 0 10px;
  color: #aab7b0;
  font-size: 13px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #829089;
  font-size: 10px;
}

.detail-meta span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.detail-meta svg {
  width: 13px;
  height: 13px;
}

.detail-actions {
  min-height: 54px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.detail-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--ink-soft);
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
}

.detail-actions button:last-child {
  border-right: 0;
}

.detail-actions button:hover {
  color: var(--brand);
  background: var(--surface-tint);
}

.detail-actions svg {
  width: 15px;
  height: 15px;
}

.detail-progress {
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}

.progress-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
}

.progress-labels strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.metric-item {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.metric-item:last-child {
  border-right: 0;
}

.metric-item span,
.metric-item strong {
  display: block;
}

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

.metric-item strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}

.error-block,
.warning-block {
  margin: 16px 22px 0;
  padding: 12px 14px;
  border-left: 3px solid var(--red);
  border-radius: 0 5px 5px 0;
  color: #8f2734;
  background: var(--red-soft);
  font-size: 11px;
}

.warning-block {
  color: #745017;
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.detail-section {
  padding: 18px 22px 20px;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
}

.detail-section-heading {
  margin-bottom: 12px;
}

.store-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.store-table th,
.store-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #e9edeb;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 700;
}

.store-table th:first-child { width: 44%; }

.store-name {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mini-log-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.mini-log {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #e9edeb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
}

.mini-log time {
  color: var(--muted-2);
}

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

.level-error .activity-level,
.mini-log.level-error span { color: var(--red); }
.level-warning .activity-level,
.mini-log.level-warning span { color: var(--amber); }
.level-success .activity-level,
.mini-log.level-success span { color: var(--brand); }

.detail-empty,
.empty-state,
.drawer-empty {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg,
.drawer-empty svg {
  width: 25px;
  height: 25px;
  color: var(--muted-2);
}

.empty-state strong,
.drawer-empty strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.empty-state span,
.drawer-empty span {
  font-size: 10px;
}

.activity-section {
  margin-top: 18px;
  overflow: hidden;
}

.activity-heading {
  min-height: 64px;
}

.text-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  color: var(--brand);
  border: 0;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.text-button svg {
  width: 14px;
  height: 14px;
}

.activity-feed {
  display: grid;
}

.activity-row {
  min-width: 0;
  min-height: 57px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 120px 70px 15px;
  align-items: center;
  gap: 10px;
  padding: 9px 17px;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.activity-row:last-child {
  border-bottom: 0;
}

.activity-row:hover {
  background: var(--surface-soft);
}

.activity-level {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--blue);
  border-radius: 6px;
  background: var(--blue-soft);
}

.activity-level svg {
  width: 14px;
  height: 14px;
}

.activity-main {
  min-width: 0;
}

.activity-main strong,
.activity-main span {
  display: block;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-main strong {
  font-size: 11px;
}

.activity-main span,
.activity-source,
.activity-row time {
  color: var(--muted);
  font-size: 10px;
}

.activity-row > svg {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}

.section-toolbar {
  min-height: 66px;
  margin-bottom: 14px;
}

.section-toolbar .eyebrow {
  margin-bottom: 1px;
}

.section-toolbar > div:first-child {
  min-width: 132px;
  flex: 0 0 auto;
}

.section-toolbar h2 {
  font-size: 19px;
}

.section-toolbar select {
  width: min(60vw, 640px);
  max-width: calc(100% - 150px);
  min-width: 190px;
  flex: 0 1 640px;
  height: 42px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.thread-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thread-new-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: #ffffff;
  border: 1px solid var(--brand);
  border-radius: 6px;
  background: var(--brand);
  font-size: 11px;
  font-weight: 750;
}

.thread-new-button:hover {
  background: var(--brand-strong);
}

.thread-new-button[aria-pressed="true"] {
  color: var(--ink-soft);
  border-color: var(--line-strong);
  background: var(--surface);
}

.thread-new-button svg {
  width: 14px;
  height: 14px;
}

.log-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
}

.log-catalog {
  min-width: 0;
  align-self: start;
  overflow: hidden;
}

.log-catalog-toolbar {
  display: grid;
  gap: 9px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.log-source-filter {
  width: 100%;
}

.log-source-filter button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  gap: 6px;
}

.log-source-filter button span {
  min-width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 4px;
  color: var(--muted);
  background: rgba(112, 122, 116, 0.1);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.log-source-filter button.active span {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.log-catalog-search {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.log-catalog-search svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.log-catalog-search input {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 11px;
}

.log-project-list {
  min-width: 0;
  max-height: calc(100vh - 285px);
  overflow-y: auto;
}

.log-project-item {
  width: 100%;
  min-height: 61px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.log-project-item:last-child {
  border-bottom: 0;
}

.log-project-item:hover,
.log-project-item.selected {
  background: var(--surface-tint);
}

.log-project-item.selected {
  box-shadow: inset 3px 0 var(--brand);
}

.log-project-main,
.log-project-side {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.log-project-main strong,
.log-project-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-project-main strong {
  font-size: 11px;
}

.log-project-main span,
.log-project-side {
  color: var(--muted);
  font-size: 9px;
}

.log-project-side {
  justify-items: end;
}

.log-project-side span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
}

.log-panel {
  min-width: 0;
  overflow: hidden;
}

.log-panel-header {
  min-height: 69px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.log-panel-header > div:first-child {
  min-width: 0;
}

.log-panel-header h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.log-history-more {
  min-height: 30px;
  padding: 0 6px;
}

.log-level-filter {
  margin: 12px 16px;
}

.log-table-wrap {
  min-width: 0;
  overflow: auto;
  border-top: 1px solid #2a332f;
  background: #121815;
}

.log-table {
  min-width: 760px;
  max-height: calc(100vh - 285px);
  overflow: auto;
  color: #c6d0ca;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
}

.log-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 112px 140px 105px minmax(260px, 1fr);
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #222a26;
}

.log-row:hover {
  background: #19201d;
}

.log-row time,
.log-source {
  color: #76827c;
}

.log-task {
  color: #8dd3bb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-message {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.log-row.level-error .log-message { color: #ff929d; }
.log-row.level-warning .log-message { color: #e9bd6b; }
.log-row.level-success .log-message { color: #7fdbbb; }

.control-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(300px, 0.76fr) minmax(420px, 1.24fr);
  gap: 16px;
}

.thread-browser,
.command-composer {
  min-width: 0;
  overflow: hidden;
}

.thread-sync-summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #f6faf8;
  font-size: 9px;
  font-weight: 650;
}

.thread-sync-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #24634e;
  font-weight: 750;
}

.thread-sync-live > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(35, 132, 98, 0.12);
}

.thread-search {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.thread-search svg {
  color: var(--muted);
}

.thread-search input {
  min-width: 0;
  flex: 1;
  height: 38px;
  border: 0;
  background: transparent;
}

.thread-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.thread-filter button {
  min-width: 0;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  font-size: 9px;
  font-weight: 700;
}

.thread-filter button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.thread-filter button.active {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 20, 19, 0.06);
}

.thread-filter button span {
  min-width: 18px;
  padding: 2px 5px;
  color: inherit;
  border-radius: 4px;
  background: rgba(16, 20, 19, 0.055);
  font-size: 8px;
}

.thread-list-heading {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 700;
}

.thread-list {
  max-height: calc(100vh - 274px);
  overflow: auto;
}

.thread-item {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.thread-item:hover,
.thread-item.selected {
  background: var(--surface-tint);
}

.thread-item.selected {
  box-shadow: inset 3px 0 var(--brand);
}

.thread-item-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.thread-item.selected .thread-item-icon {
  color: var(--brand);
  border-color: #b9d8cc;
  background: var(--brand-soft);
}

.thread-item-icon.paused,
.thread-item.selected .thread-item-icon.paused {
  color: #865f18;
  border-color: #e5cd8f;
  background: #fff5d9;
}

.thread-item-icon svg {
  width: 15px;
  height: 15px;
}

.thread-item-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.thread-item-copy strong,
.thread-item-copy > span {
  display: block;
  min-width: 0;
}

.thread-item-copy strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.38;
}

.thread-item-copy > span {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  color: var(--muted);
  font-size: 9px;
}

.thread-item-copy time {
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-sync-state {
  position: relative;
  padding-left: 8px;
  color: #54816f;
}

.thread-sync-state::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
  transform: translateY(-50%);
}

.thread-sync-state.archived {
  color: #707976;
}

.thread-sync-state.archived::before {
  background: #8b9491;
}

.thread-paused-state {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #865f18;
  font-weight: 750;
}

.thread-paused-state svg {
  width: 10px;
  height: 10px;
}

.thread-kind {
  padding: 2px 5px;
  color: #765a22;
  border-radius: 4px;
  background: #fff3d6;
  font-size: 8px;
  font-weight: 750;
}

.thread-queue-badge {
  min-width: 0;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  overflow: hidden;
  color: #876319;
  border: 1px solid #ead49a;
  border-radius: 4px;
  background: #fff8e6;
  font-size: 8px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.thread-queue-badge[hidden] {
  display: none;
}

.thread-queue-badge.running {
  color: #205f8d;
  border-color: #bcd8ea;
  background: #eef7fc;
}

.thread-queue-badge svg {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
}

.thread-queue-badge > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-queue-badge.running .lucide-loader-circle {
  animation: spin 900ms linear infinite;
}

.thread-item.has-active-queue .thread-item-icon {
  color: #286f9e;
  border-color: #bcd8ea;
  background: #eef7fc;
}

.thread-item-icon.archived {
  color: #707976;
  border-color: #d4d9d7;
  background: #f2f4f3;
}

.thread-item-chevron {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}

.selected-thread {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 17px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  background: #f2f8f5;
}

.thread-mobile-back {
  display: none;
}

.selected-thread-context {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.selected-thread-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  color: var(--brand);
  border: 1px solid #b9d8cc;
  border-radius: 6px;
  background: var(--brand-soft);
}

.selected-thread-icon svg {
  width: 17px;
  height: 17px;
}

.selected-thread-icon.archived {
  color: #66716d;
  border-color: #d0d6d3;
  background: #edf1ef;
}

.selected-thread-icon.paused {
  color: #865f18;
  border-color: #e5cd8f;
  background: #fff5d9;
}

.selected-thread-icon.create {
  color: #71541d;
  border-color: #e0c98e;
  background: #fff5d9;
}

.selected-thread-icon.create .lucide-loader-circle {
  animation: spin 900ms linear infinite;
}

.selected-thread-copy {
  min-width: 0;
}

.selected-thread-copy small,
.selected-thread-copy strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-thread-copy small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.selected-thread-copy strong {
  margin-top: 2px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.selected-thread-id {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 4px 4px 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.selected-thread-actions {
  min-width: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.selected-thread-actions > .thread-queue-badge {
  min-height: 28px;
  max-width: 150px;
  padding: 0 8px;
  font-size: 9px;
}

.thread-paused-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  color: #865f18;
  border: 1px solid #e5cd8f;
  border-radius: 5px;
  background: #fff8e6;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.thread-paused-badge svg {
  width: 11px;
  height: 11px;
}

.thread-pause-button {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #865f18;
  border: 1px solid #dfc57f;
  border-radius: 5px;
  background: #fff8e6;
}

.thread-pause-button:hover {
  color: #65450b;
  border-color: #c9a64d;
  background: #ffefc4;
}

.thread-pause-button.resume {
  color: #236a52;
  border-color: #afd1c4;
  background: #edf8f3;
}

.thread-pause-button.resume:hover {
  color: #15523d;
  border-color: #82b6a3;
  background: #dff2ea;
}

.thread-pause-button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.thread-pause-button svg {
  width: 14px;
  height: 14px;
}

.thread-pause-button .lucide-loader-circle {
  animation: spin 900ms linear infinite;
}

.is-readonly .thread-pause-button {
  display: none;
}

.selected-thread-id code {
  font-size: 9px;
}

.selected-thread-sync {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  color: #356b58;
  border: 1px solid #c9ddd5;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 9px;
  font-weight: 750;
}

.selected-thread-sync svg {
  width: 13px;
  height: 13px;
}

.copy-thread-id {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.copy-thread-id:hover {
  color: var(--brand);
  background: var(--surface-tint);
}

.copy-thread-id svg {
  width: 13px;
  height: 13px;
}

.command-composer {
  min-height: 620px;
  height: calc(100vh - 184px);
  display: flex;
  flex-direction: column;
}

.thread-chat-shell {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f4f7f5;
}

.thread-chat-toolbar {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.thread-history-more {
  min-height: 28px;
  padding: 0 7px;
  font-size: 9px;
}

.thread-history-more svg {
  width: 12px;
  height: 12px;
}

.thread-history-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 650;
}

.thread-history-status > span:first-child {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
}

.thread-chat {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 22px;
  scroll-behavior: smooth;
}

.thread-chat-empty,
.thread-chat-loading {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.thread-chat-empty svg,
.thread-chat-loading svg {
  width: 22px;
  height: 22px;
  color: #87a097;
}

.thread-chat-empty.error svg {
  color: var(--danger);
}

.thread-chat-loading svg {
  animation: spin 900ms linear infinite;
}

.thread-create-state {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 9px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.thread-create-state-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #71541d;
  border: 1px solid #e1cf9e;
  border-radius: 7px;
  background: #fff5d9;
}

.thread-create-state-icon svg {
  width: 19px;
  height: 19px;
}

.thread-create-state.status-queued .thread-create-state-icon svg,
.thread-create-state.status-claimed .thread-create-state-icon svg,
.thread-create-state.status-running .thread-create-state-icon svg {
  animation: spin 900ms linear infinite;
}

.thread-create-state.status-failed .thread-create-state-icon {
  color: var(--red);
  border-color: #ebc4ca;
  background: #fff0f2;
}

.thread-create-state strong {
  color: var(--ink);
  font-size: 13px;
}

.thread-create-state > span:not(.thread-create-state-icon),
.thread-create-state p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.thread-create-state p {
  max-width: min(520px, 90%);
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-height: 1.55;
}

.chat-day-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 14px;
}

.chat-day-marker span {
  padding: 3px 8px;
  color: var(--muted);
  border-radius: 4px;
  background: rgba(16, 20, 19, 0.055);
  font-size: 8px;
  font-weight: 700;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 15px;
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  color: var(--brand);
  border: 1px solid #c7d9d2;
  border-radius: 6px;
  background: #e8f1ed;
}

.chat-message.user .chat-avatar {
  color: #fff;
  border-color: #1e6f54;
  background: #267b5d;
}

.chat-avatar svg {
  width: 13px;
  height: 13px;
}

.chat-message-body {
  min-width: 0;
  max-width: min(84%, 660px);
}

.chat-message.user .chat-message-body {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
}

.chat-bubble {
  padding: 10px 12px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 3px 8px 8px 8px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(16, 20, 19, 0.045);
}

.chat-message.user .chat-bubble {
  color: #fff;
  border-color: #216f54;
  border-radius: 8px 3px 8px 8px;
  background: #287e5f;
  box-shadow: 0 3px 10px rgba(28, 105, 78, 0.13);
}

.chat-message.pending .chat-bubble {
  opacity: 0.72;
}

.chat-message.failed .chat-bubble {
  border-color: rgba(190, 53, 53, 0.28);
}

.chat-message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.62;
}

.chat-message footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
}

.chat-message.user footer {
  justify-content: flex-end;
}

.chat-phase {
  padding: 2px 5px;
  color: #64716c;
  border-radius: 4px;
  background: #e7ecea;
  font-weight: 700;
}

.chat-phase.completed {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #21684f;
  background: #dff0e8;
}

.chat-phase.pending {
  color: #7d683b;
  background: #f8edcf;
}

.chat-phase.failed {
  color: #9d2d2d;
  background: #f8dddd;
}

.chat-phase.paused {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #865f18;
  background: #f9edc8;
}

.chat-phase svg {
  width: 9px;
  height: 9px;
}

.chat-message.paused .chat-bubble {
  border-color: #e4cf98;
  background: #fffaf0;
}

.command-form {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

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

.command-form textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  line-height: 1.6;
}

.command-form textarea:focus {
  border-color: #74a996;
  box-shadow: 0 0 0 3px rgba(7, 132, 94, 0.09);
  background: var(--surface);
}

.chat-composer {
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 12px 14px 14px;
  background: var(--surface);
}

.chat-compose-entry {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.chat-compose-entry > label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.chat-compose-tools {
  min-height: 26px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-tool-button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 700;
}

.composer-tool-button:hover {
  color: var(--brand);
  border-color: #9dc9b9;
  background: #f0f8f5;
}

.composer-tool-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.composer-tool-button svg {
  width: 14px;
  height: 14px;
}

.attachment-limit {
  color: var(--muted-faint);
  font-size: 9px;
}

.thread-queue-hint {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  color: #386b8d;
  font-size: 8px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-queue-hint[hidden] {
  display: none;
}

.chat-composer.is-paused {
  border-top-color: #e5d4aa;
  background: #fffcf5;
}

.chat-composer.is-paused .thread-queue-hint {
  color: #865f18;
}

.chat-composer textarea:disabled {
  color: #786c53;
  border-color: #e3d7b9;
  background: #f7f3e9;
  cursor: not-allowed;
}

.thread-attachment-preview {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 3px;
}

.thread-attachment-preview[hidden] {
  display: none;
}

.thread-attachment-item {
  width: 142px;
  min-width: 142px;
  height: 56px;
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 4px 25px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.thread-attachment-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.thread-attachment-item figcaption {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.thread-attachment-item figcaption strong,
.thread-attachment-item figcaption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-attachment-item figcaption strong {
  color: var(--ink-soft);
  font-size: 9px;
}

.thread-attachment-item figcaption span {
  color: var(--muted);
  font-size: 8px;
}

.thread-attachment-item > button {
  width: 22px;
  height: 22px;
  position: absolute;
  top: 4px;
  right: 3px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.thread-attachment-item > button:hover {
  color: var(--danger);
  background: #fff0f2;
}

.thread-attachment-item > button svg {
  width: 13px;
  height: 13px;
}

.chat-composer textarea {
  min-height: 72px;
  max-height: 180px;
  resize: vertical;
  background: #f7f9f8;
}

.chat-composer .primary-button {
  min-width: 88px;
  height: 42px;
  margin-bottom: 1px;
}

.chat-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 136px));
  gap: 5px;
  margin-bottom: 7px;
}

.chat-image-grid.count-1 {
  grid-template-columns: minmax(0, 220px);
}

.chat-image-preview {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 5px;
  background: transparent;
  aspect-ratio: 4 / 3;
}

.chat-image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.chat-image-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  padding: 6px 8px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 700;
}

.chat-image-count svg {
  width: 14px;
  height: 14px;
}

.readonly-composer-note {
  min-height: 62px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  color: #725619;
  border-top: 1px solid #eadcb5;
  background: #fffaf0;
  font-size: 10px;
}

.readonly-composer-note[hidden] {
  display: none;
}

.readonly-composer-note svg {
  width: 18px;
  height: 18px;
}

.readonly-composer-note span {
  display: grid;
  gap: 2px;
}

.readonly-composer-note strong {
  color: #5d4616;
}

.delivery-details {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.delivery-details summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 15px;
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  list-style: none;
}

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

.delivery-details summary span {
  color: var(--ink-soft);
}

.delivery-summary-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink) !important;
  font-size: 10px;
}

.delivery-summary-title svg {
  width: 13px;
  height: 13px;
  color: var(--brand);
}

.delivery-details[open] .command-list {
  max-height: 260px;
  padding-top: 3px;
  border-top: 1px solid var(--line);
}

.command-composer > .detail-section-heading {
  padding: 15px 18px 10px;
}

.command-list {
  max-height: 440px;
  overflow: auto;
  padding: 0 18px 18px;
}

.command-card {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.command-card.command-queued,
.command-card.command-claimed,
.command-card.command-running {
  margin: 7px -8px 0;
  padding: 11px 8px;
  border: 1px solid #c9ddd5;
  border-radius: 6px;
  background: #f2f8f5;
}

.command-card.command-failed {
  border-left: 2px solid var(--red);
  padding-left: 9px;
}

.command-card.command-paused {
  margin: 7px -8px 0;
  padding: 11px 8px;
  border: 1px solid #e4cf98;
  border-radius: 6px;
  background: #fffaf0;
}

.command-card:last-child {
  border-bottom: 0;
}

.command-card-header,
.command-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.command-card-header {
  justify-content: space-between;
}

.command-kind {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.command-instruction {
  margin: 8px 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.command-meta {
  color: var(--muted);
  font-size: 9px;
}

.command-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.command-meta svg {
  width: 11px;
  height: 11px;
}

.command-result {
  margin-top: 10px;
  padding: 10px;
  border-left: 2px solid var(--brand);
  background: var(--surface-soft);
}

.command-result pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 9px;
}

.command-open-thread {
  margin-top: 7px;
  padding-right: 0;
  padding-left: 0;
}

.command-screenshot {
  display: block;
  max-width: 100%;
  margin-top: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.device-list {
  overflow: hidden;
}

.device-row {
  min-width: 0;
  min-height: 102px;
  display: grid;
  grid-template-columns: minmax(250px, 1.5fr) repeat(3, minmax(140px, 1fr));
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.device-row:last-child {
  border-bottom: 0;
}

.device-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.device-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  color: var(--brand);
  border-radius: 6px;
  background: var(--brand-soft);
}

.device-title > div {
  min-width: 0;
}

.device-title strong,
.device-title span,
.device-stat strong,
.device-stat span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-title strong,
.device-stat strong {
  font-size: 12px;
}

.device-title span,
.device-stat span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.drawer-backdrop,
.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 13, 10, 0.48);
  backdrop-filter: blur(3px);
}

.alert-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: min(430px, 92vw);
  height: 100%;
  color: var(--ink);
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -18px 0 50px rgba(8, 13, 10, 0.18);
  animation: drawer-in 180ms ease-out;
}

@keyframes drawer-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.drawer-header h2 {
  margin: 0;
  font-size: 18px;
}

.alert-list {
  max-height: calc(100vh - 82px);
  overflow: auto;
}

.alert-item {
  width: 100%;
  min-height: 88px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 11px;
  padding: 13px 17px;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.alert-item:hover {
  background: #fffaf1;
}

.alert-item-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--amber);
  border-radius: 6px;
  background: var(--amber-soft);
}

.alert-item-copy {
  min-width: 0;
}

.alert-item-copy strong,
.alert-item-copy span,
.alert-item-copy small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-item-copy strong { font-size: 12px; }
.alert-item-copy span { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.alert-item-copy small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.alert-item > svg { width: 14px; height: 14px; color: var(--muted-2); }

.detail-backdrop {
  z-index: 74;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 110;
  max-width: min(90vw, 420px);
  padding: 11px 15px;
  color: #ffffff;
  border: 1px solid #303b35;
  border-radius: 6px;
  background: #151c19;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

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

@media (max-width: 1180px) {
  :root { --sidebar-width: 210px; }
  .main-content { padding-left: 22px; padding-right: 22px; }
  .topbar { margin-left: -22px; margin-right: -22px; padding-left: 22px; padding-right: 22px; }
  .global-search { width: 240px; }
  .last-refresh { display: none; }
  .summary-cell { padding-left: 15px; padding-right: 15px; }
  .summary-meta { display: none; }
  .dashboard-grid { grid-template-columns: minmax(300px, 0.82fr) minmax(370px, 1.18fr); }
  .control-grid { grid-template-columns: minmax(280px, 0.82fr) minmax(370px, 1.18fr); }
}

@media (max-width: 960px) {
  :root { --sidebar-width: 82px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .brand > div:last-child,
  .main-nav::before,
  .nav-button span,
  .sidebar-system-card,
  .connection-state span:last-child,
  .sidebar-action-label { display: none; }
  .main-nav { gap: 7px; }
  .nav-button { justify-content: center; padding: 0; }
  .nav-button::before { left: -13px; }
  .connection-state { justify-content: center; padding: 0; }
  .sidebar-action { justify-content: center; padding: 0; }
  .topbar { min-height: 86px; }
  .page-subtitle { display: none; }
  .global-search { width: 210px; }
  .operations-banner { grid-template-columns: 48px minmax(0, 1fr) auto; padding: 20px; }
  .operations-status-icon { width: 48px; height: 48px; }
  .operations-copy h2 { font-size: 19px; }
  .summary-cell { min-height: 102px; gap: 10px; }
  .summary-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .summary-value { font-size: 25px; }
  .task-column .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }
  .task-column .segmented-control { width: 100%; }
  .task-column .segmented-control button { flex: 1; padding-right: 5px; padding-left: 5px; }
  .dashboard-grid { grid-template-columns: minmax(270px, 0.8fr) minmax(360px, 1.2fr); }
  .control-grid { grid-template-columns: minmax(275px, 0.8fr) minmax(370px, 1.2fr); }
  .task-column { max-height: none; }
  .log-workspace { grid-template-columns: 210px minmax(0, 1fr); }
  .log-table { min-width: 0; }
  .log-row { grid-template-columns: 78px 100px 72px minmax(0, 1fr); }
  .device-row { grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(110px, 1fr)); gap: 14px; }
}

@media (max-width: 820px) {
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .app-shell { display: block; min-height: auto; }
  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: 100%;
    height: calc(64px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: row;
    align-items: stretch;
    padding: 0 8px env(safe-area-inset-bottom);
    border-top: 1px solid #303834;
    border-right: 0;
    background: #111614;
    box-shadow: 0 -10px 30px rgba(10, 15, 12, 0.16);
  }
  .brand,
  .sidebar-system-card,
  .connection-state { display: none; }
  .main-nav {
    min-width: 0;
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
  }
  .nav-button {
    min-width: 0;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 4px 2px 2px;
    border: 0;
    border-radius: 0;
    color: #7f8a84;
    font-size: 9px;
    text-align: center;
  }
  .nav-button span { display: block; }
  .nav-button::before {
    top: 0;
    right: 22%;
    bottom: auto;
    left: 22%;
    width: auto;
    height: 2px;
    border-radius: 0 0 2px 2px;
  }
  .nav-button.active { border: 0; color: #ffffff; background: transparent; }
  .nav-button.active svg { color: #5ed2aa; }
  .nav-button svg { width: 19px; height: 19px; }
  .sidebar-footer {
    width: 58px;
    margin: 0;
    display: flex;
  }
  .sidebar .sidebar-action {
    width: 58px;
    height: auto;
    min-height: 60px;
    flex: 0 0 58px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 4px 0 2px;
    color: #7f8a84;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 9px;
  }
  .sidebar-action-label { display: block; }
  .sidebar-action svg { width: 19px; height: 19px; }
  .main-content { padding: 0 14px 24px; }
  .topbar {
    min-height: 74px;
    margin: 0 -14px;
    padding: 10px 14px;
    gap: 8px;
  }
  .page-context { min-width: 0; flex: 1; }
  .topbar h1 { font-size: 21px; }
  .topbar .eyebrow { font-size: 9px; }
  .topbar-actions { gap: 7px; }
  .global-search {
    width: 42px;
    flex: 0 0 42px;
    padding: 0;
    justify-content: center;
    background: var(--surface);
  }
  .global-search .search-leading,
  .global-search input,
  .global-search kbd { display: none; }
  .global-search-trigger {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--ink-soft);
    border: 0;
    border-radius: 5px;
    background: transparent;
  }
  .global-search.mobile-open {
    position: absolute;
    right: 14px;
    left: 14px;
    z-index: 2;
    width: auto;
    padding: 0 12px;
    justify-content: flex-start;
  }
  .global-search.mobile-open .search-leading,
  .global-search.mobile-open input { display: block; }
  .global-search.mobile-open input { width: auto; height: auto; opacity: 1; cursor: text; pointer-events: auto; }
  .global-search.mobile-open .global-search-trigger { display: none; }
  .notification-button,
  #refresh-button { width: 42px; height: 42px; flex-basis: 42px; }
  .mobile-connection-state,
  .last-refresh { display: none; }
  .view { padding-top: 14px; }
  .operations-banner {
    min-height: 138px;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 13px;
    padding: 18px;
  }
  .operations-status-icon { width: 42px; height: 42px; }
  .operations-status-icon svg { width: 22px; height: 22px; }
  .operations-copy h2 { font-size: 18px; }
  .operations-copy p { margin-top: 5px; font-size: 11px; }
  .banner-action {
    grid-column: 1 / -1;
    min-height: 40px;
    justify-content: space-between;
    margin-top: 2px;
  }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 10px; }
  .summary-cell { min-height: 96px; padding: 14px; border-bottom: 1px solid var(--line); }
  .summary-cell:nth-child(2) { border-right: 0; }
  .summary-cell:nth-child(3),
  .summary-cell:nth-child(4) { border-bottom: 0; }
  .summary-cell:nth-child(3) { border-right: 1px solid var(--line); }
  .summary-cell::before { right: 14px; left: 14px; }
  .summary-icon { width: 32px; height: 32px; flex-basis: 32px; }
  .summary-value { font-size: 24px; }
  .summary-label { font-size: 10px; }
  .summary-meta { display: none; }
  .machine-band { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .machine-band::-webkit-scrollbar { display: none; }
  .machine-band-title,
  .machine-pill { flex: 0 0 auto; }
  .attention-bar { grid-template-columns: 32px minmax(0, 1fr); }
  .attention-bar button { grid-column: 1 / -1; width: 100%; justify-content: space-between; }
  .dashboard-grid { margin-top: 14px; grid-template-columns: minmax(0, 1fr); }
  .section-heading {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
    padding: 14px;
  }
  .segmented-control { width: 100%; overflow-x: auto; }
  .segmented-control button { flex: 1 0 auto; min-height: 34px; }
  .task-tools { padding: 0 14px; }
  .task-card { padding: 15px 14px; }
  .detail-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 75;
    max-height: calc(92vh - env(safe-area-inset-bottom));
    margin: 0;
    border: 0;
    border-radius: 8px 8px 0 0;
    overflow-y: auto;
    transform: translateY(105%);
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms ease, opacity 180ms ease;
    box-shadow: 0 -24px 60px rgba(7, 13, 9, 0.28);
  }
  .detail-panel.mobile-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .detail-close { display: inline-flex; }
  .detail-header { position: sticky; top: 0; z-index: 2; padding: 17px 16px 14px; }
  .detail-title-row h2 { font-size: 17px; }
  .detail-meta { gap: 8px; }
  .detail-actions { position: sticky; top: 99px; z-index: 2; }
  .detail-progress,
  .detail-section { padding-left: 16px; padding-right: 16px; }
  .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-item { border-bottom: 1px solid var(--line); }
  .metric-item:nth-child(2) { border-right: 0; }
  .metric-item:nth-last-child(-n + 2) { border-bottom: 0; }
  .error-block,
  .warning-block { margin-left: 16px; margin-right: 16px; }
  .activity-section { margin-top: 14px; }
  .activity-heading { flex-direction: row; align-items: center; }
  .activity-row { grid-template-columns: 30px minmax(0, 1fr) 54px 14px; padding: 9px 14px; }
  .activity-source { display: none; }
  .activity-row time { text-align: right; }
  .section-toolbar { min-height: 55px; margin-bottom: 10px; }
  .section-toolbar h2 { font-size: 17px; }
  .section-toolbar select { min-width: 150px; max-width: 48vw; }
  .log-workspace { display: block; }
  .log-catalog { margin-bottom: 10px; }
  .log-catalog-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(138px, 0.8fr);
    align-items: center;
    padding: 8px;
  }
  .log-project-list {
    display: flex;
    gap: 8px;
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
  }
  .log-project-item {
    width: 172px;
    min-height: 58px;
    flex: 0 0 172px;
    border: 1px solid var(--line);
    border-radius: 6px;
    scroll-snap-align: start;
  }
  .log-project-item.selected { box-shadow: inset 0 3px var(--brand); }
  .log-panel-header { align-items: flex-start; gap: 8px; }
  .log-panel-actions { align-items: flex-end; flex-direction: column-reverse; gap: 0; }
  .log-history-more { min-height: 28px; padding-right: 0; }
  .log-level-filter { width: auto; margin: 10px; }
  .log-table-wrap { overflow-x: hidden; }
  .log-table { min-width: 0; max-height: none; }
  .log-row {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 4px 8px;
    padding: 10px 12px;
  }
  .log-task { grid-column: 2; grid-row: 1; }
  .log-source { grid-column: 1; grid-row: 2; }
  .log-message { grid-column: 2; grid-row: 2; }
  .control-grid { display: block; }
  .thread-list { max-height: calc(100dvh - 390px - env(safe-area-inset-bottom)); }
  .command-composer {
    display: none;
    min-height: 0;
    height: calc(100dvh - 146px - env(safe-area-inset-bottom));
    position: relative;
  }
  #view-control.thread-detail-open { padding-top: 8px; }
  #view-control.thread-detail-open .section-toolbar,
  #view-control.thread-detail-open .thread-browser { display: none; }
  #view-control.thread-detail-open .command-composer { display: flex; }
  .selected-thread { min-height: 62px; gap: 8px; padding: 8px 10px; }
  .thread-mobile-back {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface);
  }
  .thread-mobile-back svg { width: 16px; height: 16px; }
  .selected-thread-context { min-width: 0; flex: 1; gap: 8px; }
  .selected-thread-icon { width: 34px; height: 34px; flex-basis: 34px; }
  .selected-thread-id { display: none; }
  .selected-thread-actions { max-width: 42%; }
  .selected-thread-actions > .thread-queue-badge {
    max-width: 100%;
    min-height: 26px;
    padding: 0 7px;
    font-size: 8px;
  }
  .selected-thread-sync { min-height: 28px; padding: 0 7px; font-size: 8px; }
  .thread-chat-shell { min-height: 0; }
  .thread-chat { padding: 14px 12px 18px; }
  .chat-message-body { max-width: 86%; }
  .chat-composer { padding: 10px 11px 12px; }
  .command-form textarea { min-height: 150px; font-size: 16px; }
  .chat-composer textarea { min-height: 72px; max-height: 132px; }
  .chat-composer .primary-button { min-width: 76px; padding-right: 12px; padding-left: 12px; }
  .thread-new-button { min-height: 36px; padding: 0 10px; }
  .delivery-details[open] .command-list {
    position: absolute;
    right: 0;
    bottom: 38px;
    left: 0;
    z-index: 5;
    max-height: min(42dvh, 320px);
    padding-bottom: 12px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 -12px 28px rgba(16, 20, 19, 0.14);
  }
  .device-row {
    grid-template-columns: minmax(0, 1fr) minmax(95px, auto);
    gap: 13px;
    padding: 15px;
  }
  .device-stat:nth-child(3),
  .device-stat:nth-child(4) { padding-left: 54px; }
  .alert-drawer { width: min(420px, 100%); padding-bottom: env(safe-area-inset-bottom); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
  .login-panel-header { gap: 16px; }
  .login-system-state { font-size: 10px; }
  .global-search.mobile-open { right: 62px; }
  .global-search.mobile-open ~ .mobile-connection-state,
  .global-search.mobile-open ~ .last-refresh,
  .global-search.mobile-open ~ .notification-button { display: none; }
  .summary-cell { gap: 9px; padding: 13px 11px; }
  .summary-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .summary-value { font-size: 22px; }
  .task-tools > span { max-width: 44%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .compact-select select { max-width: 155px; }
  .task-headline { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .activity-row { grid-template-columns: 28px minmax(0, 1fr) 14px; }
  .activity-row time { display: none; }
  .activity-heading .text-button { font-size: 0; width: 36px; padding: 0; justify-content: center; }
  .activity-heading .text-button svg { width: 17px; height: 17px; }
  .section-toolbar select { min-width: 130px; }
  .log-catalog-toolbar { grid-template-columns: minmax(0, 1fr); }
  .device-row { grid-template-columns: minmax(0, 1fr); }
  .device-stat:nth-child(3),
  .device-stat:nth-child(4) { padding-left: 54px; }
}

@media (max-width: 820px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
    background: #f4f6f7;
  }

  .sidebar {
    height: calc(66px + env(safe-area-inset-bottom));
    padding: 0 5px env(safe-area-inset-bottom);
    border-top-color: #d9dee1;
    background: rgba(252, 253, 253, 0.97);
    box-shadow: 0 -8px 24px rgba(22, 31, 27, 0.1);
    backdrop-filter: blur(18px) saturate(150%);
  }

  .nav-button {
    min-height: 62px;
    gap: 2px;
    padding: 5px 2px 3px;
    color: #737d78;
    font-size: 10px;
    font-weight: 680;
  }

  .nav-button::before {
    display: none;
  }

  .nav-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    transition: color 150ms ease, background 150ms ease, transform 150ms ease;
  }

  .nav-button.active {
    color: #116d55;
  }

  .nav-button.active .nav-icon-wrap {
    color: #087b5b;
    background: #e3f3ec;
    transform: translateY(-1px);
  }

  .nav-button.active svg {
    color: #087b5b;
  }

  .nav-button svg {
    width: 18px;
    height: 18px;
  }

  .nav-badge {
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    border-color: #ffffff;
    font-size: 7px;
  }

  .sidebar-footer,
  .sidebar .sidebar-action {
    width: 50px;
  }

  .sidebar .sidebar-action {
    min-height: 62px;
    flex-basis: 50px;
    gap: 3px;
    padding-top: 5px;
    color: #89908d;
    font-size: 10px;
  }

  .sidebar .sidebar-action:hover {
    color: #b33b49;
    background: #fff1f2;
  }

  .main-content {
    padding: 0 12px 20px;
  }

  .topbar {
    min-height: 68px;
    position: sticky;
    top: 0;
    z-index: 45;
    margin: 0 -12px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(214, 221, 217, 0.94);
    background: rgba(250, 252, 251, 0.94);
    box-shadow: 0 4px 16px rgba(23, 34, 29, 0.045);
    backdrop-filter: blur(18px) saturate(150%);
  }

  .topbar h1 {
    font-size: 20px;
    line-height: 1.2;
  }

  .topbar .eyebrow {
    margin-bottom: 3px;
    color: #307662;
    font-size: 8px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .access-badge {
    width: 38px;
    min-height: 38px;
    justify-content: center;
    padding: 0;
  }

  .access-badge:not(.readonly),
  .access-badge span {
    display: none;
  }

  .global-search,
  .notification-button,
  #refresh-button {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-color: #d8dedb;
    background: #ffffff;
  }

  .global-search-trigger {
    width: 36px;
    height: 36px;
  }

  .view {
    padding-top: 12px;
  }

  .operations-banner {
    min-height: 126px;
    border-color: #2d3732;
    background: #171c1a;
    box-shadow: 0 10px 28px rgba(17, 24, 21, 0.13);
  }

  .summary-cell {
    min-height: 88px;
    padding: 12px;
  }

  .summary-value {
    font-size: 22px;
  }

  .smart-pulse-band {
    grid-template-columns: minmax(118px, 0.78fr) minmax(0, 1.22fr);
    margin-top: 8px;
  }

  .smart-pulse-item {
    min-height: 60px;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 7px 9px;
  }

  .smart-pulse-icon {
    width: 30px;
    height: 30px;
  }

  .smart-pulse-copy strong {
    font-size: 10px;
  }

  .smart-pulse-copy span {
    font-size: 8px;
  }

  .smart-pulse-item.freshness .smart-pulse-arrow,
  .smart-pulse-item.freshness .smart-pulse-copy span {
    display: none;
  }

  .machine-band {
    min-height: 42px;
    margin-top: 9px;
    border-color: #d8dedb;
    background: #fbfcfc;
  }

  .attention-bar {
    margin-top: 10px;
    border-color: #ead49c;
    background: #fff9ea;
  }

  .task-column,
  .detail-panel,
  .activity-section,
  .thread-browser,
  .command-composer,
  .log-catalog,
  .log-panel,
  .device-list {
    border-color: #d8dedb;
    box-shadow: 0 4px 16px rgba(23, 34, 29, 0.045);
  }

  .section-toolbar {
    min-height: 52px;
  }

  .thread-sync-summary {
    min-height: 32px;
    background: #f4faf7;
  }

  .thread-search {
    height: 50px;
  }

  .thread-filter {
    padding: 5px;
  }

  .thread-filter button {
    height: 31px;
    font-size: 10px;
  }

  .thread-list-heading {
    min-height: 32px;
  }

  .thread-list {
    max-height: calc(100dvh - 353px - env(safe-area-inset-bottom));
  }

  .thread-item {
    min-height: 68px;
    grid-template-columns: 36px minmax(0, 1fr) 14px;
    padding: 10px 12px;
  }

  .thread-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 7px;
  }

  .thread-item.selected {
    background: #edf7f2;
    box-shadow: inset 3px 0 #11805f;
  }

  .command-composer {
    height: calc(100dvh - 134px - env(safe-area-inset-bottom));
    border-radius: 0;
  }

  #view-control.thread-detail-open {
    padding-top: 0;
  }

  .selected-thread {
    min-height: 56px;
    padding: 7px 9px;
    background: #f3f8f6;
  }

  .thread-mobile-back {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 7px;
  }

  .selected-thread-icon {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .thread-chat-toolbar {
    min-height: 34px;
    padding: 0 10px;
  }

  .thread-chat {
    padding: 13px 10px 16px;
    background: #f5f7f7;
  }

  .chat-message {
    margin-bottom: 13px;
  }

  .chat-message-body {
    max-width: 90%;
  }

  .chat-message-text {
    font-size: 13px;
    line-height: 1.58;
  }

  .chat-bubble {
    padding: 9px 11px;
    border-color: #d9dfdc;
    box-shadow: 0 2px 7px rgba(20, 31, 26, 0.04);
  }

  .chat-message.user .chat-bubble {
    border-color: #1a7457;
    background: #20795a;
  }

  .chat-composer {
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
    padding: 8px 10px 9px;
    border-top: 1px solid #d9dfdc;
    background: #ffffff;
  }

  .chat-compose-entry {
    gap: 4px;
  }

  .chat-compose-entry > label {
    display: none;
  }

  .command-form textarea,
  .chat-composer textarea {
    min-height: 48px;
    max-height: 96px;
    padding: 9px 10px;
    border-color: #d7ddda;
    border-radius: 7px;
    background: #f8faf9;
    font-size: 16px;
    line-height: 1.45;
  }

  .chat-compose-tools {
    min-height: 28px;
  }

  .thread-queue-hint {
    max-width: 58vw;
    font-size: 8px;
  }

  .composer-tool-button {
    width: 32px;
    min-height: 28px;
    justify-content: center;
    padding: 0;
  }

  .composer-tool-button span {
    display: none;
  }

  .attachment-limit {
    margin-left: auto;
  }

  .chat-composer .primary-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 7px;
  }

  .chat-composer .primary-button span {
    display: none;
  }

  .thread-attachment-item {
    width: 128px;
    min-width: 128px;
  }

  .delivery-details summary {
    min-height: 34px;
    padding: 0 10px;
  }

  .readonly-composer-note {
    min-height: 54px;
    padding: 10px 12px;
  }

  .toast {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .main-content { padding-right: 10px; padding-left: 10px; }
  .topbar { margin-right: -10px; margin-left: -10px; padding-right: 10px; padding-left: 10px; }
  .topbar h1 { font-size: 18px; }
  .topbar-actions { gap: 4px; }
  .global-search,
  .notification-button,
  #refresh-button,
  .access-badge { width: 36px; height: 36px; flex-basis: 36px; }
  .summary-cell { padding: 10px; }
  .summary-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .nav-button { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* LNIEER gem console redesign · 2026-07-26 */
:root {
  --ink: #1d1d1f;
  --ink-soft: #4f5058;
  --muted: #74757d;
  --muted-2: #a0a1a8;
  --canvas: #f6f6f9;
  --surface: #ffffff;
  --surface-soft: #f7f7fa;
  --surface-tint: #f2f0ff;
  --line: #e6e6ec;
  --line-strong: #d7d7e1;
  --sidebar: #ffffff;
  --sidebar-soft: #f7f7fa;
  --sidebar-line: #e6e6ec;
  --brand: #6f5bff;
  --brand-strong: #5944ed;
  --brand-soft: #efecff;
  --blue: #4c6fff;
  --blue-soft: #edf1ff;
  --amber: #ed843e;
  --amber-soft: #fff1e7;
  --red: #ef476f;
  --red-soft: #ffedf2;
  --emerald: #12a97c;
  --emerald-soft: #e8f8f3;
  --shadow-sm: 0 2px 9px rgba(31, 29, 55, 0.045);
  --shadow-lg: 0 20px 55px rgba(31, 29, 55, 0.15);
  --radius: 8px;
}

html,
body {
  background: var(--canvas);
}

::selection {
  background: rgba(111, 91, 255, 0.18);
}

:focus-visible {
  outline-color: var(--brand);
}

.primary-button,
.thread-new-button {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 8px 20px rgba(111, 91, 255, 0.18);
}

.primary-button:hover,
.thread-new-button:hover {
  border-color: var(--brand-strong);
  background: var(--brand-strong);
}

.login-slide-model {
  width: 56%;
  object-fit: contain;
  object-position: 0 50%;
  transform: scale(0.9);
  transform-origin: left center;
}

.login-slide--right-subject .login-slide-model {
  object-position: 100% 50%;
}

.login-panel {
  right: clamp(22px, 3.6vw, 58px);
  width: min(326px, calc(100% - 44px));
}

.login-panel::before {
  inset: -7px;
  background: rgba(185, 173, 165, 0.56);
  filter: blur(7px);
}

.login-panel-inner {
  padding: 22px 22px 20px;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 64px rgba(34, 28, 48, 0.18);
  -webkit-backdrop-filter: blur(15px) saturate(1.08);
  backdrop-filter: blur(15px) saturate(1.08);
}

.login-brand-mark,
.brand-mark {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #ef476f 0%, #8a61ff 48%, #4c6fff 72%, #12a97c 100%);
  box-shadow: 0 6px 16px rgba(111, 91, 255, 0.22);
}

.login-brand-mark svg {
  color: #ffffff;
}

.login-intro > p,
.eyebrow,
.operations-kicker,
.detail-overline {
  color: var(--brand);
}

.login-form input:focus {
  border-color: rgba(111, 91, 255, 0.68);
  box-shadow: 0 0 0 3px rgba(111, 91, 255, 0.1);
}

.primary-button.login-submit {
  border-color: transparent;
  background: linear-gradient(100deg, #ef476f 0%, #7a5cff 45%, #4c6fff 72%, #12a97c 100%);
  background-size: 160% 100%;
  box-shadow: 0 10px 24px rgba(111, 91, 255, 0.24);
}

.app-shell {
  min-height: 100vh;
  display: block;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 60;
  width: 100%;
  height: 64px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 26px;
  padding: 0 max(24px, calc((100vw - 1380px) / 2 + 30px));
  color: var(--ink-soft);
  border: 0;
  border-bottom: 1px solid rgba(225, 225, 234, 0.9);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 12px rgba(30, 29, 55, 0.035);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
}

.sidebar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #ef476f 0 24%, #7a5cff 24% 50%, #4c6fff 50% 76%, #12a97c 76% 100%);
  opacity: 0.78;
  pointer-events: none;
}

.brand {
  min-width: 184px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 7px;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.brand strong {
  color: var(--ink);
  font-size: 16px;
}

.brand span {
  margin-top: 0;
  color: var(--muted-2);
  font-size: 9px;
}

.main-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav::before {
  display: none;
}

.nav-button {
  width: auto;
  min-width: 74px;
  min-height: 38px;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: #686971;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.nav-button::before {
  display: none;
}

.nav-button:hover {
  color: var(--ink);
  background: #f5f5f8;
}

.nav-button.active {
  color: var(--ink);
  border: 0;
  background: #f0eff5;
}

.nav-button.active svg {
  color: var(--brand);
}

.nav-button svg {
  width: 16px;
  height: 16px;
}

.nav-badge {
  top: -8px;
  right: -10px;
  border-color: #ffffff;
  background: var(--red);
}

.sidebar-footer {
  min-width: 0;
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-system-card {
  display: none;
}

.connection-state {
  min-height: 34px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 10px;
}

.connection-state.online {
  color: #25745d;
}

.sidebar .sidebar-action {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  justify-content: center;
  padding: 0;
  color: var(--muted);
  border: 0;
  border-radius: 7px;
}

.sidebar .sidebar-action:hover {
  color: var(--red);
  border: 0;
  background: var(--red-soft);
}

.sidebar-action-label {
  display: none;
}

.main-content {
  width: min(100%, 1380px);
  min-width: 0;
  margin: 0 auto;
  padding: 0 32px 52px;
}

.topbar {
  top: 64px;
  z-index: 45;
  min-height: 86px;
  margin: 0 -32px;
  padding: 13px 32px;
  border-bottom: 1px solid rgba(229, 229, 236, 0.88);
  background: rgba(246, 246, 249, 0.92);
  box-shadow: none;
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

.topbar h1 {
  font-size: 23px;
  font-weight: 720;
}

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

.global-search {
  width: min(29vw, 320px);
  border-color: var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}

.global-search:focus-within,
.global-search.focused {
  border-color: rgba(111, 91, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(111, 91, 255, 0.09);
}

.icon-button {
  border-color: var(--line);
  border-radius: 7px;
  box-shadow: var(--shadow-sm);
}

.icon-button:hover {
  color: var(--brand);
  border-color: #cbc4ff;
  background: var(--brand-soft);
}

.notification-count {
  border-color: var(--canvas);
  background: var(--red);
}

.view {
  width: min(100%, 1240px);
  padding-top: 20px;
}

.operations-banner {
  min-height: 132px;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 18px;
  padding: 22px 24px;
  color: var(--ink-soft);
  border: 1px solid #ddd8ff;
  border-top: 3px solid var(--brand);
  background: #f2f0ff;
  box-shadow: var(--shadow-sm);
}

.operations-banner.has-attention {
  border-color: #f4d7c5;
  border-top-color: var(--amber);
  background: #fff7f1;
}

.operations-status-icon {
  width: 50px;
  height: 50px;
  color: var(--brand);
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 7px 18px rgba(111, 91, 255, 0.12);
}

.has-attention .operations-status-icon {
  color: var(--amber);
  border: 0;
  background: #ffffff;
}

.operations-copy h2 {
  color: var(--ink);
  font-size: 22px;
}

.operations-copy p {
  color: #696775;
}

.operations-kicker,
.has-attention .operations-kicker {
  color: var(--brand);
}

.has-attention .operations-kicker {
  color: var(--amber);
}

.banner-action {
  color: #ffffff;
  border: 0;
  background: var(--brand);
  box-shadow: 0 8px 18px rgba(111, 91, 255, 0.18);
}

.has-attention .banner-action {
  background: var(--amber);
  box-shadow: 0 8px 18px rgba(237, 132, 62, 0.18);
}

.banner-action:hover {
  border: 0;
  background: var(--brand-strong);
}

.summary-strip {
  gap: 12px;
  margin-top: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.summary-cell {
  min-height: 112px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.summary-cell:last-child {
  border-right: 1px solid var(--line);
}

.summary-cell::before {
  right: 0;
  left: 0;
  height: 3px;
  border-radius: 8px 8px 0 0;
  background: var(--emerald);
}

.summary-cell.tone-running::before { background: var(--blue); }
.summary-cell.tone-attention::before { background: var(--amber); }
.summary-cell.tone-conversation::before { background: var(--brand); }
.summary-cell.tone-device::before { background: var(--red); }

.summary-icon {
  color: var(--emerald);
  background: var(--emerald-soft);
}

.tone-running .summary-icon { color: var(--blue); background: var(--blue-soft); }
.tone-attention .summary-icon { color: var(--amber); background: var(--amber-soft); }
.tone-conversation .summary-icon { color: var(--brand); background: var(--brand-soft); }
.tone-device .summary-icon { color: var(--red); background: var(--red-soft); }

.summary-value {
  font-size: 29px;
}

.smart-pulse-band {
  gap: 12px;
  margin-top: 12px;
  border: 0;
}

.smart-pulse-item {
  min-height: 66px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.smart-pulse-item + .smart-pulse-item {
  border-left: 1px solid var(--line);
}

button.smart-pulse-item:hover {
  border-color: #d6d0ff;
  background: #faf9ff;
}

.smart-pulse-icon {
  color: var(--blue);
  background: var(--blue-soft);
}

.smart-pulse-item.tone-danger .smart-pulse-icon { color: var(--red); background: var(--red-soft); }
.smart-pulse-item.tone-warning .smart-pulse-icon { color: var(--amber); background: var(--amber-soft); }
.smart-pulse-item.tone-active .smart-pulse-icon { color: var(--brand); background: var(--brand-soft); }
.smart-pulse-item.tone-healthy .smart-pulse-icon { color: var(--emerald); background: var(--emerald-soft); }

.machine-band {
  min-height: 48px;
  gap: 14px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.attention-bar {
  border-color: #f0d2a8;
  background: #fff8ed;
}

.attention-icon {
  color: var(--amber);
  background: var(--amber-soft);
}

.activity-section {
  margin-top: 14px;
}

.task-column,
.detail-panel,
.log-catalog,
.log-panel,
.thread-browser,
.command-composer,
.device-list,
.activity-section {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.section-toolbar {
  min-height: 62px;
  margin-bottom: 12px;
}

.section-toolbar h2 {
  font-size: 21px;
}

.section-status-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.section-status-note .connection-dot {
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(18, 169, 124, 0.12);
}

.dashboard-grid {
  grid-template-columns: minmax(340px, 0.82fr) minmax(440px, 1.18fr);
  gap: 14px;
  margin-top: 0;
}

.section-heading {
  min-height: 68px;
}

.segmented-control {
  border-color: var(--line);
  background: #f4f4f8;
}

.segmented-control button.active {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(31, 29, 55, 0.08);
}

.task-tools {
  border-color: var(--line);
  background: #fafafd;
}

.task-card:hover {
  background: #fafaff;
}

.task-card.selected {
  background: #f2f0ff;
}

.task-card.selected::before {
  background: var(--brand);
}

.task-icon {
  color: var(--brand);
  border-color: #e1ddff;
  background: var(--brand-soft);
}

.detail-header {
  color: var(--ink-soft);
  border-bottom: 1px solid #ddd8ff;
  background: #f2f0ff;
}

.detail-title-row h2 {
  color: var(--ink);
}

.detail-overline {
  color: var(--brand);
}

.detail-headline {
  color: #666574;
}

.detail-meta {
  color: #81808c;
}

.detail-close {
  color: var(--muted);
  border-color: #d8d3f7;
  background: rgba(255, 255, 255, 0.72);
}

.progress-fill {
  background: var(--brand);
}

.status-badge.status-healthy,
.status-badge.status-success {
  color: #08795a;
  border-color: #bce8d9;
  background: var(--emerald-soft);
}

.status-badge.status-running {
  color: #365bd8;
  border-color: #c9d5ff;
  background: var(--blue-soft);
}

.status-badge.status-warning {
  color: #a85b25;
  border-color: #f3cfb4;
  background: var(--amber-soft);
}

.status-badge.status-error {
  color: #bd3457;
  border-color: #fac8d4;
  background: var(--red-soft);
}

.activity-level {
  color: var(--brand);
  background: var(--brand-soft);
}

.text-button {
  color: var(--brand);
}

.log-workspace {
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
}

.log-catalog-toolbar,
.thread-filter {
  background: #f8f8fb;
}

.log-source-filter button.active span {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.log-project-item:hover,
.log-project-item.selected {
  background: var(--brand-soft);
}

.log-project-item.selected {
  box-shadow: inset 3px 0 var(--brand);
}

.log-table-wrap {
  border-top-color: var(--line);
  background: #ffffff;
}

.log-table {
  color: var(--ink-soft);
  background: #ffffff;
}

.log-row {
  border-bottom-color: #efeff3;
}

.log-row:hover {
  background: #f8f8fb;
}

.log-row time,
.log-source {
  color: var(--muted-2);
}

.log-task {
  color: var(--brand-strong);
}

.log-row.level-error .log-message { color: #bd3457; }
.log-row.level-warning .log-message { color: #a85b25; }
.log-row.level-success .log-message { color: #08795a; }

.control-grid {
  grid-template-columns: minmax(300px, 0.72fr) minmax(470px, 1.28fr);
  gap: 14px;
}

.thread-sync-summary {
  background: #f2fbf8;
}

.thread-sync-live {
  color: #147457;
}

.thread-sync-live > span {
  background: var(--emerald);
}

.thread-filter button.active {
  border-color: #ddd8ff;
  background: var(--brand-soft);
}

.thread-item.selected {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 var(--brand);
}

.selected-thread {
  background: #faf9ff;
}

.thread-chat {
  background: #f8f8fb;
}

.chat-message.user .chat-bubble {
  border-color: var(--brand);
  background: var(--brand);
}

.chat-composer .primary-button {
  box-shadow: none;
}

.device-icon {
  color: var(--brand);
  background: var(--brand-soft);
}

.drawer-backdrop,
.detail-backdrop {
  background: rgba(24, 22, 42, 0.36);
}

.toast {
  border-color: #373449;
  background: #242231;
}

@media (max-width: 1180px) and (min-width: 821px) {
  .sidebar {
    gap: 16px;
    padding-right: 20px;
    padding-left: 20px;
  }

  .brand {
    min-width: 158px;
  }

  .nav-button {
    min-width: 66px;
    padding-right: 9px;
    padding-left: 9px;
  }

  .connection-state span:last-child,
  .last-refresh {
    display: none;
  }
}

@media (max-width: 820px) {
  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
    background: #f6f6f9;
  }

  .login-stage,
  .login-view,
  .login-visual,
  .login-slide {
    background: #bdaea2;
  }

  .login-slide-model {
    width: 100%;
    height: 57svh;
    object-fit: contain;
    object-position: 50% 0;
  }

  .login-panel {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
    max-height: calc(100svh - 68px);
  }

  .login-panel-inner {
    padding: 13px 15px 14px;
    border-color: rgba(255, 255, 255, 0.68);
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 18px 45px rgba(31, 26, 45, 0.17);
    -webkit-backdrop-filter: blur(11px) saturate(1.04);
    backdrop-filter: blur(11px) saturate(1.04);
  }

  .login-intro {
    margin: 10px 0 9px;
  }

  .login-intro h1 {
    font-size: 23px;
  }

  .login-form input {
    height: 41px;
    background: rgba(255, 255, 255, 0.72);
  }

  .primary-button.login-submit {
    min-height: 41px;
  }

  .app-shell {
    display: block;
    min-height: auto;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    width: 100%;
    height: calc(68px + env(safe-area-inset-bottom));
    display: block;
    padding: 0 5px env(safe-area-inset-bottom);
    border: 0;
    border-top: 1px solid rgba(222, 222, 231, 0.94);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -8px 26px rgba(31, 29, 55, 0.08);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .sidebar::after {
    display: none;
  }

  .brand,
  .sidebar-system-card,
  .connection-state {
    display: none;
  }

  .main-nav {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
  }

  .nav-button {
    width: 100%;
    min-width: 0;
    min-height: 64px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 4px 1px 2px;
    color: #777882;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 10px;
    font-weight: 650;
  }

  .nav-button:hover,
  .nav-button.active {
    color: var(--brand-strong);
    border: 0;
    background: transparent;
  }

  .nav-icon-wrap {
    width: 32px;
    height: 30px;
    border-radius: 7px;
  }

  .nav-button.active .nav-icon-wrap {
    color: var(--brand);
    background: var(--brand-soft);
    transform: none;
  }

  .nav-button.active svg {
    color: var(--brand);
  }

  .nav-button svg {
    width: 18px;
    height: 18px;
  }

  .sidebar-footer {
    position: fixed;
    top: max(15px, env(safe-area-inset-top));
    right: 11px;
    z-index: 76;
    width: 38px;
    height: 38px;
    display: block;
    margin: 0;
  }

  .sidebar .sidebar-action {
    width: 38px;
    height: 38px;
    min-height: 38px;
    flex-basis: 38px;
    color: #777882;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
  }

  .sidebar-action-label {
    display: none;
  }

  .main-content {
    width: 100%;
    margin: 0;
    padding: 0 12px 22px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 55;
    min-height: 68px;
    margin: 0 -12px;
    padding: 8px 54px 8px 12px;
    border-bottom: 1px solid rgba(225, 225, 233, 0.92);
    background: rgba(250, 250, 252, 0.94);
    box-shadow: 0 4px 16px rgba(31, 29, 55, 0.035);
  }

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

  .topbar .eyebrow {
    margin-bottom: 2px;
    color: var(--brand);
    font-size: 8px;
  }

  .page-subtitle,
  .mobile-connection-state,
  .last-refresh,
  #refresh-button {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
  }

  .access-badge {
    width: 38px;
    min-height: 38px;
    justify-content: center;
    padding: 0;
  }

  .access-badge:not(.readonly),
  .access-badge span {
    display: none;
  }

  .global-search,
  .notification-button {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-color: var(--line);
    background: #ffffff;
  }

  .global-search {
    padding: 0;
    justify-content: center;
  }

  .global-search .search-leading,
  .global-search input,
  .global-search kbd {
    display: none;
  }

  .global-search-trigger {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .global-search.mobile-open {
    position: absolute;
    right: 53px;
    left: 12px;
    z-index: 4;
    width: auto;
    padding: 0 12px;
    justify-content: flex-start;
  }

  .global-search.mobile-open .search-leading,
  .global-search.mobile-open input {
    display: block;
  }

  .global-search.mobile-open input {
    width: auto;
    height: auto;
    opacity: 1;
    pointer-events: auto;
  }

  .global-search.mobile-open .global-search-trigger {
    display: none;
  }

  .view {
    width: 100%;
    padding-top: 12px;
  }

  .operations-banner {
    min-height: 122px;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
    border-top-width: 3px;
  }

  .operations-status-icon {
    width: 42px;
    height: 42px;
  }

  .operations-copy h2 {
    font-size: 18px;
  }

  .operations-copy p {
    margin-top: 4px;
    font-size: 11px;
  }

  .banner-action {
    grid-column: 1 / -1;
    min-height: 39px;
    justify-content: space-between;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
  }

  .summary-cell {
    min-height: 91px;
    gap: 9px;
    padding: 12px 11px;
    border: 1px solid var(--line);
  }

  .summary-cell:nth-child(2),
  .summary-cell:nth-child(3),
  .summary-cell:last-child {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .summary-cell::before {
    right: 0;
    left: 0;
  }

  .summary-icon {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }

  .summary-value {
    font-size: 23px;
  }

  .summary-label {
    font-size: 10px;
  }

  .summary-meta {
    display: none;
  }

  .smart-pulse-band {
    grid-template-columns: minmax(116px, 0.78fr) minmax(0, 1.22fr);
    gap: 8px;
    margin-top: 8px;
  }

  .smart-pulse-item {
    min-height: 61px;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 7px 8px;
  }

  .smart-pulse-icon {
    width: 30px;
    height: 30px;
  }

  .smart-pulse-copy strong {
    font-size: 10px;
  }

  .smart-pulse-copy span {
    font-size: 8px;
  }

  .smart-pulse-item.freshness .smart-pulse-arrow,
  .smart-pulse-item.freshness .smart-pulse-copy span {
    display: none;
  }

  .machine-band {
    min-width: 0;
    min-height: 42px;
    margin-top: 8px;
    padding: 0 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .machine-band::-webkit-scrollbar {
    display: none;
  }

  .machine-band-title,
  .machine-pill {
    flex: 0 0 auto;
  }

  .attention-bar {
    margin-top: 8px;
  }

  .activity-section {
    margin-top: 10px;
  }

  .section-toolbar {
    min-height: 52px;
    margin-bottom: 9px;
  }

  .section-toolbar h2 {
    font-size: 18px;
  }

  .section-status-note {
    font-size: 9px;
  }

  .dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 0;
  }

  .task-column .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .task-column .segmented-control {
    width: 100%;
    overflow-x: auto;
  }

  .task-column .segmented-control button {
    min-height: 33px;
    flex: 1 0 auto;
  }

  .detail-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    max-height: calc(92dvh - env(safe-area-inset-bottom));
    border: 0;
    border-radius: 8px 8px 0 0;
  }

  .task-card.selected {
    background: var(--brand-soft);
  }

  .log-workspace {
    display: block;
  }

  .log-catalog {
    margin-bottom: 9px;
  }

  .log-table {
    min-width: 0;
    max-height: none;
  }

  .log-row {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .control-grid {
    display: block;
  }

  .thread-list {
    max-height: calc(100dvh - 348px - env(safe-area-inset-bottom));
  }

  .command-composer {
    height: calc(100dvh - 136px - env(safe-area-inset-bottom));
    border-radius: 0;
  }

  #view-control.thread-detail-open {
    padding-top: 0;
  }

  .thread-chat {
    background: #f7f7fa;
  }

  .chat-message.user .chat-bubble {
    border-color: var(--brand);
    background: var(--brand);
  }

  .chat-composer .primary-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
  }

  .device-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .device-title {
    grid-column: 1 / -1;
  }

  .device-stat:nth-child(2),
  .device-stat:nth-child(3),
  .device-stat:nth-child(4) {
    padding-left: 0;
  }

  .device-stat:nth-child(4) {
    grid-column: 1 / -1;
  }

  .toast {
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  .main-content {
    padding-right: 10px;
    padding-left: 10px;
  }

  .topbar {
    margin-right: -10px;
    margin-left: -10px;
    padding-right: 52px;
    padding-left: 10px;
  }

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

  .nav-button {
    font-size: 9px;
  }

  .summary-cell {
    padding-right: 9px;
    padding-left: 9px;
  }
}

/* LNIEER premium login and mobile touch hardening · 2026-07-28 */
.login-view {
  overflow: auto;
  overscroll-behavior: none;
  background: #171a18;
}

.login-stage {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.34fr) minmax(390px, 0.66fr);
  overflow: visible;
  background: #171a18;
}

.login-visual {
  position: relative;
  inset: auto;
  min-height: 100vh;
  min-height: 100svh;
  background: #171a18;
}

.login-carousel-track {
  pointer-events: none;
}

.login-slide,
.login-stage .login-slide-model,
.login-stage .login-slide--right-subject .login-slide-model {
  background: #bdaea2;
}

.login-stage .login-slide-model,
.login-stage .login-slide--right-subject .login-slide-model {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  transform: none;
  -webkit-mask-image: none;
  mask-image: none;
}

.login-stage .login-slide--right-subject .login-slide-model {
  object-position: 50% 18%;
}

@media (min-width: 821px) {
  .login-stage .login-slide-model,
  .login-stage .login-slide--right-subject .login-slide-model {
    inset: 0 0 0 auto;
    width: min(82%, 820px);
  }
}

.login-visual::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 118px;
  z-index: 1;
  pointer-events: none;
  background: rgba(12, 14, 13, 0.34);
}

.login-visual figcaption {
  right: clamp(26px, 3.5vw, 54px);
  bottom: clamp(26px, 4vw, 48px);
  left: clamp(26px, 3.5vw, 54px);
  z-index: 3;
  justify-content: space-between;
  color: #ffffff;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.34);
}

.login-visual-brand strong {
  font-size: 16px;
  font-weight: 780;
}

.login-visual-brand span {
  color: rgba(255, 255, 255, 0.72);
}

.login-carousel-controls {
  position: relative;
  z-index: 4;
}

.login-carousel-dot {
  width: 34px;
  height: 40px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.login-carousel-dot::before {
  top: 18px;
  left: 12px;
  width: 8px;
  height: 2px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: none;
}

.login-carousel-dot.is-active::before {
  left: 6px;
  width: 22px;
  background: #d8b97c;
}

.login-panel {
  position: relative;
  inset: auto;
  z-index: 2;
  width: auto;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: clamp(36px, 5vw, 76px);
  overflow: visible;
  transform: none;
  background: #f4f1ea;
}

.login-panel::before {
  display: none;
}

.login-panel-inner {
  width: min(100%, 390px);
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.login-brand-mark {
  color: #d8b97c;
  border: 1px solid #2b302d;
  background: #171a18;
  box-shadow: none;
}

.login-brand-mark svg {
  color: #d8b97c;
}

.login-lockup strong {
  color: #171a18;
}

.login-lockup span {
  color: #84827c;
}

.login-system-state {
  color: #666861;
}

.login-intro {
  margin: clamp(34px, 5vh, 54px) 0 26px;
}

.login-intro > p {
  margin-bottom: 9px;
  color: #9b783f;
}

.login-intro h1 {
  color: #171a18;
  font-size: clamp(32px, 3vw, 42px);
  font-weight: 630;
  line-height: 1.12;
}

.login-intro-copy {
  gap: 3px;
  margin-top: 14px;
}

.login-intro-copy strong {
  color: #3d403c;
}

.login-intro-copy span {
  color: #777871;
}

.login-form {
  gap: 15px;
}

.login-form label {
  color: #42443f;
}

.login-form input {
  height: 50px;
  border-color: #d4d0c7;
  border-radius: 6px;
  background: #fbfaf7;
  box-shadow: none;
}

.login-form input:focus {
  border-color: #9b783f;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(155, 120, 63, 0.12);
}

.login-field > svg {
  top: 16px;
  color: #8b8a84;
}

.password-toggle {
  top: 5px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.password-toggle:hover {
  color: #171a18;
  background: #eeebe4;
}

.primary-button.login-submit {
  min-height: 50px;
  margin-top: 1px;
  border-color: #171a18;
  border-radius: 6px;
  background: #171a18;
  box-shadow: 0 12px 28px rgba(23, 26, 24, 0.17);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.primary-button.login-submit:hover {
  border-color: #2a2f2c;
  background: #2a2f2c;
}

.primary-button.login-submit svg {
  color: #d8b97c;
}

.login-footer {
  color: #9b9991;
}

button,
[role="button"],
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
[role="button"],
.nav-button,
.thread-item,
.task-card,
.log-project-item {
  touch-action: manipulation;
}

@media (max-width: 820px) {
  .login-view {
    background: #f4f1ea;
    -webkit-overflow-scrolling: touch;
  }

  .login-stage {
    min-height: 100svh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: clamp(236px, 40svh, 340px) auto;
    background: #f4f1ea;
  }

  .login-visual {
    grid-row: 1;
    min-height: 0;
    background: #171a18;
  }

  .login-stage .login-slide-model,
  .login-stage .login-slide--right-subject .login-slide-model {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 17%;
  }

  .login-visual::after {
    display: none;
  }

  .login-visual figcaption {
    top: max(12px, env(safe-area-inset-top));
    right: 16px;
    bottom: auto;
    left: 16px;
    min-height: 40px;
    color: #171a18;
    text-shadow: 0 1px 12px rgba(255, 255, 255, 0.42);
  }

  .login-visual-brand strong {
    font-size: 14px;
  }

  .login-visual-brand span {
    color: rgba(23, 26, 24, 0.66);
    font-size: 8px;
  }

  .login-carousel-dot::before {
    background: rgba(23, 26, 24, 0.34);
  }

  .login-carousel-dot.is-active::before {
    background: #9b783f;
  }

  .login-panel {
    grid-row: 2;
    min-height: 0;
    width: 100%;
    max-height: none;
    padding: 22px 20px calc(26px + env(safe-area-inset-bottom));
    overflow: visible;
    background: #f4f1ea;
  }

  .login-panel-inner {
    width: min(100%, 460px);
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .login-brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .login-system-state {
    font-size: 9px;
  }

  .login-intro {
    margin: 20px 0 18px;
  }

  .login-intro > p {
    display: block;
    margin-bottom: 5px;
    font-size: 8px;
  }

  .login-intro h1 {
    font-size: 29px;
  }

  .login-intro-copy {
    margin-top: 7px;
  }

  .login-intro-copy strong {
    font-size: 12px;
  }

  .login-intro-copy span {
    display: block;
    font-size: 10px;
  }

  .login-form {
    gap: 11px;
  }

  .login-form label {
    gap: 5px;
    font-size: 11px;
  }

  .login-form input {
    height: 48px;
    background: #fbfaf7;
  }

  .login-field > svg {
    top: 15px;
  }

  .password-toggle {
    top: 4px;
    width: 40px;
    height: 40px;
  }

  .primary-button.login-submit {
    min-height: 48px;
  }

  .login-footer {
    display: block;
    margin-top: 17px;
    font-size: 8px;
  }

  .sidebar,
  .main-nav,
  .nav-button,
  .sidebar-footer,
  .sidebar .sidebar-action,
  .topbar,
  .global-search-trigger,
  .notification-button,
  #refresh-button,
  .task-card,
  .detail-close,
  .log-project-item,
  .thread-item,
  .thread-mobile-back,
  .thread-new-button,
  .thread-pause-button,
  .composer-tool-button,
  .chat-composer .primary-button {
    pointer-events: auto;
  }

  .nav-button,
  .sidebar .sidebar-action,
  .global-search-trigger,
  .notification-button,
  #refresh-button,
  .detail-close,
  .thread-mobile-back,
  .composer-tool-button,
  .chat-composer .primary-button {
    min-width: 44px;
    min-height: 44px;
  }

  .thread-list,
  .thread-chat,
  .log-table,
  .task-list {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .command-composer {
    min-height: 0;
  }
}

@media (max-width: 380px) {
  .login-stage {
    grid-template-rows: clamp(270px, 43svh, 300px) auto;
  }

  .login-panel {
    padding-right: 16px;
    padding-left: 16px;
  }

  .login-intro {
    margin-top: 16px;
    margin-bottom: 14px;
  }

  .login-intro h1 {
    font-size: 27px;
  }

  .login-footer {
    margin-top: 13px;
  }
}

@media (max-width: 820px) and (max-height: 720px) {
  .login-panel {
    padding-top: 17px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .login-intro {
    margin-top: 12px;
    margin-bottom: 11px;
  }

  .login-intro-copy span,
  .login-footer {
    display: none;
  }

  .login-form {
    gap: 9px;
  }
}

/* Big-promo operational log hierarchy */
.log-source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-store-filter {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 16px 12px;
}

.log-store-filter-label {
  margin-right: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.log-store-filter button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  font-size: 10px;
  font-weight: 700;
}

.log-store-filter button:hover,
.log-store-filter button.active {
  color: var(--brand-strong);
  border-color: #9fd1bf;
  background: var(--brand-soft);
}

.log-store-filter button > span {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.log-store-filter .status-dot {
  width: 6px;
  height: 6px;
}

.log-table.promo-log-table {
  min-width: 0;
  color: var(--ink-soft);
  background: #fff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  font-size: 11px;
}

.promo-log-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  border-bottom: 1px solid #ecefef;
  background: #fff;
}

.promo-log-row:hover {
  background: #f8fbfa;
}

.promo-log-time {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
  padding: 13px 12px 12px 8px;
  color: var(--muted-2);
  border-right: 1px solid #eef1ef;
  font-variant-numeric: tabular-nums;
}

.promo-log-time time {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.promo-log-time span {
  font-size: 9px;
}

.promo-log-body {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 11px 14px 12px;
}

.promo-log-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.promo-store-badge,
.promo-task-badge,
.promo-stage-badge,
.promo-progress-badge,
.promo-outcome {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
}

.promo-task-badge {
  max-width: min(220px, 45vw);
  color: #4d4665;
  overflow: hidden;
  background: #f1eff8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promo-store-badge {
  color: #006d4d;
  background: #dcf2e9;
}

.promo-stage-badge {
  color: #4f5b55;
  background: #eef1ef;
}

.promo-progress-badge {
  color: #275eb9;
  background: #e8effc;
  font-variant-numeric: tabular-nums;
}

.promo-outcome {
  margin-left: auto;
}

.promo-outcome.outcome-success {
  color: #08795a;
  background: #e2f5ed;
}

.promo-outcome.outcome-warning {
  color: #96501f;
  background: #fff0db;
}

.promo-outcome.outcome-error {
  color: #b53250;
  background: #fdebed;
}

.promo-outcome.outcome-running,
.promo-outcome.outcome-info {
  color: #275eb9;
  background: #edf3ff;
}

.promo-product-line {
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}

.promo-product-line strong {
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.promo-product-line code {
  color: var(--muted);
  font-size: 10px;
}

.promo-log-message {
  min-width: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  line-height: 1.65;
}

.promo-log-message.is-readable {
  display: grid;
  gap: 3px;
  overflow-wrap: normal;
  white-space: normal;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  line-height: 1.45;
}

.promo-log-message.is-readable strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
}

.promo-log-message.is-readable span {
  color: var(--muted);
  font-size: 10px;
}

.promo-log-details {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
}

.promo-log-details summary {
  width: max-content;
  color: var(--muted-2);
  cursor: pointer;
  font-weight: 700;
  list-style-position: inside;
}

.promo-log-details[open] summary {
  margin-bottom: 6px;
}

.promo-log-details > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 6px;
  padding: 5px 0;
  border-top: 1px solid #eef1ef;
}

.promo-log-details code {
  min-width: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 9px;
  line-height: 1.5;
}

.promo-log-row.level-warning .promo-log-body {
  box-shadow: inset 3px 0 #e1a04b;
}

.promo-log-row.level-error .promo-log-body {
  box-shadow: inset 3px 0 #d25970;
}

.promo-log-row.level-success .promo-log-body {
  box-shadow: inset 3px 0 #4ab18d;
}

.thread-history-status.is-syncing > span:first-child {
  animation: history-pulse 1.1s ease-in-out infinite;
}

.thread-history-status.is-stale > span:first-child {
  background: var(--amber);
}

.thread-loading-bubbles {
  width: min(330px, 88%);
  display: grid;
  gap: 12px;
}

.thread-loading-bubbles span {
  height: 54px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e9eeeb 20%, #f5f7f6 50%, #e9eeeb 80%);
  background-size: 240% 100%;
  animation: history-shimmer 1.25s linear infinite;
}

.thread-loading-bubbles span:nth-child(1),
.thread-loading-bubbles span:nth-child(3) {
  width: 78%;
}

.thread-loading-bubbles span:nth-child(2) {
  width: 64%;
  justify-self: end;
}

@keyframes history-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes history-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 820px) {
  .log-store-filter {
    flex-wrap: nowrap;
    margin-right: 10px;
    margin-left: 10px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .log-store-filter::-webkit-scrollbar {
    display: none;
  }

  .log-store-filter-label,
  .log-store-filter button {
    flex: 0 0 auto;
  }

  .promo-log-row {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .promo-log-time {
    padding: 12px 8px 10px 4px;
  }

  .promo-log-time time {
    font-size: 9px;
  }

  .promo-log-time span {
    font-size: 8px;
  }

  .promo-log-body {
    gap: 6px;
    padding: 10px 10px 11px;
  }

  .promo-log-message.is-readable strong {
    font-size: 11px;
  }

  .promo-log-details > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .promo-outcome {
    margin-left: 0;
  }
}
