/* Crafty web studio — sits on top of the landing design tokens */

.app-body {
  min-height: 100svh;
  padding-bottom: 88px;
}

.app-body svg,
#chrome svg,
#overlays svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.app-body.is-immersive {
  padding-bottom: 0;
}

#screen {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}

.screen-wide {
  max-width: 1080px;
}

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--forest);
  color: var(--paper);
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

.tabbar button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.tabbar button.is-on,
.tabbar button:hover { color: var(--forest); }

.tabbar svg { width: 22px; height: 22px; }
.tabbar .badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--clay);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
}

.splash {
  min-height: 100svh;
  display: grid;
  place-items: center;
  background: var(--forest-deep);
  color: var(--paper);
  text-align: center;
  padding: 32px;
}

.splash img {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  margin: 0 auto 18px;
}

.splash h1 { font-size: 48px; margin-bottom: 8px; color: var(--paper); }
.splash p { opacity: 0.8; }

.page-head { margin: 8px 0 18px; }
.page-head .kicker { margin-bottom: 8px; }
.page-head h1,
.page-head h2 { font-size: clamp(28px, 5vw, 34px); line-height: 1.1; }
.page-head p { color: var(--muted); margin-top: 6px; }

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-bottom: 16px;
}

.search svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--soft);
}

.search input {
  flex: 1;
  border: 0;
  background: none;
  font: inherit;
  outline: none;
  min-width: 0;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip.is-on {
  background: var(--forest);
  color: var(--paper);
  border-color: transparent;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--forest) 12%, transparent);
  color: var(--forest);
}
.badge.clay { background: color-mix(in srgb, var(--clay) 14%, transparent); color: var(--clay); }
.badge.gold { background: color-mix(in srgb, var(--gold) 22%, transparent); color: #7a5c32; }
.badge.sage { background: color-mix(in srgb, var(--sage) 16%, transparent); color: var(--sage); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  border-radius: 16px;
  border: 0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--paper);
  background: var(--forest);
}
.btn.clay { background: var(--clay); color: var(--paper); }
.btn.secondary, .btn.ghost {
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: #a7626b; border: 1px solid color-mix(in srgb, #a7626b 35%, transparent); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.inline { width: auto; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.btn svg { width: 18px; height: 18px; }

.card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
}

.cover {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 18%, rgba(255,255,255,.12), transparent 46%),
    linear-gradient(135deg, var(--g1, #2F4A43), var(--g2, #C9A27A));
  background-size: cover;
  background-position: center;
  color: #fff;
}
.cover .lock svg {
  width: 28px;
  height: 28px;
  position: static;
  transform: none;
  opacity: 1;
}
.cover .title-on {
  position: absolute;
  inset: auto 16px 16px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.15;
  text-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.craft-card { display: grid; gap: 10px; text-align: left; }
.craft-card .cover { height: 160px; border-radius: 16px; }
.craft-card h3 { font-size: 18px; line-height: 1.2; }
.craft-card .meta { color: var(--soft); font-size: 13px; }
.craft-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}
.craft-row .cover { height: 88px; border-radius: 12px; }
.heart {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
}
.heart svg { width: 20px; height: 20px; }
.heart.is-on { color: var(--clay); }

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

.section { margin: 28px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 24px; }
.section-head p, .section-head span { color: var(--muted); font-size: 14px; }
.section-head .linkish {
  color: var(--clay);
  background: none;
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--clay-soft) 70%, transparent);
  width: 100%;
  border: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  margin-bottom: 18px;
}
.banner b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.banner .kicker { margin-bottom: 4px; }
.banner em {
  margin-left: auto;
  font-style: normal;
  background: var(--clay);
  color: var(--paper);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.week-feature .cover { height: 280px; border-radius: 22px 22px 0 0; }
.week-feature .body { padding: 16px; }
.week-feature { padding: 0; overflow: hidden; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.stat {
  background: var(--paper-2);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}
.stat b { display: block; font-family: var(--serif); font-size: 18px; }
.stat span { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--soft); }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  width: 100%;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.list-row.cardish {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-2);
  margin-bottom: 8px;
}
.check { width: 28px; height: 28px; color: var(--sage); flex: none; }
.app-body svg.check { width: 28px; height: 28px; }
.check.open { color: var(--soft); }
.strike { text-decoration: line-through; color: var(--soft); }

.field { display: grid; gap: 8px; margin-bottom: 14px; }
.field label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--soft);
}
.field input,
.field textarea,
.field select {
  font: inherit;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
}
.field textarea { min-height: 110px; resize: vertical; }

.choice {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  cursor: pointer;
  color: inherit;
  margin-bottom: 10px;
}
.choice.is-on { border-color: var(--clay); background: color-mix(in srgb, var(--clay-soft) 55%, var(--paper-2)); }
.choice b { font-size: 17px; }
.choice span { color: var(--muted); font-size: 14px; }

.dots { display: flex; gap: 8px; justify-content: center; padding: 20px 0 12px; }
.dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--line); display: block; }
.dots i.is-on { width: 22px; background: var(--clay); }

.make-wrap { display: flex; flex-direction: column; min-height: calc(100svh - 24px); }
.make-progress { padding: 8px 4px 12px; }
.make-progress .bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.make-progress .bar > i { display: block; height: 100%; background: var(--clay); }
.make-body { flex: 1; }
.make-controls { position: sticky; bottom: 0; background: var(--paper); padding: 16px 0 20px; }

.step-num { font-family: var(--serif); font-size: 20px; color: var(--clay); width: 28px; flex: none; }

.empty {
  text-align: center;
  padding: 48px 24px;
}
.empty .orb {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--clay-soft) 45%, transparent);
  color: var(--gold);
  font-size: 28px;
}
.empty h3 { font-size: 22px; margin-bottom: 8px; }
.empty p { color: var(--muted); }

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(28, 25, 21, 0.42);
  display: grid;
  place-items: end center;
}
.modal {
  width: min(560px, 100%);
  max-height: 92svh;
  overflow: auto;
  background: var(--paper);
  border-radius: 28px 28px 0 0;
  padding: 20px 20px 32px;
  box-shadow: var(--shadow);
}
@media (min-width: 720px) {
  .modal-back { place-items: center; }
  .modal { border-radius: 28px; max-height: 86svh; }
}

.share-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.share-card { width: 140px; flex: none; text-align: left; }
.share-card .cover { height: 160px; border-radius: 16px; }
.share-card small { color: var(--muted); font-size: 12px; }

.chat-log { display: grid; gap: 12px; padding-bottom: 16px; }
.bubble {
  max-width: 80%;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.bubble.mine {
  margin-left: auto;
  background: var(--forest);
  color: var(--paper);
  border-color: transparent;
}
.composer {
  display: flex;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: var(--paper);
  padding: 12px 0;
}
.composer textarea {
  flex: 1;
  min-height: 46px;
  max-height: 120px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  font: inherit;
  background: var(--paper-2);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.topbar h1 { font-size: 18px; flex: 1; }
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn svg { width: 18px; height: 18px; }

.photo-well {
  min-height: 280px;
  border-radius: 22px;
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--paper-2);
  color: var(--muted);
}
.photo-well img, .photo-well canvas { width: 100%; height: 100%; object-fit: cover; display: block; }

.stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper);
}
.stepper button {
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  cursor: pointer;
  font-weight: 700;
}
.stepper span { width: 36px; text-align: center; font-weight: 600; }

.alert-back {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(28,25,21,.4);
  display: grid;
  place-items: center;
  padding: 24px;
}
.alert {
  width: min(400px, 100%);
  background: var(--paper-2);
  border-radius: 22px;
  padding: 22px;
  border: 1px solid var(--line);
}

.ios-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-2);
  font-size: 13px;
}
.ios-banner a { color: var(--clay); font-weight: 600; text-decoration: none; }

.wizard-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.wizard-tabs span {
  font-size: 12px;
  font-weight: 600;
  color: var(--soft);
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.wizard-tabs span.is-on { color: var(--clay); border-color: var(--clay); }

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .btn-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .splash img { animation: none; }
}
