:root {
  color-scheme: light;
  --bg: #f7fafc;
  --surface: #ffffff;
  --surface-soft: #edf7f3;
  --ink: #102a43;
  --muted: #627d98;
  --line: #d9e2ec;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #ccfbf1;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --shadow: 0 10px 30px rgb(16 42 67 / 10%);
  --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: var(--bg);
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

a {
  color: var(--accent-strong);
}

.app-shell {
  max-width: 720px;
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 14px calc(env(safe-area-inset-bottom) + 86px);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -14px 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 12px;
  background: color-mix(in srgb, var(--bg) 92%, white);
  border-bottom: 1px solid rgb(217 226 236 / 70%);
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.05;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.22rem;
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.panel,
.activity-card,
.option-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 14px;
}

.hero-panel {
  background: linear-gradient(160deg, #ffffff 0%, #e6fffa 100%);
}

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

.row.wrap {
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

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

.meta-box {
  min-height: 68px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.meta-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.76rem;
  color: var(--muted);
}

.chips,
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar,
.filters::-webkit-scrollbar {
  display: none;
}

.chip,
.segmented button,
.status-select,
.filter-control,
.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.chip {
  flex: 0 0 auto;
  padding: 0 12px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.chip.active,
.segmented button.active,
.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.icon-button {
  width: 42px;
  flex: 0 0 42px;
  font-size: 1.35rem;
  font-weight: 650;
}

.ghost-button,
.primary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  text-decoration: none;
}

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

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

.filter-control,
textarea {
  width: 100%;
  padding: 0 10px;
  background: var(--surface);
}

textarea {
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  resize: vertical;
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-card {
  width: 100%;
  padding: 12px;
  text-align: left;
}

.activity-card h3 {
  margin-bottom: 6px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #134e4a;
  font-size: 0.76rem;
  font-weight: 650;
}

.tag.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.tag.neutral {
  background: #e2e8f0;
  color: #334155;
}

.planner-slots {
  display: grid;
  gap: 10px;
}

.slot {
  min-height: 116px;
  padding: 12px;
  border: 1px dashed #bcccdc;
  border-radius: var(--radius);
  background: #fbfdff;
}

.slot h3 {
  margin-bottom: 8px;
}

.planned-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  margin-top: 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.moscow-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

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

.moscow-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.moscow-item.done {
  background: #f8fafc;
}

.moscow-item.done strong {
  color: var(--muted);
  text-decoration: line-through;
}

.moscow-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.moscow-check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.moscow-content {
  display: grid;
  gap: 6px;
}

.status-select {
  width: 100%;
  padding: 0 8px;
}

.warning {
  padding: 10px;
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: #78350f;
}

.empty {
  padding: 18px 12px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
  background: rgb(255 255 255 / 94%);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.nav-item {
  min-width: 0;
  min-height: 46px;
  padding: 5px 4px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: clamp(0.68rem, 2.7vw, 0.82rem);
  font-weight: 700;
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.activity-dialog {
  width: min(680px, calc(100vw - 18px));
  max-height: min(88vh, 860px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgb(16 42 67 / 35%);
}

.activity-dialog::backdrop {
  background: rgb(16 42 67 / 45%);
}

.dialog-inner {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.dialog-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 8px;
  padding-top: 12px;
  background: white;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-list div {
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.detail-list strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.check-item input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.option-card {
  padding: 12px;
}

.install-note {
  position: fixed;
  inset: auto 14px calc(env(safe-area-inset-bottom) + 78px);
  z-index: 20;
  max-width: 680px;
  margin: 0 auto;
  padding: 12px;
  background: #102a43;
  color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.install-note button {
  float: right;
  min-height: 34px;
  margin-left: 10px;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: var(--radius);
  background: transparent;
  color: white;
}

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

  .app-header {
    margin-inline: -18px;
    padding-inline: 18px;
  }

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