:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --paper: #fffaf0;
  --paper-2: #fffdf8;
  --ink: #1f211d;
  --muted: #716b61;
  --line: rgba(40, 35, 27, 0.13);
  --dark: #20241f;
  --green: #3f7357;
  --mint: #dfece0;
  --clay: #b95d4c;
  --blue: #446d8f;
  --gold: #b47a2c;
  --shadow: 0 24px 70px rgba(41, 35, 26, 0.14);
  --tight-shadow: 0 14px 30px rgba(41, 35, 26, 0.1);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(63, 115, 87, 0.1), transparent 32%),
    linear-gradient(205deg, rgba(180, 122, 44, 0.16), transparent 38%),
    radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.9), transparent 32%),
    var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.35rem, 8vw, 5.4rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.app-shell {
  width: min(100%, 1120px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow,
.week-kicker,
.control-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.score-pill {
  flex: 0 0 auto;
  min-width: 76px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  background: var(--dark);
  color: white;
  padding: 12px 15px;
  text-align: center;
  font-weight: 950;
  box-shadow: var(--tight-shadow);
}

.view {
  display: grid;
  gap: 16px;
}

.command-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 42%),
    linear-gradient(160deg, #20241f, #30352d 58%, #4b6049);
  color: white;
  padding: 22px;
  box-shadow: var(--shadow);
}

.command-panel::before {
  content: "";
  position: absolute;
  inset: auto -12% -38% 38%;
  height: 72%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transform: rotate(-8deg);
}

.command-copy,
.command-stats,
.status-orbit {
  position: relative;
  z-index: 1;
}

.command-copy {
  display: grid;
  gap: 8px;
}

.command-copy .week-kicker {
  color: rgba(255, 255, 255, 0.67);
}

.command-copy h2 {
  font-size: clamp(2rem, 8vw, 4.6rem);
  line-height: 0.92;
}

.command-copy p:not(.week-kicker) {
  width: min(100%, 560px);
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.45;
}

.status-orbit {
  width: 142px;
  height: 142px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  justify-self: start;
  background:
    radial-gradient(circle at center, #242820 0 56%, transparent 57%),
    conic-gradient(var(--mint) var(--value), rgba(255, 255, 255, 0.16) 0);
}

.status-orbit div {
  display: grid;
  place-items: center;
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.status-orbit strong {
  font-size: 1.8rem;
  line-height: 1;
}

.status-orbit span,
.command-stats span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.78rem;
  font-weight: 800;
}

.command-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.command-stats div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px;
  background: rgba(32, 36, 31, 0.3);
}

.command-stats strong {
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.today-flow,
.page-intro,
.settings-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.78);
  padding: 16px;
  box-shadow: var(--tight-shadow);
  backdrop-filter: blur(18px);
}

.deck-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.today-flow {
  display: grid;
  gap: 14px;
}

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

.session-option {
  display: grid;
  gap: 4px;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 250, 240, 0.72)),
    var(--paper);
  color: var(--ink);
  padding: 13px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.session-option strong {
  font-size: 1.28rem;
  line-height: 1;
}

.session-option span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.session-option.active {
  border-color: transparent;
  background:
    linear-gradient(160deg, rgba(63, 115, 87, 0.95), rgba(32, 36, 31, 0.96));
  color: white;
  box-shadow: 0 18px 34px rgba(32, 36, 31, 0.2);
}

.session-option.active span {
  color: rgba(255, 255, 255, 0.68);
}

.week-context,
.closing-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.62);
  padding: 14px 15px;
  box-shadow: var(--tight-shadow);
}

.week-context > strong {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--dark);
  color: white;
  padding: 8px 11px;
  font-size: 0.88rem;
}

.closing-strip {
  align-items: flex-start;
  justify-content: flex-start;
}

.closing-strip strong {
  border-radius: 999px;
  background: #efe5d2;
  padding: 6px 10px;
}

.closing-strip span {
  color: var(--muted);
  line-height: 1.45;
}

.muted {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.filter-grid {
  display: grid;
  gap: 12px;
}

.control-group {
  display: grid;
  gap: 8px;
}

.segmented,
.area-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 1px 4px;
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar,
.area-filter::-webkit-scrollbar {
  display: none;
}

.chip,
.action-btn,
.nav-item,
.icon-btn {
  min-height: 42px;
  border-radius: 999px;
  cursor: pointer;
}

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  padding: 9px 13px;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.chip.active {
  border-color: transparent;
  background: var(--dark);
  color: white;
  box-shadow: 0 10px 24px rgba(32, 36, 31, 0.18);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--dark);
  color: white;
  padding: 10px 15px;
  font-weight: 900;
  box-shadow: 0 14px 26px rgba(32, 36, 31, 0.16);
}

.action-btn.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  box-shadow: none;
}

.danger {
  background: #7f2d2a;
}

.section-line {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 0;
}

.section-line span {
  color: var(--muted);
  font-weight: 900;
}

.task-list,
.plan-grid,
.area-grid {
  display: grid;
  gap: 12px;
}

.task-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 240, 0.82)),
    var(--paper-2);
  padding: 14px;
  box-shadow: var(--tight-shadow);
}

.task-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: var(--gold);
}

.task-card:has(.tag.clean)::before {
  background: var(--blue);
}

.task-card.done {
  border-color: rgba(63, 115, 87, 0.35);
  background:
    linear-gradient(180deg, rgba(232, 242, 229, 0.95), rgba(255, 250, 240, 0.86)),
    var(--paper-2);
}

.task-card.done h3 {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(63, 115, 87, 0.55);
}

.task-check {
  display: grid;
  place-items: start center;
  padding-top: 1px;
}

.task-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid rgba(32, 36, 31, 0.18);
  border-radius: 50%;
  background: white;
  box-shadow: 0 8px 18px rgba(32, 36, 31, 0.08);
}

.task-check input:checked + .checkmark {
  border-color: var(--green);
  background: var(--green);
}

.task-check input:checked + .checkmark::after {
  content: "";
  width: 8px;
  height: 14px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.task-main {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.task-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.task-title-row h3 {
  padding-top: 3px;
  font-size: 1.06rem;
}

.icon-btn {
  flex: 0 0 auto;
  width: 36px;
  min-height: 36px;
  background: #efe5d2;
  color: var(--dark);
  font-size: 1.12rem;
  font-weight: 950;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border: 1px solid rgba(32, 36, 31, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 900;
}

.tag.clean {
  background: #e1edf5;
  color: var(--blue);
}

.tag.tidy {
  background: #f5e4dd;
  color: var(--clay);
}

.tag.deep {
  background: #f3e7cf;
  color: var(--gold);
}

.task-note {
  display: none;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefa;
  color: var(--ink);
  padding: 10px;
}

.task-card.note-open .task-note,
.task-note.has-note {
  display: block;
}

.empty-state {
  border: 1px dashed rgba(32, 36, 31, 0.22);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.46);
}

.week-card,
.area-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.78);
  padding: 15px;
  box-shadow: var(--tight-shadow);
}

.split-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.split-intro > strong {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--dark);
  color: white;
  padding: 10px 13px;
}

.week-card {
  display: grid;
  gap: 10px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.week-card.current {
  outline: 2px solid rgba(63, 115, 87, 0.42);
  outline-offset: 2px;
}

.week-card.done {
  background: rgba(226, 239, 222, 0.8);
}

.week-card-title,
.area-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.area-card {
  display: grid;
  gap: 8px;
}

.area-detail {
  align-content: start;
}

.area-detail summary {
  display: grid;
  gap: 8px;
  list-style: none;
  cursor: pointer;
}

.area-detail summary::-webkit-details-marker {
  display: none;
}

.area-detail summary::after {
  content: "Aç";
  justify-self: start;
  border-radius: 999px;
  background: #efe5d2;
  color: var(--ink);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 950;
}

.area-detail[open] summary::after {
  content: "Kapat";
}

.area-task-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.area-task-list .task-card {
  box-shadow: none;
}

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

.detail-week summary {
  display: grid;
  gap: 10px;
  list-style: none;
  cursor: pointer;
}

.detail-week summary::-webkit-details-marker {
  display: none;
}

.simple-hero .command-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.progress-block {
  display: grid;
  gap: 8px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.progress-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(32, 36, 31, 0.11);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #86a56f);
  transition: width 180ms ease;
}

.settings-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-weight: 900;
}

.field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  padding: 9px 11px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(40, 35, 27, 0.12);
  background: rgba(244, 240, 232, 0.86);
  backdrop-filter: blur(18px);
}

.nav-item {
  background: transparent;
  color: var(--muted);
  font-weight: 950;
}

.nav-item.active {
  background: var(--dark);
  color: white;
  box-shadow: 0 14px 28px rgba(32, 36, 31, 0.18);
}

@media (max-width: 560px) {
  .deck-head {
    display: grid;
  }

  .deck-head .action-btn,
  .action-row .action-btn {
    width: 100%;
  }

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

  .command-stats div:last-child {
    grid-column: 1 / -1;
  }

  .week-context {
    display: grid;
  }

  .split-intro {
    display: grid;
  }
}

@media (min-width: 760px) {
  .app-shell {
    padding-inline: 28px;
  }

  .command-panel {
    grid-template-columns: minmax(0, 1.45fr) 160px;
    align-items: center;
    padding: 28px;
  }

  .command-stats {
    grid-column: 1 / -1;
  }

  .filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .session-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

@media (min-width: 1040px) {
  .app-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    padding-bottom: 28px;
  }

  .topbar {
    position: sticky;
    top: 24px;
    display: grid;
    align-self: start;
    margin: 0;
  }

  .view {
    min-width: 0;
  }

  .bottom-nav {
    position: sticky;
    top: 188px;
    bottom: auto;
    left: auto;
    right: auto;
    z-index: 2;
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    width: 220px;
    margin-top: 180px;
    padding: 10px;
    grid-template-columns: 1fr;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 250, 240, 0.72);
    box-shadow: var(--tight-shadow);
  }

  .command-panel {
    grid-template-columns: minmax(0, 1.35fr) 170px;
  }

  .plan-grid,
  .area-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
