:root {
  --bg: #f4f3f1;
  --card: #ffffff;
  --card-2: #ecebe7;
  --ink: #1b1b1f;
  --muted: #62626a;
  --teal: #0b5e63;
  --lime: #d7f000;
  --lav-1: #b9a6cf;
  --lav-2: #7f6e9e;
  --radius: 28px;
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  padding-bottom: 112px;
}
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
p { margin: 0; }
a { color: var(--teal); }
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 8px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; color: var(--ink); min-height: 44px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(215, 240, 0, 0.3); }
.chip { background: var(--card); border-radius: 999px; padding: 8px 14px; font-size: 14px; text-decoration: none; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }

.hero { padding: 24px 0 20px; }
.hero h1 { font-size: clamp(34px, 9vw, 48px); font-weight: 500; }
.hero h1 b { font-weight: 700; }
.hero p { margin-top: 12px; color: var(--muted); font-size: 17px; }

.card { background: var(--card); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.card h2 { font-size: 20px; font-weight: 600; }
.card .sub { color: var(--muted); font-size: 15px; margin-top: 4px; }

/* preview card, lavender like the mood widget */
.stage {
  background: linear-gradient(145deg, var(--lav-1), var(--lav-2));
  border-radius: var(--radius);
  padding: 18px 0 14px;
  margin-top: 8px;
  color: #fff;
}
.stage .cap { padding: 0 20px 12px; font-size: 14px; color: rgba(255, 255, 255, 0.92); display: flex; justify-content: space-between; }
.rail {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 20px 6px; scroll-padding: 0 20px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 74%; scroll-snap-align: start; border: 0; padding: 0; background: none; border-radius: 6px; overflow: hidden; line-height: 0; }
.slide canvas { width: 100%; height: auto; display: block; }
@media (min-width: 560px) { .slide { flex-basis: 52%; } }

.picker { display: flex; gap: 12px; overflow-x: auto; padding: 14px 2px 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.picker::-webkit-scrollbar { display: none; }
.tpl { flex: 0 0 auto; scroll-snap-align: start; background: var(--card-2); border: 2px solid transparent; border-radius: 22px; padding: 10px; text-align: left; width: 168px; }
.tpl canvas { width: 100%; height: auto; border-radius: 12px; display: block; }
.tpl span { display: block; font-weight: 600; margin-top: 8px; font-size: 15px; }
.tpl[aria-checked="true"] { border-color: var(--ink); background: var(--card); }

.btn-soft {
  width: 100%; min-height: 56px; margin-top: 14px; border: 2px dashed #bdbab2; background: var(--card-2);
  border-radius: 22px; font-weight: 600; font-size: 16px;
}
.stepper { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.stepper .ctl { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 48px; height: 48px; border-radius: 16px; border: 0; background: var(--card-2); font-size: 22px; line-height: 1; }
.stepper button:disabled { opacity: 0.4; cursor: default; }
.stepper output { min-width: 28px; text-align: center; font-weight: 600; font-size: 20px; }

.field { display: block; margin-top: 14px; }
.field span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.field textarea { width: 100%; resize: none; border: 0; background: var(--card-2); border-radius: 18px; padding: 14px 16px; font-size: 16px; }

.bar {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(244, 243, 241, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.bar .in { max-width: 640px; margin: 0 auto; }
.go {
  width: 100%; min-height: 56px; border: 0; border-radius: 22px; background: var(--ink); color: #fff;
  font-weight: 600; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.go .dot { box-shadow: none; }
.go:disabled { opacity: 0.6; }
#status { min-height: 20px; text-align: center; font-size: 14px; color: var(--muted); margin-bottom: 6px; }

/* seo content */
.copy { padding: 36px 0 8px; }
.copy h2 { font-size: 26px; margin-bottom: 12px; }
.copy p, .copy li { color: var(--muted); font-size: 16px; }
.copy ol, .copy ul { padding-left: 20px; margin: 0; display: grid; gap: 8px; }
.copy section + section { margin-top: 32px; }
details { background: var(--card); border-radius: 20px; padding: 16px 18px; margin-top: 10px; }
summary { font-weight: 600; cursor: pointer; min-height: 24px; }
details p { margin-top: 8px; }
footer { padding: 28px 0 8px; color: var(--muted); font-size: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
footer a { min-height: 44px; display: inline-flex; align-items: center; }

/* ---- v2: tray, gallery, sheet ---- */
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--muted); padding: 4px 0; flex-wrap: wrap; }
.crumbs a { min-height: 24px; }

.tray { margin-top: 12px; }
.drop { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--card-2); border: 0; border-radius: 22px; padding: 16px; }
.drop-ico { flex: none; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--teal); display: inline-flex; align-items: center; justify-content: center; }
.drop-ico .ni { width: 24px; height: 24px; }
.drop-txt strong { display: block; font-size: 16px; font-weight: 600; }
.drop-txt small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.tray.is-loading .drop, .tray.has-photos .drop, .tray.is-loading .tray-meta, .tray:not(.has-photos) .tray-meta { display: none; }
.tray-list { list-style: none; display: flex; gap: 8px; overflow-x: auto; padding: 6px 6px 4px 0; margin: 0; scrollbar-width: none; }
.tray-list:empty { display: none; }
.tray-list li { position: relative; flex: 0 0 auto; }
.tray-list img { width: 64px; height: 64px; object-fit: cover; border-radius: 16px; display: block; }
.tray-plus { width: 64px; height: 64px; border-radius: 16px; border: 0; background: var(--ink); color: #fff; font-size: 28px; line-height: 1; }
.tray-x { position: absolute; top: -6px; right: -6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 13px; line-height: 1; }
.tray-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tray-note { color: var(--muted); font-size: 14px; }
.tray-meta .link-btn { margin-top: 0; }
.tray-busy { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 12px 14px; border-radius: 16px; background: var(--card-2); font-size: 14px; color: var(--ink); }

/* loaders */
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.skel, .skel-tile, .t-card canvas.thumb:not([data-done]) { background: linear-gradient(90deg, #ecebe7 25%, #f7f6f3 50%, #ecebe7 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel-tile { width: 64px; height: 64px; border-radius: 16px; }
.skel-slide { flex: 0 0 74%; aspect-ratio: 4 / 5; border-radius: 6px; }
@media (min-width: 560px) { .skel-slide { flex-basis: 52%; } }
.skel-thumb { width: 100%; aspect-ratio: 336 / 300; border-radius: 12px; }
.proj .skel-thumb { width: 112px; flex: none; }
.skel-lines { flex: 1; display: grid; gap: 10px; }
.skel-lines .skel { height: 16px; border-radius: 8px; }
.skel-lines .skel:last-child { width: 60%; }
.spinner { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; flex: none; }
@media (prefers-reduced-motion: reduce) { .skel, .skel-tile, .t-card canvas.thumb:not([data-done]), .spinner { animation-duration: 3s; } }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; min-height: 44px; margin-top: 14px; padding: 0 6px; }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 8px; min-height: 44px; font-size: 15px; }
.switch input { width: 22px; height: 22px; accent-color: var(--ink); }
.switch[hidden], #text-card[hidden], .t-card[hidden] { display: none; }

.gal { margin-top: 28px; }
.gal h2 { font-size: 24px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-btn { flex: 0 0 auto; border: 0; background: var(--card); border-radius: 999px; padding: 10px 16px; min-height: 44px; font-size: 15px; }
.chip-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.grid { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } .wrap { max-width: 760px; } }
.t-card { background: var(--card); border-radius: 24px; padding: 8px 8px 14px; display: flex; flex-direction: column; }
.t-link { display: block; color: var(--ink); text-decoration: none; }
.thumb-wrap { position: relative; }
.t-card canvas { width: 100%; height: auto; border-radius: 18px; display: block; background: var(--card-2); aspect-ratio: 336 / 300; }
.t-card h3 { font-size: 15px; font-weight: 600; margin: 10px 6px 0; letter-spacing: -0.01em; }
.blurb { cursor: pointer; font-size: 13px; color: var(--muted); margin: 4px 6px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blurb.open { white-space: normal; overflow: visible; }
.t-card small { display: block; font-size: 12px; color: var(--muted); margin: 8px 6px 0; margin-top: auto; padding-top: 8px; }
.more-soon { color: var(--muted); font-size: 14px; margin-top: 14px; text-align: center; }

.more-card { text-decoration: none; color: var(--ink); width: 150px; }
.more-card canvas { width: 100%; height: auto; }

dialog { border: 0; border-radius: 28px; padding: 20px; width: min(92vw, 420px); max-height: 80vh; overflow: auto; background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(20, 20, 25, 0.45); }
dialog h2 { font-size: 20px; margin-bottom: 12px; }
.sheet-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet-list button { width: 100%; padding: 0; border: 0; border-radius: 16px; overflow: hidden; background: var(--card-2); aspect-ratio: 1; font-weight: 600; }
.sheet-list img { width: 100%; height: 100%; object-fit: cover; display: block; }

.copy dl { margin: 0; display: grid; gap: 4px; }
.copy dt { font-weight: 600; color: var(--ink); margin-top: 10px; }
.copy dd { margin: 0; color: var(--muted); }
.tbl { overflow-x: auto; margin: 12px 0; background: var(--card); border-radius: 20px; padding: 6px 12px; }
.tbl table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 420px; }
.tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--card-2); color: var(--muted); }
.tbl th { color: var(--ink); font-weight: 600; }
.tbl tr:last-child td { border-bottom: 0; }

/* ---- v2.1: hamburger menu, footer, history, blog ---- */
[hidden] { display: none !important; }
.no-scroll { overflow: hidden; }
.hamb { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #e3e1dc; background: var(--card); color: #5b5b63; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.ni { width: 20px; height: 20px; flex: none; }
.ni.sm { width: 16px; height: 16px; }
#nav-overlay { position: fixed; inset: 0; background: rgba(20, 20, 25, 0.35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 30; }
#nav-menu { overflow-y: auto; position: fixed; top: 0; right: 0; height: 100%; width: min(84vw, 320px); background: rgba(255,255,255,0.97); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); z-index: 40; transform: translateX(100%); transition: transform 0.28s ease; display: flex; flex-direction: column; padding: 20px; box-shadow: -12px 0 40px rgba(0,0,0,0.12); border-left: 1px solid #ecebe7; visibility: hidden; }
#nav-menu.open { transform: none; visibility: visible; }
@media (prefers-reduced-motion: reduce) { #nav-menu { transition: none; } }
.nav-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 18px; margin-bottom: 20px; }
.nav-head button { width: 44px; height: 44px; border-radius: 14px; border: 0; background: var(--card-2); display: inline-flex; align-items: center; justify-content: center; }
.nav-list { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: 4px; align-content: start; }
.nav-list a, .nav-list button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 0 14px; border-radius: 16px; border: 0; background: none; color: var(--ink); text-decoration: none; font-size: 16px; font-weight: 500; text-align: left; }
.nav-list a:hover, .nav-list button:hover { background: var(--card-2); }
.nav-list .ni { color: #8a8a92; }
.nav-foot { display: flex; align-items: center; gap: 12px; background: var(--card-2); border-radius: 18px; padding: 14px 16px; }
.nav-foot small { display: block; color: var(--muted); font-size: 13px; }

dialog p.sub { margin-top: 6px; }
.dlg-actions { display: flex; gap: 10px; margin-top: 16px; }
.dlg-actions .btn-soft { margin-top: 0; border-style: solid; border-width: 1px; border-color: #d8d6d0; }
.btn-danger { flex: 1; min-height: 56px; border: 0; border-radius: 22px; background: #b3261e; color: #fff; font-weight: 600; font-size: 16px; }

.projects { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.proj { display: flex; gap: 14px; background: var(--card); border-radius: 24px; padding: 10px; align-items: center; }
.proj img { width: 112px; height: auto; aspect-ratio: 280 / 250; object-fit: cover; border-radius: 16px; flex: none; background: var(--card-2); }
.proj h3 { font-size: 16px; font-weight: 600; }
.proj p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.proj-actions { display: flex; gap: 8px; margin-top: 10px; }
.proj-open, .proj-del { min-height: 44px; padding: 0 16px; border-radius: 14px; border: 0; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; text-decoration: none; }
.proj-open { background: var(--ink); color: #fff; }
.proj-del { background: var(--card-2); color: #8c1d18; }
.linklike { display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--ink); border-style: solid; }

.posts { list-style: none; padding: 0; display: grid; gap: 12px; margin: 0; }
.post-card a { display: block; background: var(--card); border-radius: 24px; padding: 20px; text-decoration: none; color: var(--ink); }
.post-card h2 { font-size: 20px; }
.post-card p { color: var(--muted); margin-top: 8px; font-size: 15px; }
.post-card small { display: block; margin-top: 10px; color: var(--muted); font-size: 13px; }
.post h1 { font-size: clamp(28px, 7vw, 40px); }
.byline { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.post section p + p { margin-top: 10px; }
.cta-card { background: linear-gradient(145deg, var(--lav-1), var(--lav-2)); border-radius: var(--radius); padding: 22px; color: #fff; }
.cta-card h2, .cta-card p { color: #fff; }
.cta { margin-top: 14px; text-decoration: none; }

.site-foot { margin-top: 48px; border-top: 1px solid #e3e1dc; padding: 32px 0 28px; color: var(--muted); font-size: 15px; display: grid; gap: 28px; }
.foot-top { display: grid; gap: 12px; justify-items: start; }
.foot-top .brand { color: var(--ink); font-size: 20px; }
.foot-top p { max-width: 44ch; }
.foot-cta { display: inline-flex; align-items: center; min-height: 48px; padding: 0 22px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; text-decoration: none; margin-top: 4px; }
.foot-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
@media (min-width: 640px) { .foot-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.foot-cols h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); font-weight: 700; margin: 0 0 4px; }
.foot-cols ul { list-style: none; margin: 0; padding: 0; }
.foot-cols a { display: flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: none; }
.foot-cols a:hover { color: var(--teal); }
.foot-base { border-top: 1px solid #e3e1dc; padding-top: 18px; display: grid; gap: 8px; font-size: 13px; }
.foot-base p { margin: 0; }
.foot-base a { color: var(--teal); text-decoration: none; }
.foot-base a:hover { text-decoration: underline; }
.foot-priv { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.foot-priv .ni { color: var(--teal); }
body { padding-bottom: 0; }
body[data-template] { padding-bottom: 112px; }
.wrap:has(.site-foot) { max-width: 760px; }
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.t-card { min-width: 0; }
.t-card { align-self: start; }

/* ---- favorites, share, export screen ---- */
.thumb-wrap { position: relative; }
.card-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.92); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,0.18); }
.icon-btn::after { content: ""; position: absolute; inset: -4px; }
.icon-btn .ni { width: 18px; height: 18px; }
.fav-btn[aria-pressed="true"] .ni, .pill-btn[aria-pressed="true"] .ni { fill: #f2b01e; stroke: #b07d00; }
.t-card h3 a { color: inherit; text-decoration: none; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pill-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid #d8d6d0; background: var(--card); font-weight: 600; font-size: 15px; }
.pill-btn.wide { width: 100%; min-height: 52px; }
#toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#done { width: min(92vw, 440px); text-align: center; }
#done h2 { font-size: 22px; }
#done .sub { color: var(--muted); margin-top: 8px; }
#done .small { font-size: 13px; }
.progress { height: 12px; border-radius: 999px; background: var(--card-2); overflow: hidden; margin: 18px 0 12px; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--lav-1), var(--lav-2)); transition: width 0.25s ease; }
.done-check { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; background: var(--lime); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.done-check .ni { width: 30px; height: 30px; stroke-width: 3; }
.care { text-align: left; background: var(--card-2); border-radius: 20px; padding: 16px; margin-top: 16px; font-size: 14px; color: var(--muted); display: grid; gap: 8px; }
.care strong { color: var(--ink); }
.care p { margin: 0; }
.done-actions { display: grid; gap: 10px; margin-top: 16px; justify-items: stretch; }
.done-link { display: flex; align-items: center; justify-content: center; min-height: 44px; font-weight: 600; }
.done-actions .link-btn { margin-top: 0; justify-self: center; }
@media (prefers-reduced-motion: reduce) { .progress-fill, #toast { transition: none; } }

.credit { margin-top: 14px; padding: 10px 14px; border-left: 3px solid var(--lav-2); background: var(--card); border-radius: 0 14px 14px 0; font-size: 14px; color: var(--muted); }
.credit a { font-weight: 600; word-break: break-word; }
.legal section + section { margin-top: 24px; }
.legal h2 { font-size: 20px; }

/* card buttons: hover or keyboard focus only on devices that can hover; always visible on touch */
@media (hover: hover) {
  .t-card .icon-btn { opacity: 0; transition: opacity 0.15s ease; }
  .t-card:hover .icon-btn, .t-card:focus-within .icon-btn, .t-card .fav-btn[aria-pressed="true"] { opacity: 1; }
}
