:root {
  color-scheme: dark;
  --ink: #f0ece3;
  --muted: #9c9b93;
  --red: #e85a47;
  --red-dark: #b73e32;
  --paper: #0c0f0f;
  --panel: #151918;
  --line: #303430;
  --amber: #e5b05a;
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(rgb(255 255 255 / 1.5%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 1.5%) 1px, transparent 1px),
    radial-gradient(ellipse at 82% 15%, rgb(108 35 28 / 27%), transparent 31rem),
    var(--paper);
  background-size: 42px 42px, 42px 42px, auto, auto;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1056px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  height: 83px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-content: center;
  border: 1px solid #884239;
  border-radius: 50%;
  background: #281715;
  color: var(--red);
  font-size: 11px;
}

.brand-mark span {
  display: none;
}

.brand-light {
  color: #777a72;
  font-weight: 500;
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #aaa79e;
  font-family: "Space Grotesk", sans-serif;
  font-size: 9px;
  letter-spacing: 1.1px;
}

.privacy-note span,
.warning-light {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px rgb(232 90 71 / 70%);
  animation: warning-pulse 2.4s ease-in-out infinite;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: center;
  gap: 45px;
  padding: 66px 0 43px;
}

.intro-copyblock {
  max-width: 640px;
}

.eyebrow,
.summary-label {
  font-family: "Space Grotesk", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 19px;
  color: var(--amber);
}

.eyebrow-line {
  width: 20px;
  height: 1px;
  background: var(--red);
  box-shadow: 0 0 8px rgb(232 90 71 / 70%);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 17px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(42px, 6vw, 61px);
  font-weight: 600;
  letter-spacing: -3.8px;
  line-height: 1.04;
}

h1 span {
  color: var(--red);
}

.intro-copy {
  max-width: 440px;
  margin-bottom: 0;
  color: #aaa79e;
  font-size: 14px;
  line-height: 1.75;
}

.clock-motif {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}

.clock-face {
  position: relative;
  width: 206px;
  aspect-ratio: 1;
  border: 1px solid #7d3931;
  border-radius: 50%;
  background:
    radial-gradient(circle, #151817 0 61%, transparent 62%),
    repeating-conic-gradient(from -1deg, #ae5242 0deg 1deg, transparent 1deg 30deg);
  box-shadow:
    0 0 0 7px rgb(232 90 71 / 4%),
    0 0 38px rgb(165 54 42 / 20%),
    inset 0 0 24px rgb(0 0 0 / 65%);
}

.clock-face::before {
  position: absolute;
  inset: 12px;
  border: 1px solid rgb(232 90 71 / 26%);
  border-radius: 50%;
  content: "";
}

.clock-face::after {
  position: absolute;
  inset: 24px;
  border: 1px dashed rgb(255 255 255 / 8%);
  border-radius: 50%;
  content: "";
}

.clock-hand {
  position: absolute;
  z-index: 1;
  bottom: 50%;
  left: 50%;
  display: block;
  width: 2px;
  border-radius: 2px;
  background: var(--ink);
  transform-origin: center bottom;
}

.clock-hand-hour {
  height: 51px;
  transform: translateX(-50%) rotate(356deg);
}

.clock-hand-minute {
  height: 67px;
  background: var(--red);
  transform: translateX(-50%) rotate(348deg);
}

.clock-center {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--red);
  transform: translate(-50%, -50%);
}

.clock-time {
  position: absolute;
  right: 0;
  bottom: 31px;
  left: 0;
  color: #c7b9a2;
  font-family: "Space Grotesk", sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  text-align: center;
}

.clock-motif figcaption {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  color: #c9a474;
  font-family: "Space Grotesk", sans-serif;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.2px;
}

.clock-motif figcaption > span:not(.warning-light) {
  color: #6d6b63;
}

.warning-light {
  display: inline-block;
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
}

.dashboard {
  padding-bottom: 47px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 17px;
}

.summary-card {
  position: relative;
  min-height: 151px;
  overflow: hidden;
  padding: 22px 23px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.current-card {
  border-color: #853d33;
  background:
    linear-gradient(118deg, rgb(119 43 34 / 72%), rgb(50 24 22 / 95%)),
    #341d1a;
  color: white;
}

.summary-label {
  color: #a7a399;
  font-size: 9px;
  letter-spacing: 1.1px;
}

.current-card .summary-label {
  color: #e7b4a8;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 9px rgb(232 90 71 / 80%);
  vertical-align: 1px;
}

.summary-value {
  position: relative;
  z-index: 1;
  margin: 18px 0 3px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -1.5px;
  line-height: 1;
}

.summary-foot {
  position: relative;
  z-index: 1;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.current-card .summary-foot {
  color: #d3b5aa;
}

.card-decoration {
  position: absolute;
  right: 18px;
  bottom: -34px;
  color: rgb(255 255 255 / 7%);
  font-family: "Space Grotesk", sans-serif;
  font-size: 125px;
  font-weight: 700;
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: 0.83fr 1.4fr;
  gap: 17px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgb(18 22 21 / 95%);
  box-shadow: 0 12px 30px rgb(0 0 0 / 13%);
}

.add-panel {
  padding: 22px 23px 17px;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-number {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #4b3732;
  border-radius: 3px;
  background: #211a18;
  color: var(--amber);
  font-family: "Space Grotesk", sans-serif;
  font-size: 10px;
  font-weight: 700;
}

.panel-heading h2 {
  margin: 0 0 3px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.35px;
}

.panel-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

#price-form {
  margin-top: 23px;
}

#price-form label {
  display: block;
  margin: 0 0 7px;
  color: #c5c0b5;
  font-size: 11px;
  font-weight: 600;
}

.price-input-wrap {
  display: flex;
  height: 43px;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  padding: 0 12px;
  border: 1px solid #393d37;
  border-radius: 3px;
  background: #0e1110;
  color: var(--amber);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.price-input-wrap:focus-within,
#entry-date:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgb(232 90 71 / 13%);
  outline: 0;
}

.price-input-wrap > span {
  font-size: 14px;
}

.price-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  outline: 0;
}

.price-input-wrap input::placeholder {
  color: #63665f;
}

#entry-date {
  width: 100%;
  height: 41px;
  margin-bottom: 16px;
  padding: 0 11px;
  border: 1px solid #393d37;
  border-radius: 3px;
  background: #0e1110;
  color: #ddd8ce;
  font-size: 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.submit-button {
  display: flex;
  width: 100%;
  height: 43px;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  border: 1px solid #fa7763;
  border-radius: 3px;
  background: var(--red);
  color: #1b100e;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background 140ms ease, transform 140ms ease;
}

.submit-button:hover {
  background: #f27662;
}

.submit-button:active {
  transform: translateY(1px);
}

.submit-button span {
  font-size: 16px;
}

.form-message {
  min-height: 14px;
  margin: 7px 0 0;
  color: #ff9582;
  font-size: 11px;
}

.tiny-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  color: #898b82;
  font-size: 10px;
}

.tiny-note span {
  color: var(--amber);
}

.history-panel {
  padding: 22px 23px 12px;
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 15px;
  border-bottom: 1px solid #2b302d;
}

.history-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid #433a32;
  border-radius: 50%;
  color: var(--amber);
  font-size: 17px;
}

.history-list {
  max-height: 318px;
  overflow-y: auto;
}

.history-row {
  display: flex;
  min-height: 61px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #272b28;
}

.history-row:last-child {
  border-bottom: 0;
}

.history-date-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #353831;
  border-radius: 3px;
  background: #1c201d;
  color: #bca879;
  font-size: 13px;
}

.history-details {
  min-width: 0;
  flex: 1;
}

.history-date {
  overflow: hidden;
  color: #e0dcd2;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-note {
  margin-top: 3px;
  color: #8e9188;
  font-size: 10px;
}

.history-amount {
  color: #f2c371;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  font-weight: 600;
}

.delete-entry {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #aaa59a;
  cursor: pointer;
  font-size: 16px;
  opacity: 0;
  transition: background 140ms ease, color 140ms ease, opacity 140ms ease;
}

.history-row:hover .delete-entry,
.delete-entry:focus-visible {
  opacity: 1;
}

.delete-entry:hover {
  background: #38211d;
  color: #ff9582;
}

.empty-state {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 35px;
  height: 35px;
  margin-bottom: 11px;
  place-items: center;
  border: 1px dashed #5c4036;
  border-radius: 50%;
  color: var(--red);
  font-size: 19px;
}

.empty-state p {
  margin: 0 0 4px;
  color: #d0cbc0;
  font-size: 12px;
  font-weight: 600;
}

.empty-state > span:last-child {
  color: #8e9188;
  font-size: 10px;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 15px 0 23px;
  border-top: 1px solid var(--line);
  color: #8f9089;
  font-size: 10px;
}

.footer span span {
  color: #555a53;
}

@keyframes warning-pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 12px rgb(232 90 71 / 65%);
  }

  50% {
    opacity: 0.55;
    box-shadow: 0 0 4px rgb(232 90 71 / 30%);
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 32px, 500px);
  }

  .topbar {
    height: 68px;
  }

  .intro {
    grid-template-columns: minmax(0, 1fr) 128px;
    gap: 12px;
    padding: 47px 0 32px;
  }

  .clock-face {
    width: 124px;
  }

  .clock-face::before {
    inset: 8px;
  }

  .clock-face::after {
    inset: 16px;
  }

  .clock-hand-hour {
    height: 31px;
  }

  .clock-hand-minute {
    height: 41px;
  }

  .clock-time {
    bottom: 18px;
    font-size: 8px;
  }

  .clock-motif figcaption {
    gap: 4px;
    margin-top: 12px;
    font-size: 6px;
    letter-spacing: 0.6px;
  }

  h1 {
    font-size: clamp(36px, 8vw, 49px);
    letter-spacing: -2.7px;
  }

  .intro-copy {
    font-size: 12px;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .summary-card {
    min-height: 132px;
    padding: 18px;
  }

  .current-card {
    grid-column: 1 / -1;
    min-height: 140px;
  }

  .summary-value {
    font-size: 30px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .add-panel,
  .history-panel {
    padding-right: 19px;
    padding-left: 19px;
  }

  .delete-entry {
    opacity: 1;
  }

  .footer {
    gap: 14px;
    font-size: 9px;
  }
}

@media (max-width: 420px) {
  .intro {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .clock-face {
    width: 82px;
  }

  .clock-hand-hour {
    height: 21px;
  }

  .clock-hand-minute {
    height: 27px;
  }

  .clock-time {
    bottom: 12px;
    font-size: 7px;
  }

  .clock-motif {
    flex-direction: row;
    align-self: center;
    gap: 13px;
  }

  .clock-motif figcaption {
    margin-top: 0;
    font-size: 7px;
    letter-spacing: 0.8px;
  }

  .eyebrow {
    gap: 6px;
    font-size: 7px;
    letter-spacing: 0.8px;
  }

  h1 {
    font-size: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
