:root {
  --bg: #0f1115;
  --surface: #181b22;
  --border: #2a2f3a;
  --text: #e8eaed;
  --muted: #9aa0a8;
  --accent: #3d7dd6;
  --urgent: #c45c26;
  --readonly: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

.header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
}

.header-states {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.subtitle a {
  color: var(--accent);
  text-decoration: none;
}

.subtitle a:hover {
  text-decoration: underline;
}

.today-appeared {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.today-appeared strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.today-accepted-total {
  color: #8fd4a8;
}

.today-appeared-label {
  margin-left: 0.2rem;
  font-size: 0.8rem;
}

.last-fetched {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  font-family: ui-monospace, monospace;
  color: var(--muted);
}

.sound-unlock-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  z-index: 10000;
  margin: 0;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: rgba(30, 28, 18, 0.95);
  color: #e8c547;
  font-size: 0.82rem;
  line-height: 1.35;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.25s ease;
}

.sound-unlock-toast.is-hiding {
  opacity: 0;
}

#sounds-nav-link.sounds-locked {
  border-color: rgba(201, 162, 39, 0.55);
  color: #e8c547;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.25);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.account-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.landing-page .header {
  margin-bottom: 0;
}

.landing-main {
  max-width: 880px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.landing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.landing-card {
  display: block;
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.05s ease;
}

.landing-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.landing-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.4rem;
}

.landing-card-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.refresh-rate {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  border-left-width: 4px;
}

.refresh-rate-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  min-height: 10px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.refresh-rate-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.refresh-rate--fast {
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.14);
}

.refresh-rate--fast .refresh-rate-dot {
  background: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.75);
}

.refresh-rate--fast .refresh-rate-value {
  color: #93c5fd;
}

.refresh-rate--ok {
  border-left-color: #3d9a5f;
  background: rgba(61, 154, 95, 0.12);
}

.refresh-rate--ok .refresh-rate-dot {
  background: #3d9a5f;
  box-shadow: 0 0 8px rgba(61, 154, 95, 0.7);
}

.refresh-rate--ok .refresh-rate-value {
  color: #6fcf97;
}

.refresh-rate--warn {
  border-left-color: #c9a227;
  background: rgba(201, 162, 39, 0.12);
}

.refresh-rate--warn .refresh-rate-dot {
  background: #c9a227;
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.65);
}

.refresh-rate--warn .refresh-rate-value {
  color: #e8c547;
}

.refresh-rate--slow {
  border-left-color: #c45c5c;
  background: rgba(196, 92, 92, 0.12);
}

.refresh-rate--slow .refresh-rate-dot {
  background: #c45c5c;
  box-shadow: 0 0 8px rgba(196, 92, 92, 0.65);
}

.refresh-rate--slow .refresh-rate-value {
  color: #f08a8a;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: none;
}

.btn[hidden] {
  display: none !important;
}

.btn:hover:not(:disabled) {
  border-color: var(--muted);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
}

.status {
  margin: 1rem 1.5rem 0;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.status.error {
  background: #3a1f1f;
  border: 1px solid #7a3030;
  color: #f5b0b0;
}

.status.info {
  background: #1a2438;
  border: 1px solid #2a4060;
  color: #b8d4f5;
}

.settings-launch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.settings-launch-bar .btn {
  font-size: 0.82rem;
}

.sounds-enable-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}

.sounds-enable-toggle:has(input:checked) {
  border-color: #3d9a5f;
  background: rgba(61, 154, 95, 0.12);
}

.sounds-enable-toggle input {
  accent-color: var(--accent);
}

.recom-criteria-filter,
.recom-lead-time-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.5rem;
}

.recom-criteria-filter label,
.recom-lead-time-filter label {
  font-weight: 500;
  color: var(--text);
}

.recom-criteria-filter input[type='date'],
.recom-criteria-filter input[type='number'],
.recom-lead-time-filter input[type='date'] {
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  color-scheme: dark;
}

.recom-criteria-filter input[type='date'],
.recom-lead-time-filter input[type='date'] {
  min-width: 10.5rem;
  cursor: pointer;
}

.recom-criteria-filter input[type='number'] {
  width: 6.5rem;
}

.recom-criteria-filter input[type='date']::-webkit-calendar-picker-indicator,
.recom-lead-time-filter input[type='date']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.85);
  opacity: 0.9;
}

.recom-criteria-filter input:focus,
.recom-lead-time-filter input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(100, 160, 220, 0.25);
}

.recom-material-mins-heading {
  flex: 1 0 100%;
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.recom-material-mins {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.15rem;
}

.recom-material-mins label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.recom-material-mins input[type='number'],
.settings-modal-panel input[type='number'],
.settings-modal-panel input[type='date'],
.settings-modal-panel input[type='password'] {
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  color-scheme: dark;
}

.recom-material-mins input[type='number'],
.settings-modal-panel input[type='number'] {
  width: 6.5rem;
}

.settings-modal-panel input[type='date'] {
  min-width: 10.5rem;
  cursor: pointer;
}

.settings-modal-panel input[type='date']::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.85);
  opacity: 0.9;
}

.recom-material-mins input:focus,
.settings-modal-panel input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(100, 160, 220, 0.25);
}


.material-min-pricing-hint {
  margin: 0 0 0.65rem;
}

.material-min-pricing-grid {
  margin-bottom: 0.35rem;
}

.settings-modal-list {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.settings-modal-list li {
  margin: 0.2rem 0;
}

.recom-guide-heading {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.recom-guide {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.recom-guide li {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0.25rem 0;
}

.recom-guide-emote {
  flex: 0 0 auto;
  width: 1.35rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.2;
}

.recom-guide-text {
  color: var(--muted);
}

.recom-hide-emotes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-top: 0.35rem;
}

.recom-hide-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

.recom-hide-option:hover {
  border-color: var(--accent);
}

.recom-hide-input {
  margin: 0;
  accent-color: var(--accent);
}

.recom-hide-emote {
  width: 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1;
}

.recom-hide-label {
  color: var(--muted);
  max-width: 14rem;
}

.recom-hide-hint {
  margin: 0.35rem 0 0;
  min-height: 1.1em;
}

tr.job-row-recom-filtered {
  display: none;
}

.error-banner {
  margin: 0.75rem 1.5rem 0;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
  background: #3a1f1f;
  border: 1px solid #7a3030;
  color: #f5b0b0;
}

.offer-day-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

.offer-day-label {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 8rem;
}

.offer-day-picker {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

.btn-day-nav {
  min-width: 2rem;
  padding: 0.2rem 0.45rem;
  font-size: 1.1rem;
  line-height: 1;
}

.btn-day-today {
  font-size: 0.78rem;
  padding: 0.25rem 0.55rem;
}

.offer-day-hint {
  margin-left: auto;
  font-size: 0.78rem;
}

.offer-status-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.55rem 1rem 0;
}

.offer-status-filters-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.offer-status-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  cursor: pointer;
  user-select: none;
}

.offer-status-filter input {
  accent-color: var(--accent);
}

.offer-status-filter-hint {
  margin-left: auto;
  font-size: 0.78rem;
}

.board-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.75rem 1.5rem;
}

.board-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  width: fit-content;
}

.btn-stats-nav {
  flex-shrink: 0;
}

.board-tab {
  position: relative;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
}

.board-tab:hover {
  color: var(--text);
  background: var(--bg);
}

.board-tab--active {
  color: var(--text);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--border);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.board-panel[hidden] {
  display: none !important;
}

.settings-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-top: 0;
}

.settings-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.tokens-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tokens-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.token-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.token-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.token-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.token-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.token-card-update {
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
  padding-top: 0.45rem;
}

.token-card-update > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.token-card-update > summary::-webkit-details-marker {
  display: none;
}

.token-card-update > summary::before {
  content: '';
  width: 0.38rem;
  height: 0.38rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.token-card-update[open] > summary::before {
  transform: rotate(45deg);
}

.token-card-update-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

@media (max-width: 720px) {
  .tokens-grid {
    grid-template-columns: 1fr;
  }
}

.auth-token-field-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.auth-token-update-hint {
  display: block;
  margin-top: 0.15rem;
}

.auth-token-display {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  resize: vertical;
  min-height: 4.5rem;
}

.auth-token-display:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-token-view-hint {
  display: block;
  margin-top: 0.25rem;
}

.auth-token-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  color-scheme: dark;
}

.auth-token-input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.auth-token-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(100, 160, 220, 0.25);
}

.auth-token-input:-webkit-autofill,
.auth-token-input:-webkit-autofill:hover,
.auth-token-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--bg) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 99999s ease-out 0s;
}

.settings-toolbar input[type='number'],
.settings-toolbar input[type='date'] {
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  width: 7.5rem;
}

.settings-toolbar .auto-accept-toggle {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: stretch;
  gap: 0.85rem;
  margin: 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-left-color: #5a6270;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.settings-toolbar .auto-accept-toggle:hover {
  border-top-color: #3a4150;
  border-right-color: #3a4150;
  border-bottom-color: #3a4150;
}

.settings-toolbar .auto-accept-toggle:has(.auto-accept-input:checked) {
  border-left-color: #3d9a5f;
  background: rgba(61, 154, 95, 0.12);
}

.settings-toolbar .auto-accept-toggle::after {
  content: 'Off';
  order: 2;
  flex-shrink: 0;
  min-width: 2.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: right;
  color: var(--muted);
}

.settings-toolbar .auto-accept-toggle:has(.auto-accept-input:checked)::after {
  content: 'On';
  color: #6fcf97;
}

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

.auto-accept-text {
  order: 1;
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
}

.auto-accept-track {
  order: 3;
  position: relative;
  width: 2.75rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #2a3140;
  border: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.auto-accept-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.5rem - 6px);
  height: calc(1.5rem - 6px);
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s ease, background 0.2s ease;
}

.auto-accept-input:checked + .auto-accept-track {
  background: rgba(61, 154, 95, 0.4);
  border-color: rgba(61, 154, 95, 0.8);
}

.auto-accept-input:checked + .auto-accept-track::after {
  transform: translateX(1.25rem);
  background: #6fcf97;
}

.auto-accept-input:focus-visible + .auto-accept-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.settings-modal-panel {
  font-size: 0.82rem;
  color: var(--muted);
}

.settings-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.settings-modal-header .take-modal-title {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.settings-modal-close {
  flex-shrink: 0;
}

.settings-modal-subtitle {
  margin: -0.35rem 0 0.75rem;
}

.notifications-modal-hint {
  margin: 0 0 0.85rem;
}

.notifications-enable-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;
}

.notifications-enable-toggle input {
  accent-color: var(--accent);
}

.notifications-mode-fieldset {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.notifications-mode-fieldset:disabled {
  opacity: 0.55;
}

.notifications-mode-legend {
  padding: 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.notifications-mode-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.4rem 0;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
}

.notifications-mode-option input {
  accent-color: var(--accent);
}

.notifications-test-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.settings-modal-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 1rem;
}

.settings-modal-actions .hint {
  flex: 1 1 100%;
  margin: 0 0 0.25rem;
  text-align: right;
}

@media (min-width: 36rem) {
  .settings-modal-actions .hint {
    flex: 1 1 auto;
    margin: 0;
    text-align: left;
  }
}

.job-table-wrap {
  padding: 0.75rem 1rem 1.5rem;
  overflow-x: auto;
}

.job-table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.job-table col:not(.col-tags):not(.col-material) {
  width: 0;
}

.job-table col.col-tags {
  width: auto;
}

.job-table col.col-material {
  width: 22rem;
}

.job-table thead th:not(:last-child):not(.col-material),
.job-table tbody td:not(.job-tags):not(.job-material) {
  white-space: nowrap;
}

.job-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 0.5rem 0.6rem;
  white-space: nowrap;
}

.job-table thead th.col-num,
.job-table td.col-num {
  text-align: right;
}

.job-table tbody td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.job-table tbody td.job-cell-id,
.job-table tbody td.job-cell-status,
.job-table tbody td.col-num,
.job-table tbody td.job-price {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.job-table tbody td.job-cell-status {
  white-space: normal;
}

.job-status-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.take-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.take-modal[hidden] {
  display: none !important;
}

.take-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 21, 0.75);
}

.take-modal-panel {
  position: relative;
  width: min(32rem, 100%);
  max-height: min(85vh, 640px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
}

.take-modal-panel.settings-modal-panel {
  width: min(52rem, 100%);
  max-height: min(90vh, 720px);
}

.take-modal-panel.settings-modal-panel--wide {
  width: min(60rem, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.worker-settings-tabs {
  flex-shrink: 0;
  margin: 0 0 0.75rem;
}

.worker-settings-body {
  flex: 1 1 auto;
  min-height: 18rem;
  overflow: auto;
}

#worker-panel-poll.settings-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0.85rem 1.25rem;
}

#worker-panel-poll.settings-toolbar .settings-modal-subtitle,
#worker-panel-poll.settings-toolbar label:has(.hint) {
  grid-column: 1 / -1;
}

#worker-panel-actions.settings-toolbar,
#worker-panel-telegram.settings-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}


.worker-tab-panel[hidden] {
  display: none !important;
}

.worker-tab-panel .settings-modal-subtitle {
  flex: 1 0 100%;
  margin: 0 0 0.35rem;
}

.take-modal-panel.settings-modal-panel--wide .settings-modal-actions {
  flex-shrink: 0;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.take-modal-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.take-modal-details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.take-modal-details dt {
  color: var(--muted);
  font-weight: 500;
}

.take-modal-details dd {
  margin: 0;
}

.take-modal-error {
  margin: 0 0 0.75rem;
  color: #f5b0b0;
  font-size: 0.85rem;
}

.take-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.job-row {
  background: var(--surface);
  transition: background-color 0.25s ease;
}

.job-row.job-active {
  background: #1a2438;
  box-shadow: inset 0 0 0 1px rgba(100, 160, 220, 0.28);
}

.job-row.job-active .job-code {
  color: #9ec5f5;
}

.job-row.job-new {
  background: #3d3520;
  box-shadow: inset 0 0 0 1px rgba(255, 214, 80, 0.25);
}

.job-row.job-gone {
  background: #3a1f1f;
  box-shadow: inset 0 0 0 1px rgba(220, 80, 80, 0.2);
}

.job-row.job-gone .job-code {
  color: #f0a0a0;
}

.job-row.job-gone-accepted {
  background: #1a3328;
  box-shadow: inset 0 0 0 1px rgba(80, 180, 120, 0.28);
}

.job-row.job-gone-accepted .job-code {
  color: #8fd4a8;
}

.job-row.job-row-urgent {
  box-shadow: inset 3px 0 0 rgba(240, 160, 112, 0.55);
}

.job-code {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.job-code:hover {
  text-decoration: underline;
}

.job-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
}

.job-status .job-urgent,
.job-status .job-instant {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
}

.job-status .job-urgent.is-urgent {
  color: #f0a070;
}

.job-status .job-instant.is-instant {
  color: #7ec8f0;
}

.job-material,
.job-dimensions {
  vertical-align: top;
  padding-top: 0.5rem;
  line-height: 1.35;
}

.job-table thead th.col-material,
.job-table tbody td.job-material {
  white-space: normal;
  min-width: 22rem;
  width: 22rem;
  max-width: 22rem;
  overflow-wrap: break-word;
  word-break: normal;
  font-size: 0.74rem;
}

.job-material .job-cell-line {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.job-qty {
  vertical-align: top;
  padding-top: 0.5rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.job-parts,
.job-qty,
.job-price,
.job-recom,
.job-refusal {
  font-variant-numeric: tabular-nums;
}

.job-recom {
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.job-refusal {
  text-align: center;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.job-recom.is-recommended {
  color: #7dd99a;
  font-weight: 700;
}

.job-refusal.is-refusal-candidate {
  color: #e8a86a;
  font-weight: 700;
}

.job-recom.has-fails {
  font-size: 0.92rem;
  line-height: 1.25;
}

.job-material-line {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.job-cell-line {
  white-space: nowrap;
}

.job-material-line + .job-material-line,
.job-cell-line + .job-cell-line {
  margin-top: 0.12rem;
}

.job-cell-line-num {
  text-align: right;
}

.job-ppc-below-min {
  color: #e07a7a;
}

.job-recom-price-floored {
  color: #e0b060;
}

.job-dimensions {
  font-size: 0.72rem;
  font-family: ui-monospace, monospace;
  color: var(--muted);
}

.job-dim-line .dim-axis-max {
  color: #ffb870;
  font-weight: 700;
}

.job-dim-line .dim-axis-over {
  color: #f08a8a;
  font-weight: 700;
}

.job-leadtime {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-family: ui-monospace, monospace;
  font-weight: 600;
  color: #8ec8ff;
}

.job-price {
  font-weight: 700;
  font-size: 0.82rem;
  color: #9ef0b0;
}

.job-price .job-xacct-price {
  font-weight: 600;
  font-size: 0.72rem;
  color: #c79bf0;
  margin-top: 0.18rem;
  cursor: help;
}

.telegram-notify-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0.25rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.telegram-notify-row .hint {
  flex: 1 1 14rem;
  min-width: 12rem;
}

.job-table thead th.col-highlight-price {
  color: #9ef0b0;
}

.job-table thead th.col-highlight-lead {
  color: #8ec8ff;
}

.job-found {
  font-size: 0.72rem;
  font-family: ui-monospace, monospace;
  color: var(--muted);
  white-space: nowrap;
  vertical-align: top;
  padding-top: 0.5rem;
}

.job-tags {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  width: 100%;
  max-width: 0;
}

.job-tags-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.35rem;
}

.job-tag-line {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.job-tag-line.job-tag-warn {
  color: #e8c070;
}

.job-tags:has(.btn-tags-show) {
  text-align: center;
  vertical-align: middle;
}

.btn-tags-show {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  line-height: 1.2;
}

.btn-tags-show.btn-tags-blocked {
  border-color: #e07a7a;
  color: #ffb0b0;
  background: rgba(224, 122, 122, 0.12);
}

.tags-modal-panel {
  width: min(40rem, 100%);
}

.tags-modal-job {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.tags-modal-list {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  max-height: min(55vh, 28rem);
  overflow-y: auto;
}

.tags-modal-item {
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tags-modal-item:last-child {
  border-bottom: none;
}

.tags-modal-item-warn {
  color: #e8c070;
}

.tags-modal-item-blocked {
  color: #ffb0b0;
  font-weight: 700;
  background: rgba(224, 122, 122, 0.14);
  border-left: 3px solid #e07a7a;
  padding-left: 0.4rem;
}

.job-table tbody tr {
  vertical-align: top;
}

.job-empty td {
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.login-card {
  width: min(420px, 92vw);
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.login-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.login-card label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.login-card input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

.error {
  color: #f5b0b0;
  font-size: 0.9rem;
}

.sounds-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem;
}

.sounds-intro {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 1.25rem;
}

.sound-cards {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sound-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 1.1rem 1.25rem;
}

.sound-card-head {
  margin-bottom: 0.35rem;
}

.sound-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.sound-card-sub {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.sound-card-desc {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text);
}

.sound-play-btn,
.sound-play-default {
  min-width: 5rem;
  margin-top: 0.75rem;
}

.sound-variants {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sound-variant {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

.sound-variant-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  font-size: 0.88rem;
}

.sound-variant-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sound-variant-play {
  flex-shrink: 0;
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
}

.sounds-attribution {
  margin: 1.5rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.sounds-attribution a {
  color: var(--accent);
}

.sounds-classify h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.sound-map-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.sound-map-table th,
.sound-map-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.sound-map-table th {
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
}

.sound-map-table code {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
}

.stats-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

.stats-range-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.stats-range-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}

.stats-range-form input[type='date'] {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  color-scheme: dark;
  min-width: 10.5rem;
}

.stats-offer-type-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin: 0;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.stats-offer-type-filter legend {
  padding: 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.stats-offer-type-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.stats-offer-type-option input {
  accent-color: var(--accent);
}

.stats-material-table td:first-child {
  max-width: 14rem;
}

.stats-material-row {
  cursor: pointer;
}

.stats-material-row:hover {
  background: rgba(61, 125, 214, 0.08);
}

.stats-material-name {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(61, 125, 214, 0.35);
  text-underline-offset: 2px;
}

.stats-chart-panel {
  width: min(52rem, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
}

.stats-chart-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.stats-chart-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}

.stats-chart-filters input[type='number'] {
  width: 7rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.stats-chart-summary {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.45;
}

.stats-chart-summary-total {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
}

.stats-chart-caption {
  margin: 0 0 0.5rem;
}

.stats-chart-tooltip {
  margin: 0 0 0.5rem;
  min-height: 1.2rem;
  color: var(--text);
}

.stats-chart-canvas {
  display: block;
  width: 100%;
  height: min(52vh, 420px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #12151c;
  cursor: grab;
  touch-action: none;
}

.stats-chart-canvas.is-panning {
  cursor: grabbing;
}

.stats-chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.stats-chart-toolbar-hint {
  font-size: 0.78rem;
}

.stats-chart-legend {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
}

.stats-analysis-criteria {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.stats-analysis-criteria summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.stats-analysis-hint {
  margin: 0.5rem 0 0.75rem;
}

.stats-criteria-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.stats-criteria-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.stats-recom-conditions {
  margin: 0 0 0.85rem;
  padding: 0;
  border: none;
}

.stats-recom-conditions legend {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.stats-condition-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
}

.stats-condition-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}

.stats-condition-toggle input {
  accent-color: var(--accent, #5b9cff);
}

.stats-criteria-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
}

.stats-criteria-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
}

.stats-material-mins-label {
  flex: 1 0 100%;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.stats-criteria-fields input[type='date'],
.stats-criteria-fields input[type='number'] {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  color-scheme: dark;
  min-width: 8rem;
}

.stats-range-caption {
  margin: 0 0 1rem;
}

.stats-loading {
  margin: 0 0 1rem;
}

.stats-cards-details {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.stats-cards-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.stats-cards-details .stats-cards {
  margin-top: 0.85rem;
  margin-bottom: 0;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.stats-card {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.stats-card-label {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.stats-card-value {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.1;
}

.stats-card-detail {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.stats-section h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.stats-section-hint {
  margin: 0 0 0.75rem;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.stats-table th,
.stats-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.stats-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats-table .col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
