:root {
  --bg: #f5f1e7;
  --panel: rgba(255, 250, 242, 0.94);
  --ink: #1f1a17;
  --muted: #655e5a;
  --line: rgba(31, 26, 23, 0.16);
  --accent: #111111;
  --accent-2: #25d4e8;
  --danger: #b3322a;
  --shadow: 0 24px 60px rgba(31, 26, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(37, 212, 232, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(243, 180, 68, 0.2), transparent 24%),
    linear-gradient(180deg, #f7f4ec, #f1ece0 60%, #ece4d7);
}

.app-shell {
  max-width: 1460px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero,
.toolbar,
.tracker-panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
h3,
strong {
  font-family: "Arial Black", Impact, sans-serif;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.hero-copy,
.muted,
#monthHint,
.tracker-header p {
  color: var(--muted);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 14px;
  min-width: min(320px, 100%);
}

.stat-card {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffef8, #f4ebdb);
  border: 1px solid rgba(31, 26, 23, 0.1);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.toolbar {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.month-controls,
.toolbar-actions,
.layout {
  display: flex;
  gap: 12px;
}

.month-controls {
  align-items: center;
}

.month-meta h2 {
  margin: 0;
  font-size: 1.6rem;
}

.month-meta p {
  margin: 2px 0 0;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
}

.solid-button {
  background: var(--accent);
  color: #fff;
}

.solid-button.alt {
  background: #0d6d7d;
}

.ghost-button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.ghost-button.danger {
  color: var(--danger);
}

.layout {
  margin-top: 18px;
  align-items: flex-start;
}

.tracker-panel {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 28px;
  padding: 20px;
}

.tracker-header {
  margin-bottom: 14px;
}

.tracker-header h3,
.card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.tracker-header p {
  margin: 0;
}

.tracker-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fffcf7;
}

.day-panel {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fffdf7, #f6ecde);
  border: 1px solid var(--line);
}

.day-panel-header,
.day-controls,
.day-meta {
  display: flex;
  gap: 12px;
}

.day-panel-header {
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.day-controls {
  align-items: center;
}

.day-meta {
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
}

.day-meta span {
  color: var(--muted);
  font-size: 0.85rem;
}

.day-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.day-checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(31, 26, 23, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.day-toggle {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Arial Black", Impact, sans-serif;
  cursor: pointer;
}

.day-toggle.is-done {
  color: #fff;
}

.day-habit-copy {
  min-width: 0;
  flex: 1;
}

.day-habit-copy strong,
.day-habit-copy span {
  display: block;
}

.day-habit-copy span {
  color: var(--muted);
  font-size: 0.82rem;
}

.tracker-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.tracker-table th,
.tracker-table td {
  border: 1px solid rgba(31, 26, 23, 0.12);
  text-align: center;
}

.tracker-table th {
  background: #efe5d4;
  padding: 10px 8px;
  font-size: 0.85rem;
}

.habit-name-cell {
  min-width: 260px;
  padding: 0;
  text-align: left;
  vertical-align: top;
}

.habit-name-button {
  display: block;
  width: 100%;
  border-radius: 0;
  text-align: left;
  background: transparent;
  padding: 12px 14px;
  border-left: 8px solid transparent;
}

.habit-name-button span {
  display: block;
}

.habit-name-button .meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.day-cell {
  width: 40px;
  height: 42px;
  cursor: pointer;
  background: #fff;
  transition: background 0.15s ease-out, transform 0.1s ease-out;
}

.day-cell:hover {
  background: #f0f8fa;
}

.day-cell.is-done {
  position: relative;
}

.day-cell.is-done::after {
  content: "×";
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.1rem;
  color: #fff;
}

.side-panel {
  width: 320px;
  flex-direction: column;
}

.card {
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 16px;
}

.cloud-card {
  display: grid;
  gap: 12px;
}

.cloud-field label {
  display: block;
  margin-bottom: 6px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.82rem;
}

.cloud-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
}

.cloud-actions {
  display: grid;
  gap: 8px;
}

.habit-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.habit-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.habit-pill {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 14px;
}

.habit-list button {
  padding: 8px 10px;
}

.habit-actions {
  display: flex;
  gap: 8px;
}

.sort-button {
  min-width: 40px;
  padding: 8px 10px;
}

.habit-dialog {
  width: min(420px, calc(100% - 24px));
  border: 0;
  border-radius: 22px;
  padding: 0;
  box-shadow: var(--shadow);
}

.habit-dialog::backdrop {
  background: rgba(0, 0, 0, 0.32);
}

.habit-dialog form {
  padding: 22px;
}

.field {
  display: block;
  margin-top: 14px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.9rem;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}

.field input[type="color"] {
  height: 52px;
  padding: 6px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
}

@media (max-width: 1024px) {
  .hero,
  .toolbar,
  .layout,
  .day-panel-header {
    flex-direction: column;
  }

  .hero-stats,
  .side-panel {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .tracker-wrap {
    display: none;
  }

  .toolbar-actions,
  .month-controls,
  .day-controls {
    width: 100%;
  }

  .day-controls {
    justify-content: space-between;
  }
}
