:root {
  color-scheme: light;
  --page: #eef1f7;
  --page-accent: #f9fbff;
  --surface: rgba(250, 252, 255, 0.9);
  --surface-solid: #f8faff;
  --surface-raised: #ffffff;
  --surface-soft: #edf1f8;
  --text: #202433;
  --text-soft: #5c6478;
  --muted: #858da0;
  --line: rgba(105, 117, 145, 0.16);
  --line-strong: rgba(105, 117, 145, 0.26);
  --primary: #6c63e9;
  --primary-dark: #554ccf;
  --primary-soft: #eceafe;
  --success: #20a875;
  --success-soft: #dcf7ed;
  --warning: #e49925;
  --warning-soft: #fff2d7;
  --danger: #d95c70;
  --danger-soft: #ffeaee;
  --info: #4287d6;
  --info-soft: #e4f0ff;
  --shadow-raised: 10px 10px 24px rgba(159, 170, 194, 0.2), -10px -10px 24px rgba(255, 255, 255, 0.72);
  --shadow-soft: 5px 5px 12px rgba(159, 170, 194, 0.2), -5px -5px 12px rgba(255, 255, 255, 0.78);
  --shadow-pressed: inset 3px 3px 7px rgba(159, 170, 194, 0.22), inset -3px -3px 7px rgba(255, 255, 255, 0.8);
  --focus: 0 0 0 3px rgba(108, 99, 233, 0.22);
  --radius-xl: 26px;
  --radius-lg: 19px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #171923;
  --page-accent: #202330;
  --surface: rgba(31, 34, 47, 0.92);
  --surface-solid: #202330;
  --surface-raised: #252837;
  --surface-soft: #1b1e29;
  --text: #f2f3f8;
  --text-soft: #bec3d2;
  --muted: #8e95a9;
  --line: rgba(205, 210, 230, 0.1);
  --line-strong: rgba(205, 210, 230, 0.18);
  --primary: #8c84ff;
  --primary-dark: #756ce7;
  --primary-soft: #32304f;
  --success: #4cd49e;
  --success-soft: #1e3d35;
  --warning: #f1b859;
  --warning-soft: #413521;
  --danger: #f07b8d;
  --danger-soft: #432931;
  --info: #76adf1;
  --info-soft: #27384f;
  --shadow-raised: 10px 10px 24px rgba(7, 8, 13, 0.34), -8px -8px 20px rgba(56, 60, 79, 0.24);
  --shadow-soft: 5px 5px 12px rgba(7, 8, 13, 0.34), -5px -5px 12px rgba(56, 60, 79, 0.2);
  --shadow-pressed: inset 3px 3px 8px rgba(6, 7, 12, 0.38), inset -3px -3px 8px rgba(58, 62, 80, 0.2);
  --focus: 0 0 0 3px rgba(140, 132, 255, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -8%, rgba(108, 99, 233, 0.12), transparent 33rem),
    radial-gradient(circle at 88% 10%, rgba(66, 135, 214, 0.08), transparent 30rem),
    linear-gradient(145deg, var(--page-accent), var(--page));
  color: var(--text);
  font: 14px/1.5 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  touch-action: manipulation;
}

button {
  border: 0;
}

button:not(:disabled),
a[href],
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4);
  opacity: 0.48;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 9px 13px;
  border-radius: 9px;
  background: var(--text);
  color: var(--page);
  text-decoration: none;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.topbar-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 8px 20px rgba(91, 82, 211, 0.28);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  stroke: none;
}

.brand strong,
.brand small {
  display: block;
  white-space: nowrap;
}

.brand strong {
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.icon-text-button,
.icon-button,
.small-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--text-soft);
  text-decoration: none;
  transition: transform 130ms ease, box-shadow 130ms ease, color 130ms ease, border-color 130ms ease;
}

.icon-text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 700;
}

.icon-text-button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
}

.icon-button {
  width: 40px;
  padding: 0;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
}

.icon-button:hover,
.icon-text-button:hover,
.small-button:hover {
  border-color: var(--line-strong);
  color: var(--primary);
  transform: translateY(-1px);
}

.icon-button:active,
.icon-text-button:active,
.small-button:active,
.button:active:not(:disabled),
.segmented button:active:not(:disabled),
.task-action:active:not(:disabled) {
  box-shadow: var(--shadow-pressed);
  transform: translateY(1px) scale(0.98);
}

.telegram-control {
  position: relative;
}

.telegram-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: max-content;
  min-width: 210px;
  max-width: min(310px, calc(100vw - 32px));
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: 0 18px 46px rgba(24, 29, 45, 0.2);
}

.telegram-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 40px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

.telegram-menu a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.telegram-menu svg {
  width: 16px;
  height: 16px;
}

.theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

#languageButton {
  position: relative;
}

#languageButton svg {
  opacity: 0.52;
}

#languageButtonText {
  position: absolute;
  font-size: 9px;
  font-weight: 850;
}

.workspace {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 56px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 25px;
  padding: 0 4px;
}

.hero h1 {
  margin: 3px 0 6px;
  font-size: clamp(35px, 5vw, 52px);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.hero p:not(.eyebrow) {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

.connection-pill[data-state="connected"] {
  color: var(--success);
}

.connection-pill[data-state="syncing"] {
  color: var(--warning);
}

.connection-pill[data-state="error"] {
  color: var(--danger);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-heading h2 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.step-number {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  box-shadow: var(--shadow-pressed);
}

.timeline-panel {
  margin-bottom: 22px;
  padding: 22px 24px 18px;
}

.timeline-heading {
  justify-content: space-between;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-pressed);
}

.segmented button {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  transition: 130ms ease;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.active,
.segmented button[aria-checked="true"] {
  background: var(--surface-raised);
  box-shadow: 3px 3px 8px rgba(122, 132, 154, 0.18), -3px -3px 8px color-mix(in srgb, var(--surface-raised) 82%, transparent);
  color: var(--primary);
}

.segmented.compact button {
  min-height: 30px;
  padding-inline: 11px;
}

.heatmap-wrap {
  width: 100%;
  margin-top: 19px;
  overflow: hidden;
}

.timeline-lanes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-lane {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr) 100px;
  align-items: center;
  gap: 12px;
}

.timeline-method {
  color: var(--text-soft);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.timeline-lane-summary {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.timeline-lane-summary > b {
  color: var(--success);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.heatmap {
  min-height: 15px;
  display: grid;
  grid-template-columns: repeat(144, minmax(2px, 1fr));
  gap: 2px;
  align-items: stretch;
}

.heat-cell {
  --heat-cell-accent: var(--slate);
  min-width: 0;
  border-radius: 4px;
  background: color-mix(in srgb, var(--muted) 10%, transparent);
  transition: transform 120ms ease, filter 120ms ease;
}

.heat-cell:hover,
.heat-cell:focus-visible {
  z-index: 2;
  filter: brightness(1.08);
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  transform: scale(1.2);
}

.heat-cell[data-level="1"],
.legend-scale i[data-level="1"] { background: color-mix(in srgb, var(--success) 24%, var(--surface-soft)); }
.heat-cell[data-level="2"],
.legend-scale i[data-level="2"] { background: color-mix(in srgb, var(--success) 45%, var(--surface-soft)); }
.heat-cell[data-level="3"],
.legend-scale i[data-level="3"] { background: color-mix(in srgb, var(--success) 70%, var(--surface-soft)); }
.heat-cell[data-level="4"],
.legend-scale i[data-level="4"] { background: var(--success); }

.heatmap-placeholder {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}

.timeline-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
}

.legend-scale {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-scale i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--muted) 10%, transparent);
}

.inline-retry {
  display: block;
  margin: 12px auto 0;
  padding: 5px 10px;
  background: transparent;
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 22px;
  margin-bottom: 22px;
}

.setup-grid > .panel {
  min-width: 0;
  padding: 24px;
}

.setup-grid .panel-heading {
  margin-bottom: 21px;
}

.field-label {
  display: block;
  margin: 0 0 7px 3px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 720;
}

.input-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
}

.input-shell,
.search-shell {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-pressed);
}

.input-shell > svg,
.search-shell > svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-left: 12px;
  color: var(--muted);
}

.input-shell input,
.search-shell input {
  min-width: 0;
  width: 100%;
  height: 43px;
  padding: 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
}

.input-shell:focus-within,
.search-shell:focus-within {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  box-shadow: var(--focus), var(--shadow-pressed);
}

.inside-icon {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  margin-right: 4px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}

.inside-icon:hover {
  background: var(--surface-raised);
  color: var(--primary);
}

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

.button {
  min-height: 43px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 780;
  white-space: nowrap;
  transition: transform 130ms ease, box-shadow 130ms ease, filter 130ms ease;
}

.button.primary {
  background: linear-gradient(145deg, var(--primary), var(--primary-dark));
  box-shadow: 0 8px 18px rgba(89, 80, 210, 0.24);
  color: white;
}

.button.primary:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.button.secondary {
  border-color: color-mix(in srgb, var(--primary) 20%, var(--line));
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: var(--shadow-soft);
}

.button.ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow-soft);
}

.history-row {
  min-height: 34px;
  margin-top: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.history-row select,
.sort-select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--text-soft);
  outline: 0;
}

.history-row select {
  max-width: 220px;
  height: 30px;
  padding: 0 26px 0 8px;
  font: 10px var(--mono);
}

.cdk-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.cdk-result .status-icon {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.cdk-result[data-state="error"] .status-icon {
  background: var(--danger);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.cdk-result[data-state="exhausted"] .status-icon {
  background: var(--warning);
  box-shadow: 0 0 0 4px var(--warning-soft);
}

.cdk-result strong,
.cdk-result p {
  display: block;
  margin: 0;
}

.cdk-result strong {
  font-size: 11px;
}

.cdk-result p {
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-meter {
  width: 86px;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.usage-meter i {
  display: block;
  height: 4px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}

.usage-meter b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
  transition: width 200ms ease;
}

.method-picker-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.method-picker-wrap .field-label {
  margin-bottom: 0;
}

.method-picker button {
  min-height: 29px;
}

textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: var(--surface-soft);
  box-shadow: var(--shadow-pressed);
  color: var(--text);
  font: 11px/1.55 var(--mono);
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

textarea:focus {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
  box-shadow: var(--focus), var(--shadow-pressed);
}

::placeholder {
  color: color-mix(in srgb, var(--muted) 74%, transparent);
}

.import-help {
  min-height: 31px;
  padding: 6px 3px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

#sessionParseHint {
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 750;
}

.button-row {
  display: flex;
  gap: 8px;
}

.button-row .button {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 8px;
}

.tasks-panel {
  min-height: 420px;
  padding: 24px;
}

.tasks-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}

.task-window-hint {
  max-width: 430px;
  margin: 5px 0 0;
  color: var(--warning);
  font-size: 10px;
  font-weight: 680;
}

.task-summary {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-pressed);
}

.task-summary > span {
  min-width: 62px;
  padding: 7px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-left: 1px solid var(--line);
}

.task-summary > span:first-child {
  border-left: 0;
}

.task-summary b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.task-summary small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 720;
  text-transform: uppercase;
}

.task-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
}

.task-toolbar .segmented {
  background: color-mix(in srgb, var(--surface-solid) 55%, transparent);
}

.toolbar-spacer {
  flex: 1 1 auto;
}

.search-shell {
  width: 178px;
  flex: 0 1 auto;
  background: var(--surface-solid);
  box-shadow: none;
}

.search-shell input {
  height: 37px;
  font-size: 11px;
}

.sort-select {
  width: 132px;
  height: 39px;
  padding: 0 26px 0 10px;
  background: var(--surface-solid);
  font-size: 10px;
}

.icon-button.raised {
  min-height: 39px;
  height: 39px;
  background: var(--surface-solid);
  box-shadow: none;
}

.bulk-bar {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 7px 5px;
  color: var(--muted);
  font-size: 10px;
}

.bulk-bar[aria-busy="true"] {
  color: var(--primary);
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 680;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

#selectedCount {
  margin-right: auto;
}

.small-button {
  min-height: 29px;
  padding: 0 10px;
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 750;
}

.small-button.danger {
  color: var(--danger);
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 250px;
}

.task-layer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-layer-heading {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.task-layer-heading span:last-child {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--surface-soft);
  text-align: center;
}

.task-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: 4px 4px 12px rgba(130, 140, 164, 0.11);
  content-visibility: auto;
  contain-intrinsic-size: auto 82px;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.task-card:hover {
  z-index: 1;
  border-color: var(--line-strong);
  box-shadow: 7px 9px 20px rgba(130, 140, 164, 0.14);
  transform: translateY(-1px);
}

.task-card[data-selected="true"] {
  border-color: color-mix(in srgb, var(--primary) 52%, var(--line));
  box-shadow: var(--focus), 5px 7px 16px rgba(130, 140, 164, 0.13);
}

.task-select {
  display: grid;
  align-self: start;
  place-items: center;
  padding-top: 4px;
}

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

.task-primary-line,
.task-meta-line,
.task-progress-line {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  flex-wrap: wrap;
}

.task-primary-line {
  min-height: 23px;
}

.task-identity {
  max-width: min(390px, 46vw);
  overflow: hidden;
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 8px;
  font-weight: 790;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.badge.method {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge.success,
.badge.paid,
.badge.eligible {
  background: var(--success-soft);
  color: var(--success);
}

.badge.warning,
.badge.checking {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.danger,
.badge.ineligible {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.info,
.badge.free {
  background: var(--info-soft);
  color: var(--info);
}

.badge.plus {
  border: 1px solid color-mix(in srgb, #b88700 48%, transparent);
  background: #f5b82e;
  color: #2d2100;
}

.badge.gcash-paid {
  border: 1px solid color-mix(in srgb, #b88700 48%, transparent);
  background: #f5b82e;
  color: #2d2100;
}

.badge.gcash-unpaid {
  background: var(--danger-soft);
  color: var(--danger);
}

.task-meta-line {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.task-meta-line span {
  position: relative;
  min-width: 0;
}

.task-meta-line span + span {
  padding-left: 8px;
}

.task-meta-line span + span::before {
  position: absolute;
  left: 0;
  color: var(--line-strong);
  content: "·";
}

.task-error {
  margin-top: 6px;
  color: var(--danger);
  font-size: 9px;
  font-weight: 650;
}

.task-progress-line {
  margin-top: 8px;
  flex-wrap: nowrap;
}

.progress-track {
  min-width: 80px;
  height: 5px;
  flex: 1 1 220px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-pressed);
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--info));
  transition: width 300ms ease;
}

.progress-label {
  max-width: 240px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-actions {
  max-width: 240px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.task-action {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
  color: var(--text-soft);
  transition: 130ms ease;
}

.task-action:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--primary) 26%, var(--line));
  color: var(--primary);
  transform: translateY(-1px);
}

.task-action[data-tone="primary"] {
  background: var(--primary-soft);
  color: var(--primary);
}

.task-action[data-tone="danger"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.task-action svg {
  width: 16px;
  height: 16px;
}

.qr-panel {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 3px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.qr-panel img {
  width: 150px;
  height: 150px;
  padding: 7px;
  border-radius: 10px;
  background: white;
  object-fit: contain;
}

.qr-panel strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.qr-panel p {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font: 9px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-error {
  color: var(--danger) !important;
}

.empty-state {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 13px;
  border-radius: 19px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-pressed);
  color: var(--primary);
}

.empty-icon svg {
  width: 28px;
  height: 28px;
}

.empty-state h3 {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

.empty-state p {
  margin: 4px 0 0;
  font-size: 10px;
}

.footer {
  width: min(1180px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.api-dialog {
  width: min(780px, calc(100% - 32px));
  max-height: min(820px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface-solid);
  box-shadow: 0 26px 80px rgba(13, 17, 29, 0.3);
  color: var(--text);
}

.api-dialog::backdrop {
  background: rgba(17, 20, 31, 0.52);
  backdrop-filter: blur(5px);
}

.dialog-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.dialog-tabs {
  display: flex;
  gap: 5px;
  padding: 12px 22px 0;
}

.dialog-tabs button {
  padding: 8px 12px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.dialog-tabs button[aria-selected="true"] {
  background: var(--primary-soft);
  color: var(--primary);
}

.api-guide-body {
  position: relative;
  max-height: calc(100dvh - 170px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 11px 22px 28px;
  scrollbar-gutter: stable;
}

.api-guide-body article {
  color: var(--text-soft);
  font-size: 12px;
}

.api-guide-section {
  border-bottom: 1px solid var(--line);
}

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

.api-guide-section summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 2px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 780;
  list-style: none;
}

.api-guide-section summary::-webkit-details-marker {
  display: none;
}

.api-guide-section summary::after {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease, border-color 160ms ease;
}

.api-guide-section[open] summary {
  color: var(--primary);
}

.api-guide-section[open] summary::after {
  border-color: var(--primary);
  transform: rotate(225deg) translate(-2px, -1px);
}

.api-guide-section-content {
  padding: 0 2px 19px;
}

.api-guide-section p,
.api-guide-section li {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.72;
}

.api-guide-section p {
  margin: 7px 0;
}

.api-guide-section ol {
  margin: 8px 0 11px;
  padding-left: 21px;
}

.api-guide-body code {
  color: color-mix(in srgb, var(--primary) 72%, var(--text));
  font: 0.95em var(--mono);
}

.api-guide-note {
  margin: 13px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.62;
}

.api-guide-note strong {
  color: var(--text);
}

.api-guide-note.warning {
  border-color: color-mix(in srgb, var(--warning) 38%, var(--line));
  background: color-mix(in srgb, var(--warning-soft) 64%, var(--surface-solid));
}

.api-guide-note.danger {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 65%, var(--surface-solid));
}

.api-code {
  position: relative;
  margin: 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  box-shadow: var(--shadow-pressed);
  overflow: hidden;
}

.api-code pre {
  margin: 0;
  padding: 14px 76px 14px 14px;
  overflow-x: auto;
  color: var(--text);
  font: 10px/1.6 var(--mono);
  tab-size: 2;
}

.api-code pre code {
  color: inherit;
  font: inherit;
}

.api-copy-button {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 1;
  min-width: 49px;
  min-height: 29px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 780;
}

.api-copy-button:hover,
.api-copy-button:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  color: var(--primary);
}

.api-copy-button[data-copy-state="success"] {
  color: var(--success);
}

.api-copy-button[data-copy-state="error"] {
  color: var(--danger);
}

.api-guide-table-wrap {
  max-width: 100%;
  margin: 12px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.api-guide-table {
  width: 100%;
  min-width: 570px;
  border-collapse: collapse;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.55;
}

.api-guide-table th,
.api-guide-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.api-guide-table tr:last-child td {
  border-bottom: 0;
}

.api-guide-table th {
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.api-copy-status {
  position: sticky;
  top: 0;
  z-index: 2;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 8px auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 750;
}

.api-copy-status[data-tone="success"] {
  border-color: color-mix(in srgb, var(--success) 35%, var(--line));
  color: var(--success);
}

.api-copy-status[data-tone="error"] {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  color: var(--danger);
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 300;
  width: min(350px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-solid);
  box-shadow: 0 14px 36px rgba(14, 18, 31, 0.22);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
  animation: toast-in 180ms ease both;
}

.toast.success {
  border-color: color-mix(in srgb, var(--success) 35%, var(--line));
  color: var(--success);
}

.toast.error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  color: var(--danger);
}

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

@media (max-width: 1060px) {
  .task-toolbar {
    flex-wrap: wrap;
  }

  .toolbar-spacer {
    display: none;
  }

  .task-toolbar .search-shell {
    margin-left: auto;
  }

  .status-filter {
    order: 3;
    max-width: 100%;
  }
}

@media (max-width: 860px) {
  .topbar-inner,
  .workspace,
  .footer {
    width: min(100% - 28px, 720px);
  }

  .topbar-inner {
    min-height: 66px;
  }

  .topbar-actions .icon-text-button span {
    display: none;
  }

  .topbar-actions .icon-text-button {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .workspace {
    padding-top: 34px;
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }

  .heatmap {
    min-width: 720px;
  }

  .heatmap-wrap {
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .task-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .task-actions {
    grid-column: 2;
    max-width: none;
    justify-content: flex-start;
  }

  .qr-panel {
    grid-column: 2;
  }
}

@media (max-width: 650px) {
  .topbar-inner,
  .workspace,
  .footer {
    width: calc(100% - 20px);
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar-actions .icon-button,
  .topbar-actions .icon-text-button {
    width: 36px;
    min-height: 36px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand small {
    font-size: 9px;
  }

  .workspace {
    padding: 28px 0 40px;
  }

  .hero {
    align-items: flex-start;
    margin-bottom: 18px;
  }

  .hero h1 {
    font-size: 37px;
  }

  .hero p:not(.eyebrow) {
    max-width: 260px;
    font-size: 12px;
  }

  .connection-pill {
    padding: 8px;
  }

  .connection-pill span:last-child {
    display: none;
  }

  .panel,
  .setup-grid > .panel,
  .tasks-panel {
    border-radius: 19px;
  }

  .timeline-panel,
  .setup-grid > .panel,
  .tasks-panel {
    padding: 17px;
  }

  .timeline-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline-lanes {
    min-width: 890px;
  }

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

  .input-action-row .input-shell {
    grid-column: 1 / -1;
  }

  .method-picker-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

  .method-picker {
    width: 100%;
  }

  .method-picker button {
    flex: 1;
  }

  .import-help {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .button-row.three-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .button-row.three-actions .button.primary {
    grid-column: 1 / -1;
  }

  .tasks-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-summary {
    width: 100%;
  }

  .task-summary > span {
    min-width: 0;
    flex: 1;
  }

  .task-toolbar {
    align-items: stretch;
  }

  .scrollable {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .scrollable::-webkit-scrollbar {
    display: none;
  }

  .task-toolbar .search-shell {
    width: min(100%, calc(100% - 141px));
    margin-left: 0;
  }

  .sort-select {
    flex: 1 1 120px;
  }

  .bulk-bar {
    flex-wrap: wrap;
  }

  .task-card {
    padding: 12px;
  }

  .task-identity {
    max-width: calc(100vw - 115px);
  }

  .task-actions {
    width: 100%;
  }

  .qr-panel {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
  }

  .qr-panel img {
    width: 112px;
    height: 112px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
  }

  .api-dialog {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }

  .dialog-header {
    min-height: 66px;
    padding: 12px 14px;
  }

  .dialog-tabs {
    padding: 9px 14px 0;
  }

  .api-guide-body {
    max-height: calc(100dvh - 145px);
    padding: 8px 14px 22px;
  }

  .api-guide-section summary {
    min-height: 45px;
    font-size: 12px;
  }

  .api-guide-section p,
  .api-guide-section li {
    font-size: 11px;
  }

  .api-code pre {
    padding: 13px 64px 13px 12px;
    font-size: 9px;
  }
}

@media (max-width: 410px) {
  .brand small {
    display: none;
  }

  .timeline-lane {
    grid-template-columns: 48px minmax(0, 1fr) 90px;
  }

  .qr-panel {
    grid-template-columns: 1fr;
  }
}

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

/* --------------------------------------------------------------------------
   Clearing Rail

   A compact, signal-led operations surface. The selectors below deliberately
   support both the original workspace markup and the newer semantic shell so
   generated task rows, dialogs, and API-guide content keep their behavior.
   -------------------------------------------------------------------------- */

:root {
  --canvas: #f5f7fb;
  --paper: #ffffff;
  --ink: #171a2b;
  --slate: #667085;
  --signal: #5f5ce6;
  --jade: #0a9b72;
  --page: var(--canvas);
  --page-accent: #fafbfe;
  --surface: rgba(255, 255, 255, 0.96);
  --surface-solid: var(--paper);
  --surface-raised: var(--paper);
  --surface-soft: #f0f3f8;
  --surface-hover: #f8f9fc;
  --text: var(--ink);
  --text-soft: var(--slate);
  --muted: #667085;
  --line: #e3e7ef;
  --line-strong: #cfd5e1;
  --primary: var(--signal);
  --primary-dark: #4c49c8;
  --primary-soft: #efefff;
  --success: var(--jade);
  --success-soft: #e3f6ef;
  --warning: #b7791f;
  --warning-soft: #fff5df;
  --danger: #d6455d;
  --danger-soft: #fff0f2;
  --info: #3274c7;
  --info-soft: #eaf3ff;
  --method-upi: #6658e8;
  --method-ideal: #c33778;
  --method-kakao: #8f6900;
  --method-gcash: #007cff;
  --heat-surface: #f6f8fb;
  --heat-line: #e2e7ee;
  --heat-empty: #e8edf3;
  --heat-empty-line: #d8e0e9;
  --heat-zero: #e2e8f0;
  --heat-zero-line: #cbd5e1;
  --heat-low: #b7791f;
  --heat-highlight: rgba(255, 255, 255, 0.72);
  --shadow-raised: 0 1px 2px rgba(27, 32, 50, 0.04), 0 12px 34px rgba(27, 32, 50, 0.035);
  --shadow-soft: 0 1px 2px rgba(27, 32, 50, 0.055);
  --shadow-pressed: inset 0 0 0 1px rgba(35, 42, 65, 0.055);
  --shadow-overlay: 0 18px 48px rgba(27, 32, 50, 0.16);
  --focus: 0 0 0 3px rgba(95, 92, 230, 0.2);
  --radius-xl: 18px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --display: "Instrument Sans", "Aptos Display", "Segoe UI Variable Display", "Noto Sans CJK SC", sans-serif;
  --sans: Inter, Aptos, "Segoe UI Variable Text", "Noto Sans CJK SC", "Noto Sans", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 58px;
}

:root[data-theme="dark"] {
  --canvas: #0f1220;
  --paper: #191d2d;
  --ink: #f6f7fb;
  --slate: #b2b9ca;
  --signal: #8c88ff;
  --jade: #39c69b;
  --page: var(--canvas);
  --page-accent: #121625;
  --surface: rgba(25, 29, 45, 0.96);
  --surface-solid: var(--paper);
  --surface-raised: #1c2032;
  --surface-soft: #141827;
  --surface-hover: #202539;
  --text: var(--ink);
  --text-soft: var(--slate);
  --muted: #858da3;
  --line: #2a3044;
  --line-strong: #3a425a;
  --primary: var(--signal);
  --primary-dark: #7772ef;
  --primary-soft: #2a294d;
  --success: var(--jade);
  --success-soft: #153a31;
  --warning: #efb85c;
  --warning-soft: #3d321f;
  --danger: #f0778a;
  --danger-soft: #40252d;
  --info: #78aef2;
  --info-soft: #24364e;
  --method-upi: #948cff;
  --method-ideal: #ee78ad;
  --method-kakao: #e6ba3d;
  --method-gcash: #007cff;
  --heat-surface: #141924;
  --heat-line: #2b3342;
  --heat-empty: #2a3544;
  --heat-empty-line: #3d4b5c;
  --heat-zero: #334155;
  --heat-zero-line: #475569;
  --heat-low: #c28a24;
  --heat-highlight: rgba(255, 255, 255, 0.045);
  --shadow-overlay: 0 22px 56px rgba(0, 0, 0, 0.42);
  --shadow-raised: 0 1px 2px rgba(0, 0, 0, 0.2), 0 16px 42px rgba(0, 0, 0, 0.12);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-pressed: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  --focus: 0 0 0 3px rgba(140, 136, 255, 0.24);
}

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

body {
  background: var(--canvas);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
}

h1,
h2,
h3,
.brand strong,
.task-summary b {
  font-family: var(--display);
}

button,
a,
input,
select,
textarea {
  transition-timing-function: var(--ease-standard);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: none;
}

.topbar,
.app-header {
  min-height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.topbar-inner,
.app-header__inner,
.app-header-inner {
  width: min(1280px, calc(100% - 40px));
  min-height: var(--header-height);
}

.app-header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-inline: auto;
}

.payment-context {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  justify-self: start;
  color: var(--text);
  white-space: nowrap;
}

.payment-context-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.payment-context[data-method="kakao"] .payment-context-mark {
  padding: 0;
  border-color: color-mix(in srgb, #b88700 28%, var(--line));
  background: #fee500;
}

.payment-context-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.payment-context-title {
  overflow: hidden;
  font: 680 14px/1.2 var(--display);
  letter-spacing: 0;
  text-overflow: ellipsis;
}

.app-title {
  margin: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  color: var(--text-soft);
  font: 650 14px/1.2 var(--display);
  letter-spacing: -0.015em;
}

.header-status,
.header-activity-meta {
  justify-self: end;
}

.header-activity-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 11px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.header-activity-key,
.header-refresh-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.header-activity-key i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.header-activity-key[data-key-state="success"] i {
  border: 0;
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--jade) 11%, transparent);
}

.header-activity-key[data-key-state="empty"] i {
  border-radius: 3px;
}

.header-refresh-meta {
  gap: 4px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.header-actions .icon-text-button {
  min-width: 0;
  gap: 6px;
  padding-inline: 10px;
}

.header-actions .icon-text-button svg {
  width: 15px;
  height: 15px;
}

.app-header #languageButton {
  position: static;
}

.app-header #languageButton svg {
  opacity: 1;
}

.app-header #languageButtonText {
  position: static;
  font-size: 10px;
  font-weight: 760;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.brand {
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--signal);
  box-shadow: none;
}

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

.brand strong {
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.brand small {
  margin-top: 0;
  font-size: 9px;
  letter-spacing: 0.11em;
}

.topbar-actions,
.app-header__actions,
.app-header-actions {
  gap: 6px;
}

.icon-text-button,
.icon-button,
.small-button,
.task-action {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: none;
}

.icon-text-button,
.icon-button {
  min-height: 36px;
  border-radius: 9px;
}

.icon-text-button {
  padding-inline: 11px;
  font-size: 11px;
  font-weight: 650;
}

.icon-button {
  width: 36px;
}

.icon-button:hover,
.icon-text-button:hover,
.small-button:hover,
.task-action:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-hover);
  color: var(--primary);
  transform: none;
}

.icon-button:active,
.icon-text-button:active,
.small-button:active,
.button:active:not(:disabled),
.segmented button:active:not(:disabled),
.task-action:active:not(:disabled) {
  box-shadow: none;
  transform: scale(0.975);
}

.telegram-menu {
  border-radius: 12px;
  box-shadow: 0 18px 52px rgba(20, 24, 40, 0.14);
}

.workspace,
.clearing-workspace {
  width: min(1280px, calc(100% - 40px));
  margin-inline: auto;
}

.panel,
.live-payment-rail,
.command-dock,
.task-ledger {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: none;
}

.hero,
.clearing-hero {
  min-height: 54px;
  margin: 0;
  padding: 0 2px;
}

.hero .eyebrow,
.clearing-hero .eyebrow {
  display: none;
}

.hero h1,
.clearing-hero h1 {
  margin: 0 0 2px;
  font-size: 29px;
  font-weight: 720;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero p:not(.eyebrow),
.clearing-hero p:not(.eyebrow) {
  font-size: 12px;
}

.connection-pill {
  min-height: 32px;
  padding: 6px 10px;
  border-color: var(--line);
  background: var(--paper);
  font-size: 10px;
  font-weight: 680;
}

.connection-dot {
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}

.panel-heading {
  gap: 9px;
}

.panel-heading h2 {
  margin-top: 0;
  font-size: 17px;
  font-weight: 690;
  letter-spacing: -0.025em;
}

.section-kicker,
.eyebrow {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.11em;
}

.step-number {
  display: none;
}

/* Live payment rail ------------------------------------------------------- */

.timeline-panel,
.live-payment-rail {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "rail-lanes"
    "rail-legend";
  gap: 6px;
  margin: 0;
  padding: 14px 16px 12px;
  overflow: hidden;
}

.live-payment-rail {
  border-color: color-mix(in srgb, var(--signal) 14%, var(--line));
}

.rail-heading {
  min-width: 0;
  flex: 1 1 auto;
  order: 2;
  overflow: hidden;
}

.timeline-inline-meta {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font: 650 9px/1 var(--sans);
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-inline-meta-compact {
  display: none;
}

.heatmap-wrap,
.live-payment-rail__lanes,
.live-rail-lanes {
  grid-area: rail-lanes;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: visible;
}

.timeline-lanes {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
}

.timeline-switch-row {
  --timeline-row-gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--timeline-row-gap);
  margin-bottom: 8px;
}

.timeline-method-switcher {
  --active-method-color: var(--primary);
  position: relative;
  min-width: 0;
  width: max-content;
  max-width: 60%;
  flex: 0 1 auto;
  order: 1;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--slate) 7%, var(--paper));
  scrollbar-width: none;
}

.timeline-method-switcher::-webkit-scrollbar {
  display: none;
}

.timeline-switch-overflow {
  z-index: 3;
  width: 16px;
  min-width: 16px;
  align-self: stretch;
  display: none;
  place-items: center;
  margin-left: calc(-16px - var(--timeline-row-gap));
  order: 1;
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
  color: var(--muted);
  font: 750 14px/1 var(--sans);
  pointer-events: none;
}

.timeline-method-switcher[data-overflow="true"][data-scroll-end="false"] + .timeline-switch-overflow {
  display: grid;
}

.timeline-method-switcher[data-active-method="upi"] { --active-method-color: var(--method-upi); }
.timeline-method-switcher[data-active-method="ideal"] { --active-method-color: var(--method-ideal); }
.timeline-method-switcher[data-active-method="kakao"] { --active-method-color: var(--method-kakao); }
.timeline-method-switcher[data-active-method="gcash"] { --active-method-color: var(--method-gcash); }

.timeline-method-switcher button {
  position: relative;
  z-index: 1;
  min-width: 78px;
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: 660 10px/1 var(--sans);
  white-space: nowrap;
  transition: color 180ms var(--ease-standard), transform 90ms var(--ease-standard);
}

.timeline-method-switcher button > i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: var(--method-color, var(--primary));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--method-color, var(--primary)) 10%, transparent);
}

.timeline-method-switcher button[data-timeline-method="upi"] > i { background: var(--method-upi); }
.timeline-method-switcher button[data-timeline-method="ideal"] > i { background: var(--method-ideal); }
.timeline-method-switcher button[data-timeline-method="kakao"] > i { background: var(--method-kakao); }
.timeline-method-switcher button[data-timeline-method="gcash"] > i { background: var(--method-gcash); }

.timeline-method-switcher button.active {
  color: var(--active-method-color);
}

.timeline-method-switcher button:active {
  transform: scale(0.975);
}

.timeline-switch-indicator {
  position: absolute;
  top: 3px;
  left: 0;
  height: 31px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(24, 29, 48, 0.06), 0 3px 8px rgba(24, 29, 48, 0.035);
  pointer-events: none;
  transition: width 230ms var(--ease-out), transform 230ms var(--ease-out), border-color 180ms var(--ease-standard), background-color 180ms var(--ease-standard);
}

.timeline-switch-indicator::after {
  content: "";
  position: absolute;
  right: 25%;
  bottom: 2px;
  left: 25%;
  height: 2px;
  border-radius: 99px;
  background: var(--active-method-color);
}

.timeline-switch-row .timeline-lane-summary > b {
  color: var(--success);
}

.timeline-lane {
  --rail-color: var(--jade);
  grid-template-columns: 50px minmax(0, 1fr) 76px;
  align-items: start;
  gap: 8px;
  min-height: 58px;
}

#timelineActiveRail {
  width: 100%;
  max-width: 100%;
  display: block;
  min-height: 0;
  padding: 8px 9px;
}

.rail-lane {
  display: block;
  min-height: 0;
  border: 1px solid var(--heat-line);
  border-radius: 10px;
  background: var(--heat-surface);
  box-shadow: inset 0 1px 0 var(--heat-highlight);
}

.timeline-lane[data-timeline-lane="upi"] {
  --rail-color: var(--method-upi);
}

.timeline-lane[data-timeline-lane="ideal"] {
  --rail-color: var(--method-ideal);
}

.timeline-lane[data-timeline-lane="kakao"] {
  --rail-color: var(--method-kakao);
}

.timeline-lane[data-timeline-lane="gcash"] {
  --rail-color: var(--method-gcash);
}

.rail-method-mark {
  width: 3px;
  height: 18px;
  margin-top: 1px;
  border-radius: 99px;
  background: var(--rail-color);
}

.timeline-method {
  padding-top: 4px;
  color: var(--text-soft);
  font: 650 10px/1 var(--sans);
}

.timeline-lane-summary {
  min-width: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  margin-left: auto;
  padding-top: 0;
  order: 3;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.timeline-lane-summary > b {
  color: var(--rail-color);
  font: 680 11px/1 var(--mono);
}

.heatmap {
  min-width: 0;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  container-type: inline-size;
}

.heatmap-row {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(var(--heat-columns, 48), minmax(0, 1fr));
  align-items: center;
  gap: 2px;
}

.heat-cell {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: max(18px, calc((100cqw - 94px) / 48));
  aspect-ratio: auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--heat-empty-line);
  border-radius: 999px;
  background: var(--heat-empty);
  color: var(--text);
  cursor: help;
  font: 760 clamp(7px, 0.66vw, 10px)/1 var(--mono);
  font-variant-numeric: tabular-nums;
  transition: background-color 160ms var(--ease-standard), border-color 160ms var(--ease-standard), box-shadow 160ms var(--ease-standard), transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}

.timeline-lane .heat-cell[data-outcome="empty"] {
  --heat-cell-accent: var(--slate);
  border-color: var(--heat-empty-line);
  background: var(--heat-empty);
  color: var(--muted);
}

.timeline-lane .heat-cell[data-outcome="pass"] {
  --heat-cell-accent: var(--jade);
  border-color: var(--jade);
  background: var(--jade);
  color: #06271e;
}

.timeline-lane .heat-cell[data-outcome="partial"] {
  --heat-cell-accent: var(--heat-low);
  border-color: var(--heat-low);
  background: var(--heat-low);
  color: #2b1a02;
}

.timeline-lane .heat-cell[data-outcome="failed"] {
  --heat-cell-accent: var(--slate);
  border-color: var(--heat-zero-line);
  background: var(--heat-zero);
  color: var(--muted);
}

.timeline-lane .heat-cell:not([data-outcome="empty"]) {
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 22%, transparent), 0 1px 2px color-mix(in srgb, var(--heat-cell-accent) 14%, transparent);
}

.heat-cell[data-current="true"] {
  box-shadow: 0 0 0 1px var(--heat-surface), 0 0 0 2px var(--line-strong);
}

.heat-cell:hover {
  z-index: 2;
  outline: 2px solid color-mix(in srgb, var(--heat-cell-accent) 72%, white);
  outline-offset: 2px;
  filter: none;
  transform: translateY(-1px) scale(1.08);
  box-shadow: 0 5px 13px color-mix(in srgb, var(--heat-cell-accent) 22%, transparent);
}

.heat-cell:focus-visible {
  z-index: 3;
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 0 0 1px var(--paper), 0 5px 13px color-mix(in srgb, var(--signal) 20%, transparent);
}

.heat-cell-count {
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  line-height: 1;
  pointer-events: none;
  text-overflow: clip;
  transform-origin: center;
  white-space: nowrap;
}

.heat-cell[data-fresh="true"],
.live-payment-rail [data-new="true"] {
  animation: clearing-rail-confirm 620ms var(--ease-out) both;
}

.timeline-legend,
.live-payment-rail__legend,
.live-rail-legend {
  grid-area: rail-legend;
  margin-top: 5px;
  font-size: 8px;
}

.timeline-legend .legend-scale {
  gap: 10px;
}

.timeline-legend .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.timeline-legend .legend-item i {
  width: 8px;
  height: 8px;
  border: 1px solid transparent;
  border-radius: 50%;
}

.timeline-legend .legend-item i[data-outcome="empty"] {
  border-color: color-mix(in srgb, var(--slate) 16%, var(--line));
  background: color-mix(in srgb, var(--slate) 8%, var(--surface-soft));
}

.timeline-legend .legend-item i[data-outcome="failed"] {
  border-color: var(--heat-zero-line);
  background: var(--heat-zero);
}

.timeline-legend .legend-item i[data-outcome="partial"] {
  background: var(--heat-low);
}

.timeline-legend .legend-item i[data-outcome="pass"] {
  background: var(--jade);
}

.timeline-tooltip {
  --tooltip-signal: #9aa6b8;
  --tooltip-surface: #121827;
  position: fixed;
  z-index: 420;
  width: min(224px, calc(100vw - 24px));
  padding: 11px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(25, 33, 51, 0.985), rgba(15, 20, 32, 0.985));
  box-shadow: 0 18px 42px rgba(8, 12, 22, 0.28), 0 2px 8px rgba(8, 12, 22, 0.18);
  color: #f7f9fc;
  font: 600 11px/1.35 var(--sans);
  pointer-events: none;
  text-align: left;
  transform-origin: var(--tooltip-arrow-x, 50%) 100%;
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  animation: clearing-tooltip-in 140ms var(--ease-out) both;
}

.timeline-tooltip[data-tone="pass"] {
  --tooltip-signal: var(--jade);
}

.timeline-tooltip[data-tone="partial"] {
  --tooltip-signal: var(--heat-low);
}

.timeline-tooltip[data-tone="failed"] {
  --tooltip-signal: var(--heat-zero);
}

.timeline-tooltip[data-tone="empty"] {
  --tooltip-signal: #9aa6b8;
}

.timeline-tooltip::after {
  content: "";
  position: absolute;
  left: var(--tooltip-arrow-x, 50%);
  width: 9px;
  height: 9px;
  background: var(--tooltip-surface);
  transform: translateX(-50%) rotate(45deg);
}

.timeline-tooltip[data-placement="above"]::after {
  bottom: -5px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.timeline-tooltip[data-placement="below"] {
  transform-origin: var(--tooltip-arrow-x, 50%) 0;
}

.timeline-tooltip[data-placement="below"]::after {
  top: -5px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.timeline-tooltip-head,
.timeline-tooltip-metrics,
.timeline-tooltip-rate,
.timeline-tooltip-success,
.timeline-tooltip-rate-copy,
.timeline-tooltip-empty {
  display: flex;
  align-items: center;
}

.timeline-tooltip-head {
  justify-content: space-between;
  gap: 12px;
}

.timeline-tooltip-head time {
  color: #aeb8c8;
  font: 650 10px/1 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.025em;
}

.timeline-tooltip-method {
  max-width: 78px;
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--tooltip-method-color) 52%, rgba(255, 255, 255, 0.14));
  border-radius: 999px;
  background: color-mix(in srgb, var(--tooltip-method-color) 18%, transparent);
  color: #f8fafc;
  font-size: 8px;
  font-weight: 760;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-tooltip-metrics {
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
}

.timeline-tooltip-success {
  min-width: 0;
  gap: 5px;
  color: var(--tooltip-signal);
}

.timeline-tooltip-success i,
.timeline-tooltip-empty i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--tooltip-signal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tooltip-signal) 15%, transparent);
}

.timeline-tooltip-success strong {
  font: 760 15px/1 var(--mono);
  font-variant-numeric: tabular-nums;
}

.timeline-tooltip-success span {
  color: color-mix(in srgb, var(--tooltip-signal) 82%, white);
  font-size: 10px;
}

.timeline-tooltip-requests {
  overflow: hidden;
  color: #c2cad7;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-tooltip-rate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 10px;
}

.timeline-tooltip-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.timeline-tooltip-track i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--tooltip-signal);
  box-shadow: 0 0 10px color-mix(in srgb, var(--tooltip-signal) 28%, transparent);
}

.timeline-tooltip-rate-copy {
  gap: 4px;
  color: #929eaf;
  font-size: 8px;
  white-space: nowrap;
}

.timeline-tooltip-rate-copy strong {
  color: #e5eaf1;
  font: 720 9px/1 var(--mono);
  font-variant-numeric: tabular-nums;
}

.timeline-tooltip-empty {
  gap: 8px;
  margin-top: 12px;
  color: #c2cad7;
  font-size: 10px;
}

.heat-cell[data-tooltip-pinned="true"] {
  z-index: 2;
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 0 0 1px var(--paper), 0 5px 13px color-mix(in srgb, var(--signal) 20%, transparent);
}

.mobile-filter-button {
  display: none;
  position: relative;
}

.filter-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding-inline: 4px;
  border: 2px solid var(--paper);
  border-radius: 99px;
  background: var(--primary);
  color: #fff;
  font: 720 9px/1 var(--mono);
}

.legend-scale i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.live-payment-rail .legend-scale i[data-level="0"] {
  background: var(--surface-soft);
}

.live-payment-rail .legend-scale i[data-level="1"] {
  background: color-mix(in srgb, var(--slate) 18%, var(--surface-soft));
}

.live-payment-rail .legend-scale i[data-level="2"] {
  background: color-mix(in srgb, var(--slate) 34%, var(--surface-soft));
}

.live-payment-rail .legend-scale i[data-level="3"] {
  background: color-mix(in srgb, var(--slate) 56%, var(--surface-soft));
}

.live-payment-rail .legend-scale i[data-level="4"] {
  background: var(--slate);
}

/* Inputs and controls ----------------------------------------------------- */

.field-label {
  margin: 0 0 6px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
}

.input-shell,
.search-shell,
textarea,
.history-row select,
.sort-select {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: none;
}

.input-shell,
.search-shell {
  border-radius: 10px;
}

.input-shell:focus-within,
.search-shell:focus-within,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.input-shell input,
.search-shell input {
  height: 40px;
  font-size: 13px;
}

textarea {
  min-height: 126px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.55;
}

.button {
  min-height: 40px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 680;
  transition: background-color 140ms var(--ease-standard), border-color 140ms var(--ease-standard), color 140ms var(--ease-standard), transform 90ms var(--ease-standard);
}

.button.primary {
  background: var(--primary);
  box-shadow: none;
}

.button.primary:hover:not(:disabled) {
  background: var(--primary-dark);
  filter: none;
  transform: none;
}

.button.secondary {
  border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
  background: var(--primary-soft);
  box-shadow: none;
}

.button.ghost {
  border-color: var(--line);
  background: var(--paper);
  box-shadow: none;
}

.segmented,
.paste-mode-picker {
  gap: 2px;
  padding: 3px;
  border-color: var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  box-shadow: none;
}

.segmented button,
.paste-mode-picker button {
  min-height: 30px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 650;
}

.segmented button.active,
.segmented button[aria-checked="true"],
.paste-mode-picker button.active,
.paste-mode-picker button[aria-checked="true"] {
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(25, 30, 48, 0.06);
  color: var(--primary);
}

.method-picker button[data-create-method="upi"][aria-checked="true"] {
  color: var(--method-upi);
}

.method-picker button[data-create-method="ideal"][aria-checked="true"] {
  color: var(--method-ideal);
}

.method-picker button[data-create-method="kakao"][aria-checked="true"] {
  color: var(--method-kakao);
}

.method-picker button[data-create-method="gcash"][aria-checked="true"] {
  color: var(--method-gcash);
}

.segmented button[data-method-filter="gcash"].active {
  color: var(--method-gcash);
}

.cdk-result {
  border-radius: 10px;
  background: var(--surface-soft);
}

.usage-meter b {
  background: var(--jade);
}

/* Command dock and ledger ------------------------------------------------ */

.command-dock {
  min-width: 0;
  align-self: start;
  overflow: clip;
}

.dock-section {
  min-width: 0;
  padding: 18px;
}

.dock-section + .dock-section {
  border-top: 1px solid var(--line);
}

.dock-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dock-section-heading:has(.dock-state-mark) {
  justify-content: flex-start;
}

.dock-section-heading h2 {
  margin: 1px 0 0;
  font: 690 17px/1.2 var(--display);
  letter-spacing: -0.025em;
}

.dock-state-mark {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 12%, transparent);
}

.text-button {
  min-height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  font-size: 10px;
  font-weight: 680;
}

.text-button:hover {
  background: var(--primary-soft);
}

.cdk-actions {
  margin-top: 8px;
}

.cdk-actions .button {
  min-width: 0;
  flex: 1 1 0;
}

.paste-mode-wrap {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 11px;
}

.paste-mode-wrap .field-label {
  margin-bottom: 0;
}

.paste-mode-picker {
  width: 100%;
}

.paste-mode-picker button {
  min-width: 0;
  padding-inline: 6px;
  flex: 1 1 0;
}

.command-dock > .panel,
.command-dock .cdk-panel,
.command-dock .import-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.command-dock > .panel + .panel,
.command-dock .cdk-panel + .import-panel {
  border-top: 1px solid var(--line);
}

.setup-grid {
  gap: 12px;
  margin: 0;
}

.setup-grid > .panel {
  padding: 17px;
}

.setup-grid .panel-heading,
.command-dock .panel-heading {
  margin-bottom: 14px;
}

.input-action-row {
  gap: 7px;
}

.history-row {
  margin-top: 9px;
}

.command-dock .history-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
}

.command-dock .history-row select {
  width: 100%;
  max-width: none;
}

.history-buy-link {
  min-width: 0;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid #dda51f;
  border-radius: 9px;
  background: #f5b82e;
  box-shadow: 0 4px 10px rgba(117, 82, 0, 0.16);
  color: #352700;
  font-size: 10px;
  font-weight: 720;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 130ms var(--ease-standard), transform 90ms var(--ease-standard), box-shadow 130ms var(--ease-standard);
}

.history-buy-link svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.history-buy-link:hover {
  border-color: #c68f0a;
  background: #ffc43d;
  color: #2f2200;
  transform: translateY(-1px);
}

.history-buy-link:active {
  background: #e8a91c;
  box-shadow: 0 2px 5px rgba(117, 82, 0, 0.18);
  transform: scale(0.975);
}

[data-theme="dark"] .history-buy-link {
  border-color: #dca51f;
  background: #f6bb32;
  color: #2f2200;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .history-buy-link:hover {
  background: #ffca4c;
  color: #251a00;
}

.method-picker-wrap {
  margin-bottom: 10px;
}

.import-help {
  min-height: 28px;
  padding: 5px 1px 3px;
  font-size: 9px;
}

.button-row {
  gap: 7px;
}

.command-dock .three-actions .button.secondary {
  border-color: var(--line);
  background: var(--paper);
  color: var(--text-soft);
}

.command-dock .button.primary:disabled {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  opacity: 1;
}

.task-ledger,
.tasks-panel {
  min-width: 0;
  min-height: 590px;
  padding: 18px;
}

.ledger-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.ledger-heading h2 {
  margin: 1px 0 0;
  font: 710 21px/1.15 var(--display);
  letter-spacing: -0.035em;
}

.ledger-columns {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 56px 92px 96px 108px;
  gap: 10px;
  min-height: 29px;
  align-items: center;
  padding: 0 11px 0 43px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ledger-columns span:last-child {
  text-align: right;
}

.tasks-heading {
  margin-bottom: 13px;
}

.tasks-heading .panel-heading h2,
.task-ledger__title,
.task-ledger h2 {
  font-size: 21px;
  font-weight: 710;
}

.task-summary {
  border-color: var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: none;
}

.task-summary > span {
  min-width: 58px;
  padding: 5px 9px;
}

.task-summary b {
  font-size: 13px;
}

.task-summary small {
  font-size: 8px;
  letter-spacing: 0.03em;
}

.task-toolbar {
  gap: 6px;
  padding: 7px;
  border-color: var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.task-toolbar .segmented {
  background: transparent;
}

.task-toolbar .search-shell,
.task-toolbar .sort-select,
.task-toolbar .icon-button.raised {
  height: 36px;
  min-height: 36px;
  background: var(--paper);
}

.task-toolbar .search-shell {
  width: 168px;
}

.task-toolbar .search-shell input {
  height: 34px;
  font-size: 11px;
}

.task-toolbar .sort-select {
  width: 122px;
}

.bulk-bar {
  min-height: 37px;
  padding: 6px 5px 4px;
  font-size: 10px;
}

.small-button {
  min-height: 28px;
  border-radius: 8px;
  background: var(--paper);
}

.task-list,
.task-ledger__list {
  gap: 10px;
}

.task-layer {
  gap: 6px;
}

.task-layer-heading {
  min-height: 25px;
  padding-inline: 5px;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.task-layer-heading span:last-child {
  background: var(--surface-soft);
}

.task-card,
.task-ledger-row {
  min-height: 78px;
  gap: 10px;
  padding: 10px 11px;
  border-color: var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: none;
  contain-intrinsic-size: auto 82px;
  transition: background-color 160ms var(--ease-standard), border-color 160ms var(--ease-standard), box-shadow 200ms var(--ease-out), transform 220ms var(--ease-out);
}

.task-card:has(> .ledger-account),
.task-ledger-row {
  grid-template-columns: 22px minmax(150px, 1fr) 56px 92px 96px 108px;
  align-items: center;
}

.ledger-account,
.ledger-method,
.ledger-extraction,
.ledger-payment,
.ledger-actions {
  min-width: 0;
}

.ledger-account .task-identity {
  display: block;
  max-width: 100%;
}

.ledger-account {
  display: grid;
  align-content: center;
  row-gap: 3px;
}

.task-account-identity {
  flex-wrap: nowrap;
}

.task-eligibility-line {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 19px;
}

.task-imported-line {
  margin-top: 0;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ledger-method,
.ledger-extraction,
.ledger-payment {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 5px;
  color: var(--text-soft);
  font-size: 10px;
}

.ledger-extraction .task-progress-line {
  width: 100%;
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.ledger-extraction .progress-track {
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
}

.ledger-extraction .progress-label {
  max-width: 100%;
}

.ledger-extraction .task-error {
  margin-top: 0;
  line-height: 1.35;
}

.ledger-payment [data-countdown-task] {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.ledger-actions {
  justify-self: end;
}

.task-card:hover,
.task-ledger-row:hover {
  z-index: auto;
  border-color: var(--line-strong);
  background: var(--surface-hover);
  box-shadow: none;
  transform: none;
}

.task-card[data-selected="true"],
.task-ledger-row[data-selected="true"] {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--line));
  background: color-mix(in srgb, var(--primary-soft) 42%, var(--paper));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 10%, transparent);
}

.task-layer[data-layer="active"] .task-card,
.task-card[data-layer="active"] {
  border-left: 3px solid var(--signal);
}

.task-layer[data-layer="successful"] .task-card,
.task-card[data-layer="successful"],
.task-card[data-payment-state="unpaid"] {
  border-left: 3px solid var(--jade);
}

.task-layer[data-layer="failed"] .task-card,
.task-card[data-layer="failed"] {
  border-left: 3px solid var(--danger);
}

.task-layer[data-layer="paid"] .task-card,
.task-card[data-layer="paid"] {
  border-left: 3px solid color-mix(in srgb, var(--jade) 44%, var(--line));
}

.task-select {
  padding-top: 3px;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.task-primary-line,
.task-meta-line,
.task-progress-line {
  gap: 6px;
}

.task-identity {
  max-width: min(420px, 41vw);
  font-size: 12px;
  font-weight: 600;
}

.badge {
  min-height: 19px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 680;
  letter-spacing: 0;
}

.badge.method {
  background: var(--primary-soft);
}

.badge.method[data-method="upi"] {
  background: color-mix(in srgb, var(--method-upi) 10%, var(--paper));
  color: var(--method-upi);
}

.badge.method[data-method="ideal"] {
  background: color-mix(in srgb, var(--method-ideal) 10%, var(--paper));
  color: var(--method-ideal);
}

.badge.method[data-method="kakao"] {
  background: color-mix(in srgb, var(--method-kakao) 13%, var(--paper));
  color: var(--method-kakao);
}

.badge.method[data-method="gcash"] {
  background: color-mix(in srgb, var(--method-gcash) 10%, var(--paper));
  color: var(--method-gcash);
}

.task-meta-line {
  margin-top: 3px;
  font-size: 10px;
}

.task-progress-line {
  margin-top: 6px;
}

.progress-track {
  height: 3px;
  background: var(--surface-soft);
  box-shadow: none;
}

.progress-track i {
  background: var(--signal);
  transition: width 320ms var(--ease-out);
}

.progress-label,
.task-error {
  font-size: 10px;
}

.task-actions {
  max-width: 210px;
  gap: 4px;
}

.task-more {
  position: relative;
  flex: 0 0 auto;
}

.task-layer:has(.task-more[open]) {
  position: relative;
  z-index: 60;
}

.task-card:has(.task-more[open]),
.task-ledger-row:has(.task-more[open]) {
  z-index: 60;
  content-visibility: visible;
}

.task-more > summary {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.task-more > summary::-webkit-details-marker {
  display: none;
}

.task-more > summary:hover,
.task-more > summary:focus-visible,
.task-more[open] > summary {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.task-more > summary svg {
  width: 17px;
  height: 17px;
}

.task-more-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 61;
  display: flex;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--shadow-overlay);
}

.task-action {
  width: 32px;
  height: 32px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
}

.task-action[data-tone="primary"] {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 5px 12px color-mix(in srgb, var(--primary) 18%, transparent);
}

.task-action[data-tone="primary"]:hover:not(:disabled) {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
}

.task-action[data-tone="danger"] {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.task-action[data-tone="danger"]:hover:not(:disabled) {
  background: var(--danger-soft);
  color: var(--danger);
}

.task-action svg {
  width: 15px;
  height: 15px;
}

.qr-panel,
.payment-shelf {
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 18px;
  margin: 6px 0 1px;
  padding: 16px;
  border-color: color-mix(in srgb, var(--jade) 18%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--success-soft) 36%, var(--paper));
  animation: clearing-shelf-in 180ms var(--ease-out) both;
}

.qr-panel img,
.payment-shelf img {
  width: 168px;
  height: 168px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 4px 18px rgba(20, 28, 44, 0.07);
}

.empty-state {
  min-height: 230px;
  padding: 34px 20px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  box-shadow: none;
}

.empty-state h3 {
  font-size: 14px;
}

.empty-state p {
  font-size: 11px;
}

/* Sheet primitives: tools, eligibility, and the mobile QR inspector. */

.surface-dialog,
.tools-sheet,
.eligibility-sheet,
.mobile-qr-sheet,
.filter-sheet {
  width: min(560px, calc(100% - 32px));
  max-height: min(780px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden auto;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(18, 22, 36, 0.22);
  color: var(--text);
}

.surface-dialog::backdrop,
.tools-sheet::backdrop,
.eligibility-sheet::backdrop,
.mobile-qr-sheet::backdrop,
.filter-sheet::backdrop,
.confirm-dialog::backdrop {
  background: rgba(15, 18, 31, 0.48);
  backdrop-filter: blur(4px);
}

.sheet-handle {
  display: none;
}

.sheet-header {
  min-height: 68px;
  padding: 14px 18px;
}

.sheet-header h2 {
  margin: 1px 0 0;
  font: 700 19px/1.2 var(--display);
  letter-spacing: -0.03em;
}

.tools-surface-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 16px 18px;
}

.tools-surface-grid .telegram-control {
  min-width: 0;
}

.tool-row {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  transition: border-color 140ms var(--ease-standard), background-color 140ms var(--ease-standard), transform 90ms var(--ease-standard);
}

.tool-row:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.tool-row:active {
  transform: scale(0.985);
}

.tool-row > svg {
  grid-row: 1 / 3;
  align-self: center;
  width: 21px;
  height: 21px;
  color: var(--primary);
}

.tool-row > span {
  align-self: end;
  font-size: 12px;
  font-weight: 680;
}

.tool-row > small {
  align-self: start;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-row .theme-icon {
  grid-row: 1 / 3;
}

.eligibility-form {
  display: grid;
  grid-template-columns: 1fr;
  padding: 16px 18px 20px;
}

.eligibility-form select {
  width: 100%;
  min-height: 40px;
  margin-bottom: 14px;
  padding-inline: 11px 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--text);
}

.eligibility-method-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: -4px;
  margin-bottom: 14px;
}

.eligibility-method-context > span {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-raised) 74%, transparent);
}

.eligibility-method-context small {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eligibility-method-context strong {
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.eligibility-form textarea {
  min-height: 136px;
}

.form-guidance {
  margin: 8px 0 13px;
  color: var(--muted);
  font-size: 10px;
}

.eligibility-result {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 11px;
}

.eligibility-result[data-state="checking"] {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
  color: var(--primary);
}

.eligibility-result[data-state="eligible"] {
  border-color: color-mix(in srgb, var(--jade) 36%, var(--line));
  background: color-mix(in srgb, var(--success-soft) 52%, var(--paper));
  color: var(--success);
}

.eligibility-result[data-state="mixed"] {
  border-color: color-mix(in srgb, var(--warning) 36%, var(--line));
  background: color-mix(in srgb, var(--warning-soft) 48%, var(--paper));
}

.eligibility-result[data-state="ineligible"],
.eligibility-result[data-state="error"] {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 46%, var(--paper));
  color: var(--danger);
}

.eligibility-result-summary {
  font-weight: 700;
}

.eligibility-result ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-soft);
}

.eligibility-result li + li {
  margin-top: 4px;
}

.eligibility-result li[data-state="eligible"] {
  color: var(--success);
}

.eligibility-result li[data-state="ineligible"],
.eligibility-result li[data-state="error"] {
  color: var(--danger);
}

.mobile-qr-sheet {
  padding-bottom: 18px;
}

.mobile-qr-identity,
.mobile-qr-status {
  margin: 0;
  padding-inline: 18px;
  text-align: center;
}

.mobile-qr-identity {
  overflow: hidden;
  padding-top: 14px;
  color: var(--text);
  font: 600 12px/1.4 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-qr-image {
  min-height: 220px;
  display: grid;
  place-items: center;
  margin: 14px 18px;
  color: var(--muted);
}

.mobile-qr-image[data-state="loading"] {
  border-radius: 14px;
  background: var(--surface-soft);
}

.mobile-qr-image[data-state="error"] {
  min-height: 120px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
}

.mobile-qr-placeholder,
.mobile-qr-error {
  max-width: 280px;
  padding: 18px;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.mobile-qr-status {
  min-height: 20px;
  color: var(--text-soft);
  font-size: 11px;
}

.mobile-qr-link {
  width: calc(100% - 36px);
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 18px 0;
  text-decoration: none;
}

.filter-sheet-body {
  display: grid;
  gap: 18px;
  padding: 16px 18px 20px;
}

.filter-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-fieldset legend {
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 680;
}

.filter-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.filter-choice-grid.status-choices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filter-choice-grid button {
  min-height: 40px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 660;
  transition: border-color 140ms var(--ease-standard), background-color 140ms var(--ease-standard), color 140ms var(--ease-standard), transform 90ms var(--ease-standard);
}

.filter-choice-grid button:hover {
  border-color: var(--line-strong);
  background: var(--surface-hover);
}

.filter-choice-grid button:active {
  transform: scale(0.975);
}

.filter-choice-grid button.active {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 10%, transparent);
}

[data-status-filter][data-count]::after {
  content: " (" attr(data-count) ")";
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.86em;
  font-variant-numeric: tabular-nums;
}

[data-status-filter].active[data-count]::after {
  color: currentColor;
  opacity: 0.78;
}

.filter-sheet-body > .sort-select {
  width: 100%;
  min-height: 42px;
}

.filter-sheet-actions {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 8px;
  padding-top: 2px;
}

.confirm-dialog {
  width: min(430px, calc(100% - 32px));
  display: none;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 13px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 28px 80px rgba(18, 22, 36, 0.24);
  color: var(--text);
}

.confirm-dialog[open] {
  display: grid;
  animation: clearing-confirm-in 180ms var(--ease-out) both;
}

.confirm-symbol {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--danger) 24%, var(--line));
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
}

.confirm-symbol svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.confirm-copy {
  min-width: 0;
}

.confirm-copy h2 {
  margin: 3px 0 7px;
  font: 710 19px/1.2 var(--display);
  letter-spacing: -0.03em;
}

.confirm-copy > p:last-child {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.55;
}

.confirm-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8px;
  margin-top: 4px;
}

.duplicate-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: min(720px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: 0 28px 80px rgba(18, 22, 36, 0.24);
  color: var(--text);
}

.duplicate-dialog::backdrop {
  background: color-mix(in srgb, var(--canvas) 58%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.duplicate-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  animation: clearing-confirm-in 180ms var(--ease-out) both;
}

.duplicate-dialog-header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 34px;
  align-items: start;
  gap: 13px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.duplicate-symbol {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--warning) 30%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--warning) 12%, var(--paper));
  color: color-mix(in srgb, var(--warning) 78%, var(--text));
}

.duplicate-symbol svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.duplicate-dialog-header h2 {
  margin: 3px 0 6px;
  font: 710 19px/1.2 var(--display);
  letter-spacing: 0;
}

.duplicate-dialog-header p:last-child {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.55;
}

.duplicate-list {
  min-height: 0;
  padding: 12px 20px;
  overflow-y: auto;
}

.duplicate-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

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

.duplicate-item-copy strong,
.duplicate-item-copy small {
  display: block;
}

.duplicate-item-copy strong {
  overflow: hidden;
  font: 700 12px/1.35 var(--body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duplicate-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font: 650 9px/1.35 var(--mono);
}

.duplicate-item-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.duplicate-item-actions .button {
  min-height: 34px;
  padding-inline: 11px;
  white-space: nowrap;
}

.duplicate-actions {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 8px;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line);
}

.duplicate-actions[data-has-fresh="false"] {
  grid-template-columns: 1fr;
}

@media (max-width: 620px) {
  .duplicate-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .duplicate-dialog-header {
    grid-template-columns: 40px minmax(0, 1fr) 32px;
    padding: 16px 14px 13px;
  }

  .duplicate-symbol {
    width: 40px;
    height: 40px;
  }

  .duplicate-list {
    padding-inline: 14px;
  }

  .duplicate-item {
    grid-template-columns: 1fr;
  }

  .duplicate-item-actions {
    justify-content: flex-end;
  }

  .duplicate-actions {
    padding: 12px 14px 14px;
  }
}

.button.danger-filled {
  border-color: var(--danger);
  background: var(--danger);
  color: #fff;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--danger) 22%, transparent);
}

.button.danger-filled:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--danger) 84%, black);
  background: color-mix(in srgb, var(--danger) 84%, black);
  color: #fff;
}

.mobile-dock {
  display: none;
}

/* Desktop clearing shell ------------------------------------------------- */

@media (min-width: 1061px) {
  .workspace,
  .clearing-workspace {
    padding: 18px 0 44px;
  }

  .workspace:not(.clearing-workspace) {
    display: grid;
    grid-template-columns: 352px minmax(0, 1fr);
    grid-template-areas:
      "clearing-hero clearing-hero"
      "clearing-rail clearing-rail"
      "clearing-dock clearing-ledger";
    gap: 14px;
  }

  .workspace:not(.clearing-workspace) > .hero {
    grid-area: clearing-hero;
  }

  .workspace:not(.clearing-workspace) > .timeline-panel {
    grid-area: clearing-rail;
  }

  .workspace:not(.clearing-workspace) > .setup-grid {
    grid-area: clearing-dock;
    grid-template-columns: minmax(0, 1fr);
    align-self: start;
    position: sticky;
    top: calc(var(--header-height) + 14px);
  }

  .workspace:not(.clearing-workspace) > .tasks-panel {
    grid-area: clearing-ledger;
  }

  .clearing-workspace {
    width: 100%;
    display: grid;
    grid-template-columns: 352px minmax(0, 1fr);
    grid-template-areas:
      "clearing-rail clearing-rail"
      "clearing-dock clearing-ledger";
    gap: 14px;
  }

  .workspace.clearing-rail-app {
    width: min(1280px, calc(100% - 40px));
    display: block;
  }

  .workspace.clearing-rail-app > .live-payment-rail {
    margin-bottom: 14px;
  }

  .workspace.clearing-rail-app > .clearing-workspace {
    width: 100%;
    padding: 0;
  }

  .clearing-workspace > .live-payment-rail,
  .clearing-workspace > #activitySurface {
    grid-area: clearing-rail;
  }

  .clearing-workspace > .command-dock,
  .clearing-workspace > #commandDock {
    grid-area: clearing-dock;
    position: sticky;
    top: calc(var(--header-height) + 14px);
    max-height: calc(100dvh - var(--header-height) - 28px);
    overflow: hidden auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .clearing-workspace > .task-ledger,
  .clearing-workspace > #taskLedger {
    grid-area: clearing-ledger;
  }

  .setup-grid .input-action-row {
    grid-template-columns: 1fr 1fr;
  }

  .setup-grid .input-action-row .input-shell {
    grid-column: 1 / -1;
  }

  .button-row.three-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .button-row.three-actions .button.primary {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .task-toolbar {
    display: grid;
    grid-template-columns: auto minmax(150px, 1fr) 122px 36px;
    align-items: center;
  }

  .task-toolbar #taskMethodFilter {
    grid-column: 1;
  }

  .task-toolbar .search-shell {
    grid-column: 2;
    width: 100%;
    margin-left: 0;
  }

  .task-toolbar .sort-select {
    grid-column: 3;
  }

  .task-toolbar #refreshTasksBtn {
    grid-column: 4;
  }

  .task-toolbar .status-filter {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    overflow-x: auto;
  }

  .task-toolbar .toolbar-spacer {
    display: none;
  }
}

@media (min-width: 1280px) {
  .ledger-columns {
    grid-template-columns: minmax(220px, 1fr) 70px 112px 112px 176px;
  }

  .task-card:has(> .ledger-account),
  .task-ledger-row {
    grid-template-columns: 22px minmax(220px, 1fr) 70px 112px 112px 176px;
  }
}

/* Compact laptops retain the rail hierarchy without forcing a narrow dock. */

@media (min-width: 761px) and (max-width: 1060px) {
  .workspace,
  .clearing-workspace {
    width: min(920px, calc(100% - 32px));
    padding: 18px 0 42px;
  }

  .clearing-workspace {
    display: grid;
    gap: 12px;
  }

  .workspace.clearing-rail-app {
    display: block;
  }

  .workspace.clearing-rail-app > .live-payment-rail {
    margin-bottom: 12px;
  }

  .workspace.clearing-rail-app > .clearing-workspace {
    width: 100%;
    padding: 0;
  }

  .command-dock {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

  .command-dock .cdk-panel + .import-panel {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .heat-cell {
    height: max(14px, calc((100cqw - 94px) / 48));
  }
}

@media (min-width: 761px) and (max-width: 960px) {
  .app-header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .app-title {
    display: none;
  }

  .header-activity-meta {
    gap: 7px;
  }

  .header-activity-key > span {
    display: none;
  }
}

/* Mobile scanner surface ------------------------------------------------- */

@media (max-width: 760px), (hover: none) and (pointer: coarse) and (max-height: 500px) {
  :root {
    --header-height: 56px;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: clip;
  }

  body {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
    font-size: 14px;
  }

  .topbar,
  .app-header {
    min-height: var(--header-height);
  }

  .topbar-inner,
  .app-header__inner,
  .app-header-inner {
    width: 100%;
    min-height: var(--header-height);
    padding-inline: 12px;
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .topbar-actions,
  .app-header__actions,
  .app-header-actions {
    min-width: 0;
    gap: 2px;
  }

  .app-header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .payment-context {
    gap: 7px;
  }

  .payment-context-mark {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .payment-context-title {
    font-size: 12px;
  }

  .app-title {
    display: none;
  }

  .header-activity-meta {
    display: none;
  }

  .header-actions {
    grid-column: 2;
    justify-self: end;
    gap: 2px;
  }

  .header-status {
    width: auto;
    min-width: 0;
    max-width: 126px;
    min-height: 34px;
    justify-content: flex-start;
    padding: 0 9px;
    border-radius: 99px;
  }

  .header-status span:last-child {
    display: block;
    min-width: 0;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions .icon-button,
  .topbar-actions .icon-text-button,
  .app-header .icon-button,
  .app-header .icon-text-button {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
  }

  .topbar-actions .icon-text-button span,
  .app-header .icon-text-button span {
    display: none;
  }

  .app-header #languageButtonText {
    display: block;
  }

  .workspace,
  .clearing-workspace {
    width: 100%;
    padding: 12px;
  }

  .workspace.clearing-rail-app {
    display: block;
  }

  .workspace.clearing-rail-app > .clearing-workspace {
    width: 100%;
    padding: 0;
  }

  .workspace.clearing-rail-app > .live-payment-rail {
    margin-bottom: 10px;
  }

  .clearing-workspace {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .hero,
  .clearing-hero {
    min-height: 48px;
    padding-inline: 2px;
  }

  .hero h1,
  .clearing-hero h1 {
    font-size: 24px;
  }

  .hero p:not(.eyebrow),
  .clearing-hero p:not(.eyebrow) {
    display: none;
  }

  .connection-pill {
    max-width: 48%;
    overflow: hidden;
  }

  .connection-pill span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .connection-pill.header-status {
    max-width: 126px;
  }

  .panel,
  .live-payment-rail,
  .command-dock,
  .task-ledger {
    border-radius: 14px;
  }

  .timeline-panel,
  .live-payment-rail {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "rail-lanes"
      "rail-legend";
    gap: 6px;
    padding: 13px;
  }

  .timeline-heading,
  .live-payment-rail__heading,
  .live-rail-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .timeline-heading h2,
  .live-payment-rail h2 {
    font-size: 15px;
  }

  .heatmap-wrap,
  .live-payment-rail__lanes,
  .live-rail-lanes {
    width: 100%;
    padding: 0;
    overflow: visible;
  }

  .timeline-lanes {
    width: 100%;
    min-width: 0;
    gap: 8px;
  }

  .timeline-lane {
    min-height: 0;
    grid-template-columns: 5px minmax(0, 1fr) auto;
    grid-template-areas:
      "method-mark method-name method-summary"
      "method-heat method-heat method-heat";
    gap: 7px 6px;
  }

  .timeline-switch-row {
    --timeline-row-gap: 6px;
    align-items: center;
    margin-bottom: 8px;
  }

  .timeline-method-switcher {
    width: min(58%, 160px);
    max-width: min(58%, 160px);
    flex: 0 0 min(58%, 160px);
  }

  .timeline-method-switcher button {
    min-width: 48px;
    min-height: 30px;
    gap: 4px;
    padding: 4px 7px;
    font-size: 8.5px;
  }

  .timeline-switch-indicator {
    height: 30px;
  }

  .timeline-inline-meta-full {
    display: none;
  }

  .timeline-inline-meta-compact {
    display: block;
    font-size: 8px;
  }

  .timeline-switch-row > .timeline-lane-summary {
    min-width: 10px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    padding: 0;
  }

  .timeline-switch-row > .timeline-lane-summary > span {
    display: none;
  }

  #timelineActiveRail {
    display: block;
    min-height: 0;
    padding: 5px 4px;
  }

  .rail-lane {
    display: block;
    padding: 5px 4px;
  }

  .rail-method-mark {
    grid-area: method-mark;
    height: 14px;
  }

  .timeline-method {
    grid-area: method-name;
    padding-top: 3px;
  }

  .timeline-lane-summary {
    grid-area: method-summary;
    padding-top: 2px;
  }

  .timeline-lane-summary {
    font-size: 9px;
  }

  .timeline-lane-summary > b {
    font-size: 11px;
  }

  .heatmap {
    grid-area: method-heat;
    width: 100%;
    min-width: 0;
    min-height: 0;
    gap: 3px;
  }

  .heatmap-row {
    grid-template-columns: repeat(var(--heat-columns, 48), minmax(0, 1fr));
    gap: 1px;
  }

  .heat-cell {
    height: clamp(10px, 2.8vw, 12px);
    border-width: 0;
    border-radius: 999px;
    font-size: 5px;
  }

  .timeline-lane .heat-cell[data-outcome="empty"] {
    box-shadow: inset 0 0 0 1px var(--heat-empty-line);
  }

  .timeline-lane .heat-cell[data-current="true"] {
    box-shadow: 0 0 0 1px var(--heat-surface), 0 0 0 2px var(--line-strong);
  }

  .heat-cell-count[data-count-width="one"] {
    transform: scaleX(1);
  }

  .heat-cell-count[data-count-width="two"] {
    transform: scaleX(0.65);
  }

  .heat-cell-count[data-count-width="many"] {
    transform: scaleX(0.45);
  }

  .heat-cell[data-tooltip-pinned="true"] {
    transform: none;
  }

  .timeline-legend {
    flex-wrap: wrap;
    row-gap: 6px;
    margin-top: 0;
  }

  .legend-scale {
    width: 100%;
    display: flex;
    flex: 0 0 100%;
    justify-content: center;
    order: -1;
    gap: 7px;
  }

  .command-dock,
  .setup-grid,
  .task-ledger,
  .tasks-panel {
    width: 100%;
    min-width: 0;
  }

  .setup-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .setup-grid > .panel,
  .command-dock .cdk-panel,
  .command-dock .import-panel {
    padding: 15px;
  }

  .dock-section {
    padding: 12px 15px;
  }

  .dock-section-heading {
    align-items: flex-start;
    margin-bottom: 10px;
  }

  .setup-grid .panel-heading,
  .command-dock .panel-heading {
    margin-bottom: 13px;
  }

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

  .input-action-row .input-shell {
    grid-column: 1 / -1;
  }

  .input-shell input,
  .search-shell input,
  .button,
  .history-buy-link,
  .history-row select,
  .sort-select,
  .segmented button,
  .paste-mode-picker button,
  .small-button {
    min-height: 44px;
  }

  .history-buy-link {
    padding-inline: 11px;
    font-size: 11px;
  }

  .input-shell input,
  .search-shell input,
  textarea,
  .history-row select,
  .sort-select,
  .eligibility-form select {
    font-size: 16px;
  }

  .inside-icon {
    width: 44px;
    height: 44px;
    margin-right: 0;
  }

  textarea {
    height: 128px;
    min-height: 112px;
    font-size: 16px;
    line-height: 1.4;
  }

  .method-picker-wrap {
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }

  .method-picker-wrap > .field-label {
    width: 104px;
    flex: 0 0 104px;
    margin-bottom: 0;
  }

  .paste-mode-wrap {
    align-items: stretch;
    flex-direction: column;
  }

  .method-picker,
  .paste-mode-picker {
    width: 100%;
  }

  .method-picker button,
  .paste-mode-picker button {
    flex: 1 1 0;
  }

  .import-help {
    min-height: 20px;
    padding-block: 3px;
    font-size: 11px;
  }

  .import-help > span:first-child {
    display: none;
  }

  .button-row.three-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .button-row.three-actions .button.primary {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .task-ledger,
  .tasks-panel {
    min-height: calc(100dvh - var(--header-height) - 100px);
    padding: 14px;
  }

  .tasks-heading {
    gap: 10px;
    margin-bottom: 12px;
  }

  .ledger-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .tasks-heading .panel-heading h2,
  .task-ledger h2 {
    font-size: 20px;
  }

  .task-summary {
    width: 100%;
  }

  .task-summary > span {
    min-width: 0;
    padding: 7px 5px;
    flex: 1 1 0;
  }

  .task-summary b {
    font-size: 15px;
  }

  .task-summary small {
    font-size: 8px;
  }

  .task-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px 44px;
    gap: 7px;
    padding: 8px;
  }

  .ledger-columns {
    display: none;
  }

  .task-toolbar .method-filter,
  .task-toolbar .status-filter,
  .task-toolbar > .sort-select {
    display: none;
  }

  .task-toolbar .search-shell {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 44px;
    margin: 0;
  }

  .task-toolbar .search-shell input {
    height: 42px;
    font-size: 13px;
  }

  .task-toolbar .mobile-filter-button {
    grid-column: 2;
    grid-row: 1;
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
  }

  .task-toolbar #refreshTasksBtn {
    grid-column: 3;
    grid-row: 1;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .task-toolbar .toolbar-spacer {
    display: none;
  }

  .bulk-bar {
    position: sticky;
    bottom: calc(64px + env(safe-area-inset-bottom));
    z-index: 12;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 8px;
    padding: 8px;
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    backdrop-filter: blur(14px);
  }

  .bulk-bar .check-label {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .bulk-bar #selectedCount {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin: 0;
  }

  .bulk-bar #startSelectedBtn {
    grid-column: 1;
    grid-row: 2;
  }

  .bulk-bar #deleteSelectedBtn {
    grid-column: 2;
    grid-row: 2;
  }

  .bulk-bar[data-has-selection="false"] {
    display: none;
  }

  .bulk-bar .small-button {
    min-height: 40px;
    padding-inline: 12px;
  }

  .task-list,
  .task-ledger__list {
    gap: 12px;
  }

  .task-layer {
    gap: 8px;
  }

  .task-layer-heading {
    min-height: 30px;
    font-size: 10px;
  }

  .task-card,
  .task-ledger-row {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 9px;
    min-height: 92px;
    padding: 13px 12px;
    border-radius: 12px;
  }

  .task-card:has(> .ledger-account),
  .task-ledger-row {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .ledger-account,
  .ledger-method,
  .ledger-extraction,
  .ledger-payment,
  .ledger-actions {
    grid-column: 2;
    width: 100%;
  }

  .ledger-method,
  .ledger-extraction,
  .ledger-payment {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .ledger-extraction .task-progress-line {
    width: 100%;
  }

  .ledger-actions {
    justify-self: stretch;
  }

  .task-select {
    min-width: 22px;
    min-height: 44px;
    align-self: start;
    align-items: flex-start;
    padding-top: 4px;
  }

  .task-select input {
    width: 18px;
    height: 18px;
  }

  .task-primary-line {
    align-items: flex-start;
    gap: 6px;
  }

  .task-identity {
    width: 100%;
    max-width: calc(100vw - 92px);
    margin-bottom: 2px;
    flex-basis: 100%;
    font-size: 13px;
  }

  .badge {
    min-height: 22px;
    padding-inline: 7px;
    font-size: 9px;
  }

  .task-meta-line,
  .progress-label,
  .task-error {
    font-size: 11px;
    line-height: 1.45;
  }

  .task-progress-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .progress-track {
    width: 100%;
    height: 4px;
  }

  .progress-label {
    max-width: 100%;
  }

  .task-actions {
    grid-column: 2;
    width: 100%;
    max-width: none;
    justify-content: flex-start;
    gap: 5px;
  }

  .task-action {
    width: 44px;
    height: 44px;
    border-color: var(--line);
    border-radius: 10px;
    background: var(--paper);
  }

  .task-more > summary {
    width: 44px;
    height: 44px;
    border-color: var(--line);
    border-radius: 10px;
    background: var(--paper);
  }

  .task-more-menu {
    right: 0;
    left: auto;
    gap: 6px;
    padding: 8px;
  }

  .toast-region {
    top: calc(var(--header-height) + 10px);
    right: 12px;
    bottom: auto;
    left: 12px;
    width: auto;
  }

  .task-action svg {
    width: 18px;
    height: 18px;
  }

  .qr-panel,
  .payment-shelf {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 14px;
    padding: 16px;
    text-align: center;
  }

  .qr-panel img,
  .payment-shelf img {
    width: min(280px, 100%);
    height: auto;
    aspect-ratio: 1;
  }

  .qr-panel p,
  .payment-shelf p {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .mobile-dock {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 120;
    min-height: calc(62px + env(safe-area-inset-bottom));
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    align-items: start;
    padding: 6px max(10px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    box-shadow: 0 -12px 30px rgba(20, 25, 42, 0.07);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
  }

  .mobile-dock button,
  .mobile-dock a {
    min-width: 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    padding: 3px 4px;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 9px;
    font-weight: 680;
    text-decoration: none;
  }

  .mobile-dock button > span,
  .mobile-dock a > span {
    width: 100%;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-dock button[aria-selected="true"],
  .mobile-dock button.active,
  .mobile-dock a[aria-current="page"] {
    background: var(--primary-soft);
    color: var(--primary);
  }

  .mobile-dock svg {
    width: 20px;
    height: 20px;
  }

  [data-mobile-view="tasks"] [data-mobile-panel]:not([data-mobile-panel="tasks"]),
  [data-mobile-view="add"] [data-mobile-panel]:not([data-mobile-panel="add"]),
  [data-mobile-view="activity"] [data-mobile-panel]:not([data-mobile-panel="activity"]),
  html[data-mobile-view="tasks"] [data-mobile-panel]:not([data-mobile-panel="tasks"]),
  html[data-mobile-view="add"] [data-mobile-panel]:not([data-mobile-panel="add"]),
  html[data-mobile-view="activity"] [data-mobile-panel]:not([data-mobile-panel="activity"]),
  body[data-mobile-view="tasks"] [data-mobile-panel]:not([data-mobile-panel="tasks"]),
  body[data-mobile-view="add"] [data-mobile-panel]:not([data-mobile-panel="add"]),
  body[data-mobile-view="activity"] [data-mobile-panel]:not([data-mobile-panel="activity"]) {
    display: none !important;
  }

  .surface-dialog,
  .tools-sheet,
  .eligibility-sheet,
  .mobile-qr-sheet,
  .filter-sheet {
    width: 100%;
    max-width: none;
    max-height: min(88dvh, 780px);
    margin: auto 0 0;
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: clearing-sheet-in 220ms var(--ease-out) both;
  }

  .sheet-handle {
    width: 38px;
    height: 4px;
    display: block;
    margin: 8px auto 0;
    border-radius: 99px;
    background: var(--line-strong);
  }

  .sheet-header {
    min-height: 60px;
    padding: 10px 16px 12px;
  }

  .tools-surface-grid {
    grid-template-columns: 1fr;
    padding: 10px 14px 18px;
  }

  .tool-row {
    min-height: 62px;
    padding-inline: 12px;
  }

  .eligibility-form {
    padding: 12px 16px 18px;
  }

  .filter-sheet-body {
    gap: 17px;
    padding: 12px 16px 18px;
  }

  .filter-choice-grid button,
  .filter-sheet-body > .sort-select,
  .filter-sheet-actions .button {
    min-height: 44px;
  }

  .confirm-dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 18px 18px 0 0;
  }

  .confirm-dialog[open] {
    animation: clearing-sheet-in 220ms var(--ease-out) both;
  }

  .confirm-actions .button {
    min-height: 48px;
  }

  .eligibility-form select,
  .eligibility-form .button {
    min-height: 44px;
  }

  .mobile-qr-image {
    min-height: min(320px, calc(100vw - 48px));
    margin: 12px 16px;
  }

  .mobile-qr-identity,
  .mobile-qr-status {
    padding-inline: 16px;
  }

  .mobile-qr-link {
    width: calc(100% - 32px);
    min-height: 48px;
    margin: 14px 16px 0;
  }

  .mobile-qr-sheet img,
  #mobileQrDialog img {
    display: block;
    width: min(320px, calc(100vw - 48px));
    height: auto;
    aspect-ratio: 1;
    margin-inline: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
  }

  .footer {
    display: none;
  }
}

@media (max-width: 380px) {
  .payment-context-title {
    display: none;
  }

  .brand > span:last-child {
    display: none;
  }

  .topbar-inner,
  .app-header__inner,
  .app-header-inner {
    padding-inline: 8px;
  }

  .workspace,
  .clearing-workspace {
    padding-inline: 8px;
  }

  .timeline-switch-row {
    --timeline-row-gap: 4px;
  }

  .timeline-inline-meta-compact {
    font-size: 7.5px;
  }

  .timeline-legend .legend-scale {
    gap: 5px;
    font-size: 7px;
  }

  .timeline-legend .legend-item {
    gap: 2px;
  }

  .task-ledger,
  .tasks-panel,
  .setup-grid > .panel,
  .command-dock .cdk-panel,
  .command-dock .import-panel {
    padding-inline: 12px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  #mobileQrDialog[open] {
    width: min(760px, calc(100% - 24px));
    height: calc(100dvh - 16px);
    max-height: none;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      "qr-image qr-header"
      "qr-image qr-identity"
      "qr-image qr-status"
      "qr-image qr-link";
    align-items: center;
    margin: auto;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
  }

  #mobileQrDialog > .sheet-handle {
    display: none;
  }

  #mobileQrDialog > .sheet-header {
    grid-area: qr-header;
    align-self: stretch;
    min-height: 58px;
  }

  #mobileQrDialog > .mobile-qr-identity {
    grid-area: qr-identity;
    align-self: end;
    padding-top: 12px;
  }

  #mobileQrDialog > .mobile-qr-image {
    grid-area: qr-image;
    width: 100%;
    min-height: 0;
    height: 100%;
    margin: 0;
    padding: 12px;
  }

  #mobileQrDialog > .mobile-qr-status {
    grid-area: qr-status;
    align-self: start;
    padding-top: 8px;
  }

  #mobileQrDialog > .mobile-qr-link {
    grid-area: qr-link;
    width: calc(100% - 32px);
    margin: 10px 16px 14px;
  }

  #mobileQrDialog img,
  .mobile-qr-sheet img {
    width: min(310px, calc(100dvh - 40px));
    max-width: 100%;
    max-height: calc(100dvh - 40px);
  }
}

@keyframes clearing-rail-confirm {
  0% {
    opacity: 0.38;
    transform: scaleY(0.45);
  }
  45% {
    opacity: 1;
    transform: scaleY(1.8);
  }
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes clearing-shelf-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes clearing-sheet-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes clearing-tooltip-in {
  from {
    opacity: 0;
    transform: translateY(3px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes clearing-confirm-in {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.task-card.is-flipping,
.task-ledger-row.is-flipping {
  transition: transform 220ms var(--ease-out);
}

.task-card[data-transition="ready"],
.task-ledger-row[data-transition="ready"] {
  animation: clearing-ready-arrival 460ms var(--ease-out) both;
}

@keyframes clearing-ready-arrival {
  0% {
    border-color: var(--line);
    box-shadow: none;
  }
  44% {
    border-color: color-mix(in srgb, var(--jade) 70%, var(--line));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--jade) 10%, transparent);
  }
  100% {
    border-color: var(--line);
    box-shadow: none;
  }
}

@keyframes clearing-import-attention {
  0%,
  100% {
    box-shadow: none;
  }
  42% {
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--signal) 58%, transparent), inset 4px 0 0 var(--signal);
  }
}

.import-panel[data-attention="true"] {
  animation: clearing-import-attention 680ms var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  .heat-cell[data-fresh="true"],
  .live-payment-rail [data-new="true"],
  .import-panel[data-attention="true"],
  .task-card[data-transition="ready"],
  .task-ledger-row[data-transition="ready"],
  .qr-panel,
  .payment-shelf,
  .surface-dialog,
  .tools-sheet,
  .eligibility-sheet,
  .mobile-qr-sheet {
    animation: none !important;
  }

  .task-card.is-flipping,
  .task-ledger-row.is-flipping,
  .progress-track i {
    transition: none !important;
  }

  .heat-cell,
  .heat-cell:hover,
  .heat-cell:focus-visible,
  .heat-cell[data-tooltip-pinned="true"] {
    transform: none !important;
    transition: none !important;
  }

  .timeline-switch-indicator {
    transition: none !important;
  }
}

/* Account preflight progress center -------------------------------------- */

.preflight-center {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  width: min(410px, calc(100vw - 40px));
  max-height: min(720px, calc(100dvh - var(--header-height) - 36px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line-strong) 76%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--paper) 96%, transparent);
  box-shadow: 0 24px 64px rgba(22, 27, 45, 0.2), 0 2px 8px rgba(22, 27, 45, 0.08);
  color: var(--text);
  isolation: isolate;
  backdrop-filter: blur(22px) saturate(1.12);
  -webkit-backdrop-filter: blur(22px) saturate(1.12);
  animation: preflight-center-in 240ms var(--ease-out) both;
}

.preflight-center::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 30%, var(--success)) 62%, var(--success));
  opacity: 0.9;
}

.preflight-center[data-state="complete"]::before {
  background: var(--success);
}

.preflight-center[data-state="partial"]::before,
.preflight-center[data-state="stopped"]::before {
  background: linear-gradient(90deg, var(--warning), var(--primary));
}

.preflight-minimize {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  transition: background-color 140ms var(--ease-standard), color 140ms var(--ease-standard), transform 140ms var(--ease-standard);
}

.preflight-minimize:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.preflight-minimize:active {
  transform: translateY(1px);
}

.preflight-minimize svg {
  width: 18px;
  height: 18px;
}

.preflight-sheet-handle {
  display: none;
}

.preflight-header {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 18px 58px 13px 17px;
  border-bottom: 1px solid var(--line);
}

.preflight-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary-soft) 78%, var(--paper));
  color: var(--primary);
}

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

.preflight-center[data-state="complete"] .preflight-mark {
  border-color: color-mix(in srgb, var(--success) 28%, var(--line));
  background: var(--success-soft);
  color: var(--success);
}

.preflight-heading-copy {
  min-width: 0;
}

.preflight-heading-copy .section-kicker {
  margin: 0 0 2px;
  color: var(--primary);
  font-size: 8px;
  letter-spacing: 0.11em;
}

.preflight-heading-copy h2 {
  margin: 0;
  overflow: hidden;
  font: 720 16px/1.2 var(--display);
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preflight-header-count {
  color: var(--text-soft);
  font: 650 10px/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.preflight-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preflight-overview {
  padding: 14px 17px 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-soft) 34%, transparent);
}

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

#preflightLiveStatus {
  min-width: 0;
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preflight-elapsed {
  flex: 0 0 auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.preflight-elapsed time {
  color: var(--text-soft);
  font-family: var(--mono);
}

.preflight-progress-track {
  position: relative;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--line-strong) 45%, var(--surface-soft));
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--text) 7%, transparent);
}

.preflight-progress-track > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--preflight-progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 38%, var(--success)));
  box-shadow: 0 0 12px color-mix(in srgb, var(--primary) 34%, transparent);
  transition: width 300ms var(--ease-out);
}

.preflight-center[data-state="complete"] .preflight-progress-track > i {
  background: var(--success);
  box-shadow: 0 0 12px color-mix(in srgb, var(--success) 30%, transparent);
}

.preflight-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 11px;
}

.preflight-metrics > span {
  min-width: 0;
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 6px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--paper) 76%, transparent);
}

.preflight-metrics i {
  grid-row: 1 / 3;
  align-self: center;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--muted);
}

.preflight-metrics [data-metric="active"] i {
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.preflight-metrics [data-metric="eligible"] i {
  background: var(--success);
}

.preflight-metrics [data-metric="ineligible"] i {
  background: var(--warning);
}

.preflight-metrics [data-metric="retry"] i {
  background: var(--danger);
}

.preflight-metrics b {
  min-width: 0;
  font: 720 13px/1.1 var(--mono);
  font-variant-numeric: tabular-nums;
}

.preflight-metrics small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preflight-groups {
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  padding: 8px 10px 10px;
  scrollbar-width: thin;
}

.preflight-group + .preflight-group {
  margin-top: 5px;
}

.preflight-group-toggle {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  transition: background-color 140ms var(--ease-standard), color 140ms var(--ease-standard);
}

.preflight-group-toggle:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.preflight-group-toggle > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.preflight-group-toggle [data-group-dot] {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: var(--primary);
}

.preflight-group[data-group="failed"] .preflight-group-toggle [data-group-dot] {
  background: var(--warning);
}

.preflight-group[data-group="completed"] .preflight-group-toggle [data-group-dot] {
  background: var(--success);
}

.preflight-group-toggle strong {
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preflight-group-toggle b {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--surface-soft);
  color: var(--muted);
  font: 650 9px/1.4 var(--mono);
  text-align: center;
}

.preflight-group-toggle > svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  transition: transform 160ms var(--ease-out);
}

.preflight-group-toggle[aria-expanded="false"] > svg {
  transform: rotate(-90deg);
}

.preflight-account-list {
  display: grid;
  gap: 6px;
  padding: 1px 2px 4px;
}

.preflight-account {
  position: relative;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--paper) 88%, var(--surface-soft));
  transition: border-color 160ms var(--ease-standard), background-color 160ms var(--ease-standard);
}

.preflight-account[data-state="checking"],
.preflight-account[data-state="starting"] {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  background: color-mix(in srgb, var(--primary-soft) 36%, var(--paper));
}

.preflight-account[data-state="eligible"],
.preflight-account[data-state="started"] {
  border-color: color-mix(in srgb, var(--success) 30%, var(--line));
  background: color-mix(in srgb, var(--success-soft) 32%, var(--paper));
}

.preflight-account[data-state="ineligible"] {
  border-color: color-mix(in srgb, var(--warning) 32%, var(--line));
  background: color-mix(in srgb, var(--warning-soft) 28%, var(--paper));
}

.preflight-account[data-state="failed"] {
  border-color: color-mix(in srgb, var(--danger) 26%, var(--line));
  background: color-mix(in srgb, var(--danger-soft) 24%, var(--paper));
}

.preflight-account-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.preflight-account-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--text-soft);
}

.preflight-account-icon svg {
  width: 15px;
  height: 15px;
}

.preflight-account-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.preflight-account-copy strong,
.preflight-account-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preflight-account-copy strong {
  font-size: 10px;
  font-weight: 680;
}

.preflight-account-copy small {
  color: var(--muted);
  font-size: 8px;
}

.preflight-account-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 680;
  white-space: nowrap;
}

.preflight-account-status > i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: currentColor;
}

.preflight-account[data-state="checking"] .preflight-account-status,
.preflight-account[data-state="starting"] .preflight-account-status {
  color: var(--primary);
}

.preflight-account[data-state="checking"] .preflight-account-status > i,
.preflight-account[data-state="starting"] .preflight-account-status > i {
  animation: preflight-dot-pulse 1.15s ease-in-out infinite;
}

.preflight-account[data-state="eligible"] .preflight-account-status,
.preflight-account[data-state="started"] .preflight-account-status {
  color: var(--success);
}

.preflight-account[data-state="ineligible"] .preflight-account-status {
  color: var(--warning);
}

.preflight-account[data-state="failed"] .preflight-account-status {
  color: var(--danger);
}

.preflight-stage-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.preflight-stage {
  position: relative;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding-inline: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
}

/* GCash has a route-aware preflight; give its longer labels a little more
   breathing room without changing the compact generic rail. */
.preflight-account[data-method="gcash"] .preflight-stage {
  font-size: 8.5px;
  line-height: 1.15;
}

.preflight-stage::after {
  position: absolute;
  top: 10px;
  right: -50%;
  left: 50%;
  z-index: 0;
  height: 2px;
  content: "";
  background: var(--line-strong);
}

.preflight-stage:last-child::after {
  display: none;
}

.preflight-stage > i {
  position: relative;
  z-index: 1;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--line-strong) 78%, var(--paper));
  border-radius: 99px;
  background: var(--paper);
  color: transparent;
}

.preflight-stage > i svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.3;
}

.preflight-stage[data-state="active"] {
  color: var(--primary);
  font-weight: 700;
}

.preflight-stage[data-state="active"] > i {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
}

.preflight-stage[data-state="complete"] {
  color: var(--success);
  font-weight: 700;
}

.preflight-stage[data-state="complete"]::after {
  background: color-mix(in srgb, var(--success) 54%, var(--line));
}

.preflight-stage[data-state="complete"] > i {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.preflight-stage[data-state="failed"] {
  color: var(--danger);
  font-weight: 700;
}

.preflight-stage[data-state="failed"] > i {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.preflight-stage[data-state="ineligible"] {
  color: var(--warning);
  font-weight: 700;
}

.preflight-stage[data-state="ineligible"] > i {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.preflight-account-detail {
  margin: 8px 0 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 8.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.preflight-account[data-state="ineligible"] .preflight-account-detail {
  background: var(--warning-soft);
  color: var(--warning);
}

.preflight-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 97%, transparent);
}

.preflight-footer > p {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
}

.preflight-footer > p svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

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

.preflight-actions .button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-inline: 10px;
  font-size: 9px;
}

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

.preflight-center[data-minimized="true"] {
  width: min(330px, calc(100vw - 40px));
  grid-template-rows: auto;
}

.preflight-center[data-minimized="true"] .preflight-body,
.preflight-center[data-minimized="true"] .preflight-footer {
  display: none;
}

.preflight-center[data-minimized="true"] .preflight-header {
  border-bottom: 0;
}

.preflight-center[data-minimized="true"] .preflight-minimize svg {
  transform: rotate(180deg);
}

.preflight-progress-pill {
  display: none;
}

@keyframes preflight-center-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes preflight-dot-pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) and (max-height: 500px) {
  .preflight-center {
    inset: auto 0 calc(78px + env(safe-area-inset-bottom));
    z-index: 180;
    width: 100%;
    max-height: min(76dvh, calc(100dvh - 94px), 720px);
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
    background: var(--paper);
    box-shadow: 0 -18px 54px rgba(15, 19, 34, 0.2);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation-name: clearing-sheet-in;
  }

  .preflight-center[data-minimized="true"] {
    display: none;
  }

  .preflight-center::before {
    top: 0;
  }

  .preflight-minimize {
    top: 1px;
    right: 50%;
    width: 64px;
    min-width: 64px;
    height: 44px;
    transform: translateX(50%);
  }

  .preflight-minimize:active {
    transform: translateX(50%) translateY(1px);
  }

  .preflight-minimize svg {
    display: none;
  }

  .preflight-sheet-handle {
    width: 38px;
    height: 4px;
    display: block;
    border-radius: 99px;
    background: var(--line-strong);
  }

  .preflight-header {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 33px 16px 12px;
  }

  .preflight-mark {
    width: 40px;
    height: 40px;
  }

  .preflight-heading-copy h2 {
    font-size: 17px;
  }

  .preflight-header-count {
    font-size: 9px;
  }

  .preflight-overview {
    padding: 13px 16px;
  }

  .preflight-progress-copy {
    font-size: 11px;
  }

  .preflight-progress-track {
    height: 8px;
  }

  .preflight-metrics > span {
    min-height: 46px;
    align-content: center;
    padding: 7px;
  }

  .preflight-stage-rail {
    gap: 1px;
    margin-top: 12px;
  }

  .preflight-stage {
    gap: 5px;
    padding-inline: 1px;
    font-size: 8.5px;
  }

  .preflight-account[data-method="gcash"] .preflight-stage {
    font-size: 8px;
  }

  .preflight-stage > i {
    width: 20px;
    height: 20px;
  }

  .preflight-stage::after {
    top: 9.5px;
  }

  .preflight-metrics b {
    font-size: 14px;
  }

  .preflight-metrics small {
    font-size: 8.5px;
  }

  .preflight-groups {
    padding: 8px 12px 12px;
  }

  .preflight-group-toggle {
    min-height: 44px;
    padding-inline: 7px;
  }

  .preflight-group-toggle strong {
    font-size: 11px;
  }

  .preflight-account-list {
    gap: 8px;
  }

  .preflight-account {
    padding: 11px;
    border-radius: 12px;
  }

  .preflight-account-head {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .preflight-account-icon {
    width: 32px;
    height: 32px;
  }

  .preflight-account-copy strong {
    font-size: 11px;
  }

  .preflight-account-copy small,
  .preflight-account-status {
    font-size: 9px;
  }

  .preflight-stage {
    gap: 5px;
    font-size: 8.5px;
  }

  .preflight-stage > i {
    width: 18px;
    height: 18px;
  }

  .preflight-stage::after {
    top: 8px;
  }

  .preflight-footer {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .preflight-footer > p {
    font-size: 9px;
  }

  .preflight-actions {
    width: 100%;
  }

  .preflight-actions .button {
    min-width: 0;
    min-height: 44px;
    flex: 1 1 0;
    font-size: 11px;
  }

  .preflight-progress-pill {
    position: fixed;
    right: 12px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    z-index: 170;
    width: min(286px, calc(100vw - 24px));
    min-height: 56px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 62px 18px;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    box-shadow: 0 14px 38px rgba(15, 19, 34, 0.2), 0 2px 6px rgba(15, 19, 34, 0.08);
    color: var(--text);
    text-align: left;
    backdrop-filter: blur(20px) saturate(1.14);
    -webkit-backdrop-filter: blur(20px) saturate(1.14);
    animation: preflight-center-in 200ms var(--ease-out) both;
  }

  .preflight-pill-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
  }

  .preflight-pill-icon svg {
    width: 18px;
    height: 18px;
  }

  .preflight-pill-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
  }

  .preflight-pill-copy strong,
  .preflight-pill-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .preflight-pill-copy strong {
    font-size: 10px;
  }

  .preflight-pill-copy small {
    color: var(--muted);
    font: 600 9px/1.2 var(--mono);
  }

  .preflight-pill-track {
    position: relative;
    height: 5px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--surface-soft);
  }

  .preflight-pill-track i {
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--preflight-progress, 0%);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transition: width 300ms var(--ease-out);
  }

  .preflight-pill-chevron {
    width: 17px;
    height: 17px;
    color: var(--muted);
  }
}

@media (max-width: 380px) {
  .preflight-header {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .preflight-header-count {
    grid-column: 2;
  }

  .preflight-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preflight-progress-pill {
    grid-template-columns: 34px minmax(0, 1fr) 50px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .preflight-center,
  .preflight-progress-pill,
  .preflight-account-status > i {
    animation: none !important;
  }

  .preflight-progress-track > i,
  .preflight-pill-track i,
  .preflight-group-toggle > svg,
  .preflight-minimize {
    transition: none !important;
  }
}
