:root {
  font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #f7f8fc;
  background-color: #05060a;
  line-height: 1.5;
  font-weight: 400;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(circle at top, #151c3f, #05060a 60%);
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 4rem;
}

.app-shell {
  width: min(960px, 100%);
}

.hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 4vw, 3.25rem);
  margin: 0;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0.5rem 0 0;
  color: #a3accf;
}

main {
  display: grid;
  gap: 1.5rem;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

section {
  background: rgba(15, 18, 38, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 1.75rem;
  backdrop-filter: blur(18px);
  box-shadow: 0 25px 60px rgba(5, 6, 10, 0.65);
}

input[type='number'] {
  font-size: 1.1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  transition: border 0.2s, background 0.2s;
}

input[type='number']:focus {
  outline: none;
  border-color: #6fe4ff;
  background: rgba(255, 255, 255, 0.08);
}

button {
  border: none;
  border-radius: 16px;
  padding: 0.95rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #ff6b6b, #ffc56f);
  color: #0b0b0c;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 107, 107, 0.35);
}

button:active {
  transform: translateY(0);
}

.goal-display {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.tracking-date {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  color: #8d96c3;
  margin: 0 0 0.85rem;
}

.goal-progress {
  text-align: center;
  padding: 2.25rem 2rem 1.5rem;
  background: radial-gradient(circle at top, rgba(19, 24, 55, 0.95), rgba(9, 11, 24, 0.9));
  border-radius: 36px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 25px 60px rgba(5, 6, 10, 0.55);
}

.fraction {
  font-size: clamp(2.8rem, 5vw, 3.75rem);
  font-weight: 700;
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
}

.goal-inline-editor {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}

.goal-inline-editor button {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.goal-inline-editor button:hover {
  outline: none;
  box-shadow: none;
  transform: none;
  text-shadow: 0 0 14px rgba(124, 242, 156, 0.65);
}

.goal-inline-editor button:focus {
  outline: none;
  box-shadow: none;
  transform: none;
}
.goal-inline-editor #goalCount {
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
}

.goal-inline-editor button:focus-visible {
  outline: 2px solid #7cf29c;
  outline-offset: 6px;
}

.goal-inline-editor .edit-hint {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #7d86b8;
}

.goal-inline-editor input {
  display: none;
  width: 140px;
  text-align: center;
  margin-top: 0.4rem;
  font-size: 2.4rem;
  font-weight: 700;
}

.goal-inline-editor[data-editing='true'] button {
  display: none;
}

.goal-inline-editor[data-editing='true'] input {
  display: inline-block;
}

.fraction .divider {
  font-weight: 400;
  opacity: 0.6;
}

.remaining {
  color: #98a4df;
  margin: 0.75rem 0 1rem;
}

.goal-complete {
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #7cf29c;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.goal-complete[data-visible='true'] {
  opacity: 1;
  transform: translateY(0);
}

.progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

#progressFill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(135deg, #6fe4ff, #7cf29c);
  transition: width 0.4s ease;
}

.entry-panel .entry-header h2,
.ledger-inline .ledger-headline h3 {
  margin: 0;
  font-size: 1.5rem;
}

.entry-panel .entry-header p,
.ledger-inline .ledger-headline p {
  margin: 0.35rem 0 0;
  color: #9aa3cc;
}

.entry-form input[type='number'] {
  flex: 1;
  min-width: 200px;
}

.entry-form {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.timer-panel {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.5rem;
}

.timer-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.timer-header p {
  margin: 0.3rem 0 0;
  color: #9aa3cc;
}

.timer-display {
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.timer-display .colon {
  opacity: 0.6;
}

.timer-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.timer-chip {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  color: #f7f8fc;
  font-weight: 600;
  cursor: pointer;
  transition: border 0.2s, background 0.2s, color 0.2s;
}

.timer-chip.active,
.timer-chip:focus-visible {
  outline: none;
  border-color: rgba(124, 242, 156, 0.7);
  background: rgba(124, 242, 156, 0.12);
  color: #7cf29c;
}

.timer-start-btn {
  margin-top: auto;
}

.timer-notice {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #f0bb84;
}

.timer-status {
  min-height: 1.25rem;
  margin: 0;
  font-size: 0.95rem;
  color: #9aa3cc;
}

.timer-autostart {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  align-self: flex-end;
}

.timer-autostart-copy {
  text-align: right;
  color: #9aa3cc;
  font-size: 0.9rem;
  line-height: 1.3;
}

.timer-autostart-copy span {
  display: block;
  font-size: 0.78rem;
  color: #727ba6;
}

.ios-toggle {
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  padding: 0;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ios-toggle .ios-toggle-handle {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0b0b0c;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, background 0.2s ease;
}

.ios-toggle[data-state='on'] {
  background: linear-gradient(135deg, #6fe4ff, #7cf29c);
}

.ios-toggle[data-state='on'] .ios-toggle-handle {
  transform: translateX(24px);
  background: #f7f8fc;
}

.ios-toggle:focus-visible {
  outline: 2px solid rgba(124, 242, 156, 0.6);
  outline-offset: 4px;
}

.form-feedback {
  min-height: 1.5rem;
  margin: 0.75rem 0 0;
  color: #ffc56f;
  font-size: 0.95rem;
}

.ledger-list {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.ledger-count {
  font-size: 1.25rem;
  font-weight: 600;
}

.ledger-time {
  font-size: 0.95rem;
  color: #a1abd6;
}

.ledger-inline {
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  section {
    padding: 1.25rem;
  }

  .entry-form input[type='number'],
  .goal-inline-editor input {
    min-width: 0;
  }

  .fraction {
    font-size: 2.4rem;
  }

  .timer-panel {
    aspect-ratio: auto;
  }
}

