.tc-mode-bar {
  display: inline-flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin: .35rem 0 1rem;
}

.tc-mode-bar button {
  min-height: 40px;
  padding: .45rem .9rem;
  border-radius: 8px;
}

.tc-mode-bar [aria-pressed="true"] {
  background: #e0f3ed;
  border-color: #17624e;
  color: #104b3e;
  font-weight: 700;
}

.tc-presets {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: .7rem 0 1.1rem;
}

.tc-presets button {
  min-width: 3.5rem;
  padding: .5rem .8rem;
}

.tc-presets [aria-pressed="true"] {
  background: #e0f3ed;
  border-color: #17624e;
  color: #104b3e;
  font-weight: 700;
}

.tc-item-list {
  display: grid;
  gap: .55rem;
  margin: .75rem 0;
}

.tc-diner-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: center;
}

.tc-remove-diner {
  min-height: 42px;
  padding: .35rem .7rem;
  font-size: .85rem;
}

.tc-item-actions {
  margin: .5rem 0 1rem;
}

.tc-check {
  display: flex;
  gap: .5rem;
  align-items: center;
  font-weight: 550;
}

.tc-check input,
#tcRound,
#tcTipPreTax {
  flex-shrink: 0;
  height: 20px;
  min-height: 20px;
  width: 20px;
  margin: 0 .4rem 0 0;
  padding: 0;
}

.tc-check-wrap {
  align-self: center;
}

#tcTaxPanel {
  margin: .75rem 0 1rem;
}

#tcTotal {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 750;
  overflow-wrap: anywhere;
  margin: .6rem 0;
}

#tcSummary {
  margin: 1rem 0;
}

#tcSummary > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #d6e3df;
  padding: .6rem 0;
}

#tcSummary > div[hidden] {
  display: none !important;
}

#tcSummary dt,
#tcSummary dd {
  margin: 0;
}

#tcSummary dd {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#tcSplitSummary {
  font-weight: 650;
  font-size: 1.05rem;
}

.tc-compare {
  margin: 1rem 0;
  padding: .85rem .95rem;
  border-radius: 10px;
  border: 1px solid #d6e3df;
  background: #fafcfb;
}

.tc-compare h3 {
  margin: 0 0 .65rem;
  font-size: .96rem;
  color: #103347;
}

.tc-compare-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
}

.tc-compare-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: .6rem .7rem;
  border-radius: 8px;
  gap: .15rem;
}

.tc-compare-card[aria-pressed="true"] {
  background: #e0f3ed;
  border-color: #17624e;
  color: #104b3e;
}

.tc-cc-rate {
  font-size: .82rem;
  font-weight: 700;
}

.tc-cc-total {
  font-size: 1.05rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.tc-cc-sub {
  font-size: .78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tc-result-actions {
  margin: 1rem 0;
}

.tc-table-scroll {
  overflow-x: auto;
  max-width: 100%;
}

#tcTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: .75rem;
  font-size: .9rem;
}

#tcTable th,
#tcTable td {
  text-align: right;
  padding: .55rem .35rem;
  border-bottom: 1px solid #d6e3df;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

#tcTable th[scope="row"],
#tcTable thead th:first-child {
  text-align: left;
}

#tcTable th {
  font-weight: 600;
}

#tcResult[hidden] {
  display: none !important;
}

#tcBreakdown {
  margin: 1.2rem 0;
}

#tcBreakdown summary {
  cursor: pointer;
  font-weight: 650;
}

.tc-label {
  font-size: .9rem;
  color: #365768;
}

.project-status {
  font-size: .82rem;
  color: var(--muted);
  margin: .65rem 0 0;
}

@media (max-width: 600px) {
  .tc-compare-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .tc-diner-row .tc-remove-diner {
    grid-column: 1 / -1;
    justify-self: start;
  }

  #tcTable {
    font-size: .82rem;
  }

  #tcTable th,
  #tcTable td {
    padding: .45rem .25rem;
  }

  #tcSummary > div {
    gap: .5rem;
  }

  #tcSummary dd {
    overflow-wrap: anywhere;
    max-width: 52%;
  }
}

@media print {
  body[data-tool="tip-calc"] form,
  body[data-tool="tip-calc"] .tc-result-actions,
  body[data-tool="tip-calc"] .cs-studio-actions,
  body[data-tool="tip-calc"] .cs-preset-bar,
  body[data-tool="tip-calc"] .tool-rating,
  body[data-tool="tip-calc"] .ci-organic-guide,
  body[data-tool="tip-calc"] .project-status {
    display: none !important;
  }

  .tc-compare {
    break-inside: avoid;
  }
}
