:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface2: #eef1f6;
  --border: #d8dee8;
  --text: #1a2332;
  --muted: #5c6b7f;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #dc2626;
  --success: #15803d;
  --warning: #b45309;
  --radius: 8px;
  --font: "Segoe UI", system-ui, sans-serif;
  --shadow: 0 1px 3px rgba(26, 35, 50, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[v-cloak] {
  display: none;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.header-user .username {
  font-size: 0.875rem;
  color: var(--muted);
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tagline {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.15rem;
}

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: calc(100vh - 72px);
}

.layout.sidebar-collapsed {
  grid-template-columns: 3.25rem 1fr;
}

.layout.layout-home {
  grid-template-columns: 1fr;
}

@media (min-width: 1200px) {
  .layout {
    grid-template-columns: 420px 1fr;
  }

  .layout.sidebar-collapsed {
    grid-template-columns: 3.25rem 1fr;
  }

  .layout.layout-home {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 0.75rem;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
}

.sidebar-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sidebar-toggle:hover {
  background: var(--surface2);
  color: var(--text);
}

.sidebar-toggle-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  line-height: 1;
}

.sidebar-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  margin-left: auto;
}

.sidebar-pin:hover {
  background: var(--surface2);
  color: var(--text);
}

.sidebar-pin.pinned {
  color: var(--accent);
  border-color: var(--accent);
  background: #e8effe;
}

.sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.project-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.project-list li {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 0.25rem;
  border: 1px solid transparent;
}

.project-list li:hover,
.project-list li.highlighted {
  background: var(--surface2);
}

.project-list li.active {
  background: #e8effe;
  border-color: var(--accent);
}

.project-list li.highlighted.active {
  background: #dfe8fc;
}

.project-row {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}

.project-subject {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.35;
  min-width: 0;
}

.btn-icon-copy {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.btn-icon-copy:hover {
  background: var(--surface2);
  color: var(--accent);
}

.main {
  padding: 1.5rem;
  overflow-y: auto;
}

.empty-main {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.home-link {
  all: unset;
  cursor: pointer;
  color: inherit;
}

.home-link:hover {
  color: var(--accent);
}

.home-main {
  display: flex;
  justify-content: center;
  padding: 2rem 1.5rem 3rem;
}

.home-page {
  width: min(36rem, 100%);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.home-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.home-todos,
.home-projects {
  display: flex;
  flex-direction: column;
}

.home-todos-panel,
.home-projects-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.home-projects .search-input {
  margin-bottom: 0;
}

.home-todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
}

.home-todo-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.home-todo-item:last-child {
  border-bottom: none;
}

.home-todo-text {
  flex: 1;
  line-height: 1.45;
  font-size: 0.95rem;
}

.home-todo-remove {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.home-todo-remove:hover {
  background: var(--surface2);
  color: var(--danger, #c0392b);
}

.home-todo-add {
  display: flex;
  gap: 0.5rem;
}

.home-todo-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.home-todo-input:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.home-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.home-project-list {
  max-height: none;
  margin-top: 0;
}

.home-project-list li.empty {
  cursor: default;
  padding: 0.5rem 0.75rem;
}

.home-project-list li.empty:hover {
  background: transparent;
}

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

.home-hint code {
  font-size: 0.85em;
}

.job-todos {
  margin-bottom: 1.25rem;
}

.job-todos .panel-head {
  margin-bottom: 0.5rem;
}

.job-todos .panel-head h3 {
  margin: 0;
  font-size: 1rem;
}

.job-todo-list {
  margin-bottom: 0.65rem;
}

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 72px);
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.auth-hint,
.auth-message {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.auth-form label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.auth-form input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.auth-error {
  color: var(--danger);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.auth-switch {
  margin-top: 1rem;
  text-align: center;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0;
  text-decoration: underline;
}

.btn-link:hover {
  color: var(--accent-hover);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.project-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.subject-preview {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
  font-family: ui-monospace, monospace;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  box-shadow: var(--shadow);
}

.btn:hover {
  background: var(--surface2);
  border-color: #c5ced9;
}

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

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

.btn-danger {
  border-color: #fecaca;
  color: var(--danger);
  background: #fef2f2;
}

.btn-danger:hover {
  background: #fee2e2;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-head h3 {
  font-size: 1rem;
  font-weight: 600;
}

.quote-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  background: var(--surface);
}

.quote-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  background: var(--surface2);
}

.quote-head:hover {
  background: #e4e9f0;
}

.quote-name {
  flex: 1;
  font-weight: 500;
}

.quote-total {
  font-weight: 600;
  color: var(--success);
}

.chevron {
  color: var(--muted);
  font-size: 0.75rem;
}

.quote-body {
  padding: 1rem;
}

.quote-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.variation-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--bg);
}

.variation-card.collapsed .variation-head {
  margin-bottom: 0;
  cursor: pointer;
}

.variation-head {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.collapse-btn {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1;
}

.collapse-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

.variation-order {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex-shrink: 0;
}

.order-btn {
  width: 1.75rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
}

.order-btn:hover:not(:disabled) {
  background: var(--surface2);
  color: var(--text);
}

.order-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.variation-head-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

.desc-input.field-saving,
.desc-input.field-saved,
.desc-input.field-error,
.status-select.field-saving,
.status-select.field-saved,
.status-select.field-error,
.cell-input.field-saving,
.cell-input.field-saved,
.cell-input.field-error {
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.field-saving {
  opacity: 0.7;
  cursor: wait;
  background: var(--surface2) !important;
}

.field-saved {
  background: #f0fdf4 !important;
}

.field-error {
  background: #fef2f2 !important;
  outline: 1px solid var(--danger);
}

.desc-input {
  flex: 1;
  min-width: 180px;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

.desc-input:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.status-select {
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.status-proposed {
  border-color: var(--muted);
  background: #f8fafc;
  color: var(--muted);
}

.status-pending {
  border-color: var(--warning);
  background: #fffbeb;
}

.status-approved {
  border-color: var(--success);
  background: #f0fdf4;
}

.status-declined {
  border-color: var(--danger);
  background: #fef2f2;
  opacity: 0.85;
}

.bulk-variations-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.bulk-variations-text {
  width: 100%;
  min-height: 12rem;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
}

.variation-total {
  font-weight: 600;
  min-width: 6.75rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.line-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.line-table th,
.line-table td {
  padding: 0.35rem 0.45rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  overflow: hidden;
}

.line-table th {
  color: var(--muted);
  font-weight: 500;
  background: var(--surface2);
}

.line-table .col-desc {
  width: auto;
}

.cost-desc-wrap {
  position: relative;
}

.cost-suggestions-portal {
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  max-height: 14rem;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.cost-suggestions-portal li {
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cost-suggestions-portal li:hover,
.cost-suggestions-portal li.active {
  background: var(--surface2);
}

.line-table td.col-desc {
  overflow: visible;
}

.line-table .col-qty {
  width: 6rem;
}

.line-table .col-uom {
  width: 3.75rem;
}

.line-table .col-rate {
  width: 6rem;
}

.line-table .col-cost {
  width: 5.5rem;
  text-align: right;
}

.line-table .col-actions {
  width: 8.5rem;
  padding-left: 0.25rem;
  padding-right: 0.5rem;
}

.cell-input {
  width: 100%;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
}

.cell-input:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.cell-input.desc {
  min-width: 0;
}

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

.line-table td.col-actions {
  overflow: visible;
}

.line-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  width: 100%;
}

.line-action-btn {
  flex-shrink: 0;
  width: 1.65rem;
  height: 1.65rem;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.line-action-btn:hover:not(:disabled) {
  background: var(--surface2);
}

.line-action-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.line-action-btn.line-action-delete {
  color: var(--danger);
  border-color: #fecaca;
  background: #fef2f2;
}

.line-action-btn.line-action-delete:hover {
  background: #fee2e2;
}

.empty,
.empty-panel {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.5rem 0;
}

.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  max-width: 440px;
  width: 90%;
  box-shadow: 0 12px 40px rgba(26, 35, 50, 0.15);
}

.modal[open] {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.modal::backdrop {
  background: rgba(26, 35, 50, 0.35);
}

.modal form {
  padding: 1.25rem;
}

.modal h3 {
  margin-bottom: 1rem;
}

.modal label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.modal input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

.fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.fieldset legend {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0 0.25rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

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

.tools-modal {
  max-width: 520px;
}

.tools-modal.tools-modal--wide {
  max-width: 760px;
}

.tools-modal-inner {
  padding: 1.25rem;
}

.tools-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tools-modal-head h3 {
  margin: 0;
}

.tools-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.tools-tab {
  padding: 0.4rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.tools-tab:hover {
  background: var(--surface2);
  color: var(--text);
}

.tools-tab.active {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
}

.tools-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

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

.tools-textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  resize: vertical;
}

.tools-textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.tools-copy-output {
  flex: 1;
  resize: none;
  background: var(--surface2);
}

.tools-actions {
  display: flex;
  gap: 0.5rem;
}

.tools-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.tools-config label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.tools-config input {
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

.tools-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.tools-stat {
  text-align: center;
  padding: 0.65rem 0.5rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tools-stat-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.tools-stat-value {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.tools-total {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.tools-copy-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.tools-copy-row .btn {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.worksheet-select {
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

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

.worksheet-param {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.worksheet-param input {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

.worksheet-param--derived input {
  background: var(--surface2);
  color: var(--muted);
}

.worksheet-param-unit {
  font-weight: 400;
}

.worksheet-draft {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.worksheet-desc-input {
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

.worksheet-margin-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.worksheet-margin-label input {
  width: 5rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

.worksheet-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.worksheet-lines th,
.worksheet-lines td {
  padding: 0.25rem 0.35rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.worksheet-lines th {
  color: var(--muted);
  font-weight: 600;
}

.worksheet-lines input {
  width: 100%;
  min-width: 0;
  padding: 0.3rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}

.worksheet-lines td:nth-child(2) input,
.worksheet-lines td:nth-child(4) input {
  max-width: 5rem;
}

.worksheet-lines td:nth-child(3) input {
  max-width: 4rem;
}

.worksheet-target {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.command-launcher-backdrop {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  background: transparent;
}

.command-launcher {
  width: min(36rem, 100%);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(26, 35, 50, 0.2);
  padding: 0.5rem 0.7rem;
}

.command-launcher-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.command-launcher-prefix {
  font-weight: 600;
  color: var(--accent);
}

.command-launcher-input {
  flex: 1;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
}

.command-launcher-output {
  margin: 0.75rem 0 0.1rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  max-height: 40vh;
  overflow: auto;
}

.command-launcher-hint {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.command-launcher-picklist {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  max-height: 40vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.command-launcher-picklist-item {
  padding: 0.45rem 0.65rem;
  font-size: 0.88rem;
  cursor: default;
  border-bottom: 1px solid var(--border);
}

.command-launcher-picklist-item:last-child {
  border-bottom: none;
}

.command-launcher-picklist-item.active {
  background: var(--accent);
  color: #fff;
}

.command-launcher-meta {
  margin: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.local-find-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.local-find-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  min-width: 12rem;
}

.local-find-prefix {
  font-weight: 600;
  color: var(--accent);
}

.local-find-input {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.local-find-meta {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 5rem;
}

.local-find-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.quote-status-filters {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
}

.quote-status-filters-label {
  color: var(--muted);
  font-weight: 500;
}

.quote-status-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  user-select: none;
}

.price-margin-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.price-margin-input {
  width: 3.25rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
}

.price-grid-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.margin-preview-btn.active {
  border-color: var(--accent);
  background: #e8effe;
  color: var(--accent);
}

.margin-preview-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.variation-card.local-find-target,
.line-table tr.local-find-target {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(26, 35, 50, 0.12);
  z-index: 100;
}

@media (max-width: 768px) {
  .layout,
  .layout.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
  }

  .layout:not(.sidebar-collapsed) .sidebar {
    max-height: 40vh;
  }

  .layout.sidebar-collapsed .sidebar {
    max-height: none;
    border-bottom: none;
  }

  .sidebar-toggle-label {
    writing-mode: horizontal-tb;
    transform: none;
    text-transform: none;
    font-size: 0.875rem;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .home-project-list .btn-icon-copy {
    display: none;
  }
}
