@font-face {
  font-family: StructuredText;
  src: url("fonts/Geomanist-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: StructuredText;
  src: url("fonts/Geomanist-Medium.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

:root {
  --ink: #0c0c0d;
  --muted: #8a8a8f;
  --paper: #ffffff;
  --page: #f5f5f4;
  --line: #e9e9e9;
  --accent: #e98f95;
  --accent-soft: #f8e7e8;
  --shadow: 0 28px 80px rgba(18, 18, 20, 0.12);
  --font: StructuredText, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  background:
    radial-gradient(circle at 18% 8%, rgba(233, 143, 149, 0.16), transparent 28rem),
    radial-gradient(circle at 90% 0%, rgba(233, 143, 149, 0.09), transparent 24rem),
    var(--page);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.svg-icon {
  display: block;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.structured-app {
  position: relative;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px 118px;
}

.day-header {
  max-width: 1060px;
  margin: 0 auto;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(3.4rem, 7.4vw, 5.95rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

h1 b {
  color: var(--accent);
  font-weight: 900;
}

.round-tool,
.tiny-add,
.inbox-plus,
.close-button,
.floating-add {
  display: grid;
  place-items: center;
  color: var(--accent);
}

.round-tool {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 10px 26px rgba(10, 10, 10, 0.08);
}

.round-tool .svg-icon { width: 25px; height: 25px; }

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(86px, 1fr));
  gap: 12px;
  margin: 20px 0 24px;
}

.day-pill {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: center;
}

.day-pill span {
  display: block;
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.day-pill strong {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 10px;
  border-radius: 50%;
  font-size: 2.45rem;
  line-height: 1;
}

.day-pill.is-active strong {
  background: var(--accent);
  color: #fff;
}

.dot-row {
  display: flex;
  justify-content: center;
  min-height: 18px;
  gap: 0;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--dot);
  opacity: var(--dot-opacity, .62);
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.12);
  margin-left: -3px;
}

.dot:first-child {
  margin-left: 0;
}

.planner-shell {
  position: relative;
  max-width: 1060px;
  min-height: 730px;
  margin: 0 auto;
  border-radius: 54px 54px 0 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sheet-handle {
  position: absolute;
  top: 18px;
  left: 50%;
  z-index: 3;
  width: 86px;
  height: 8px;
  border-radius: 999px;
  background: #dedede;
  transform: translateX(-50%);
}

.view-pane {
  display: none;
}

.view-pane.is-active {
  display: block;
}

.planner-grid {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 730px;
}

.coach-ai-panel {
  display: grid;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,231,232,.34));
  padding: 42px 42px 22px;
}

.coach-ai-panel.is-ai {
  background: linear-gradient(180deg, var(--accent-soft), rgba(255,255,255,.98));
}

.mode-row,
.ai-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mode-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8f8f7;
  padding: 6px;
}

.mode-toggle button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.mode-toggle button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(15,15,16,.08);
}

.voice-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  padding: 0 18px;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(10, 10, 10, 0.08);
}

.voice-button.is-listening {
  background: var(--accent);
  color: #fff;
}

.voice-button .svg-icon {
  width: 21px;
  height: 21px;
}

.ai-command {
  display: grid;
  gap: 12px;
}

.ai-command p {
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.35;
}

.ai-command textarea {
  width: 100%;
  resize: vertical;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  padding: 16px 18px;
  font: inherit;
  line-height: 1.35;
}

.compact-action {
  min-height: 46px;
  border-radius: 999px;
  padding: 0 16px;
}

.inbox-pane {
  border-right: 1px solid var(--line);
  padding: 44px 22px 28px;
}

.pane-head,
.feature-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.pane-head {
  margin-bottom: 18px;
}

.pane-head h2,
.feature-head h2 {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.feature-head p {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .16em;
}

.tiny-add {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--accent-soft);
}

.tiny-add .svg-icon,
.inbox-plus .svg-icon { width: 18px; height: 18px; }

.inbox-list,
.full-list,
.focus-stack,
.settings-list {
  display: grid;
  gap: 12px;
}

.inbox-task {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
  min-height: 70px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 10px 22px rgba(15, 15, 16, 0.06);
  transition: border-color .18s ease, transform .18s ease;
}

.inbox-task:hover {
  border-color: rgba(233, 143, 149, .34);
  transform: translateY(-1px);
}

.inbox-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.inbox-icon .svg-icon { width: 19px; height: 19px; }

.inbox-title {
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.2;
}

.inbox-meta {
  color: var(--muted);
  font-size: .78rem;
}

.inbox-plus {
  border: 0;
  background: transparent;
}

.timeline-pane {
  padding: 38px 44px 46px;
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.quick-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.quick-icon {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-soft), #efefef);
  color: var(--accent);
}

.quick-icon .svg-icon {
  width: 43px;
  height: 43px;
  stroke-width: 1.9;
}

.quick-card strong {
  font-size: 1.15rem;
  line-height: 1.12;
  max-width: 120px;
}

.timeline-list {
  position: relative;
  display: grid;
  gap: 0;
}

.timeline-list::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 28px;
  left: 122px;
  width: 6px;
  border-radius: 999px;
  background: #e6e6e6;
}

.task-row {
  position: relative;
  display: grid;
  grid-template-columns: 84px 112px minmax(0, 1fr) 52px;
  align-items: center;
  min-height: var(--row-height, 108px);
}

.time-stack {
  display: grid;
  align-self: stretch;
  align-content: space-between;
  color: var(--muted);
  font-size: 1.15rem;
}

.rail-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 92px;
  height: var(--node-height, 92px);
  border: 0;
  border-radius: 999px;
  background: #ececec;
  color: var(--accent);
}

.rail-node .svg-icon {
  width: 39px;
  height: 39px;
  stroke-width: 2.05;
}

.rail-node.is-active {
  background: linear-gradient(var(--accent-soft) 0 72%, #e8e8e8 88%);
  outline: 3px solid rgba(233, 143, 149, 0.34);
  box-shadow: 0 10px 28px rgba(15, 15, 16, 0.15);
}

.task-copy {
  margin-left: -6px;
  border-radius: 20px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background .18s ease;
}

.task-copy:hover {
  background: #fafafa;
}

.task-time,
.remaining,
.task-repeat {
  color: var(--muted);
  font-size: 1.05rem;
}

.task-time {
  margin-bottom: 6px;
}

.task-title {
  color: #060607;
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.04;
}

.complete-ring {
  width: 40px;
  height: 40px;
  border: 4px solid var(--accent);
  border-radius: 50%;
  background: transparent;
}

.complete-ring.is-complete {
  background: var(--accent);
  box-shadow: inset 0 0 0 7px #fff;
}

.feature-page {
  padding: 58px 42px 48px;
}

.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 18px;
  font-weight: 900;
}

.pill-button .svg-icon {
  width: 20px;
  height: 20px;
}

.full-list {
  margin-top: 28px;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  margin-top: 26px;
}

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

.calendar-label {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: .12em;
}

.calendar-cell {
  display: grid;
  align-content: space-between;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.calendar-cell strong {
  font-size: 1.5rem;
}

.calendar-cell span {
  color: var(--muted);
  font-size: .75rem;
}

.calendar-cell.is-selected {
  border-color: rgba(233, 143, 149, .45);
  background: var(--accent-soft);
}

.calendar-agenda {
  display: grid;
  align-content: start;
  gap: 12px;
  border-left: 1px solid var(--line);
  padding-left: 22px;
}

.calendar-agenda p {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .16em;
}

.calendar-agenda h3 {
  font-size: 2rem;
}

.agenda-card,
.settings-row,
.focus-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  padding: 14px;
}

.agenda-card,
.settings-row {
  width: 100%;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease;
}

.agenda-card:hover,
.settings-row:hover,
.focus-card:hover {
  border-color: rgba(233, 143, 149, .34);
  transform: translateY(-1px);
}

.agenda-card span,
.settings-row span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
}

.agenda-card .svg-icon,
.settings-row .svg-icon {
  width: 22px;
  height: 22px;
}

.agenda-card strong,
.settings-row h3,
.focus-card h3 {
  display: block;
  font-size: 1.05rem;
  font-weight: 900;
}

.agenda-card small,
.settings-row p,
.focus-card p {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.34;
}

.focus-stack,
.settings-list {
  margin-top: 28px;
}

.focus-card {
  grid-template-columns: 54px minmax(0, 1fr) 58px;
  min-height: 88px;
  cursor: pointer;
}

.focus-card.is-enabled {
  background: linear-gradient(90deg, var(--accent-soft), #fff 42%);
}

.focus-number {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #f2f2f2;
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 900;
}

.switch {
  position: relative;
  width: 56px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #e7e7e7;
  padding: 4px;
}

.switch span {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  transition: transform .2s ease;
}

.switch.is-on {
  background: var(--accent);
}

.switch.is-on span {
  transform: translateX(22px);
}

.settings-list {
  grid-template-columns: 1fr 1fr;
}

.settings-row {
  align-items: start;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(710px, calc(100vw - 150px));
  min-height: 76px;
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 48px rgba(15, 15, 16, 0.16);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.nav-tab {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 900;
  opacity: .55;
}

.nav-tab.is-active {
  opacity: 1;
}

.nav-tab .svg-icon {
  width: 27px;
  height: 27px;
  stroke-width: 2;
}

.nav-tab span {
  font-size: .78rem;
}

.floating-add {
  position: fixed;
  right: max(28px, calc((100vw - 1060px) / 2 + 20px));
  bottom: 18px;
  z-index: 21;
  width: 96px;
  height: 96px;
  border: 2px solid rgba(233, 143, 149, 0.22);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 18px 42px rgba(233, 143, 149, 0.42);
}

.floating-add .svg-icon {
  width: 46px;
  height: 46px;
  stroke-width: 2.6;
}

dialog {
  width: min(520px, calc(100vw - 24px));
  border: 0;
  border-radius: 30px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.task-editor {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.detail-panel {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.task-editor header,
.detail-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-editor h2 {
  font-size: 2rem;
}

.detail-panel header p {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .16em;
}

.detail-panel h2 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.05;
}

.detail-panel > p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.45;
}

.close-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #f1f1f1;
}

.close-button .svg-icon {
  width: 22px;
  height: 22px;
}

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

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
}

.editor-grid,
.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.secondary,
.primary {
  min-height: 50px;
  border: 0;
  border-radius: 16px;
  font-weight: 900;
}

.secondary {
  background: #f1f1f1;
  color: var(--ink);
}

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

.empty-state {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

@media (max-width: 880px) {
  .structured-app {
    padding-left: 0;
    padding-right: 0;
  }

  .day-header {
    padding-left: 24px;
    padding-right: 24px;
  }

  .week-strip {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .day-pill span,
  .dot-row {
    width: auto;
  }

  .day-pill strong {
    width: 50px;
    height: 50px;
    font-size: 1.95rem;
  }

  .dot {
    width: 11px;
    height: 11px;
  }

  .planner-grid,
  .calendar-layout,
  .settings-list {
    grid-template-columns: 1fr;
  }

  .coach-ai-panel {
    padding: 46px 22px 18px;
  }

  .mode-row,
  .ai-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-toggle,
  .voice-button,
  .compact-action {
    width: 100%;
  }

  .compact-pane {
    display: none;
  }

  .calendar-agenda {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding: 20px 0 0;
  }

  .timeline-pane,
  .feature-page {
    padding: 52px 22px 132px;
  }

  .quick-row {
    gap: 8px;
    margin-bottom: 16px;
  }

  .quick-icon {
    width: 102px;
    height: 102px;
  }

  .timeline-list::before {
    left: 91px;
  }

  .task-row {
    grid-template-columns: 72px 94px minmax(0, 1fr) 40px;
    min-height: var(--row-height-mobile, var(--row-height, 112px));
  }

  .rail-node {
    width: 86px;
  }

  .bottom-nav {
    width: calc(100vw - 164px);
    left: 18px;
    transform: none;
    min-height: 82px;
  }

  .floating-add {
    right: 18px;
    bottom: 16px;
    width: 96px;
    height: 96px;
  }
}

@media (max-width: 560px) {
  .structured-app {
    padding: 12px 0 118px;
  }

  .round-tool {
    display: none;
  }

  .day-header {
    padding: 22px 20px 0;
  }

  h1 {
    font-size: 3.35rem;
  }

  .week-strip {
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
  }

  .day-pill span {
    font-size: .86rem;
  }

  .day-pill strong {
    width: 45px;
    height: 45px;
    font-size: 1.72rem;
  }

  .dot {
    width: 10px;
    height: 10px;
  }

  .planner-shell {
    min-height: 820px;
    border-radius: 46px 46px 0 0;
  }

  .quick-icon {
    width: 82px;
    height: 82px;
  }

  .quick-icon .svg-icon {
    width: 34px;
    height: 34px;
  }

  .quick-card strong {
    font-size: .98rem;
  }

  .timeline-pane,
  .feature-page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .timeline-list::before {
    left: 79px;
  }

  .task-row {
    grid-template-columns: 58px 84px minmax(0, 1fr) 36px;
  }

  .time-stack,
  .task-time,
  .remaining,
  .task-repeat {
    font-size: .88rem;
  }

  .rail-node {
    width: 76px;
  }

  .rail-node .svg-icon {
    width: 32px;
    height: 32px;
  }

  .task-title {
    font-size: 1.5rem;
  }

  .complete-ring {
    width: 32px;
    height: 32px;
  }

  .calendar-grid {
    gap: 5px;
  }

  .calendar-cell {
    min-height: 58px;
    border-radius: 14px;
    padding: 7px;
  }

  .calendar-cell strong {
    font-size: 1.1rem;
  }

  .calendar-cell span {
    display: none;
  }

  .focus-card {
    grid-template-columns: 48px minmax(0, 1fr) 52px;
  }

  .feature-head {
    align-items: start;
  }

  .bottom-nav {
    min-height: 78px;
    width: calc(100vw - 106px);
  }

  .nav-tab span {
    display: block;
    max-width: 54px;
    font-size: .58rem;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }
}
