* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
  padding: 2rem;
  max-width: 880px;
  margin: 0 auto;
}

header { margin-bottom: 2rem; }

h1 { font-size: 1.6rem; font-weight: 600; color: #1d1d1f; }

.subtitle { color: #6e6e73; font-size: 0.9rem; margin-top: 0.25rem; }

h2 { font-size: 1.1rem; font-weight: 500; margin-bottom: 1rem; color: #6e6e73; }

.tag {
  font-size: 0.75rem;
  background: #e5e5ea;
  color: #6e6e73;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 400;
  vertical-align: middle;
}

.card {
  background: #fff;
  border: 1px solid #d2d2d7;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.field + .field { border-top: 1px solid #f0f0f2; }

.field span { font-weight: 500; }

.field.note {
  justify-content: flex-start;
}
.field.note span {
  font-weight: 400;
  font-size: 0.85rem;
  color: #8e8e93;
  font-style: italic;
}

.detail {
  font-weight: 400 !important;
  color: #8e8e93;
  font-size: 0.85rem;
}

.dual {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  font-weight: 500;
}

.monthly {
  color: #8e8e93;
  font-size: 0.85rem;
  font-weight: 400 !important;
  min-width: 100px;
  text-align: right;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.input-group .unit {
  font-weight: 400;
  color: #8e8e93;
  font-size: 0.85rem;
}

input[type="number"] {
  background: #f5f5f7;
  border: 1px solid #d2d2d7;
  border-radius: 6px;
  color: #1d1d1f;
  padding: 0.4rem 0.6rem;
  width: 90px;
  text-align: right;
  font-size: 0.9rem;
}

input[type="number"]:focus {
  outline: none;
  border-color: #2563eb;
}

output {
  font-weight: 600;
  font-size: 0.95rem;
  color: #2563eb;
}

.field.result {
  border-top: 2px solid #e5e5ea;
  margin-top: 0.25rem;
  padding-top: 0.75rem;
}

.field.result label { font-weight: 600; }
.field.result output { color: #1d1d1f; font-weight: 700; font-size: 1.05rem; }
.field.result span { font-weight: 700; }

.negative { color: #059669 !important; }

/* Scenario inputs */
.scenario-inputs {
  display: flex;
  gap: 0.75rem;
}

.scenario-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.scenario-col .col-label {
  font-size: 0.75rem;
  font-weight: 400;
  color: #8e8e93;
}

.scenario-col input { width: 72px; }

/* Scenario Table */
.scenarios { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 1rem;
}

th, td { padding: 0.5rem 0.75rem; text-align: right; }
th:first-child, td:first-child { text-align: left; }

thead th {
  font-weight: 600;
  border-bottom: 2px solid #d2d2d7;
  padding-bottom: 0.75rem;
  color: #1d1d1f;
}

.th-sub { font-weight: 400; color: #8e8e93; font-size: 0.8rem; }

tbody + tbody { border-top: 1px solid #e5e5ea; }

tr.muted td { color: #8e8e93; }
tr.subtotal td { font-weight: 600; border-top: 1px solid #d2d2d7; padding-top: 0.75rem; }
tr.charter td { color: #059669; }
tr.total-both td { font-weight: 500; color: #6e6e73; }

tr.highlight td {
  font-weight: 700;
  font-size: 1rem;
  color: #1d1d1f;
  border-top: 2px solid #d2d2d7;
  padding-top: 0.75rem;
}

tr.key-metric td { font-weight: 600; color: #2563eb; }
tr.key-metric:first-child td { border-top: 2px solid #e5e5ea; padding-top: 0.75rem; }
tr.tax-row td { color: #059669; }

/* Projection table */
.projection { max-width: 100%; }

.proj-assumptions {
  margin-bottom: 1rem;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 -1.5rem;
  padding: 0 1.5rem;
}

#projTable {
  min-width: 900px;
  font-size: 0.8rem;
}

#projTable th,
#projTable td {
  padding: 0.35rem 0.5rem;
  white-space: nowrap;
}

#projTable .row-label {
  text-align: left;
  font-weight: 500;
  min-width: 150px;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}

#projTable thead th {
  font-size: 0.75rem;
  color: #6e6e73;
  font-weight: 600;
  border-bottom: 2px solid #d2d2d7;
  position: sticky;
  top: 0;
  background: #fff;
}

#projTable tr.subtotal td { font-weight: 600; border-top: 1px solid #d2d2d7; }
#projTable tr.highlight td { font-weight: 700; border-top: 2px solid #d2d2d7; color: #1d1d1f; }
#projTable tr.charter td { color: #059669; }
#projTable tr.tax-row td { color: #059669; font-weight: 600; }
#projTable tr.dep-row td { color: #8e8e93; }
#projTable tr.escalating td { color: #d97706; }
#projTable tr.muted td { color: #8e8e93; font-size: 0.75rem; }
#projTable tr.cumulative td { font-weight: 700; color: #2563eb; }
#projTable tr.spacer-row td { padding: 0.25rem 0; border: none; }

.proj-totals {
  margin-top: 1.25rem;
  border-top: 2px solid #e5e5ea;
  padding-top: 0.75rem;
}
