:root {
  --bg: #f5f7f7;
  --panel: #ffffff;
  --ink: #172121;
  --muted: #657171;
  --line: #dce4e1;
  --accent: #2f6f5e;
  --accent-strong: #215344;
  --amber: #c17d22;
  --red: #a23d3d;
  --sidebar: #203330;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 220px 1fr;
}

.sidebar {
  background: var(--sidebar);
  color: #eef6f3;
  padding: 20px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 22px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  background: #e3b35c;
  color: #172121;
}

nav {
  display: grid;
  gap: 4px;
}

nav a {
  border-radius: 6px;
  color: #cbd8d4;
  padding: 10px 12px;
  text-decoration: none;
}

nav a.active,
nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.workspace {
  padding: 28px;
  min-width: 0;
}

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

.topbar-profile {
  display: grid;
  gap: 6px;
  justify-items: end;
  min-width: min(320px, 100%);
  position: relative;
}

.profile-calendar-picker {
  min-width: min(320px, 100%);
}

.profile-calendar-picker span {
  font-size: 12px;
}

.profile-calendar-picker select {
  min-width: 0;
}

.profile-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.profile-menu-button:hover {
  border-color: var(--accent);
}

.profile-menu-label {
  font-size: 13px;
}

.profile-menu-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef6f3;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.profile-menu-badge.needs-attention {
  background: #fff2df;
  color: #8b5a16;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: min(360px, calc(100vw - 36px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 48px rgba(23, 33, 33, 0.16);
}

.profile-menu[hidden] {
  display: none;
}

.profile-menu-section {
  display: grid;
  gap: 8px;
}

.profile-menu-section + .profile-menu-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.profile-menu-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.guest-field {
  width: min(260px, 36vw);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 16px;
}

.primary {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 0 16px;
}

.primary:hover {
  background: var(--accent-strong);
}

.primary:disabled {
  cursor: progress;
  opacity: 0.72;
}

.secondary {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  padding: 0 16px;
}

.secondary:hover {
  border-color: var(--accent);
}

.secondary.danger {
  border-color: rgba(162, 61, 61, 0.28);
  color: var(--red);
}

.secondary.danger:hover {
  border-color: var(--red);
}

.compact {
  min-height: 32px;
  padding: 0 10px;
}

.full {
  width: 100%;
}

.summary {
  display: none;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-bottom: 20px;
}

.snapshots {
  grid-auto-rows: minmax(78px, auto);
}

.summary .snapshot-label {
  position: relative;
  background: #eef6f3;
}

.summary-toggle {
  justify-self: start;
  min-height: 26px;
  border: 1px solid rgba(47, 111, 94, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 10px;
}

.summary div {
  display: grid;
  gap: 5px;
  background: var(--panel);
  padding: 16px;
}

.summary span,
label span,
.status {
  color: var(--muted);
  font-size: 13px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin: -4px 0 0;
}

.summary strong {
  font-size: 22px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.stack-col {
  display: grid;
  gap: 20px;
}

#scheduledView {
  gap: 20px;
}

.seed-panel {
  overflow: hidden;
}

.workspace > .view {
  display: none;
}

.workspace > #scheduledView.active {
  display: grid;
}

.workspace > #paydayView.active {
  display: block;
}

.workspace > #accountsView.active {
  display: block;
}

.workspace > #drilldownView.active {
  display: block;
}

.workspace > #tagsView.active {
  display: block;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.google-seed-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, max-content));
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  justify-content: start;
}

.google-seed-controls label {
  min-width: 0;
}

.google-seed-controls select {
  width: min(100%, 420px);
}

.seed-panel .table-wrap {
  max-width: 100%;
}

.google-preview-table td {
  vertical-align: top;
}

.calendar-sync-preview {
  border-top: 0;
  padding-top: 0;
}

.modal-google-seed-controls {
  margin-bottom: 0;
}

.panel-heading {
  margin-bottom: 14px;
}

.panel-heading.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.scheduled-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.filters {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.filter-chip {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  padding: 0 12px;
}

.filter-chip:last-child {
  border-right: 0;
}

.filter-chip.active,
.filter-chip:hover {
  background: #e9f3ef;
  color: var(--accent-strong);
}

.filter-chip.purpose-sink {
  color: #8a5a17;
}

.filter-chip.purpose-sink.active,
.filter-chip.purpose-sink:hover {
  background: #ffe39d;
  color: #5d3b07;
}

.filter-chip.purpose-bill {
  color: #3f5f57;
}

.filter-chip.purpose-bill.active,
.filter-chip.purpose-bill:hover {
  background: #dbe9e0;
  color: #26463d;
}

.filter-chip.purpose-allowance {
  color: #245a94;
}

.filter-chip.purpose-allowance.active,
.filter-chip.purpose-allowance:hover {
  background: #d8ebff;
  color: #173f6f;
}

.filter-chip.purpose-saving {
  color: #8e6b12;
}

.filter-chip.purpose-saving.active,
.filter-chip.purpose-saving:hover {
  background: #ffefb3;
  color: #6d4f05;
}

.tag-filter {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tag-filter-chip {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  padding: 4px 12px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.tag-filter-chip:hover,
.tag-filter-chip.active {
  box-shadow: 0 8px 22px rgba(23, 33, 33, 0.12);
  transform: translateY(-1px);
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdfc;
  color: var(--ink);
  padding: 8px 10px;
}

input[type="color"] {
  min-width: 52px;
  padding: 4px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(47, 111, 94, 0.18);
}

textarea {
  min-height: 180px;
  line-height: 1.45;
  padding: 10px 12px;
  resize: vertical;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.table-panel {
  min-width: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.drilldown-table {
  table-layout: fixed;
}

.drilldown-table th:nth-child(1),
.drilldown-table td:nth-child(1) {
  width: 30%;
}

.drilldown-table th:nth-child(2),
.drilldown-table td:nth-child(2) {
  width: 110px;
}

.drilldown-table th:nth-child(3),
.drilldown-table td:nth-child(3) {
  width: 120px;
}

.drilldown-table th:nth-child(4),
.drilldown-table td:nth-child(4) {
  width: 130px;
}

.drilldown-table th:nth-child(5),
.drilldown-table td:nth-child(5) {
  width: 26%;
}

.drilldown-table th:nth-child(6),
.drilldown-table td:nth-child(6) {
  width: 130px;
}

.drilldown-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.sort-header {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-transform: inherit;
}

.sort-header:hover {
  color: var(--accent-strong);
}

td {
  font-size: 14px;
}

.action-col {
  width: 42px;
  min-width: 42px;
  padding-right: 4px;
}

.icon-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}

.icon-button:hover {
  border-color: var(--line);
  background: #f6faf8;
  color: var(--accent-strong);
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.gcal-icon-button {
  position: relative;
}

.gcal-icon-button::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  border: 2px solid #ffffff;
  border-radius: 999px;
}

.gcal-icon-button.has-entry::after {
  background: #22c55e;
}

.gcal-icon-button.missing-entry::after {
  background: #cbd5e1;
}

.gcal-icon-button.missing-entry {
  color: #9aa7b2;
  border-color: #d8e0e5;
  background: #f7fafc;
  cursor: default;
  opacity: 0.9;
}

.gcal-icon-button.missing-entry:hover {
  color: #9aa7b2;
  border-color: #d8e0e5;
  background: #f7fafc;
}

.gcal-icon-button:disabled {
  pointer-events: none;
}

.tag {
  display: inline-flex;
  min-width: 54px;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.tag.bill {
  background: #dbe9e0;
  color: #26463d;
}

.tag.sink {
  background: #ffe39d;
  color: #5d3b07;
}

.tag.allowance {
  background: #d8ebff;
  color: #173f6f;
}

.tag.saving {
  background: #ffefb3;
  color: #6d4f05;
}

.tag-pill,
.tag-filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag-filter-chip,
.tag-pill,
.tag-option {
  border: 1px solid transparent;
}

.tag-pill {
  margin: 2px 4px 2px 0;
  padding: 2px 8px;
}

.selected-tag {
  gap: 6px;
}

.tag-remove {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.68);
  color: currentColor;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

.tag-all,
.tag-general {
  background: #edf1f5;
  color: #334155;
}

.tag-health {
  background: #dff7ea;
  color: #14633c;
}

.tag-banking-finance {
  background: #dbeafe;
  color: #1d4f91;
}

.tag-gifting {
  background: #fce7f3;
  color: #9d174d;
}

.tag-streaming {
  background: #ede9fe;
  color: #5b21b6;
}

.tag-insurance {
  background: #cffafe;
  color: #0e6370;
}

.tag-groceries {
  background: #dcfce7;
  color: #166534;
}

.tag-school {
  background: #ffedd5;
  color: #9a3412;
}

.tag-home {
  background: #e0f2fe;
  color: #075985;
}

.tag-car {
  background: #fef3c7;
  color: #92400e;
}

.tag-family {
  background: #fae8ff;
  color: #86198f;
}

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

.entry-title {
  color: var(--ink);
  min-width: 260px;
}

.nested-payment-row {
  background: #fbfcfc;
}

.nested-payment-row td {
  border-bottom-style: dashed;
}

.nested-payment-cell {
  position: relative;
}

.nested-payment-name {
  position: relative;
  padding-left: 28px;
}

.nested-payment-name::before {
  content: "";
  position: absolute;
  left: 12px;
  top: -18px;
  width: 12px;
  height: calc(100% + 8px);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-bottom-left-radius: 10px;
}

.tag-picker {
  position: relative;
  z-index: 30;
}

.tag-picker-selected {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfdfc;
  padding: 5px 6px 5px 10px;
}

.tag-picker-menu {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 44px rgba(23, 33, 33, 0.16);
  padding: 10px;
}

.tag-picker.open .tag-picker-menu {
  display: grid;
  gap: 10px;
}

.tag-picker-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 140px;
  overflow-y: auto;
}

.tag-option {
  min-height: 30px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
}

.tag-option.active {
  box-shadow: inset 0 0 0 2px currentColor;
}

.tag-create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.tag-manager {
  max-width: 980px;
}

.tag-manager-rows {
  display: grid;
  gap: 8px;
}

.tag-manager-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(160px, 1fr) 150px 70px auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.tag-manager-row .preview {
  justify-content: center;
}

.drilldown-panel {
  max-width: 1180px;
}

.drilldown-groups {
  display: grid;
  gap: 14px;
}

.drilldown-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.drilldown-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #f8fbfa;
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
}

.drilldown-group-header div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drilldown-group-header span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.drilldown-table td:first-child {
  position: relative;
}

.tree-item {
  padding-left: 28px;
}

.tree-item::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.tree-item::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: var(--line);
}

.danger {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-weight: 700;
  padding: 4px 0;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.accounts-panel {
  max-width: 1100px;
}

.accounts-table {
  table-layout: fixed;
}

.accounts-table th:nth-child(1),
.accounts-table td:nth-child(1) {
  width: 28%;
}

.accounts-table th:nth-child(2),
.accounts-table td:nth-child(2) {
  width: 210px;
}

.accounts-table th:nth-child(3),
.accounts-table td:nth-child(3) {
  width: 90px;
}

.accounts-table th:nth-child(5),
.accounts-table td:nth-child(5) {
  width: 160px;
}

.highlight-row {
  background: #fff7dc;
  outline: 2px solid #e3b35c;
  outline-offset: -2px;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.empty-state {
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.payday-layout {
  display: grid;
  gap: 18px;
  max-width: 1120px;
}

.payday-hero {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px) minmax(180px, 240px) auto;
  align-items: end;
  gap: 18px;
}

.cycle-controls {
  display: flex;
  gap: 8px;
}

.income-field input {
  font-size: 22px;
  font-weight: 800;
}

.income-total {
  display: grid;
  gap: 6px;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.income-total span {
  color: var(--muted);
  font-size: 13px;
}

.income-total strong {
  font-size: 26px;
}

.income-total strong.negative {
  color: var(--red);
}

.payday-tldr-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.payday-tldr-list div {
  display: grid;
  gap: 6px;
  background: #ffffff;
  padding: 14px;
}

.payday-tldr-list span {
  color: var(--muted);
  font-size: 13px;
}

.tooltip-label {
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.payday-tldr-list strong {
  font-size: 20px;
}

.payday-transfers {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 16px;
}

.transfer-card {
  border-left-width: 5px;
}

.transfer-card.bill {
  border-left-color: #7e9b8d;
}

.transfer-card.bill-setaside {
  border-left-color: #14b8a6;
}

.transfer-card.sink {
  border-left-color: #e3b35c;
}

.transfer-card.allowance {
  border-left-color: #3b82f6;
}

.transfer-card.saving {
  border-left-color: #d4a72c;
}

.transfer-card-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  margin: 0;
  padding: 0;
  text-align: left;
}

.transfer-card.open .transfer-card-heading {
  margin-bottom: 12px;
}

.transfer-card-heading > span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.transfer-card-heading strong {
  font-size: 22px;
  white-space: nowrap;
}

.transfer-card-chevron {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  transition: transform 120ms ease;
}

.transfer-card.open .transfer-card-chevron {
  transform: rotate(180deg);
}

.transfer-card ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.transfer-card ul[hidden] {
  display: none;
}

.transfer-card li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.transfer-card li div {
  display: grid;
  gap: 3px;
}

.transfer-card li small {
  color: var(--muted);
  font-size: 12px;
}

.transfer-card li span {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.modal {
  width: min(560px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

#bulkImportDialog {
  width: min(1400px, calc(100vw - 32px));
}

.modal::backdrop {
  background: rgba(23, 33, 33, 0.42);
}

.modal-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(23, 33, 33, 0.22);
  padding: 18px;
  width: min(760px, calc(100vw - 32px));
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.bulk-import-card {
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.bulk-import-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.bulk-import-preview {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  min-width: 0;
}

.bulk-import-preview .panel-heading.row {
  flex-wrap: wrap;
}

.edit-gcal-actions {
  align-items: center;
  justify-content: flex-end;
}

.edit-gcal-actions .compact {
  min-width: 0;
}

#editForm label,
#editForm .two-col,
#editForm .bulk-import-preview,
#editForm .bulk-import-details,
#editForm select,
#editForm input {
  min-width: 0;
}

#editDialog {
  width: min(800px, calc(100vw - 24px));
}

#editGcalMatchSelect {
  max-width: 100%;
}

.bulk-import-table {
  table-layout: fixed;
  min-width: 100%;
}

.bulk-import-table th:nth-child(1),
.bulk-import-table td:nth-child(1) {
  width: 18%;
}

.bulk-import-table th:nth-child(2),
.bulk-import-table td:nth-child(2) {
  width: 12%;
}

.bulk-import-table th:nth-child(3),
.bulk-import-table td:nth-child(3) {
  width: 14%;
}

.bulk-import-table th:nth-child(4),
.bulk-import-table td:nth-child(4) {
  width: 20%;
}

.bulk-import-table th:nth-child(5),
.bulk-import-table td:nth-child(5) {
  width: 16%;
}

.bulk-import-table th:nth-child(6),
.bulk-import-table td:nth-child(6) {
  width: 10%;
}

.bulk-import-table th:nth-child(7),
.bulk-import-table td:nth-child(7) {
  width: 10%;
}

.bulk-import-table td {
  vertical-align: top;
  white-space: normal;
  min-width: 0;
}

.bulk-import-table td .tag-pill,
.bulk-import-table td .tag {
  margin-top: 6px;
}

.bulk-import-row-invalid {
  background: #fff7f7;
}

.bulk-import-row-invalid td {
  box-shadow: inset 0 -1px 0 rgba(162, 61, 61, 0.12);
}

.bulk-import-row-skipped {
  background: #f7faf9;
  opacity: 0.78;
}

.bulk-import-row-skipped td {
  box-shadow: inset 0 -1px 0 rgba(101, 113, 113, 0.08);
}

.bulk-import-row-imported {
  background: #eef6f3;
}

.bulk-import-row-imported td {
  box-shadow: inset 0 -1px 0 rgba(47, 111, 94, 0.12);
}

.bulk-import-cell {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.bulk-import-details {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  min-width: 0;
}

.bulk-import-details.two-col {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.bulk-import-details label {
  gap: 4px;
  min-width: 0;
}

.bulk-import-details label span,
.bulk-import-meta {
  font-size: 12px;
}

.bulk-import-table input,
.bulk-import-table select {
  min-width: 0;
}

.bulk-import-errors {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(162, 61, 61, 0.28);
  border-radius: 8px;
  background: #fff0f0;
  color: #8d2f2f;
  font-size: 12px;
  padding: 10px 12px;
}

.bulk-import-errors::before {
  content: "Needs attention";
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.bulk-import-warnings {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(193, 125, 34, 0.32);
  border-radius: 8px;
  background: #fff8eb;
  color: #8b5b14;
  font-size: 12px;
  padding: 10px 12px;
}

.bulk-import-warnings::before {
  content: "Check";
  color: var(--amber);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  #bulkImportDialog {
    width: calc(100vw - 16px);
  }

  .bulk-import-card {
    max-height: calc(100vh - 16px);
    padding: 16px;
  }
}

.delete-account-bulk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.delete-account-impacts {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.delete-account-impacts table {
  white-space: normal;
}

.delete-account-impacts td,
.delete-account-impacts th {
  vertical-align: top;
}

.delete-account-impacts .muted-text {
  padding: 6px 0;
}

.delete-account-impact {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(180px, 1fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.delete-account-impact:first-child {
  border-top: 0;
  padding-top: 0;
}

.delete-account-impact small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

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

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

  .topbar-profile {
    width: 100%;
    justify-items: stretch;
    min-width: 0;
  }

  .profile-calendar-picker {
    min-width: 0;
  }

  .scheduled-actions,
  .filters {
    align-items: stretch;
    flex-direction: column;
  }

  .guest-field,
  .tag-filter {
    width: 100%;
  }

  .tag-filter {
    justify-content: flex-start;
  }

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

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

  .delete-account-bulk,
  .delete-account-impact {
    grid-template-columns: 1fr;
  }

  .payday-hero,
  .payday-transfers,
  .payday-tldr-list {
    grid-template-columns: 1fr;
  }

  .cycle-controls {
    flex-wrap: wrap;
  }

  .income-total {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 14px;
  }
}

@media (max-width: 560px) {
  .summary,
  .two-col {
    grid-template-columns: 1fr;
  }
}
