/* ==========================================================================
   SDR CRM - component styles (layer 4)
   --------------------------------------------------------------------------
   Load order: /brand/brand.css (1) -> /brand/tokens.css (2) ->
   /v2/styles/v2-shell.css (3, the rail roles, grafted from public-v2) -> this.

   Ported from the approved mockup, sdr-crm-mockup-v2.html. Its --mock-* roles
   carried the same names and values as v2's --v2-* roles, so they read the
   grafted v2-shell.css here and no role is declared twice.

   No hex value appears in this file. Font sizes use the type tokens where one
   exists; 11px, 12px, 18px and 26px have none and are written as v2.css writes
   them. Those four are parked for Iris.

   Desktop only, the same as v2 (ruling p3v). No breakpoint below 1280.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.45;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--color-accent-ink);
}
h1,
h2,
h3,
p {
  margin: 0;
}
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
.rail :focus-visible {
  outline-color: var(--v2-rail-focus-ring);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: var(--eyebrow-tracking);
  font-size: 11px;
  font-weight: 700;
}
.muted {
  color: var(--color-text-muted);
  font-size: 12px;
}
.strong {
  color: var(--color-text-strong);
  font-weight: 600;
}
.email {
  overflow-wrap: normal;
}
[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: -48px;
  background: var(--color-surface);
  color: var(--color-text-strong);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 70;
  transition: top 0.12s ease;
}
.skip-link:focus {
  top: var(--space-sm);
}

/* ---------------- Shell ---------------- */
.shell {
  display: grid;
  /* 232px and 68px are v2's open and collapsed rail widths, kept so both apps match. */
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
  width: 100%;
}
.shell.is-collapsed {
  grid-template-columns: 68px minmax(0, 1fr);
}
.rail {
  background: var(--v2-rail-bg);
  color: var(--v2-rail-ink);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--v2-rail-rule);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.rail__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  min-height: 62px;
}
.rail__mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: var(--radius-sm);
  background: var(--surface-brand-hero);
  color: var(--on-surface-brand-hero);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}
.rail__wordmark {
  font-weight: 700;
  font-size: 15px;
  color: var(--v2-rail-ink-strong);
}
.rail__wordmark small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: var(--v2-rail-ink-mute);
}
.rail__nav {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--space-sm) var(--space-md) var(--space-lg);
}
.rail__section {
  margin: var(--space-lg) 0 var(--space-xs);
  padding: 0 var(--space-sm);
  color: var(--v2-rail-ink-mute);
}
.rail__section:first-child {
  margin-top: var(--space-xs);
}
.navitem {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--v2-rail-ink);
  font-size: var(--text-body);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
}
.navitem:hover {
  background: var(--v2-rail-hover);
  color: var(--v2-rail-ink-strong);
}
.navitem.is-active {
  background: var(--v2-rail-active);
  color: var(--v2-rail-active-ink);
  font-weight: 600;
}
.navitem.is-disabled {
  color: var(--v2-rail-ink-mute);
  cursor: default;
}
.navitem.is-disabled:hover {
  background: none;
  color: var(--v2-rail-ink-mute);
}
.navitem svg {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
}
.navitem__count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  background: var(--v2-rail-badge);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}
.navitem.is-active .navitem__count {
  background: var(--v2-rail-badge-active);
}
.rail__user {
  border-top: 1px solid var(--v2-rail-rule);
  background: var(--v2-rail-bg-2);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: var(--radius-pill);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  background: var(--v2-avatar-bg);
  color: var(--v2-avatar-ink);
}
.rail__user-meta {
  min-width: 0;
  flex: 1 1 auto;
}
.rail__user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--v2-rail-ink-strong);
  overflow-wrap: anywhere;
}
.rail__user-role {
  font-size: 11px;
  color: var(--v2-rail-ink-mute);
}
.shell.is-collapsed .rail__wordmark,
.shell.is-collapsed .rail__section,
.shell.is-collapsed .navitem span,
.shell.is-collapsed .rail__user-meta {
  display: none;
}
.shell.is-collapsed .rail__brand,
.shell.is-collapsed .rail__user {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
.shell.is-collapsed .navitem {
  justify-content: center;
  padding: 9px 0;
}

.iconbtn {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: inherit;
  padding: 6px;
  display: grid;
  place-items: center;
  line-height: 0;
}
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-xl);
  background: var(--v2-topbar);
  border-bottom: 1px solid var(--color-border);
  min-height: var(--topbar-h);
}
.topbar .iconbtn {
  color: var(--color-text-muted);
}
.topbar .iconbtn:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-caption);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.crumbs b {
  color: var(--color-text);
  font-weight: 600;
}
.searchwrap {
  position: relative;
  flex: 1 1 auto;
  max-width: 560px;
  margin: 0 auto;
  min-width: 0;
}
.searchwrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}
.searchwrap .input {
  padding-left: 32px;
  background: var(--color-surface-2);
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

.content {
  padding: var(--space-xl) var(--space-xl) 96px;
  flex: 1 1 auto;
  min-width: 0;
}
.content:focus {
  outline: none;
}
.pagehead {
  margin-bottom: var(--space-lg);
}
.pagehead h1 {
  font-size: 26px;
  line-height: 1.15;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
  color: var(--color-text-strong);
}
.pagehead p {
  font-size: var(--text-caption);
  color: var(--color-text-muted);
}
.greet {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-strong);
  margin-bottom: var(--space-md);
}

/* ---------------- Controls ---------------- */
.input {
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-caption);
}
.input::placeholder {
  color: var(--color-text-muted);
}
textarea.input {
  resize: vertical;
  min-height: 64px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--text-caption);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  background: var(--color-surface-2);
  border-color: var(--color-border-strong);
}
.btn.is-on {
  border-color: var(--border-selected);
  color: var(--color-accent-ink);
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
}
.btn--primary {
  background: var(--surface-cta);
  border-color: var(--surface-cta);
  color: var(--on-surface-cta);
}
.btn--primary:hover {
  background: var(--surface-cta-hover);
  border-color: var(--surface-cta-hover);
}
.btn--primary:focus-visible {
  outline-color: var(--focus-ring-on-cta);
}
/* A fill token with its paired ink (GL-003 2.0a). The status ink never fills.
   Hover underlines rather than borrowing a darker red; that role is Iris's. */
.btn--danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: var(--on-surface-danger);
}
.btn--danger:hover {
  background: var(--color-danger);
  border-color: var(--color-danger);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn--sm {
  padding: 3px 9px;
  font-size: 12px;
  min-height: 26px;
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btngroup {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.btngroup .btn {
  border: 0;
  border-radius: 0;
}
.btngroup .btn + .btn {
  border-left: 1px solid var(--color-border);
}
.btngroup .btn:focus-visible {
  outline-offset: -3px;
}
.btnrow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}
.leadlink {
  font-weight: 700;
  color: var(--color-accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: var(--space-md);
}
.field label,
.flabel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--eyebrow-tracking);
  color: var(--color-text-muted);
}
.formerror {
  color: var(--color-danger-ink);
  font-size: var(--text-caption);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.formerror:empty {
  display: none;
}

/* ---------------- Chips ---------------- */
.chip {
  display: inline-block;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.chip--won {
  background: var(--surface-status-success);
  color: var(--on-surface-status-success);
}
.chip--lost {
  background: var(--surface-status-danger);
  color: var(--on-surface-status-danger);
}
.chip--ex {
  background: var(--surface-status-warning);
  color: var(--on-surface-status-warning);
}
.chip--proc {
  background: var(--surface-status-info);
  color: var(--on-surface-status-info);
}
.chip--none {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
}
.src {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--viz-cat-5-ink);
  border-radius: var(--radius-xs);
  padding: 1px 7px;
}
.src--crm {
  background: var(--viz-cat-5);
}

/* ---------------- Cards and tiles ---------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}
.card__title {
  font-size: var(--text-h2);
  font-weight: 700;
  color: var(--color-text-strong);
}
.card__sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.card__end {
  margin-left: auto;
}
.card__body {
  padding: var(--space-md) var(--space-lg);
}
.card__body--flush {
  padding: 0;
}
.subhead {
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--color-text-strong);
  margin: var(--space-lg) 0 var(--space-sm);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.tiles--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.tile {
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  box-shadow: var(--shadow-sm);
  color: inherit;
}
button.tile:hover {
  border-color: var(--border-selected);
}
.tile__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--eyebrow-tracking);
  color: var(--color-text-muted);
}
.tile__val {
  display: block;
  font-size: var(--text-metric);
  font-weight: 700;
  line-height: 1.05;
  margin-top: 6px;
  color: var(--color-text-strong);
}
.tile__sub {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.tile--danger {
  border-color: var(--color-danger);
  box-shadow:
    inset 0 0 0 1px var(--color-danger),
    var(--shadow-sm);
}
.tile--danger .tile__val {
  color: var(--on-surface-status-danger);
}
.tile--warn .tile__val {
  color: var(--on-surface-status-warning);
}
.stack {
  display: grid;
  gap: var(--space-lg);
}
.empty {
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  color: var(--color-text-muted);
}

/* ---------------- Stage strip and saved views ---------------- */
.pillstrip {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.pill-stage {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-stage:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}
.pill-stage.is-on {
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  border-color: var(--border-selected);
  color: var(--color-accent-ink);
}
.pill-stage__n {
  font-size: var(--text-body);
  font-weight: 700;
  color: var(--color-text-strong);
}
.pill-stage.is-on .pill-stage__n {
  color: var(--color-accent-ink);
}
.dd {
  position: relative;
}
.pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  min-width: 260px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm);
}
.pop__head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--eyebrow-tracking);
  color: var(--color-text-muted);
  padding: 2px 4px 6px;
}
.views__group {
  padding: var(--space-md) var(--space-sm) var(--space-xs);
  color: var(--color-text-muted);
}
.views__group:first-of-type {
  padding-top: var(--space-xs);
}
.viewitem {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 1px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text);
  font-size: var(--text-caption);
  text-align: left;
}
.viewitem:hover {
  background: var(--color-surface-2);
}
.viewitem.is-active {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-accent-ink);
  font-weight: 700;
}
.viewitem__name {
  flex: 1 1 auto;
}
.viewitem__count {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
}
.viewitem.is-active .viewitem__count {
  color: var(--color-accent-ink);
}

/* ---------------- Grid ---------------- */
table.grid {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: var(--text-caption);
  table-layout: fixed;
}
table.grid th,
table.grid td {
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 6px 9px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
  background: var(--color-surface);
}
table.grid th:last-child,
table.grid td:last-child {
  border-right: 0;
}
table.grid thead th {
  position: sticky;
  top: var(--topbar-h);
  z-index: 3;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--eyebrow-tracking);
  border-bottom: 1px solid var(--color-border-strong);
  overflow-wrap: normal;
}
table.grid thead th .th-sub {
  display: block;
  margin-top: 2px;
  padding-top: 2px;
  border-top: 1px dashed var(--color-border);
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
table.grid tbody tr:nth-child(even) td {
  background-image: linear-gradient(var(--v2-zebra), var(--v2-zebra));
}
table.grid tbody tr:hover td {
  background-image: linear-gradient(var(--v2-cell-hover), var(--v2-cell-hover));
}
table.grid tr.is-overdue td:first-child {
  box-shadow: inset 3px 0 0 var(--color-danger);
}
table.grid .is-num {
  text-align: right;
}
table.grid tbody td.is-num {
  font-weight: 600;
}
.cell2 {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
table.grid td .chip {
  white-space: normal;
}
.rownum {
  color: var(--color-text-muted);
  white-space: nowrap;
}
.phones {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
}
.phones li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
}
.phones .kind {
  font-size: 11px;
  color: var(--color-text-muted);
}
.gridfoot {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Column widths. Each set sums to 100%. My leads, 11 columns. */
/* 48px holds a three-digit row number plus the cell's 18px of padding at any width. */
col.w-n {
  width: 48px;
}
col.w-status {
  width: 10%;
}
col.w-lead {
  width: 13%;
}
col.w-phones {
  width: 13%;
}
col.w-email {
  width: 10%;
}
col.w-source {
  width: 7%;
}
col.w-stage {
  width: 11%;
}
col.w-owner {
  width: 7%;
}
col.w-next {
  width: 13%;
}
col.w-due {
  width: 5%;
}
col.w-moved {
  width: 8%;
}
/* Today queue, 7 columns. */
col.q-n {
  width: 48px;
}
col.q-why {
  width: 12%;
}
col.q-what {
  width: 29%;
}
col.q-lead {
  width: 20%;
}
col.q-phone {
  width: 15%;
}
col.q-moved {
  width: 11%;
}
col.q-open {
  width: 9%;
}
/* Rejected rows, 2 columns. */
col.r-row {
  width: 10%;
}
col.r-why {
  width: 90%;
}
/* Recent uploads, 10 columns. */
col.b-when {
  width: 12%;
}
col.b-list {
  width: 22%;
}
col.b-owner {
  width: 12%;
}
col.b-n {
  width: 7%;
}
col.b-status {
  width: 14%;
}
col.b-act {
  width: 12%;
}

/* ---------------- Lead page ---------------- */
.backrow {
  margin-bottom: var(--space-md);
}
.leadhead {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  align-items: flex-start;
  padding: var(--space-lg);
}
.leadhead__id {
  flex: 1 1 320px;
  min-width: 0;
}
.leadhead h2 {
  font-size: var(--text-h1);
  line-height: 1.2;
  color: var(--color-text-strong);
}
.leadhead .chips {
  margin-top: var(--space-sm);
}
.coldclock {
  flex: 0 1 380px;
  border-left: 3px solid var(--border-selected);
  padding: 2px var(--space-md);
}
.coldclock__n {
  font-size: var(--text-metric-sm);
  font-weight: 700;
  color: var(--color-text-strong);
}
.coldclock.is-cold {
  border-left-color: var(--color-danger);
}
.pickform {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  align-items: center;
  gap: var(--space-xs);
}
.select-inline {
  width: auto;
  min-width: 0;
  flex: 0 1 auto;
  padding: 3px 6px;
}
.leadhead__actions {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.leadgrid {
  display: grid;
  gap: var(--space-lg);
  align-items: start;
  margin-top: var(--space-lg);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr) minmax(0, 1.6fr);
}
.nextstep {
  border: 2px solid var(--border-selected);
}
.nextstep.is-overdue {
  border-color: var(--color-danger);
}
.nextstep__what {
  font-size: var(--text-h2);
  line-height: 1.3;
  font-weight: 700;
  color: var(--color-text-strong);
  margin: var(--space-xs) 0;
}
.nextstep .btnrow {
  margin-top: var(--space-md);
}
.nsform {
  margin-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}
dl.kv {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-sm) var(--space-md);
  margin: 0;
}
dl.kv dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--eyebrow-tracking);
  color: var(--color-text-muted);
  padding-top: 3px;
}
dl.kv dd {
  margin: 0;
  overflow-wrap: anywhere;
  display: flex;
  flex-wrap: wrap;
  gap: 4px var(--space-sm);
  align-items: center;
}
.tasks {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tasks li {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}
.tasks li:last-child {
  border-bottom: 0;
}
.tasks input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
}
.tasks .is-done label {
  text-decoration: line-through;
  color: var(--color-text-muted);
}
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.feed li {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr);
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}
.feed li:last-child {
  border-bottom: 0;
}
.feed li.empty {
  display: block;
}
.feed__when {
  color: var(--color-text-muted);
  font-size: 12px;
}
.feed__title {
  font-weight: 600;
  color: var(--color-text-strong);
}
.feed__body {
  margin-top: 2px;
}
.notice {
  margin-top: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  background: var(--surface-status-info);
  color: var(--on-surface-status-info);
}
.notice.is-closed {
  background: var(--color-surface-2);
  color: var(--color-text);
}
.notice.is-error {
  background: var(--surface-status-danger);
  color: var(--on-surface-status-danger);
  margin-top: 0;
}
.notice .btnrow {
  margin-top: var(--space-sm);
}

/* ---------------- Upload ---------------- */
.preview p {
  margin-bottom: var(--space-xs);
}
.maptable {
  border-collapse: collapse;
  margin: var(--space-sm) 0;
}
.maptable th {
  text-align: left;
  padding: 3px var(--space-md) 3px 0;
  font-weight: 600;
}
.maptable td {
  padding: 3px 0;
}
.upform {
  max-width: 560px;
  margin-top: var(--space-md);
}
.sumline {
  margin: var(--space-sm) 0 0;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.sumline.is-ok {
  background: var(--surface-status-success);
  color: var(--on-surface-status-success);
}
.sumline.is-bad {
  background: var(--surface-status-danger);
  color: var(--on-surface-status-danger);
}

/* ---------------- Dialogs and toast ---------------- */
dialog {
  border: 0;
  border-radius: var(--radius-md);
  padding: 0;
  box-shadow: var(--shadow-lg);
  /* The mockup's dialog width, and 16px of margin each side on a narrow window. */
  width: min(480px, calc(100vw - 32px));
  color: var(--color-text);
  background: var(--color-surface);
}
dialog::backdrop {
  background: var(--scrim-backdrop);
}
.dialog__band {
  background: var(--surface-brand);
  color: var(--on-surface-brand);
  padding: var(--space-md) var(--space-lg);
  font-weight: 700;
}
.dialog__body {
  padding: var(--space-lg);
}
.dialog__body > p {
  margin-bottom: var(--space-md);
}
.toast {
  position: fixed;
  right: var(--space-xl);
  bottom: var(--space-xl);
  z-index: 300;
  max-width: 460px;
  background: var(--color-text-strong);
  color: var(--color-bg);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--text-caption);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  pointer-events: none;
}
.toast.is-open {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .toast,
  .skip-link {
    transition: none;
  }
}
