:root {
  --ink: #292321;
  --muted: #776d64;
  --teal: #087f80;
  --teal-dark: #08686a;
  --teal-pale: #e4f1ed;
  --orange: #ed941d;
  --coral: #d94d30;
  --paper: #f1e9df;
  --card: #fffdf9;
  --line: #dfd2c2;
  --shadow: 0 12px 34px rgba(75, 53, 34, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("sea-pattern.svg");
  font: 14px "Nunito Sans", Arial, sans-serif;
}
.topbar {
  min-height: 76px;
  padding: 9px max(28px, calc((100% - 1120px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(249, 244, 237, .96);
  border-bottom: 2px solid rgba(8, 127, 128, .35);
  box-shadow: 0 2px 12px rgba(75, 53, 34, .045);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mascot { width: 47px; height: 47px; object-fit: contain; padding: 3px; border: 1px solid #dacbb8; border-radius: 50%; background: #f8f0e5; }
.brand strong, .brand small { display: block; }
.brand strong { font: 700 17px "Lora", Georgia, serif; letter-spacing: -.5px; }
.brand small { margin-top: 3px; color: var(--teal); font: 700 9px "Barlow Condensed", sans-serif; letter-spacing: 1.65px; }
.top-date { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 600 12px "Nunito Sans", sans-serif; }
.date-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px rgba(237, 148, 29, .15); }
.shell { width: min(1040px, calc(100% - 40px)); margin: 44px auto 28px; }
.intro { display: flex; align-items: center; justify-content: space-between; margin-bottom: 23px; padding: 0 4px; }
.eyebrow { display: inline-block; margin: 0 0 9px; padding: 4px 13px; color: #fff9ef; background: var(--teal); clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%); font: 600 10px "Barlow Condensed", sans-serif; letter-spacing: 1.7px; }
.intro h1 { margin: 0; font: 700 30px "Lora", Georgia, serif; letter-spacing: -.8px; }
.subtitle { margin: 8px 0 0; color: #6f655c; font-size: 13px; }
.intro-icon { width: 52px; height: 52px; display: grid; place-items: center; color: #fff9ef; background: var(--coral); border: 3px solid rgba(255,255,255,.52); outline: 1px solid var(--coral); border-radius: 50%; font-size: 22px; }
.panel, .results { background: rgba(255, 253, 249, .95); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.calculator-panel { padding: 25px 29px 23px; border-top: 4px solid var(--orange); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.panel-heading h2 { margin: 0; font: 700 18px "Lora", Georgia, serif; letter-spacing: -.25px; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.step { padding: 6px 15px; color: white; background: var(--teal); clip-path: polygon(8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%, 0 50%); font: 700 11px "Barlow Condensed", sans-serif; letter-spacing: .8px; }
.step i { color: #c7e2dc; font-style: normal; font-weight: 500; }
.input-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.calc-form label { display: block; color: #4a4039; font-size: 11px; font-weight: 800; }
.hint { margin-left: 4px; color: #8c7d70; font-size: 10px; font-weight: 500; }
.calc-form input { width: 100%; height: 43px; border: 1px solid #ddcdbb; border-radius: 7px; background: #fffefa; color: var(--ink); font: 500 13px "Nunito Sans", sans-serif; outline: none; transition: border .15s, box-shadow .15s; }
.calc-form input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,127,128,.13); }
.calc-form label > input { margin-top: 8px; padding: 0 12px; }
.money-input, .percent-input { display: flex; align-items: center; gap: 8px; height: 43px; margin-top: 8px; padding: 0 11px; color: var(--teal); border: 1px solid #ddcdbb; border-radius: 7px; background: #fffefa; }
.money-input:focus-within, .percent-input:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8,127,128,.13); }
.money-input input, .percent-input input { height: 39px; padding: 0; border: 0 !important; background: transparent; box-shadow: none !important; }
.money-input > span, .percent-input > span { font-size: 11px; font-weight: 800; }
.note-label { margin-top: 16px; }
.note-label > input { margin-top: 8px; }
.form-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; padding-top: 17px; border-top: 1px dashed #d9c8b5; }
.form-bottom p { margin: 0; color: var(--muted); font-size: 11px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 13px; height: 40px; padding: 0 16px; border-radius: 7px; font: 800 12px "Nunito Sans", sans-serif; text-decoration: none; cursor: pointer; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--teal); border: 1px solid var(--teal-dark); box-shadow: inset 0 -2px 0 rgba(0,0,0,.09); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { color: var(--coral); background: #fffaf2; border: 1px solid #e7b998; }
.notice { margin-bottom: 15px; padding: 12px 15px; border-radius: 8px; font-size: 13px; }
.notice.success { color: #276342; background: #e6f2e9; border-left: 4px solid var(--teal); }
.notice.error { color: #a13c2d; background: #fff0ed; border-left: 4px solid var(--coral); }
.results { margin-top: 21px; padding: 24px 27px 20px; border-top: 4px solid var(--teal); }
.results-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.results-title h2 { margin: 0; font: 700 21px "Lora", Georgia, serif; }
.results-title .eyebrow { margin-bottom: 6px; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.result-card { min-height: 117px; padding: 16px 18px; border: 1px solid #e6dccf; border-radius: 9px; background: #fffefa; }
.result-card.featured { background: #edf5ef; border-color: #c7ded2; }
.result-card.alert-card { background: #fff3e5; border-color: #efcfaa; }
.result-card span, .result-card small { display: block; color: #756b62; font-size: 11px; }
.result-card strong { display: block; margin: 9px 0 5px; font: 700 22px "Lora", Georgia, serif; letter-spacing: -.5px; }
.result-card.featured strong { color: var(--teal-dark); }
.result-card.alert-card strong { color: #b56317; }
.result-card small { font-size: 10px; }
.details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px 20px; padding: 17px 4px 1px; }
.details > div { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }
.details span { color: var(--muted); }
.details strong { font-weight: 800; white-space: nowrap; }
.history-panel { margin-top: 21px; padding: 24px 27px 17px; border-top: 4px solid var(--coral); }
.history-panel .panel-heading { margin-bottom: 18px; }
.empty { display: flex; flex-direction: column; align-items: center; padding: 26px 0 30px; text-align: center; }
.empty > span { width: 39px; height: 39px; display: grid; place-items: center; margin-bottom: 11px; color: white; background: var(--teal); clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%); font-size: 19px; }
.empty strong { font: 700 13px "Lora", Georgia, serif; }
.empty p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 9px 12px; color: #fff9ef; background: var(--teal); text-align: left; font: 600 10px "Barlow Condensed", sans-serif; letter-spacing: 1px; text-transform: uppercase; }
th:first-child { border-radius: 5px 0 0 5px; }
th:last-child { border-radius: 0 5px 5px 0; }
td { padding: 13px 12px; border-bottom: 1px solid #eee5da; font-size: 11px; }
td:first-child { font-weight: 800; }
td.omitted-cell { color: #b56317; font-weight: 800; }
.delete { color: #9a8b7e; background: transparent; border: 0; font-size: 20px; cursor: pointer; line-height: 1; }
.delete:hover { color: var(--coral); }
.storage-note { margin: 13px 0 0; color: #91857b; font-size: 10px; }
footer { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 24px 0 5px; color: var(--teal); text-align: center; font: 700 10px "Barlow Condensed", sans-serif; letter-spacing: 1.4px; }
footer small { width: 100%; color: #8b7d70; font: 700 9px "Nunito Sans", sans-serif; letter-spacing: 1.5px; }
.footer-rule { width: 38px; height: 1px; background: var(--orange); }
.top-actions { display: flex; align-items: center; gap: 9px; }
.top-user { color: var(--teal-dark); font-size: 11px; font-weight: 800; }
.logout-form { margin: 0; }
.auth-shell { max-width: 470px; margin-top: 65px; }
.auth-card { padding: 31px 34px 24px; border-top: 4px solid var(--teal); }
.auth-card h1 { margin: 0; font: 700 27px "Lora", Georgia, serif; letter-spacing: -.7px; }
.auth-copy { margin: 8px 0 22px; color: var(--muted); font-size: 12px; }
.auth-form { display: grid; gap: 15px; }
.auth-form label > input { display: block; margin-top: 8px; }
.auth-form .button { width: 100%; margin-top: 4px; }
.auth-footnote { margin: 18px 0 0; padding-top: 13px; border-top: 1px dashed var(--line); color: #8c7d70; font-size: 10px; text-align: center; }
.auth-footer { padding-top: 25px; }
@media (max-width: 760px) {
  .topbar { padding: 9px 20px; }
  .shell { width: calc(100% - 28px); margin-top: 30px; }
  .intro h1 { font-size: 25px; }
  .calculator-panel, .history-panel, .results { padding: 20px 17px; }
  .input-grid { grid-template-columns: repeat(2, 1fr); }
  .result-grid { grid-template-columns: 1fr; }
  .result-card { min-height: 98px; }
  .details { grid-template-columns: 1fr 1fr; }
  .results-title { align-items: flex-end; gap: 12px; }
  .results-title .button { padding: 0 10px; gap: 7px; }
  .top-actions { gap: 6px; }
  .top-actions .button { height: 36px; padding: 0 9px; font-size: 10px; }
  .auth-shell { margin-top: 42px; }
}
@media (max-width: 440px) {
  .input-grid { grid-template-columns: 1fr; }
  .form-bottom { align-items: flex-start; flex-direction: column; }
  .form-bottom .button { width: 100%; }
  .intro-icon { width: 43px; height: 43px; flex: none; margin-left: 12px; }
  .top-date { font-size: 11px; }
  .brand-mascot { width: 41px; height: 41px; }
  .brand strong { font-size: 14px; }
  .brand small { font-size: 8px; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 138px; }
  .top-user { display: none; }
  .top-actions .button { height: 33px; padding: 0 8px; }
  .details { grid-template-columns: 1fr; }
  .results-title { align-items: flex-start; flex-direction: column; }
  .results-title form, .results-title .button { width: 100%; }
  .auth-card { padding: 25px 20px 20px; }
}
