/* Same palette and type as marfooos.dev, so the portal reads as the same place. */

:root {
  --paper: #F7F2EA;
  --card:  #FFFFFF;
  --ink:   #29261F;
  --muted: #797365;
  --green: #2F6B46;
  --line:  #E5DDD0;
  --bad:   #9B3226;
  --wait:  #8A6A1F;
}

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

body {
  font-family: 'Public Sans', system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.0325rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrap { max-width: 940px; margin: 0 auto; padding: 0 1.4rem; width: 100%; }
main.wrap { flex: 1; padding-top: 2.4rem; padding-bottom: 3rem; }

a { color: var(--green); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

h1, h2, h3 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; }
h1 { font-size: 2rem; line-height: 1.15; }
h2 { font-size: 1.15rem; margin-bottom: 1rem; }

.sub   { color: var(--muted); margin: 0.35rem 0 1.8rem; }
.crumb { margin-bottom: 0.6rem; font-size: 0.9rem; }
.fine  { font-size: 0.86rem; color: var(--muted); line-height: 1.5; }
.empty { color: var(--muted); font-style: italic; }
code.wrapped { word-break: break-all; font-size: 0.8rem; }

/* ---------------------------------------------------------------- header */

header {
  background: rgba(247, 242, 234, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
header .wrap {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding-top: 0.9rem; padding-bottom: 0.9rem; flex-wrap: wrap;
}
.logo {
  font-family: 'Fraunces', Georgia, serif; font-weight: 700;
  font-size: 1.25rem; color: var(--ink); text-decoration: none;
}
.logo span { color: var(--green); }
.logo small {
  font-family: 'Public Sans', sans-serif; font-weight: 500;
  font-size: 0.78rem; color: var(--muted); margin-left: 0.5rem;
}
nav { display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap; }
nav a {
  text-decoration: none; color: var(--muted);
  font-weight: 500; font-size: 0.93rem;
}
nav a:hover, nav a.on { color: var(--ink); }
nav a.on { text-decoration: underline; text-underline-offset: 5px; }
nav form { display: inline; }

.linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 0.93rem; font-weight: 500; color: var(--muted);
}
.linkish:hover { color: var(--ink); }

footer {
  border-top: 1px solid var(--line);
  padding-top: 1.2rem; padding-bottom: 1.6rem;
}
footer p { font-size: 0.86rem; color: var(--muted); }

/* ---------------------------------------------------------------- cards */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.4rem;
}
.card-foot {
  border-top: 1px solid var(--line);
  margin: 1.2rem -1.5rem -1.4rem;
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
}
.narrow { max-width: 26rem; margin: 2rem auto; }

/* ---------------------------------------------------------------- tiles */

.tiles {
  display: grid;
  /* 10rem so the admin's five tiles sit on one row rather than four plus an orphan. */
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.tile {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.15rem;
}
.tile-label { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tile-value { font-family: 'Fraunces', Georgia, serif; font-size: 1.7rem; line-height: 1.2; }

/* ---------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.62rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
td:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; }
.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.right { text-align: right; }

/* Tables carry money and dates. Let them scroll rather than squash — which
   needs the cells held on one line, or they just wrap to fit and never
   overflow. Descriptions underneath a cell still wrap. */
.card > table { display: block; overflow-x: auto; }
.card > table th, .card > table td { white-space: nowrap; }
/* Buttons in the last column may stack rather than push the table into a
   scroll — "Pay $420.00" beside "Receipt" is wider than a row needs to be. */
.card > table td:last-child { white-space: normal; }
.card > table .fine { white-space: normal; }
/* Only a description needs room to wrap; a "$60 paid" note under a figure must
   not push its own column wider. */
.card > table td:first-child .fine { min-width: 12rem; }

.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 0.1rem 0.5rem; border-radius: 999px;
  border: 1px solid currentColor;
}
.badge.ok   { color: var(--green); }
.badge.bad  { color: var(--bad); }
.badge.wait { color: var(--wait); }

/* ---------------------------------------------------------------- receipt */

.receipt {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 2rem 2.2rem; max-width: 44rem;
}
.receipt-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.receipt-top h1 { font-size: 1.7rem; }
.receipt-stamp {
  font-family: 'Fraunces', Georgia, serif; font-size: 1.1rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--green);
  border: 2px solid var(--green); border-radius: 6px;
  padding: 0.2rem 0.9rem; transform: rotate(-3deg);
}
.receipt-stamp.part { color: var(--wait); border-color: var(--wait); }
.receipt-h {
  font-size: 0.82rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin: 1.6rem 0 0.2rem;
}
.receipt-parties {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  margin: 1.8rem 0; padding: 1.2rem 0; border-block: 1px solid var(--line);
}
.receipt-parties span { display: block; text-transform: uppercase; letter-spacing: 0.05em; }
.receipt table { margin-bottom: 1.2rem; }
.receipt tbody tr:last-child td { border-bottom: 0; }
.receipt .total td {
  border-top: 2px solid var(--ink); border-bottom: 0;
  padding-top: 0.8rem; font-size: 1.05rem; font-weight: 700; color: var(--ink);
}
.receipt .owing td { border-bottom: 0; padding-top: 0.15rem; color: var(--muted); }
.receipt-foot { margin: 0; }

@media (max-width: 560px) { .receipt { padding: 1.3rem 1.2rem; } .receipt-parties { grid-template-columns: 1fr; } }

/* The receipt is the only page anyone prints; everything around it goes. */
@page { margin: 18mm; }

@media print {
  header, footer, .no-print, .crumb { display: none !important; }
  body { background: #fff; }
  main.wrap { padding: 0; max-width: none; }
  .receipt { border: 0; padding: 0; max-width: none; }
  .notice { border-style: solid; }
}

/* ---------------------------------------------------------------- split */

/* The label rule below sets display:block, which would win over [hidden]. */
[hidden] { display: none !important; }

.split-ui { margin-bottom: 0.9rem; }
.split-count {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.88rem; font-weight: 500; margin-bottom: 0.7rem;
}
.split-count .btn { padding: 0 0.55rem; line-height: 1.7; }
.split-count output { min-width: 1.1rem; text-align: center; font-variant-numeric: tabular-nums; }

.split-row {
  display: grid; grid-template-columns: 7rem 1fr 2.8rem 5rem;
  align-items: center; gap: 0.8rem; margin-bottom: 0.5rem;
}
.split-row input[type="range"] {
  width: 100%; margin: 0; padding: 0;
  border: 0; background: none; accent-color: var(--green);
}
.split-row input[type="range"]:disabled { opacity: 0.55; }
.split-name { font-size: 0.88rem; }
.split-pct { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.split-cash { font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .split-row { grid-template-columns: 1fr 2.8rem 5rem; row-gap: 0.2rem; }
  .split-name { grid-column: 1 / -1; }
  .split-row input[type="range"] { grid-column: 1; }
}

/* ---------------------------------------------------------------- plans */

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.plan {
  border: 1px solid var(--line); border-radius: 9px;
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.plan.current { border-color: var(--green); background: rgba(47, 107, 70, 0.04); }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.plan-price { font-family: 'Fraunces', Georgia, serif; font-size: 1.25rem; white-space: nowrap; }
.plan-price .fine { font-family: 'Public Sans', sans-serif; }
.plan p { flex: 1; margin: 0; }
.plan > :last-child { margin-top: auto; align-self: flex-start; }

/* ---------------------------------------------------------------- websites */

.site { border-top: 1px solid var(--line); padding: 0.9rem 0; }
.site:first-child { border-top: 0; padding-top: 0; }
.site-form {
  display: flex; gap: 0.8rem; align-items: flex-end; flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.site-form label { margin-bottom: 0; }
.site-form label:nth-of-type(1) { flex: 1 1 11rem; }
.site-form label:nth-of-type(2) { flex: 2 1 14rem; }
.site-form label:nth-of-type(3) { flex: 0 1 8rem; }
.site-form label:nth-of-type(4) { flex: 0 1 10rem; }

/* ---------------------------------------------------------------- requests */

.request { border-top: 1px solid var(--line); padding: 1rem 0; }
.request:first-child { border-top: 0; padding-top: 0; }
.request:last-child { padding-bottom: 0; }
.request-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 0.45rem; }
.request p { margin-bottom: 0.4rem; }
.reply {
  border-left: 3px solid var(--green);
  padding: 0.15rem 0 0.15rem 0.8rem;
  color: var(--muted); font-size: 0.93rem;
}
.request-form {
  display: flex; gap: 0.9rem; align-items: flex-end; flex-wrap: wrap;
  margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px dashed var(--line);
}
.request-form label { margin-bottom: 0; }
.request-form label:first-of-type { flex: 0 0 10rem; }
.request-form label:last-of-type { flex: 1 1 16rem; }
.request-form button { margin-bottom: 0.05rem; }

/* ---------------------------------------------------------------- forms */

label { display: block; margin-bottom: 0.9rem; font-size: 0.88rem; font-weight: 500; }
input, select, textarea {
  display: block; width: 100%; margin-top: 0.3rem;
  font: inherit; font-size: 0.97rem; color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 0.55rem 0.7rem;
}
input:disabled { background: var(--paper); color: var(--muted); }

/* Italic, so a placeholder can never be mistaken for a value already typed —
   "1000.00" sitting in a pale box reads as filled in otherwise. */
::placeholder { color: var(--muted); opacity: 0.75; font-style: italic; }
textarea { resize: vertical; }

.btn {
  display: inline-block; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 0.95rem;
  background: var(--green); color: #fff; text-decoration: none;
  border: 1px solid var(--green); border-radius: 7px;
  padding: 0.55rem 1.1rem;
}
.btn:hover { background: #275939; }
.btn.small { font-size: 0.86rem; padding: 0.34rem 0.8rem; }
.btn.ghost { background: none; color: var(--green); }
.btn.ghost:hover { background: rgba(47, 107, 70, 0.08); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: rgba(155, 50, 38, 0.08); }

form.inline { display: inline-block; }
form.stack { margin-top: 0.2rem; }
form.stack label { margin-bottom: 0.6rem; }

.flash {
  border: 1px solid var(--green); border-left-width: 4px;
  background: var(--card); color: var(--ink);
  border-radius: 7px; padding: 0.7rem 1rem; margin-bottom: 1.4rem;
  font-size: 0.93rem;
}
.flash.bad { border-color: var(--bad); }

.notice {
  background: #FDF6E3; border: 1px dashed var(--wait);
  color: var(--ink); border-radius: 7px;
  padding: 0.75rem 0.9rem; margin-bottom: 1.2rem;
  font-size: 0.87rem; line-height: 1.5;
}

@media (max-width: 560px) {
  h1 { font-size: 1.6rem; }
  main.wrap { padding-top: 1.6rem; }
  .card { padding: 1.1rem 1.1rem; }
  .card-foot { margin: 1rem -1.1rem -1.1rem; padding: 0.9rem 1.1rem; }
  nav { gap: 1rem; width: 100%; }
}
