:root {
  color-scheme: light;
  --paper: #f7f2ea;
  --surface: #fffefd;
  --ink: #453f39;
  --muted: #8f867b;
  --line: #ded7cd;
  --accent: #c9aa66;
  --accent-strong: #9b7432;
  --done: #78a36f;
  --shadow: 0 16px 50px rgba(69, 63, 57, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #e9e5de;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(160deg, #efe9df 0%, #f8f5ef 52%, #e6ded2 100%);
}

button,
input {
  font: inherit;
}

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

.phone-shell {
  width: min(100%, 480px);
  min-height: 100svh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 76px 1fr 76px;
  align-items: center;
  height: 96px;
  padding: 18px 20px 14px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  backdrop-filter: blur(18px);
}

.app-header h1 {
  margin: 0;
  text-align: center;
  font-size: 24px;
  line-height: 1;
  color: #050505;
}

.icon-button {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: #252525;
  font-size: 42px;
  line-height: 1;
  display: grid;
  place-items: center;
  justify-self: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

#menuButton {
  padding-bottom: 12px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, 0.58);
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 56px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #b49a67;
  font-weight: 700;
  font-size: 17px;
}

.tab.active {
  border-color: var(--accent);
  color: var(--ink);
}

.view {
  display: none;
  padding: 24px 20px 34px;
}

.view.active {
  display: block;
}

.date-row {
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  gap: 14px;
  align-items: center;
  width: min(100%, 300px);
  margin: 0 auto 26px;
}

.date-button {
  width: 54px;
  height: 44px;
  border: 2px solid #ded4c8;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
  color: #9b9288;
  font-size: 24px;
}

.date-button:disabled {
  opacity: 0.35;
}

.today-label {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
}

.hidden-date {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.progress-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 6px 28px;
}

.progress-ring {
  width: 124px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background:
    radial-gradient(circle closest-side, var(--paper) 78%, transparent 80%),
    conic-gradient(var(--done) calc(var(--progress, 0) * 1%), #e8e2d8 0);
}

.percent {
  display: block;
  font-size: 33px;
  line-height: 1;
  font-weight: 800;
}

.count {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 17px;
}

.quick-actions {
  display: grid;
  gap: 10px;
  min-width: 134px;
}

.small-button,
.add-form button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-weight: 800;
}

.small-button.filled,
.add-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.tasks {
  display: grid;
  gap: 14px;
}

.task-card {
  display: grid;
  grid-template-columns: 58px 1fr 44px;
  align-items: center;
  min-height: 82px;
  padding: 13px 20px 13px 18px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.task-card.done {
  border-color: rgba(120, 163, 111, 0.55);
  background: #fbfff9;
}

.task-emoji {
  font-size: 30px;
}

.task-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 22px;
  font-weight: 800;
}

.task-check {
  width: 36px;
  height: 36px;
  border: 3px solid #bfb8af;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.task-card.done .task-check {
  border-color: var(--done);
  background: var(--done);
}

.add-form {
  display: grid;
  grid-template-columns: 58px 1fr 70px;
  gap: 10px;
  margin-top: 20px;
  padding: 12px;
  border: 2px dashed var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
}

.add-form input {
  min-width: 0;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

#emojiInput {
  text-align: center;
  padding: 0;
  font-size: 22px;
}

.graph-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.graph-header h2,
.insight h3 {
  margin: 0;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  height: 240px;
  padding: 18px 14px 12px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.bar-item {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 8px;
  height: 100%;
  min-width: 0;
}

.bar-track {
  display: flex;
  align-items: end;
  min-height: 0;
  border-radius: 999px;
  background: #ece5dc;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  min-height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #87ae7b, #c9aa66);
}

.bar-label {
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.insight {
  margin-top: 18px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.insight p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 700;
}

.menu {
  width: min(calc(100% - 32px), 420px);
  border: 0;
  border-radius: 22px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu::backdrop {
  background: rgba(41, 37, 33, 0.24);
  backdrop-filter: blur(3px);
}

.menu form {
  padding: 22px;
}

.menu h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.menu p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

.manage-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.manage-item {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.delete-button {
  min-height: 36px;
  border: 1px solid #dfb6a8;
  border-radius: 10px;
  background: #fff5f1;
  color: #a9543c;
  font-weight: 800;
}

.wide {
  width: 100%;
}

@media (max-width: 380px) {
  .app-header {
    grid-template-columns: 62px 1fr 62px;
    padding-inline: 12px;
  }

  .app-header h1 {
    font-size: 21px;
  }

  .view {
    padding-inline: 14px;
  }

  .task-card {
    grid-template-columns: 48px 1fr 40px;
    padding-inline: 14px;
  }

  .task-title,
  .today-label {
    font-size: 19px;
  }

  .progress-area {
    align-items: stretch;
    flex-direction: column;
  }

  .progress-ring {
    margin-inline: auto;
  }

  .quick-actions {
    grid-template-columns: 1fr 1fr;
  }
}
