:root {
  --shell-width: 560px;
  --cream: #fff7ec;
  --cream-strong: #ffe8c7;
  --peach: #ffd8bb;
  --rose: #f7a8c4;
  --rose-dark: #c95f86;
  --lavender: #c9b6ff;
  --mint: #bdebd3;
  --butter: #ffe58f;
  --ink: #4b3440;
  --muted: #8a6f79;
  --card: rgba(255, 255, 255, 0.82);
  --card-strong: rgba(255, 255, 255, 0.94);
  --ring: rgba(247, 168, 196, 0.22);
  --dot-color: rgba(201, 95, 134, 0.13);
  --shadow: 0 14px 34px rgba(142, 83, 111, 0.17);
  --shadow-soft: 0 8px 18px rgba(142, 83, 111, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis-weight: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 229, 143, 0.78), transparent 18rem),
    radial-gradient(circle at 88% 0%, rgba(201, 182, 255, 0.72), transparent 18rem),
    radial-gradient(circle at 76% 92%, rgba(189, 235, 211, 0.72), transparent 16rem),
    linear-gradient(145deg, #fff8ef 0%, #ffe8f0 54%, #f5edff 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, var(--dot-color) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 255, 255, 0.62) 1px, transparent 1.5px);
  background-position: 0 0, 10px 10px;
  background-size: 22px 22px;
  opacity: 0.42;
}

body.theme-lavender {
  --cream: #fbf7ff;
  --cream-strong: #eadfff;
  --peach: #f2d7ff;
  --rose: #a98df5;
  --rose-dark: #7258c9;
  --lavender: #d8cbff;
  --mint: #c8efd9;
  --butter: #ffdca8;
  --ring: rgba(169, 141, 245, 0.24);
  --dot-color: rgba(114, 88, 201, 0.13);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 220, 168, 0.66), transparent 18rem),
    radial-gradient(circle at 88% 0%, rgba(169, 141, 245, 0.78), transparent 18rem),
    radial-gradient(circle at 76% 92%, rgba(200, 239, 217, 0.7), transparent 16rem),
    linear-gradient(145deg, #fbf7ff 0%, #f2eaff 54%, #fff4fb 100%);
}

body.theme-mint {
  --cream: #f1fff8;
  --cream-strong: #d6f8e8;
  --peach: #ffe0c9;
  --rose: #69cfa0;
  --rose-dark: #2d8a65;
  --lavender: #c8d9ff;
  --mint: #bdebd3;
  --butter: #fff0a6;
  --ring: rgba(105, 207, 160, 0.24);
  --dot-color: rgba(45, 138, 101, 0.13);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 240, 166, 0.72), transparent 18rem),
    radial-gradient(circle at 88% 0%, rgba(189, 235, 211, 0.86), transparent 18rem),
    radial-gradient(circle at 76% 92%, rgba(200, 217, 255, 0.7), transparent 16rem),
    linear-gradient(145deg, #f1fff8 0%, #e4fff1 54%, #fff9ed 100%);
}

body.theme-honey {
  --cream: #fff9ec;
  --cream-strong: #ffe7b0;
  --peach: #ffd3a4;
  --rose: #f0a33a;
  --rose-dark: #b96b12;
  --lavender: #e1c9ff;
  --mint: #cceecf;
  --butter: #ffe58f;
  --ring: rgba(240, 163, 58, 0.24);
  --dot-color: rgba(185, 107, 18, 0.13);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 229, 143, 0.88), transparent 18rem),
    radial-gradient(circle at 88% 0%, rgba(255, 211, 164, 0.78), transparent 18rem),
    radial-gradient(circle at 76% 92%, rgba(225, 201, 255, 0.58), transparent 16rem),
    linear-gradient(145deg, #fff9ec 0%, #fff0cf 54%, #fff6e9 100%);
}

body.theme-bubblegum {
  --cream: #fff0f5;
  --cream-strong: #ffd6e8;
  --peach: #ffc2d6;
  --rose: #ff6b9d;
  --rose-dark: #d4477a;
  --lavender: #e8c2ff;
  --mint: #dbffea;
  --butter: #fff5b8;
  --ring: rgba(255, 107, 157, 0.24);
  --dot-color: rgba(212, 71, 122, 0.13);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 245, 184, 0.78), transparent 18rem),
    radial-gradient(circle at 88% 0%, rgba(255, 194, 214, 0.76), transparent 18rem),
    radial-gradient(circle at 76% 92%, rgba(232, 194, 255, 0.64), transparent 16rem),
    linear-gradient(145deg, #fff0f5 0%, #ffe0ec 54%, #faf0ff 100%);
}

body.theme-blush {
  --cream: #fff5f5;
  --cream-strong: #ffe0e0;
  --peach: #ffccd5;
  --rose: #e892ab;
  --rose-dark: #c46b84;
  --lavender: #dcc8ff;
  --mint: #d5f0e2;
  --butter: #ffe9c4;
  --ring: rgba(232, 146, 171, 0.24);
  --dot-color: rgba(196, 107, 132, 0.13);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 233, 196, 0.78), transparent 18rem),
    radial-gradient(circle at 88% 0%, rgba(255, 204, 213, 0.76), transparent 18rem),
    radial-gradient(circle at 76% 92%, rgba(220, 200, 255, 0.64), transparent 16rem),
    linear-gradient(145deg, #fff5f5 0%, #ffeae6 54%, #f8f0ff 100%);
}

body.theme-sky {
  --cream: #f4f9ff;
  --cream-strong: #d8ebff;
  --peach: #ffdfc9;
  --rose: #7eb8da;
  --rose-dark: #4f8ab5;
  --lavender: #c8d9ff;
  --mint: #c8eed8;
  --butter: #fff4c2;
  --ring: rgba(126, 184, 218, 0.24);
  --dot-color: rgba(79, 138, 181, 0.13);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 244, 194, 0.78), transparent 18rem),
    radial-gradient(circle at 88% 0%, rgba(200, 217, 255, 0.82), transparent 18rem),
    radial-gradient(circle at 76% 92%, rgba(200, 238, 216, 0.68), transparent 16rem),
    linear-gradient(145deg, #f4f9ff 0%, #eaf4ff 54%, #fef9f1 100%);
}

body.theme-cocoa {
  --cream: #fdf8f4;
  --cream-strong: #f0e2d6;
  --peach: #ffe0c9;
  --rose: #c4907a;
  --rose-dark: #9e6551;
  --lavender: #dfcfff;
  --mint: #ddf0de;
  --butter: #ffe4b0;
  --ring: rgba(196, 144, 122, 0.24);
  --dot-color: rgba(158, 101, 81, 0.13);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 228, 176, 0.86), transparent 18rem),
    radial-gradient(circle at 88% 0%, rgba(255, 224, 201, 0.76), transparent 18rem),
    radial-gradient(circle at 76% 92%, rgba(223, 207, 255, 0.58), transparent 16rem),
    linear-gradient(145deg, #fdf8f4 0%, #f7ede3 54%, #fef7f2 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(201, 95, 134, 0.32);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, var(--shell-width));
  min-height: 100vh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px calc(96px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 1;
}

.top-hero,
.hero-card,
.page-card,
.detail-hero,
.timer-card,
.project-card,
.new-card,
.empty-state,
.action-card,
.page-header,
.stats-section,
.timeline-section {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.top-hero {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 12%, rgba(255, 229, 143, 0.72), transparent 7rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 232, 240, 0.88)),
    repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(247, 168, 196, 0.13) 12px, rgba(247, 168, 196, 0.13) 18px);
}

.top-hero::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -28px;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(247, 168, 196, 0.2), transparent 67%);
}

.hero-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hero-main h1 {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--rose-dark);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.55rem, 7vw, 2.35rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.15;
}

.stats-pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 800;
}

.stats-pill {
  min-height: 36px;
  padding: 8px 12px;
  background: linear-gradient(135deg, var(--butter), #fff1b3);
  font-size: 0.86rem;
  box-shadow: var(--shadow-soft);
}

.total-time-pill {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.05;
}

.total-time-pill span {
  color: var(--rose-dark);
  font-size: 0.58rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.total-time-pill strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.status-chip {
  padding: 5px 9px;
  color: var(--rose-dark);
  background: #ffe2ed;
  font-size: 0.72rem;
}

.status-done {
  color: #2e7d32;
  background: #dcedc8;
}

.project-card-finished {
  opacity: 0.64;
}

.project-card-finished h2 {
  text-decoration: line-through;
}

.timer-banner {
  display: block;
  margin-top: 10px;
  min-height: 44px;
  padding: 11px 13px;
  border-radius: 20px;
  color: #3a594a;
  background: linear-gradient(135deg, var(--mint), #ddf8e9);
  font-size: 0.9rem;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.quick-start-form {
  padding: 0;
  background: none;
}

.quick-start-button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 11px 13px;
  border: none;
  border-radius: 20px;
  color: #3a594a;
  background: linear-gradient(135deg, var(--mint), #ddf8e9);
  font-size: 0.9rem;
  font-weight: 850;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
  cursor: pointer;
  text-align: left;
}

.quick-start-button:hover {
  background: linear-gradient(135deg, #a2e3c7, #c9f5d7);
}

.streak-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(240, 163, 58, 0.13), rgba(240, 163, 58, 0.24));
  box-shadow: inset 0 0 0 1px rgba(240, 163, 58, 0.14);
}

.streak-fire {
  font-size: 1.5rem;
  line-height: 1;
}

.streak-banner strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
}

.streak-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.undo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 700;
}

.undo-button {
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid rgba(201, 95, 134, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--peach);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.undo-button:hover {
  background: rgba(247, 168, 196, 0.15);
  border-color: rgba(201, 95, 134, 0.35);
}

.weekly-chart {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.weekly-chart-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 58px;
  flex: 1;
  padding: 8px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-soft);
}

.weekly-chart-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.weekly-chart-value {
  font-size: 0.76rem;
  font-weight: 900;
  color: var(--ink);
  white-space: nowrap;
}

.time-entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.content-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.new-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 22px;
  color: var(--rose-dark);
  font-weight: 900;
}

.new-card span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  background: var(--rose);
  font-size: 1.45rem;
}

.project-card {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  min-height: 112px;
  padding: 10px;
  border-radius: 26px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.project-card:active {
  transform: scale(0.985);
  background: var(--card-strong);
}

.project-cover {
  overflow: hidden;
  min-height: 92px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 76% 22%, rgba(255, 255, 255, 0.75), transparent 30%),
    linear-gradient(135deg, var(--cream-strong), var(--lavender));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.56);
}

.project-cover img,
.image-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 92px;
  font-size: 2.2rem;
}

.project-card-body {
  min-width: 0;
  padding: 2px 2px 2px 0;
}

.project-card h2 {
  margin: 8px 0 4px;
  overflow-wrap: anywhere;
  font-size: 1.08rem;
}

.project-card p,
.detail-hero p,
.muted,
.tiny-note {
  color: var(--muted);
}

.project-card p,
.project-description,
.muted {
  margin-bottom: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.project-card strong {
  font-size: 0.84rem;
}

.login-screen {
  display: grid;
  min-height: calc(100svh - 24px);
  padding: 16px 0;
  place-items: center;
}

.hero-card,
.page-card,
.detail-hero,
.timer-card,
.page-header,
.timeline-section {
  padding: 16px;
  border-radius: 28px;
}

.page-stack {
  display: grid;
  gap: 10px;
}

.page-card-header {
  margin-bottom: 12px;
}

.page-card-header .back-link,
.page-header .back-link {
  margin-bottom: 10px;
}

.page-header .hero-main {
  align-items: center;
}

.login-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 420px);
  padding: 26px 18px 18px;
  text-align: center;
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 229, 143, 0.56), transparent 7rem),
    linear-gradient(150deg, rgba(255, 255, 255, 0.94), rgba(255, 235, 243, 0.9));
}

.login-card h1 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 12vw, 2.85rem);
}

.login-card label {
  text-align: left;
}

.sparkle {
  position: absolute;
  top: 13px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--rose);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
  font-size: 1.35rem;
}

.form-stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.file-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 2px dashed rgba(247, 168, 196, 0.32);
  border-radius: 17px;
  color: var(--rose-dark);
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
}

.file-label input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: inherit;
  opacity: 0;
  cursor: pointer;
  background: transparent;
  box-shadow: none;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 2px solid rgba(247, 168, 196, 0.28);
  border-radius: 17px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 4px var(--ring), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.primary-button,
.inline-form button,
.form-stack button {
  min-height: 50px;
  padding: 13px 16px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(201, 95, 134, 0.24);
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.primary-button:active,
.inline-form button:active,
.form-stack button:active {
  transform: translateY(1px) scale(0.99);
  filter: saturate(1.04);
}

.primary-button.stop {
  background: linear-gradient(135deg, #9f88f2, #7258c9);
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 2px;
  margin-bottom: 0;
  color: var(--rose-dark);
  font-size: 0.86rem;
  font-weight: 900;
}

.back-link::before {
  content: "‹";
  margin-right: 5px;
  font-size: 1.2em;
  line-height: 1;
}

.project-detail {
  display: grid;
  gap: 12px;
}

.detail-topline,
.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-topline {
  margin-bottom: 10px;
}

.detail-topline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-topline-actions form {
  display: flex;
  margin: 0;
}

.delete-button {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid rgba(201, 95, 134, 0.18);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.8rem;
  cursor: pointer;
}

.delete-button:hover {
  color: #b0413e;
  background: rgba(211, 47, 47, 0.09);
  border-color: rgba(211, 47, 47, 0.22);
}

.edit-link {
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid rgba(201, 95, 134, 0.18);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.85rem;
  text-decoration: none;
}

.edit-link:hover {
  color: var(--peach);
  background: rgba(247, 168, 196, 0.12);
  border-color: rgba(201, 95, 134, 0.28);
}

.tiny-delete {
  display: grid;
  place-items: center;
  width: 22px;
  min-height: 22px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.5;
}

.tiny-delete:hover {
  opacity: 1;
  color: #b0413e;
  background: rgba(211, 47, 47, 0.07);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-meta span {
  padding: 9px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.project-title-row,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-title-row {
  align-items: flex-start;
  margin-bottom: 8px;
}

.project-title-row h1 {
  min-width: 0;
  margin-bottom: 0;
}

.project-title-row strong,
.section-heading > span {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  color: #3a594a;
  background: var(--mint);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.section-heading {
  margin-bottom: 10px;
}

.list-heading {
  align-items: center;
  padding: 0 2px;
}

.compact-heading {
  margin-bottom: 8px;
}

.compact-heading h2,
.compact-heading .eyebrow {
  margin-bottom: 0;
}

.section-heading h2,
.section-heading .eyebrow {
  margin-bottom: 0;
}

.project-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.project-summary-grid article,
.action-card,
.stats-section {
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.project-summary-grid span,
.daily-chart-label,
.time-entry-main small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.project-summary-grid strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.timer-focus {
  background:
    radial-gradient(circle at 92% 0%, rgba(255, 229, 143, 0.72), transparent 9rem),
    linear-gradient(135deg, rgba(189, 235, 211, 0.94), rgba(255, 255, 255, 0.9));
}

.project-actions {
  display: grid;
  gap: 12px;
}

.project-actions + .timeline-section {
  margin-top: 4px;
}

.action-card h2,
.stats-section h2 {
  margin-bottom: 8px;
}

.compact-card {
  padding: 14px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.inline-form button,
.inline-form .wide-field {
  grid-column: 1 / -1;
}

.inline-form label {
  min-width: 0;
}

.time-inline-form input[type="date"] {
  max-width: 140px;
}

.settings-page {
  gap: 12px;
}

.settings-card .compact-heading {
  margin-bottom: 12px;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.theme-choice {
  position: relative;
  min-height: 66px;
  padding: 12px 10px 12px 42px;
  border: 2px solid rgba(247, 168, 196, 0.22);
  border-radius: 19px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.theme-choice:has(input:checked) {
  border-color: var(--rose);
  background: var(--card-strong);
  box-shadow: 0 0 0 4px var(--ring), var(--shadow-soft);
}

.theme-choice input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
}

.theme-swatch {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 999px;
  transform: translateY(-50%);
  box-shadow: var(--shadow-soft);
}

.theme-choice-rose .theme-swatch {
  background: linear-gradient(135deg, #f7a8c4, #ffe58f);
}

.theme-choice-lavender .theme-swatch {
  background: linear-gradient(135deg, #a98df5, #ffdca8);
}

.theme-choice-mint .theme-swatch {
  background: linear-gradient(135deg, #69cfa0, #fff0a6);
}

.theme-choice-honey .theme-swatch {
  background: linear-gradient(135deg, #f0a33a, #e1c9ff);
}

.theme-choice-bubblegum .theme-swatch {
  background: linear-gradient(135deg, #ff6b9d, #fff5b8);
}

.theme-choice-blush .theme-swatch {
  background: linear-gradient(135deg, #e892ab, #ffe9c4);
}

.theme-choice-sky .theme-swatch {
  background: linear-gradient(135deg, #7eb8da, #fff4c2);
}

.theme-choice-cocoa .theme-swatch {
  background: linear-gradient(135deg, #c4907a, #ffe4b0);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

figure {
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow-soft);
}

figure img {
  aspect-ratio: 1;
}

figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.time-list {
  display: grid;
  gap: 8px;
}

.time-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.time-entry-main {
  display: grid;
  gap: 3px;
}

.time-list span {
  color: var(--muted);
  text-align: right;
  font-size: 0.86rem;
}

.daily-chart {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 42px) / 7);
  gap: 7px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 160px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
}

.daily-chart-item {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.daily-chart-value {
  min-height: 22px;
  color: var(--rose-dark);
  font-size: 0.68rem;
  font-weight: 900;
}

.daily-chart-track {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 94px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.daily-chart-bar {
  width: 100%;
  min-height: 8px;
  height: var(--height);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--rose), var(--lavender));
}

.chart-note {
  margin-top: 8px;
}

.dashboard-chart {
  overflow: hidden;
}

.small-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 999px;
  color: var(--rose-dark);
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
}

.card-meta-row strong {
  color: var(--ink);
  white-space: nowrap;
}

.empty-state {
  padding: 18px;
  border-radius: 26px;
  text-align: center;
}

.empty-state .small-link {
  margin-top: 8px;
}

.toast-stack {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 5;
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.toast {
  padding: 10px 12px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 10px 25px rgba(75, 52, 64, 0.14);
  font-weight: 800;
}

.toast.error {
  color: #9a2947;
}

.toast.success {
  color: #3a705a;
}

.sw-prompt {
  position: fixed;
  right: max(12px, calc((100vw - var(--shell-width)) / 2 + 12px));
  bottom: calc(88px + env(safe-area-inset-bottom));
  left: max(12px, calc((100vw - var(--shell-width)) / 2 + 12px));
  z-index: 6;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sw-prompt[hidden] {
  display: none;
}

body:not(:has(.bottom-nav)) .sw-prompt {
  bottom: max(12px, env(safe-area-inset-bottom));
}

.sw-prompt strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.94rem;
}

.sw-prompt p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.sw-prompt-actions {
  display: grid;
  grid-template-columns: 0.8fr 1fr;
  gap: 8px;
}

.sw-prompt button {
  min-height: 42px;
  border-radius: 15px;
  font-size: 0.82rem;
  font-weight: 900;
}

.sw-dismiss-button {
  color: var(--rose-dark);
  background: rgba(247, 168, 196, 0.15);
}

.sw-install-button {
  color: white;
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  box-shadow: var(--shadow-soft);
}

.sw-install-button:disabled {
  cursor: wait;
  opacity: 0.82;
}

.bottom-nav {
  position: fixed;
  right: max(10px, calc((100vw - var(--shell-width)) / 2 + 10px));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(10px, calc((100vw - var(--shell-width)) / 2 + 10px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-items: stretch;
  justify-items: stretch;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.bottom-nav .nav-item {
  display: grid;
  grid-template-rows: auto auto;
  gap: 2px;
  place-items: center;
  width: 100%;
  min-height: 52px;
  border-radius: 20px;
  color: var(--rose-dark);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 900;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.bottom-nav .nav-item span:last-child {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav .nav-item.active {
  color: var(--ink);
  background: linear-gradient(135deg, var(--cream-strong), rgba(255, 255, 255, 0.86));
  box-shadow: inset 0 0 0 1px rgba(247, 168, 196, 0.18), var(--shadow-soft);
}

.bottom-nav .nav-item:active {
  transform: scale(0.98);
}

.nav-icon {
  font-size: 1rem;
  line-height: 1;
}

.bottom-nav form {
  display: grid;
  width: 100%;
  margin: 0;
}

@media (min-width: 720px) {
  .app-shell {
    padding-top: 22px;
  }

  .project-card:hover,
  .small-link:hover,
  .bottom-nav .nav-item:hover {
    transform: translateY(-1px);
  }

  .project-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 430px) {
  .inline-form {
    grid-template-columns: minmax(92px, 0.7fr) 1fr;
  }

  .inline-form button,
  .inline-form .wide-field {
    grid-column: 1 / -1;
  }
}

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