@import url("https://fonts.bunny.net/css?family=ibm-plex-mono:500,600|manrope:400,500,600,700,800&display=swap");

/* Pine Ledger — neutros + accent pine; lucro é o único verde vivo */
:root {
  --ink: #141c1b;
  --muted: #5e6d6a;
  --line: #d5ddd9;
  --paper: #eef1f0;
  --surface: #ffffff;
  --soft: #f3f6f5;
  --accent: #0c5c4d;
  --accent-hover: #0a4a3e;
  --deep: #12352e;
  --deep-2: #18453c;
  --danger: #b42318;
  /* Status “ok” contido — não compete com lucro */
  --ok: #3d6b5c;
  /* Resultado financeiro positivo — único destaque vivo */
  --profit: #189878;
  --info: #2f5d6e;
  --teal: var(--accent);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --z-toast: 10000;
  --z-modal: 50;
  --font: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  font-family: var(--font);
  color: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#app {
  position: relative;
  z-index: 1;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--deep);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* ── Shell ── */

.shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 16px 24px 48px;
}

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

.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-actions .button {
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
}

.topbar-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.topbar-meta span {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
}

.project-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  box-sizing: border-box;
  transition:
    background 0.18s var(--ease),
    border-color 0.18s var(--ease),
    color 0.18s var(--ease),
    transform 0.14s var(--ease);
}

.icon-button:hover {
  border-color: #b8cdc9;
  background: var(--soft);
  color: var(--deep);
  transform: translateY(-1px);
}

.icon-button:active {
  transform: scale(0.96);
}

.icon-button:focus-visible {
  outline: 3px solid rgb(12 92 77 / 0.28);
  outline-offset: 2px;
}

.icon-button .icon {
  display: block;
}

dialog.dialog-project {
  width: min(420px, calc(100% - 32px));
}

.project-settings-modal .modal-sticky {
  padding: 22px 24px 14px;
}

.project-settings-modal .modal-sticky .eyebrow {
  margin: 0 0 6px;
}

.project-settings-modal .modal-sticky h2 {
  margin: 0 40px 0 0;
  font-size: 20px;
}

.project-settings-modal .modal-body {
  display: grid;
  gap: 18px;
  padding: 4px 24px 22px;
}

.project-facts {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.project-facts > div {
  display: grid;
  gap: 4px;
  padding: 12px 0;
}

.project-facts > div + div {
  border-top: 1px solid var(--line);
}

.project-facts dt {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.35;
  text-wrap: pretty;
}

.project-facts dd.is-mono {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

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

.mark {
  display: grid;
  place-items: center;
  min-width: 44px;
  height: 40px;
  padding: 0 8px;
  border-radius: 10px;
  background: linear-gradient(165deg, var(--deep-2), var(--deep));
  color: #edf7f6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand b,
.brand small {
  display: block;
}

.brand b {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

/* ── Buttons ── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    background 0.18s var(--ease),
    border-color 0.18s var(--ease),
    color 0.18s var(--ease),
    transform 0.14s var(--ease);
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: scale(0.98) translateY(0);
}

.button:focus-visible {
  outline: 3px solid rgb(12 92 77 / 0.28);
  outline-offset: 2px;
}

.button.primary {
  background: var(--teal);
  color: #fff;
}

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

.button.quiet {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.quiet:hover {
  border-color: #b8cdc9;
  background: var(--soft);
}

.button.danger {
  border-color: #efd2d0;
  background: #fff7f6;
  color: var(--danger);
}

.button.danger:hover {
  background: #ffe9e7;
}

/* ── Workspace head ── */

.workspace-head {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  animation: rise-in 0.4s var(--ease) both;
}

.contract-block {
  padding: 18px 20px 14px;
  background:
    linear-gradient(180deg, #f7faf9 0%, var(--surface) 72%);
  border-bottom: 1px solid var(--line);
}

.contract-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 14px;
}

.contract-copy {
  min-width: 0;
  flex: 1 1 220px;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 28ch;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.contract-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.contract-meta-qty {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.contract-meta-qty b {
  font-weight: 700;
  color: var(--deep);
}

.contract-meta-pct {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #c5ddd7;
  border-radius: 999px;
  background: #e8f5f1;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.contract-meta-period {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.contract-profit {
  display: grid;
  gap: 4px;
  min-width: min(220px, 100%);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-align: left;
  transition:
    border-color 0.16s var(--ease),
    background 0.16s var(--ease),
    transform 0.16s var(--ease);
}

.contract-profit:hover {
  border-color: #b9d7d2;
  background: #fbfdfc;
}

.contract-profit:active {
  transform: translateY(1px);
}

.contract-profit.is-pressed {
  border-color: #b9d7d2;
  background: #f3faf7;
}

.contract-profit span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.contract-profit b {
  font-family: var(--mono);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.contract-profit.is-positive b {
  color: var(--profit);
  -webkit-text-fill-color: var(--profit);
}

.contract-profit.is-negative b {
  color: var(--danger);
  -webkit-text-fill-color: var(--danger);
}

.exec-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: none;
}

.exec-bar-track {
  flex: 1;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #e2ebe8;
}

.exec-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.45s var(--ease);
}

.panel-finance {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.panel-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px 16px;
  border-right: 1px solid var(--line);
}

.panel-metric:last-child {
  border-right: 0;
}

.panel-metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-metric b {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  transition:
    border-color 0.14s var(--ease),
    background 0.14s var(--ease),
    color 0.14s var(--ease);
}

.status-chip:hover {
  border-color: #b8cdc9;
  background: var(--soft);
}

.status-chip b {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: #e8efed;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.status-chip.is-pressed {
  border-color: #b5c7c3;
  background: var(--soft);
  color: var(--deep);
}

.status-chip.is-pressed b {
  background: var(--accent);
  color: #fff;
}

.status-chip.info.is-pressed {
  border-color: #c2d0d6;
  background: #f4f7f8;
}

.status-chip.info.is-pressed b {
  background: var(--info);
}

.status-chip.ok.is-pressed {
  border-color: #b5c7c3;
  background: var(--soft);
}

.status-chip.ok.is-pressed b {
  background: var(--ok);
}

.status-chip.danger.is-pressed {
  border-color: #e2b4af;
  background: #fff7f6;
}

.status-chip.danger.is-pressed b {
  background: var(--danger);
}

.negative {
  color: var(--danger) !important;
  font-weight: 700;
}

/* ── Toolbar / filters ── */

.workspace-body {
  margin-top: 22px;
  animation: rise-in 0.45s var(--ease) 0.05s both;
}

.toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.toolbar-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.toolbar-copy {
  min-width: 0;
  flex: 1;
}

.open-filters {
  gap: 8px;
}

.filter-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.toolbar-copy h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
  text-wrap: balance;
}

.clear-filters {
  flex: 0 0 auto;
}

.toolbar-search {
  width: 100%;
}

.toolbar-search .field {
  min-height: 42px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr)) repeat(2, minmax(118px, 0.9fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.period-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.period-presets .button {
  min-height: 34px;
  font-size: 12px;
  background: var(--surface);
}

.filter-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.filter-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.view-mobile {
  display: none;
}

.item-cards {
  gap: 10px;
  padding: 12px;
}

.item-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition:
    border-color 0.16s var(--ease),
    background 0.16s var(--ease);
}

.item-card:hover,
.item-card:focus-visible {
  border-color: #b9d7d2;
  background: #f7fbfa;
  outline: none;
}

.item-card-top {
  display: grid;
  gap: 0;
}

.item-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.item-card-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.item-card-grid b {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.item-card-grid .row-progress {
  margin-top: 6px;
}

.field {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  transition:
    border-color 0.16s var(--ease),
    background 0.16s var(--ease);
}

.field:hover {
  border-color: #b8cdc9;
}

.field:focus {
  border-color: var(--accent);
  outline: 3px solid rgb(12 92 77 / 0.22);
  outline-offset: 1px;
}

textarea.field {
  min-height: 88px;
  padding: 12px;
  resize: vertical;
  line-height: 1.45;
}

.field.project-select {
  width: auto;
  min-width: min(280px, 28vw);
  max-width: min(420px, 36vw);
  min-height: 36px;
  height: 36px;
  padding: 0 30px 0 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
}

input[type="date"].field {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

input[type="date"].field::-webkit-datetime-edit,
input[type="date"].field::-webkit-datetime-edit-fields-wrapper {
  min-width: 0;
  max-width: 100%;
  padding: 0;
}

/* ── Table surface ── */

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

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

.table-box table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 13px;
}

.table-box th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef5f3;
  color: #5a7074;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
}

.table-box th,
.table-box td {
  padding: 12px 12px;
  border-bottom: 1px solid #edf2f1;
  vertical-align: top;
}

.table-box tbody tr:last-child td {
  border-bottom: 0;
}

.item-row {
  cursor: pointer;
  transition: background 0.14s var(--ease);
}

.item-row:hover,
.item-row:focus-visible {
  background: #f5faf8;
}

.item-row:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}

.item-col {
  min-width: 300px;
  max-width: 440px;
}

.item-primary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: baseline;
}

.code {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.item-name {
  font-weight: 600;
  line-height: 1.35;
}

.sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.capacity,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.capacity {
  background: #e7f0ec;
  color: var(--deep-2);
}

.status-pill.pendente {
  background: #eef1f2;
  color: #53666a;
}

.status-pill.parcial {
  background: #eef2f4;
  color: #4a6570;
}

.status-pill.concluido {
  background: #eef2f0;
  color: var(--ok);
}

.status-pill.prejuizo {
  background: #fceceb;
  color: var(--danger);
}

.num {
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.num b {
  font-weight: 600;
}

.profit.positive,
.profit.positive b,
b.profit.positive,
#form-profit.positive {
  color: var(--profit);
  font-weight: 700;
}

.profit.negative,
.profit.negative b,
b.profit.negative {
  color: var(--danger);
  font-weight: 700;
}

.execution {
  min-width: 105px;
}

.execution b {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.execution span {
  color: var(--muted);
  font-weight: 500;
}

.row-progress {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #e5efed;
}

.row-progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}

.empty-row {
  padding: 48px 24px !important;
  color: var(--muted);
  text-align: center;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px;
}

.empty-state b {
  color: var(--ink);
  font-size: 14px;
}

.empty-state span {
  max-width: 36ch;
  font-size: 13px;
  line-height: 1.45;
}

/* ── Loading ── */

.loading-shell {
  display: grid;
  gap: 16px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #e1ebe8;
  border-radius: var(--radius);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.45), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.35s var(--ease) infinite;
}

.skeleton.hero {
  height: 220px;
  border-radius: var(--radius-lg);
}

.skeleton.bar {
  height: 48px;
}

.skeleton.table {
  height: 320px;
  border-radius: var(--radius-lg);
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

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

/* ── Login ── */

.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  min-height: 100dvh;
}

.login-panel {
  position: relative;
  display: grid;
  align-items: end;
  padding: 40px;
  background: linear-gradient(165deg, var(--deep-2) 0%, var(--deep) 100%);
  color: #eef4f2;
  overflow: hidden;
}

.login-panel-inner {
  position: relative;
  z-index: 1;
  max-width: 380px;
}

.login-panel .brand b {
  color: #fff;
}

.login-panel .brand small {
  color: #a8c8c5;
}

.login-panel .mark {
  background: rgb(255 255 255 / 0.12);
  border: 1px solid rgb(255 255 255 / 0.16);
}

.login-panel h1 {
  margin: 10px 0 12px;
  max-width: 14ch;
  color: #fff;
  font-size: clamp(28px, 3.4vw, 40px);
}

.login-panel p {
  margin: 0;
  color: #bfd3d0;
  font-size: 15px;
  line-height: 1.5;
  max-width: 34ch;
}

.login-form-wrap {
  display: grid;
  place-items: center;
  padding: 32px 24px;
  background: var(--paper);
}

.login-card {
  width: min(400px, 100%);
  padding: 28px 28px 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  animation: rise-in 0.4s var(--ease) both;
}

.login-brand-mobile {
  display: flex;
  margin: 0 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.login-brand-mobile .mark {
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 8px;
  font-size: 10px;
}

.login-brand-mobile .brand {
  gap: 8px;
}

.login-brand-mobile .brand b {
  font-size: 14px;
}

.login-brand-mobile .brand small {
  margin-top: 0;
  font-size: 11px;
}

.login-card h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.login-lead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  max-width: 36ch;
}

.login-card form,
.entry-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.label {
  display: grid;
  gap: 7px;
  color: #355458;
  font-size: 12px;
  font-weight: 700;
}

.label .field {
  font-size: 15px;
  font-weight: 500;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  min-width: 0;
}

.form-grid > .label {
  min-width: 0;
  max-width: 100%;
}

.full {
  grid-column: 1 / -1;
}

/* ── Dialog / Modals ── */

dialog {
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  max-height: calc(100dvh - 48px);
  margin: auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

dialog.dialog-sheet {
  width: min(880px, calc(100% - 40px));
}

dialog.dialog-form {
  width: min(900px, calc(100% - 40px));
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

dialog.dialog-confirm {
  width: min(400px, calc(100% - 40px));
}

dialog.dialog-filters {
  width: min(480px, calc(100% - 32px));
}

.filters-modal .modal-sticky {
  padding-bottom: 14px;
}

.filters-modal .modal-sticky h2 {
  margin: 0 44px 0 0;
}

.filters-form {
  display: grid;
  gap: 0;
  padding: 4px 22px 22px;
}

.filters-modal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
}

.filters-actions {
  margin-top: 18px;
  padding-top: 4px;
}

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

dialog::backdrop {
  background: rgb(8 36 40 / 0.52);
  backdrop-filter: blur(6px);
}

dialog[open] {
  animation: modal-in 0.32s var(--ease);
}

dialog[open]::backdrop {
  animation: backdrop-in 0.28s var(--ease);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 48px);
}

.modal-sticky {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 20px 24px 16px;
  background:
    linear-gradient(180deg, #f7faf9 0%, #ffffff 78%);
  border-bottom: 1px solid transparent;
}

.modal.has-scroll .modal-sticky {
  border-bottom-color: var(--line);
}

.modal-body {
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.modal h2 {
  max-width: 680px;
  margin: 4px 48px 6px 0;
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.modal .intro {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.close {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: #5a6d70;
  font-size: 20px;
  line-height: 1;
  transition:
    background 0.14s var(--ease),
    border-color 0.14s var(--ease),
    color 0.14s var(--ease),
    transform 0.14s var(--ease);
}

.close:hover {
  border-color: #b8cdc9;
  background: var(--soft);
  color: var(--ink);
}

.close:active {
  transform: translateY(1px);
}

.close:focus-visible {
  outline: 3px solid rgb(12 92 77 / 0.28);
  outline-offset: 2px;
}

.modal-head {
  display: block;
  padding-right: 44px;
}

.item-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.item-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.item-modal .modal-sticky {
  position: sticky;
  top: 0;
  z-index: 3;
}

.item-summary div {
  min-width: 0;
  padding: 14px 16px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.item-summary div:first-child {
  border-left: 0;
}

.item-summary span {
  display: block;
}

.item-summary b {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.history {
  padding: 22px 24px 28px;
  background: #f5f8f7;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
}

.history-head > div {
  min-width: 0;
}

.history h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-head p {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.01em;
}

.history-head .add-launch {
  flex: 0 0 auto;
  min-height: 40px;
  padding-inline: 14px;
  white-space: nowrap;
}

.launch-list {
  display: grid;
  gap: 6px;
}

.launch {
  display: grid;
  grid-template-columns: 100px minmax(140px, 1fr) minmax(96px, 120px) minmax(96px, 130px) auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 8px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px;
  transition: border-color 0.16s var(--ease);
}

.launch-note {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.launch:hover {
  border-color: #b9d7d2;
  background: #fbfdfc;
}

.launch b {
  display: block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}

.launch-date small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.launch-main span,
.launch-metric span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.launch-metric {
  text-align: right;
}

.launch-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 96px;
}

.launch-actions .button {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 11px;
}

.empty-launches {
  display: grid;
  min-height: 100px;
  align-content: center;
  justify-items: start;
  gap: 4px;
  padding: 28px 16px;
  border: 1px dashed #c9d6d2;
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.55);
  color: var(--muted);
  font-size: 13px;
}

.empty-launches b {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

/* Launch form with aside */

.launch-modal {
  padding: 0;
  max-height: none;
}

.launch-head {
  padding: 22px 28px 0;
  padding-right: 56px;
  background:
    linear-gradient(180deg, #f7faf9 0%, #ffffff 90%);
  border-bottom: 1px solid var(--line);
}

.launch-head .eyebrow {
  margin-bottom: 2px;
}

.launch-head h2 {
  margin: 4px 0 6px;
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.launch-head .intro {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.launch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  align-items: stretch;
}

.launch-modal.is-compact .launch-layout {
  grid-template-columns: 1fr;
}

.launch-modal.is-compact .launch-head {
  border-bottom: 0;
  background: transparent;
}

.launch-modal:not(.is-compact) .form-preview {
  display: none;
}

.launch-main-col {
  padding: 20px 28px 24px;
  overflow: visible;
  min-width: 0;
}

.launch-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 20px;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, #f3f7f6 0%, var(--soft) 100%);
  overflow: visible;
  min-width: 0;
}

.preview-head {
  display: grid;
  gap: 2px;
}

.preview-result {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.preview-result span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preview-result b {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  transition: color 0.18s var(--ease);
}

.preview-result.is-negative b,
.preview-result b.negative {
  color: var(--danger);
}

.preview-result.is-positive b {
  color: var(--profit);
}

.preview-breakdown {
  display: grid;
  gap: 0;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.preview-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.preview-line:last-child {
  border-bottom: 0;
}

.preview-line span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.preview-line b {
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.preview-line b i {
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
}

.preview-line.is-deduct span {
  padding-left: 10px;
}

.form-preview {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
}

.form-preview-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  background: transparent;
}

.form-preview-result span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-preview-result b {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  transition: color 0.18s var(--ease);
}

.form-preview.is-positive .form-preview-result b {
  color: var(--profit);
}

.form-preview.is-negative .form-preview-result b,
.form-preview-result b.negative {
  color: var(--danger);
}

.form-preview-rows {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
}

.form-preview-row {
  display: grid;
  gap: 2px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.form-preview-row:last-child {
  border: 0;
}

.form-preview-row span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.form-preview-row b {
  overflow: hidden;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-preview-row.is-deduct b {
  color: var(--muted);
}

@media (max-width: 640px) {
  .form-preview-rows {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .form-preview-row {
    grid-template-columns: 1fr auto;
    align-items: baseline;
  }
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.form-actions .button {
  min-width: 140px;
}

/* Confirm modal */

.confirm-modal {
  padding: 28px 26px 24px;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border: 1px solid #c9dbe4;
  border-radius: 12px;
  background: #eef5f8;
  color: var(--info);
  font-size: 18px;
  font-weight: 800;
}

.confirm-icon.is-danger {
  border-color: #ecc4c0;
  background: #fff4f3;
  color: var(--danger);
}

.confirm-modal h2 {
  margin: 0 40px 8px 0;
  font-size: 20px;
  letter-spacing: -0.035em;
}

.confirm-modal p {
  margin: 0;
  max-width: 36ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.confirm-modal .form-actions {
  margin-top: 24px;
  padding-top: 4px;
}

.confirm-modal .form-actions .button {
  flex: 1;
  min-width: 0;
}

/* Toast — popover top layer fica acima de <dialog> */

.toast {
  position: fixed;
  inset: auto auto 22px 50%;
  z-index: var(--z-toast);
  box-sizing: border-box;
  width: max-content;
  max-width: min(440px, calc(100vw - 32px));
  margin: 0;
  padding: 12px 16px;
  border: 1px solid var(--deep-2);
  border-radius: 10px;
  background: var(--deep);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease);
  overflow: visible;
}

.toast:popover-open,
.toast.show {
  display: block;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: var(--danger);
  border-color: #8f1c16;
}

.field.money-input,
.field.integer-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
}

/* ── Responsive: tablet ── */

@media (max-width: 1100px) {
  .shell {
    padding: 16px 16px 36px;
  }

  .panel-finance {
    grid-template-columns: repeat(3, 1fr);
  }

  .panel-metric:nth-child(3n) {
    border-right: 0;
  }

  .panel-metric:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .table-box table {
    min-width: 960px;
  }

  .launch-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

/* ── Responsive: tablet narrow / large phone ── */

@media (max-width: 860px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-panel {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
  }

  .view-desktop {
    display: none;
  }

  .item-cards.view-mobile {
    display: grid;
  }
}

/* ── Responsive: mobile ── */

@media (max-width: 640px) {
  .shell {
    padding: 12px 12px calc(28px + env(safe-area-inset-bottom));
  }

  .topbar {
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-height: 0;
    margin-bottom: 14px;
  }

  .topbar-left {
    flex: 1 1 100%;
    width: 100%;
  }

  .topbar-meta,
  .topbar-divider {
    display: none;
  }

  .topbar-actions {
    flex: 1 1 100%;
    width: 100%;
    gap: 8px;
  }

  .project-controls {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
  }

  .topbar-actions .button,
  .icon-button,
  .field.project-select {
    min-height: 40px;
    height: 40px;
  }

  .icon-button {
    width: 40px;
  }

  .field.project-select {
    width: 100%;
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
  }

  .topbar-actions > .button {
    flex: 0 0 auto;
  }

  .project-settings-modal .modal-body {
    padding: 2px 16px 18px;
  }

  .project-settings-modal .modal-sticky {
    padding: 18px 16px 12px;
  }

  h1 {
    font-size: clamp(20px, 5.5vw, 26px);
    max-width: none;
  }

  .contract-block {
    padding: 16px;
  }

  .contract-line {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 12px;
  }

  .contract-copy {
    flex: 0 0 auto;
  }

  .contract-profit {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
  }

  .contract-profit.is-positive b {
    color: var(--profit);
    -webkit-text-fill-color: var(--profit);
  }

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

  .panel-metric {
    padding: 12px 14px;
    border-right: 1px solid var(--line);
    border-top: 0;
  }

  .panel-metric:nth-child(2n) {
    border-right: 0;
  }

  .panel-metric:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .panel-metric b {
    font-size: 12px;
  }

  .panel-status {
    padding: 12px 14px;
    gap: 6px;
  }

  .status-chip {
    flex: 1 1 calc(50% - 6px);
    justify-content: space-between;
    min-height: 40px;
  }

  .toolbar-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .toolbar-copy h2 {
    font-size: 20px;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .button {
    flex: 1;
    min-height: 44px;
  }

  .field,
  .label .field,
  textarea.field {
    min-height: 44px;
    font-size: 16px;
  }

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

  .filters-form {
    padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  }

  .filters-actions {
    position: sticky;
    bottom: 0;
    margin: 12px -16px 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
  }

  .item-cards {
    padding: 10px;
  }

  dialog,
  dialog.dialog-sheet,
  dialog.dialog-form,
  dialog.dialog-confirm,
  dialog.dialog-filters,
  dialog.dialog-project {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  dialog[open] {
    animation: modal-in-mobile 0.3s var(--ease);
  }

  @keyframes modal-in-mobile {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  dialog.dialog-form[open] {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-x: hidden;
    max-width: 100%;
  }

  .modal {
    max-height: 100dvh;
    min-height: 100dvh;
    max-width: 100%;
  }

  dialog.dialog-form .modal.launch-modal {
    flex: 1;
    min-height: 0;
    max-height: none;
    max-width: 100%;
    overflow: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .launch-layout,
  .launch-main-col,
  .entry-form {
    min-width: 0;
    max-width: 100%;
  }

  .modal-sticky {
    padding: 18px 16px 12px;
  }

  .modal h2 {
    margin-right: 36px;
    font-size: 20px;
  }

  .modal-head {
    padding-right: 0;
  }

  .history-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .history-head .add-launch {
    width: 100%;
    min-height: 44px;
  }

  .item-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .item-summary div:nth-child(3n + 1) {
    border-left: 0;
  }

  .item-summary div:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  .history {
    padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  }

  .launch {
    grid-template-columns: 1fr 1fr;
    align-items: start;
    column-gap: 8px;
    row-gap: 8px;
  }

  .launch-date {
    grid-column: 1 / -1;
  }

  .launch-metric {
    text-align: left;
  }

  .launch-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    min-width: 0;
  }

  .launch-note {
    order: 10;
  }

  .launch-actions .button {
    min-height: 40px;
  }

  .launch-head {
    padding: 20px 16px 0;
    padding-right: 48px;
  }

  .launch-head h2 {
    font-size: 20px;
  }

  .launch-main-col {
    padding: 16px 16px 0;
    overflow-x: clip;
  }

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

  .full {
    grid-column: auto;
  }

  .form-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  }

  .form-actions .button {
    min-width: 0;
    min-height: 48px;
  }

  dialog.dialog-form .entry-form {
    margin-top: 0;
  }

  dialog.dialog-form .form-actions {
    position: sticky;
    z-index: 4;
    bottom: 0;
    margin: 12px -16px 0;
    padding: 13px 16px calc(13px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-sizing: border-box;
  }

  .confirm-modal {
    padding: 24px 16px calc(20px + env(safe-area-inset-bottom));
  }

  .login-form-wrap {
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  }

  .login-card {
    padding: 22px 18px;
  }

  .login-card .button {
    width: 100%;
    min-height: 48px;
  }

  .toast {
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .skeleton::after {
    display: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  dialog::backdrop {
    backdrop-filter: none;
    background: rgb(5 40 46 / 0.72);
  }
}
