/* LingoDesk work screens (phase 1): lists, forms, tabs, pills, dialog, diary. Uses the tokens in lingodesk.css. */
:root { --ld-info: #1d5fa8; --ld-info-soft: #e8f0fb; --ld-danger-soft: #fdecea; --ld-row-hover: #faf9f6; --ld-head: #faf9f6;
  --ld-backdrop: rgba(20, 28, 26, .38); }
:root[data-skin="evergreen"] { --ld-row-hover: #f4f7f6; --ld-head: #f7f9f8; }
:root[data-skin="midnight"] { --ld-info: #8ab8ee; --ld-info-soft: #172739; --ld-danger-soft: #3a1d1a; --ld-row-hover: #1a2422; --ld-head: #121a18;
  --ld-backdrop: rgba(0, 0, 0, .6); }
@media (prefers-color-scheme: dark) {
  :root[data-skin="system"] { --ld-info: #8ab8ee; --ld-info-soft: #172739; --ld-danger-soft: #3a1d1a; --ld-row-hover: #1a2422; --ld-head: #121a18;
    --ld-backdrop: rgba(0, 0, 0, .6); }
}
.ld-main a { color: var(--ld-accent); }
.ld-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.ld-toolbar .ld-grow { flex: 1 1 auto; }
.ld-toolbar input[type=search], .ld-toolbar select, .ld-toolbar input[type=date] { min-height: 38px; border: 1px solid var(--ld-line-strong); border-radius: 8px; padding: 0 12px;
  background: var(--ld-surface); color: var(--ld-fg); font: 14px var(--ld-font); }
.ld-toolbar input[type=search] { width: min(320px, 100%); }

.ld-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--ld-line); margin: 0 0 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.ld-tabs a, .ld-tabs button { padding: 9px 14px; color: var(--ld-muted) !important; text-decoration: none; border: 0; background: none; font: 500 14px var(--ld-font);
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.ld-tabs a.is-on, .ld-tabs button.is-on { color: var(--ld-fg) !important; border-bottom-color: var(--ld-accent); font-weight: 600; }
.ld-tabs a:hover, .ld-tabs button:hover { color: var(--ld-fg) !important; }
.ld-count { font: 500 11px/1.6 var(--ld-mono); background: var(--ld-line); color: var(--ld-fg); border-radius: 999px; padding: 0 6px; margin-left: 4px; }

.ld-table-wrap { overflow-x: auto; background: var(--ld-surface); border: 1px solid var(--ld-line); border-radius: var(--ld-radius); box-shadow: var(--ld-shadow); }
.ld-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ld-table th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--ld-muted);
  padding: 10px 14px; border-bottom: 1px solid var(--ld-line); white-space: nowrap; background: var(--ld-head); }
.ld-table td { padding: 11px 14px; border-bottom: 1px solid var(--ld-line); vertical-align: top; }
.ld-table tbody tr:last-child td { border-bottom: 0; }
.ld-table tbody tr:hover { background: var(--ld-row-hover); }
.ld-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ld-table .nowrap { white-space: nowrap; }
.ld-table .sub { display: block; color: var(--ld-muted); font-size: 12px; margin-top: 2px; }
.ld-table tfoot td { font-weight: 600; border-top: 1px solid var(--ld-line); }
.ld-table td input, .ld-table td select { width: 100%; min-height: 34px; border: 1px solid var(--ld-line); border-radius: 6px; padding: 4px 8px;
  background: var(--ld-surface); color: var(--ld-fg); font: 14px var(--ld-font); }
.ld-table td input.num { text-align: right; }

.ld-pill { display: inline-block; font: 500 12px/1.75 var(--ld-font); padding: 0 8px; border-radius: 999px; white-space: nowrap;
  background: var(--ld-line); color: var(--ld-fg); }
.ld-pill.is-ok { background: var(--ld-accent-soft); color: var(--ld-accent); }
.ld-pill.is-warn { background: var(--ld-warn-soft); color: var(--ld-warn); }
.ld-pill.is-danger { background: var(--ld-danger-soft); color: var(--ld-danger); }
.ld-pill.is-info { background: var(--ld-info-soft); color: var(--ld-info); }
.ld-pill.is-muted { background: transparent; box-shadow: inset 0 0 0 1px var(--ld-line); color: var(--ld-muted); }

.ld-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.ld-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; }
.ld-form-grid .is-wide { grid-column: 1 / -1; }
.ld-field label, .ld-label { display: block; font-size: 13px; font-weight: 500; margin: 0 0 4px; }
.ld-help { display: block; font-size: 12px; color: var(--ld-muted); margin-top: 3px; }
.ld-field input:not([type=checkbox]):not([type=radio]):not([type=file]), .ld-field select, .ld-field textarea {
  width: 100%; min-height: 38px; border: 1px solid var(--ld-line); border-radius: 6px; padding: 6px 10px; background: var(--ld-surface);
  color: var(--ld-fg); font: 14px var(--ld-font); }
.ld-field textarea { min-height: 80px; resize: vertical; }
.ld-field input:focus, .ld-field select:focus, .ld-field textarea:focus, .ld-table td input:focus { outline: 2px solid var(--ld-accent); outline-offset: 0; border-color: var(--ld-accent); }
.ld-check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.ld-check input { margin-top: 3px; accent-color: var(--ld-accent); }
.ld-section { margin: 22px 0 10px; font-size: 15px; font-weight: 600; }
.ld-section:first-child { margin-top: 0; }
.ld-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ld-btn.is-danger { color: var(--ld-danger); }
.ld-btn.is-danger:hover { border-color: var(--ld-danger); }
.ld-btn.is-small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.ld-btn.is-link { border: 0; background: none; padding: 0 4px; color: var(--ld-accent); min-height: 0; }
.ld-note.is-error { background: var(--ld-danger-soft); border-left-color: var(--ld-danger); }
.ld-note.is-info { background: var(--ld-info-soft); border-left-color: var(--ld-info); }
.ld-note { margin: 0 0 12px; }

.ld-two { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.ld-two > * { min-width: 0; }   /* a wide table scrolls inside its own box instead of widening the page */
.ld-stack { display: grid; gap: 16px; align-content: start; }
.ld-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.ld-stat { background: var(--ld-surface); border: 1px solid var(--ld-line); border-radius: var(--ld-radius); padding: 14px 18px; text-decoration: none;
  color: inherit !important; box-shadow: var(--ld-shadow); transition: border-color .12s, box-shadow .12s; }
.ld-stat span { display: block; font-size: 12.5px; color: var(--ld-muted); }
.ld-stat strong { display: block; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 4px; color: var(--ld-fg); letter-spacing: -.02em; }
.ld-stat.is-warn strong { color: var(--ld-warn); }
a.ld-stat:hover { border-color: var(--ld-accent); box-shadow: var(--ld-shadow-lg); }
.ld-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.ld-dl dt { color: var(--ld-muted); font-weight: 400; }
.ld-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.ld-mono { font-family: var(--ld-mono); font-size: 13px; }
.ld-copy { display: flex; gap: 6px; align-items: center; }
.ld-copy input { flex: 1; min-width: 0; font: 13px var(--ld-mono); min-height: 34px; border: 1px solid var(--ld-line); border-radius: 6px; padding: 0 8px; background: var(--ld-bg); color: var(--ld-fg); }
.ld-list { list-style: none; margin: 0; padding: 0; }
.ld-list li { padding: 8px 0; border-bottom: 1px solid var(--ld-line); font-size: 14px; }
.ld-list li:last-child { border-bottom: 0; }
.ld-muted { color: var(--ld-muted); }
.ld-pre { white-space: pre-wrap; font: 13px/1.5 var(--ld-font); background: var(--ld-bg); border: 1px solid var(--ld-line); border-radius: 6px; padding: 10px 12px; max-height: 420px; overflow: auto; margin: 0; }

.ld-dialog-backdrop { position: fixed; inset: 0; background: var(--ld-backdrop); display: grid; place-items: center; z-index: 50; padding: 16px; }
.ld-dialog { background: var(--ld-surface); color: var(--ld-fg); border-radius: 10px; width: min(560px, 100%); max-height: calc(100vh - 32px);
  overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.ld-dialog.is-wide { width: min(760px, 100%); }
.ld-dialog > header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--ld-line); }
.ld-dialog > header h2 { margin: 0; font-size: 17px; font-weight: 600; }
.ld-dialog > header button { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--ld-muted); cursor: pointer; }
.ld-dialog-body { padding: 16px 18px; }
.ld-dialog > footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--ld-line); }

/* diary */
.ld-diary-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.ld-diary-head h2 { margin: 0 8px 0 0; font-size: 18px; font-weight: 600; min-width: 190px; }
.ld-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--ld-line); border-radius: var(--ld-radius); background: var(--ld-surface); overflow: hidden; }
.ld-week.is-day { grid-template-columns: 1fr; }
.ld-day { min-height: 380px; border-right: 1px solid var(--ld-line); display: flex; flex-direction: column; min-width: 0; }
.ld-day:last-child { border-right: 0; }
.ld-week.is-day .ld-day { min-height: 240px; }
.ld-day-head { padding: 8px 10px; border-bottom: 1px solid var(--ld-line); font-size: 13px; display: flex; justify-content: space-between; gap: 6px; }
.ld-day-head a { color: var(--ld-fg) !important; text-decoration: none; font-weight: 500; }
.ld-day.is-today .ld-day-head { background: var(--ld-accent-soft); }
.ld-day.is-today .ld-day-head a { color: var(--ld-accent) !important; }
.ld-day-items { padding: 6px; display: grid; gap: 6px; align-content: start; }
.ld-item { display: block; text-align: left; width: 100%; border: 1px solid var(--ld-line); border-left: 3px solid var(--ld-accent); border-radius: 6px; padding: 6px 8px;
  background: var(--ld-bg); color: var(--ld-fg) !important; text-decoration: none; font-size: 12.5px; line-height: 1.35; cursor: pointer; }
.ld-item strong { display: block; font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.ld-item .ld-item-sub { color: var(--ld-muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-item.is-deadline { border-left-color: var(--ld-info); }
.ld-item.is-enquiry { border-left-style: dashed; }
.ld-item.is-cancelled { opacity: .55; text-decoration: line-through !important; }
.ld-item.is-clash { border-left-color: var(--ld-danger); background: var(--ld-danger-soft); }
.ld-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--ld-line); border-radius: var(--ld-radius); background: var(--ld-surface); overflow: hidden; }
.ld-month .ld-dow { padding: 6px 8px; font-size: 12px; color: var(--ld-muted); border-bottom: 1px solid var(--ld-line); }
.ld-month .ld-cell { min-height: 96px; border-right: 1px solid var(--ld-line); border-bottom: 1px solid var(--ld-line); padding: 4px; min-width: 0; }
.ld-month .ld-cell:nth-child(7n) { border-right: 0; }
.ld-month .ld-cell.is-other { background: var(--ld-bg); }
.ld-month .ld-cell.is-today { box-shadow: inset 0 0 0 2px var(--ld-accent); }
.ld-month .ld-num { font-size: 12px; font-weight: 500; padding: 2px 4px; color: var(--ld-fg) !important; text-decoration: none; }
.ld-month .ld-item { padding: 2px 6px; margin-top: 3px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-month .ld-more { font-size: 11px; color: var(--ld-muted); padding: 2px 4px; }

@media (max-width: 1100px) { .ld-two { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .ld-week { grid-template-columns: 1fr; }
  .ld-day { min-height: 0; border-right: 0; border-bottom: 1px solid var(--ld-line); }
  .ld-month .ld-cell { min-height: 58px; }
  .ld-month .ld-item { display: none; }
  .ld-month .ld-cell.has-items .ld-num { color: var(--ld-accent) !important; font-weight: 700; }
  .ld-page-header h1 { font-size: 22px; }
}

.ld-input { min-height: 34px; border: 1px solid var(--ld-line); border-radius: 6px; padding: 4px 8px; background: var(--ld-surface); color: var(--ld-fg); font: 14px var(--ld-font); }
.ld-input:focus { outline: 2px solid var(--ld-accent); border-color: var(--ld-accent); }
.ld-tabs.is-plain { overflow: visible; }

/* phase 2: translation editor (source | translation side by side), progress, signatures, public link pages, availability */
.ld-segs { display: grid; gap: 0; background: var(--ld-surface); border: 1px solid var(--ld-line); border-radius: var(--ld-radius); }
.ld-seg { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) 150px; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--ld-line); align-items: start; }
.ld-seg:last-child { border-bottom: 0; }
.ld-seg.is-head { font-size: 12px; font-weight: 600; color: var(--ld-muted); padding-top: 8px; padding-bottom: 8px; }
.ld-seg.is-confirmed { background: var(--ld-accent-soft); }
.ld-seg .ld-seq { font: 12px var(--ld-mono); color: var(--ld-muted); padding-top: 6px; }
.ld-seg .ld-src { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; padding-top: 6px; }
.ld-seg textarea { width: 100%; min-height: 60px; border: 1px solid var(--ld-line); border-radius: 6px; padding: 6px 8px; font: 14px var(--ld-font); background: var(--ld-surface); color: var(--ld-fg); resize: vertical; }
.ld-seg .ld-seg-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.ld-alt { margin-top: 6px; padding: 8px; border: 1px dashed var(--ld-accent); border-radius: 6px; font-size: 13px; white-space: pre-wrap; }
.ld-progress { height: 8px; background: var(--ld-line); border-radius: 999px; overflow: hidden; }
.ld-progress > span { display: block; height: 100%; background: var(--ld-accent); transition: width .4s; }
.ld-sign { display: block; width: 100%; max-width: 560px; height: 200px; border: 1px solid var(--ld-line); border-radius: var(--ld-radius); background: #fff; touch-action: none; cursor: crosshair; }
.ld-picture { max-width: 180px; max-height: 120px; border: 1px solid var(--ld-line); border-radius: 6px; background: #fff; padding: 4px; }
.ld-public { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.ld-public-brand { font-size: 13px; color: var(--ld-muted); margin: 0 0 16px; }
.ld-public h1 { font-size: 24px; margin: 0 0 6px; }
.ld-avail { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ld-avail-day { background: var(--ld-surface); border: 1px solid var(--ld-line); border-radius: 6px; padding: 8px; font-size: 13px; min-height: 84px; }
.ld-avail-day.is-off { background: var(--ld-bg); color: var(--ld-muted); }
.ld-avail-day b { display: block; font-size: 12px; margin-bottom: 4px; }
.ld-busy { display: block; background: var(--ld-warn-soft); color: var(--ld-warn); border-radius: 4px; padding: 1px 6px; margin-top: 3px; font: 12px var(--ld-mono); }
@media (max-width: 820px) {
  .ld-seg { grid-template-columns: 1fr; }
  .ld-seg.is-head { display: none; }
  .ld-seg .ld-seg-actions { flex-direction: row; flex-wrap: wrap; }
  .ld-avail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* the connected inbox: one email beside its actions */
.ld-two.is-wide-side { grid-template-columns: minmax(0, 1fr) 400px; }
@media (max-width: 1100px) { .ld-two.is-wide-side { grid-template-columns: 1fr; } }
.ld-mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; max-height: 70vh; overflow: auto; }

/* ---------- every device: phones, tablets, laptops ----------
   Phones (up to 640px): tables become one card per row with the column name beside each value (ld-device.js copies
   the headings into data-label); tabs wrap instead of scrolling; buttons and inputs are thumb-sized and inputs use
   16px text so iPhones do not zoom in; dialogs fill the screen width. A table that must stay a grid (an editing grid
   with many inputs) takes the class is-grid and keeps scrolling inside its box. */
.ld-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ld-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.ld-steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--ld-line); }
.ld-steps li:last-child { border-bottom: 0; }
.ld-steps .sub { display: block; color: var(--ld-muted); font-size: 13px; margin-top: 2px; }
.ld-step-mark { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ld-line); display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.ld-steps li.is-done .ld-step-mark { background: var(--ld-accent); border-color: var(--ld-accent); color: #0b1514; }
.ld-steps li.is-done strong { color: var(--ld-muted); }

@media (hover: none) and (pointer: coarse) {
  .ld-btn { min-height: 44px; }
  .ld-btn.is-small { min-height: 38px; }
  .ld-tabs a, .ld-tabs button { min-height: 44px; }
}

/* narrow screens: one column that never grows past the screen (a file input or a long option cannot widen it) */
@media (max-width: 1100px) { .ld-two, .ld-two.is-wide-side { grid-template-columns: minmax(0, 1fr); } }
input[type=file] { max-width: 100%; }

@media (max-width: 640px) {
  /* 16px text in every box: iPhones zoom into anything smaller */
  input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea { font-size: 16px !important; }
  .ld-tabs { flex-wrap: wrap; overflow: visible; row-gap: 0; }
  .ld-tabs a, .ld-tabs button { padding: 9px 10px; }

  .ld-field input, .ld-field select, .ld-field textarea, .ld-toolbar input, .ld-toolbar select, .ld-input,
  .ld-table td input, .ld-table td select, .ld-seg textarea { font-size: 16px; }
  .ld-toolbar input[type=search] { width: 100%; }
  .ld-toolbar input[type=search] { flex: 1 1 100%; }
  .ld-page-header .ld-actions, .ld-page-header > div:last-child { width: 100%; }

  .ld-dialog-backdrop { place-items: end stretch; padding: 0; }
  .ld-dialog, .ld-dialog.is-wide { width: 100%; border-radius: 12px 12px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom); }
  .ld-dialog > footer .ld-btn { flex: 1 1 auto; }

  /* tables -> one card per row */
  .ld-table-wrap:has(> table.ld-table.is-labelled:not(.is-grid)) { background: none; border: 0; overflow: visible; }
  table.ld-table.is-labelled:not(.is-grid), table.ld-table.is-labelled:not(.is-grid) tbody,
  table.ld-table.is-labelled:not(.is-grid) tfoot { display: block; width: 100%; }
  table.ld-table.is-labelled:not(.is-grid) thead { display: none; }
  table.ld-table.is-labelled:not(.is-grid) tr { display: block; background: var(--ld-surface); border: 1px solid var(--ld-line); border-radius: var(--ld-radius); padding: 6px 12px; margin-bottom: 10px; }
  table.ld-table.is-labelled:not(.is-grid) tbody tr:hover { background: var(--ld-surface); }
  table.ld-table.is-labelled:not(.is-grid) td { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed var(--ld-line); text-align: right; white-space: normal; }
  table.ld-table.is-labelled:not(.is-grid) td:last-child { border-bottom: 0; }
  table.ld-table.is-labelled:not(.is-grid) td::before { content: attr(data-label); flex: 0 0 auto; max-width: 45%; text-align: left; color: var(--ld-muted); font-size: 12px; font-weight: 500; }
  table.ld-table.is-labelled:not(.is-grid) td[data-label=""]::before { display: none; }
  table.ld-table.is-labelled:not(.is-grid) td[data-label=""] { justify-content: flex-end; }
  table.ld-table.is-labelled:not(.is-grid) td > * { min-width: 0; }
  table.ld-table.is-labelled:not(.is-grid) td .sub { text-align: right; }
  /* the first cell is the row's title: full width, bold, no label */
  table.ld-table.is-labelled:not(.is-grid) td:first-child { display: block; text-align: left; font-weight: 600; }
  table.ld-table.is-labelled:not(.is-grid) td:first-child::before { display: none; }
  table.ld-table.is-labelled:not(.is-grid) td:first-child .sub { text-align: left; font-weight: 400; }
  table.ld-table.is-labelled:not(.is-grid) td:empty { display: none; }
  table.ld-table.is-labelled:not(.is-grid) tfoot tr { background: none; border-style: dashed; }

  .ld-steps li { grid-template-columns: 24px minmax(0, 1fr); }
  .ld-steps li > .ld-btn { grid-column: 2; justify-self: start; }
}

/* "Continue with Google" / Microsoft on sign-in and sign-up */
.ld-social { display: grid; gap: 10px; margin: 0 0 18px; }
.ld-social-btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 16px;
  border: 1px solid var(--ld-line); border-radius: 8px; background: var(--ld-surface); color: var(--ld-fg); font: 500 15px var(--ld-font); cursor: pointer; }
.ld-social-btn:hover { border-color: var(--ld-accent); }
.ld-social-btn:focus-visible { outline: 2px solid var(--ld-accent); outline-offset: 2px; }
.ld-social-or { display: flex; align-items: center; gap: 10px; color: var(--ld-muted); font-size: 13px; margin-top: 6px; }
.ld-social-or::before, .ld-social-or::after { content: ""; flex: 1; border-top: 1px solid var(--ld-line); }

/* the Settings page: groups of cards, one line each */
.ld-settings-group { margin: 0 0 22px; max-width: 1100px; }
.ld-settings-group h2 { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ld-muted); margin: 0 0 8px; }
.ld-settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
/* CAT analyses (job / quote card) and the match-discount grid */
.ld-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
label.ld-btn { position: relative; cursor: pointer; }
label.ld-btn:focus-within { outline: 2px solid var(--ld-accent); outline-offset: 2px; }
label.ld-btn.is-disabled { opacity: .55; pointer-events: none; }
.ld-cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ld-cat-item { border: 1px solid var(--ld-line); border-radius: var(--ld-radius); padding: 10px; margin: 0 0 12px; background: var(--ld-surface-2, var(--ld-surface)); }
.ld-cat-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.ld-cat-title strong { overflow-wrap: anywhere; }
.ld-cat-item .ld-table-wrap { box-shadow: none; }
.ld-cat-table { font-size: 13px; }
.ld-cat-table td, .ld-cat-table th { padding: 5px 6px; }
.ld-cat-table th { letter-spacing: 0; font-size: 11px; }
.ld-cat-table td:first-child { white-space: normal; min-width: 0; }
.ld-cat-table tfoot td { background: var(--ld-head); }
.ld-cat-sum { margin: 8px 0 4px; font-size: 13px; color: var(--ld-fg); }
.ld-cat-sum span { color: var(--ld-muted); }
.ld-cat-files { margin: 6px 0; font-size: 13px; }
.ld-cat-files summary { cursor: pointer; color: var(--ld-accent); }
.ld-cat-warn { margin: 8px 0; padding: 8px 10px 8px 26px; border-radius: 6px; background: var(--ld-warn-soft); color: var(--ld-fg); font-size: 12.5px; }
.ld-cat-item .ld-actions { margin-top: 10px; }
.ld-cat-add { margin-top: 4px; }
.ld-cat-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; margin-bottom: 6px; }
.ld-cat-words label { font-size: 12.5px; }
.ld-grid-editor { max-width: 620px; }
.ld-grid-editor td { vertical-align: middle; }
.ld-pct { display: inline-flex; align-items: center; gap: 6px; }
.ld-pct input { width: 84px !important; }

/* Settings > Payment chasers */
.ld-chase-line { display: flex; flex-wrap: wrap; gap: 6px 4px; list-style: none; margin: 0; padding: 0; font-size: 13px; }
.ld-chase-line li { padding: 3px 10px; border-radius: 999px; background: var(--ld-accent-soft); color: var(--ld-accent); }
.ld-chase-line li:not(:last-child)::after { content: " \2192"; color: var(--ld-muted); }
.ld-chase-line li.is-final { background: var(--ld-danger-soft); color: var(--ld-danger); }
.ld-chase-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 12px; font-size: 14px; }
.ld-chase-when input { width: 80px; min-height: 36px; border: 1px solid var(--ld-line); border-radius: 6px; padding: 4px 8px; background: var(--ld-surface); color: var(--ld-fg); font: 14px var(--ld-font); }
.ld-chase-when select { min-height: 36px; border: 1px solid var(--ld-line); border-radius: 6px; padding: 4px 8px; background: var(--ld-surface); color: var(--ld-fg); font: 14px var(--ld-font); }
.ld-card.is-off { opacity: .7; }

/* Settings > Email */
.ld-mail-from { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--ld-line); border-radius: var(--ld-radius); background: var(--ld-surface-2, var(--ld-surface)); margin-bottom: 12px; }
.ld-mail-from strong { display: block; overflow-wrap: anywhere; }
.ld-mail-providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.ld-mail-provider { display: flex; flex-direction: column; align-items: flex-start; padding: 12px; border: 1px solid var(--ld-line); border-radius: var(--ld-radius); }
.ld-guide { padding-top: 10px; }
.ld-guide ol { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 6px; }
.ld-fwd { display: grid; gap: 4px; }
.ld-senders { columns: 2; column-gap: 16px; font-size: 13px; }

.ld-settings-card { display: grid; gap: 4px; padding: 14px 16px; background: var(--ld-surface); border: 1px solid var(--ld-line);
  border-radius: var(--ld-radius); color: var(--ld-fg); text-decoration: none; }
.ld-settings-card:hover { border-color: var(--ld-accent); }
.ld-settings-card strong { font-weight: 600; }
.ld-settings-card span { color: var(--ld-muted); font-size: 13px; line-height: 1.45; }

/* Settings > Appearance: one card per skin with a small picture of it */
.ld-skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; max-width: 1100px; margin: 0 0 14px; }
.ld-skin { display: grid; gap: 12px; padding: 12px; text-align: left; background: var(--ld-surface); color: var(--ld-fg); border: 1px solid var(--ld-line);
  border-radius: 12px; box-shadow: var(--ld-shadow); cursor: pointer; font: inherit; transition: border-color .12s, box-shadow .12s; }
.ld-skin:hover { border-color: var(--ld-accent); box-shadow: var(--ld-shadow-lg); }
.ld-skin.is-on { border-color: var(--ld-accent); box-shadow: 0 0 0 2px var(--ld-accent-soft), var(--ld-shadow); }
.ld-skin:focus-visible { outline: 2px solid var(--ld-accent); outline-offset: 2px; }
.ld-skin-preview { position: relative; display: flex; height: 132px; border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.ld-skin-rail { width: 30%; display: grid; align-content: start; gap: 7px; padding: 12px 10px; }
.ld-skin-rail i { display: block; height: 6px; border-radius: 3px; }
.ld-skin-rail i:first-child { width: 60%; height: 8px; margin-bottom: 4px; }
.ld-skin-body { flex: 1; display: grid; align-content: start; gap: 10px; padding: 14px 12px; }
.ld-skin-body > b { display: block; width: 55%; height: 9px; border-radius: 3px; }
.ld-skin-cardrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ld-skin-card { display: grid; gap: 6px; padding: 9px 8px; border-radius: 6px; }
.ld-skin-card i { display: block; width: 70%; height: 5px; border-radius: 3px; }
.ld-skin-card b { display: block; width: 45%; height: 8px; border-radius: 3px; }
.ld-skin-btn { display: block; width: 38%; height: 14px; border-radius: 5px; }
.ld-skin-night { position: absolute; inset: 0 0 0 50%; clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%); opacity: .92; }
.ld-skin-text { display: grid; gap: 3px; padding: 0 4px 2px; }
.ld-skin-text strong { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.ld-skin-text em { font-style: normal; font: 600 11px/1.7 var(--ld-font); padding: 0 8px; border-radius: 999px; background: var(--ld-accent-soft); color: var(--ld-accent); }
.ld-skin-text > span { color: var(--ld-muted); font-size: 13px; line-height: 1.45; }
