/*
 * Nezdoo — the free tools (website/tools/): the rent receipt maker and the
 * electricity bill splitter. Builds on styles.css and pg.css.
 */

.tool {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  margin-top: 30px;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 26px;
  box-shadow: var(--shadow-md);
}

.tool-card.wide {
  margin-top: 30px;
}

.fl {
  display: block;
  font-weight: 600;
  font-size: 14.5px;
  margin: 14px 0 6px;
}

.fl small {
  font-weight: 400;
  color: var(--text-muted);
}

.tool-card input,
.tool-card select,
.tool-card textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-alt);
  color: var(--navy);
}

.tool-card input:focus,
.tool-card select:focus,
.tool-card textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--coral);
  box-shadow: 0 0 0 4px var(--coral-soft);
}

.tool-card .btn {
  margin-top: 18px;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}

.three {
  display: grid;
  grid-template-columns: 1fr 1fr 0.7fr;
  gap: 0 14px;
}

.err {
  color: #c0392b;
  font-size: 15px;
  margin: 12px 0 0;
}

.small-print {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin: 12px 0 0;
}

.tool-notes h2 {
  margin-top: 6px;
}

.ticks {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ticks li {
  position: relative;
  padding: 8px 0 8px 30px;
  color: var(--text-body);
}

.ticks li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 14px;
  width: 12px;
  height: 7px;
  border-left: 2.4px solid var(--coral);
  border-bottom: 2.4px solid var(--coral);
  transform: rotate(-45deg);
}

.out-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.out-head h2 {
  margin: 0;
}

.out-head p {
  margin: 4px 0 0;
}

.out-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  margin-top: 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}

.ghost-btn:hover {
  border-color: var(--navy);
}

.out-actions .btn,
.out-actions .ghost-btn {
  margin-top: 0;
}

/* ---------- the receipts ---------- */

.rcpt {
  background: #fff;
  border: 1px solid #d9dde5;
  border-radius: 14px;
  padding: 20px 22px;
  margin: 0 0 16px;
  font-size: 15px;
  max-width: 780px;
}

.rcpt header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--coral);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.rcpt header b {
  color: var(--coral);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 18px;
}

.rcpt header span {
  text-align: right;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.5;
}

.rcpt header small {
  font-weight: 400;
  color: var(--text-secondary);
}

.rcpt p {
  margin: 0 0 12px;
  line-height: 1.6;
}

.rcpt table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
}

.rcpt th {
  text-align: left;
  width: 30%;
  font-weight: 400;
  color: var(--text-secondary);
  padding: 5px 0;
  border-bottom: 1px solid #eef0f4;
}

.rcpt td {
  padding: 5px 0;
  border-bottom: 1px solid #eef0f4;
}

.rcpt .sign {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  line-height: 2.1;
}

.rcpt .lbl {
  display: inline-block;
  min-width: 170px;
  color: var(--text-secondary);
}

.rcpt .blank {
  display: inline-block;
  min-width: 140px;
  height: 14px;
  border-bottom: 1px solid var(--navy);
  vertical-align: bottom;
}

.rcpt .blank.wide {
  min-width: 220px;
}

.rcpt .line {
  margin-top: 14px;
}

.rcpt .stamp {
  flex: none;
  width: 72px;
  height: 84px;
  border: 1px dashed var(--text-secondary);
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ---------- the bill splitter ---------- */

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.seg button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
}

.seg button[aria-selected='true'] {
  background: var(--navy);
  color: #fff;
}

.scroll {
  overflow-x: auto;
}

.rooms-t {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.rooms-t th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 6px 6px;
  white-space: nowrap;
}

.rooms-t td {
  padding: 4px 6px;
}

.rooms-t input {
  min-width: 90px;
  padding: 9px 11px;
}

.rooms-t input.narrow {
  min-width: 64px;
  max-width: 90px;
}

.rooms-t .x {
  border: 0;
  background: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}

.result {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
}

.result th {
  text-align: left;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
}

.result td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--divider);
}

.result tr:last-child td {
  border-bottom: 0;
}

.result .num {
  text-align: right;
  white-space: nowrap;
}

#out {
  margin-top: 30px;
}

@media (max-width: 860px) {
  .tool {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .tool-card {
    padding: 20px 16px;
  }
}

@media (max-width: 480px) {
  .two,
  .three {
    grid-template-columns: 1fr;
  }

  .rcpt .lbl {
    min-width: 0;
    display: block;
    line-height: 1.4;
  }

  .rcpt .sign {
    line-height: 1.6;
  }

  .seg {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    border-radius: 18px;
  }

  .seg button {
    padding: 9px 4px;
    font-size: 13.5px;
    border-radius: 14px;
  }

  .rooms-t {
    table-layout: fixed;
  }

  .rooms-t th {
    font-size: 10.5px;
    letter-spacing: 0.02em;
    padding: 0 3px 6px;
    white-space: normal;
  }

  .rooms-t td {
    padding: 3px;
  }

  .rooms-t input,
  .rooms-t input.narrow {
    min-width: 0;
    max-width: none;
    padding: 9px 7px;
    font-size: 15px;
  }

  .rooms-t th:last-child,
  .rooms-t td:last-child {
    width: 30px;
  }

  .rooms-t .x {
    padding: 4px 2px;
  }

  .result th {
    font-size: 10.5px;
    letter-spacing: 0.02em;
    padding: 10px 6px;
  }

  .result td {
    padding: 10px 6px;
    font-size: 15px;
  }
}

/* Printing the receipts: only they, one to a page. */
@media print {
  @page {
    margin: 16mm;
  }

  body {
    background: #fff;
  }

  header.site,
  footer.site,
  .crumbs,
  .list-head,
  .tool,
  .get-app,
  .out-head,
  #warn {
    display: none !important;
  }

  #out {
    margin: 0;
  }

  .pg-shell {
    padding: 0;
    max-width: none;
  }

  .rcpt {
    break-inside: avoid;
    page-break-inside: avoid;
    max-width: none;
    margin: 0 0 14mm;
  }

  .rcpt:nth-of-type(2n) {
    break-after: page;
    page-break-after: always;
  }
}
