:root {
  color-scheme: light;
  --ink: #26352d;
  --muted: #72766f;
  --paper: #f4f0e8;
  --paper-2: #fbf9f4;
  --white: #fffefa;
  --line: rgba(38, 53, 45, 0.12);
  --green: #24372d;
  --green-2: #496354;
  --sage: #dbe3d7;
  --clay: #c86f4d;
  --clay-soft: #efd8cc;
  --gold: #caa76d;
  --paper-light: var(--white);
  --label: #596159;
  --green-ink: var(--green);
  --sage-ink: #4f6557;
  --clay-ink: #704b3d;
  --border-subtle: rgba(38, 53, 45, 0.1);
  --border-faint: rgba(38, 53, 45, 0.08);
  --border-dashed: rgba(38, 53, 45, 0.2);
  --surface-card: rgba(255, 254, 250, 0.82);
  --surface-card-soft: rgba(255, 254, 250, 0.76);
  --surface-card-faint: rgba(255, 254, 250, 0.48);
  --surface-control: rgba(255, 254, 250, 0.66);
  --surface-control-strong: rgba(255, 254, 250, 0.86);
  --surface-disabled: rgba(255, 254, 250, 0.55);
  --surface-rail: rgba(251, 249, 244, 0.76);
  --surface-sticky: rgba(251, 249, 244, 0.94);
  --surface-mobile-head: rgba(244, 240, 232, 0.9);
  --surface-day: rgba(244, 240, 232, 0.64);
  --surface-photo-picker: rgba(244, 240, 232, 0.68);
  --surface-hover: rgba(255, 255, 255, 0.62);
  --surface-icon: rgba(255, 255, 255, 0.7);
  --surface-favorite: rgba(255, 254, 250, 0.82);
  --surface-button-glass: rgba(255, 255, 255, 0.72);
  --surface-sage-note: rgba(219, 227, 215, 0.38);
  --surface-sage-panel: rgba(219, 227, 215, 0.62);
  --surface-clay-panel: rgba(239, 216, 204, 0.54);
  --sheet-border: rgba(255, 255, 255, 0.55);
  --stat-border: rgba(255, 255, 255, 0.72);
  --body-glow: rgba(202, 167, 109, 0.14);
  --photo-sheen-start: rgba(255, 255, 255, 0.8);
  --photo-sheen-end: rgba(255, 255, 255, 0.05);
  --progress-track: #e8e4db;
  --photo-placeholder: #e7e0d3;
  --collage-placeholder: #ede8dc;
  --idea-placeholder-a: #e6dfce;
  --idea-placeholder-b: #d7e0d5;
  --quick-neutral: #e6dfce;
  --quick-blue: #dbe3ea;
  --archive-ink: #6d6760;
  --archive-bg: #e5e1da;
  --deleted-ink: #8f4339;
  --deleted-bg: #f5ddd6;
  --warning-ink: #65502d;
  --warning-bg: #fff7e7;
  --warning-line: #e0bd79;
  --danger-ink: #973f34;
  --danger-bg: #fff5f1;
  --shadow: 0 20px 60px rgba(50, 48, 40, 0.1);
  --soft-shadow: 0 10px 30px rgba(50, 48, 40, 0.07);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.calendar-diary-filter { display: flex; justify-content: space-between; align-items: center; width: calc(100% - 32px); min-height: 44px; margin: 4px 16px 0; padding: 0 12px; border: 0; border-radius: 10px; color: #444; background: #fff; font: inherit; font-size: 15px; text-align: left; }
.calendar-diary-filter span { color: #5969ff; font-size: 21px; }
.diary-entry { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 9px 0; border: 0; color: #333; background: transparent; text-align: left; font: inherit; }
.diary-entry img, .diary-entry-icon { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 6px; object-fit: cover; }
.diary-entry-icon { display: grid; place-items: center; color: #5969ff; background: #f1f3ff; font-size: 25px; }
.diary-entry > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.diary-entry strong { font-size: 16px; font-weight: 500; }
.diary-entry small { overflow: hidden; color: #888; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.diary-entry b { margin-left: auto; color: #aaa; font-size: 21px; font-weight: 400; }
.calendar-add-menu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 15px 0; }
.calendar-add-menu button { display: grid; place-items: center; gap: 8px; min-height: 76px; border: 0; border-radius: 12px; color: #5969ff; background: #f5f6ff; font: inherit; font-size: 26px; }
.calendar-add-menu button span { color: #333; font-size: 14px; }
.calendar-add-menu button:disabled { opacity: .42; }
.diary-overlay { padding: 0; }
.diary-sheet.sheet { width: min(100%, 620px); height: 100%; max-height: 100%; margin: 0 auto; border-radius: 0; background: #fff; overflow-y: auto; }
.diary-sheet form { min-height: 100%; }
.diary-head { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 4px 14px; border-bottom: 1px solid #f3f3f3; }
.diary-head strong { font-size: 19px; font-weight: 500; }
.diary-head button { min-width: 44px; min-height: 44px; border: 0; color: #303030; background: transparent; font: inherit; font-size: 27px; }
.diary-head button[type="submit"] { color: #5969ff; font-size: 17px; }
.diary-editor { padding: 18px 16px 45px; }
.diary-date { display: block; margin: 0 0 14px; color: #aaa; font-size: 13px; }
.diary-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.diary-photo, .diary-add-photo { position: relative; flex: 0 0 90px; width: 90px; height: 90px; border-radius: 5px; }
.diary-photo img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.diary-photo button { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border: 0; border-radius: 50%; color: #fff; background: #333; font-size: 19px; }
.diary-add-photo { display: grid; place-items: center; border: 1px dashed #c9c9c9; color: #b5b5b5; font-size: 37px; }
.diary-add-photo input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.diary-editor textarea { display: block; width: 100%; min-height: 45vh; margin-top: 18px; padding: 0; border: 0; outline: 0; resize: vertical; color: #333; background: transparent; font: inherit; font-size: 17px; line-height: 1.6; }
.diary-editor textarea::placeholder { color: #bbb; }
.diary-delete { margin-top: 20px; padding: 10px 0; border: 0; color: #d95050; background: transparent; font: inherit; }

/* Category and occasion overviews: every entry stays available in a horizontal rail. */
.closet-overview {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.closet-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 16px;
}

.closet-overview-title,
.closet-overview-actions button,
.closet-overview-footer button,
.closet-list-back button {
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.closet-overview-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  text-align: left;
  font-size: 23px;
}

.closet-overview-title strong { font-weight: 680; }
.closet-overview-title span { color: var(--muted); }

.closet-overview-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.closet-overview-actions button {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 24px;
}

.overview-swipe-stack,
.outfit-group-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.overview-swipe-card,
.outfit-group-card {
  min-width: 0;
  padding: 15px 0 11px;
  border: 1px solid var(--border-faint);
  border-radius: 18px;
  background: var(--surface-card);
  box-shadow: var(--soft-shadow);
}

.overview-swipe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 15px;
}

.overview-swipe-head > button:first-child {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.overview-swipe-head strong { overflow: hidden; font-size: 18px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.overview-swipe-head small { flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.overview-swipe-more { flex: 0 0 36px; width: 36px; height: 36px; border: 0; border-radius: 9px; color: var(--muted); background: var(--photo-placeholder); font-size: 19px; cursor: pointer; }

.overview-swipe-rail,
.outfit-group-previews {
  display: flex;
  gap: 8px;
  min-width: 0;
  margin-top: 7px;
  padding: 0 15px 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.overview-swipe-rail::-webkit-scrollbar,
.outfit-group-previews::-webkit-scrollbar { display: none; }

.overview-swipe-item {
  flex: 0 0 86px;
  width: 86px;
  height: 94px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-faint);
  border-radius: 11px;
  background: var(--photo-placeholder);
  scroll-snap-align: start;
  cursor: pointer;
}
.overview-swipe-photo { width: 100%; height: 100%; aspect-ratio: auto; border-radius: inherit; }
.overview-swipe-photo::after { display: none; }
.overview-swipe-empty { padding: 18px 15px; color: var(--muted); font-size: 14px; }
.overview-swipe-foot { display: flex; justify-content: space-between; gap: 8px; padding: 7px 15px 0; color: var(--muted); font-size: 12px; }

.closet-overview-footer,
.closet-list-back {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.closet-overview-footer button,
.closet-list-back button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--label);
  background: var(--surface-card);
  font-size: 13px;
}

.closet-list-back {
  margin: 0 0 12px;
}

@media (max-width: 900px) {
  .closet-overview { margin: 0 4px; width: calc(100% - 8px); }
  .closet-overview-head { margin-bottom: 12px; }
  .closet-overview-title { font-size: 24px; }
  .overview-swipe-card, .outfit-group-card { box-shadow: none; }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf3ed;
  --muted: #a9b4ac;
  --paper: #131a16;
  --paper-2: #19221d;
  --white: #222d26;
  --line: rgba(225, 239, 229, 0.13);
  --green: #294438;
  --green-2: #8fb39d;
  --sage: #31473a;
  --clay: #df8966;
  --clay-soft: #55382d;
  --gold: #d3b47c;
  --label: #c2cdc5;
  --green-ink: #c5ddce;
  --sage-ink: #c0d4c6;
  --clay-ink: #ffd0bf;
  --border-subtle: rgba(225, 239, 229, 0.11);
  --border-faint: rgba(225, 239, 229, 0.09);
  --border-dashed: rgba(225, 239, 229, 0.2);
  --surface-card: rgba(34, 45, 38, 0.94);
  --surface-card-soft: rgba(30, 41, 34, 0.9);
  --surface-card-faint: rgba(34, 45, 38, 0.66);
  --surface-control: rgba(34, 45, 38, 0.8);
  --surface-control-strong: rgba(34, 45, 38, 0.94);
  --surface-disabled: rgba(34, 45, 38, 0.52);
  --surface-rail: rgba(25, 34, 29, 0.88);
  --surface-sticky: rgba(25, 34, 29, 0.96);
  --surface-mobile-head: rgba(19, 26, 22, 0.92);
  --surface-day: rgba(34, 45, 38, 0.72);
  --surface-photo-picker: rgba(34, 45, 38, 0.66);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --surface-icon: rgba(255, 255, 255, 0.07);
  --surface-favorite: rgba(25, 34, 29, 0.82);
  --surface-button-glass: rgba(255, 255, 255, 0.08);
  --surface-sage-note: rgba(49, 71, 58, 0.52);
  --surface-sage-panel: rgba(49, 71, 58, 0.72);
  --surface-clay-panel: rgba(85, 56, 45, 0.76);
  --sheet-border: rgba(255, 255, 255, 0.1);
  --stat-border: rgba(255, 255, 255, 0.1);
  --body-glow: rgba(202, 167, 109, 0.08);
  --photo-sheen-start: rgba(255, 255, 255, 0.08);
  --photo-sheen-end: rgba(255, 255, 255, 0.01);
  --progress-track: #2a352e;
  --photo-placeholder: #2a352e;
  --collage-placeholder: #263229;
  --idea-placeholder-a: #2b382f;
  --idea-placeholder-b: #304238;
  --quick-neutral: #3b392f;
  --quick-blue: #2d3b42;
  --archive-ink: #d2ccc4;
  --archive-bg: #3a3d3a;
  --deleted-ink: #ffc0ad;
  --deleted-bg: #56342f;
  --warning-ink: #f1d99e;
  --warning-bg: #443a25;
  --warning-line: #806b3c;
  --danger-ink: #ffb3a5;
  --danger-bg: #4b2f2b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  --soft-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]),
  :root[data-theme="system"] {
    color-scheme: dark;
    --ink: #edf3ed;
    --muted: #a9b4ac;
    --paper: #131a16;
    --paper-2: #19221d;
    --white: #222d26;
    --line: rgba(225, 239, 229, 0.13);
    --green: #294438;
    --green-2: #8fb39d;
    --sage: #31473a;
    --clay: #df8966;
    --clay-soft: #55382d;
    --gold: #d3b47c;
    --label: #c2cdc5;
    --green-ink: #c5ddce;
    --sage-ink: #c0d4c6;
    --clay-ink: #ffd0bf;
    --border-subtle: rgba(225, 239, 229, 0.11);
    --border-faint: rgba(225, 239, 229, 0.09);
    --border-dashed: rgba(225, 239, 229, 0.2);
    --surface-card: rgba(34, 45, 38, 0.94);
    --surface-card-soft: rgba(30, 41, 34, 0.9);
    --surface-card-faint: rgba(34, 45, 38, 0.66);
    --surface-control: rgba(34, 45, 38, 0.8);
    --surface-control-strong: rgba(34, 45, 38, 0.94);
    --surface-disabled: rgba(34, 45, 38, 0.52);
    --surface-rail: rgba(25, 34, 29, 0.88);
    --surface-sticky: rgba(25, 34, 29, 0.96);
    --surface-mobile-head: rgba(19, 26, 22, 0.92);
    --surface-day: rgba(34, 45, 38, 0.72);
    --surface-photo-picker: rgba(34, 45, 38, 0.66);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --surface-icon: rgba(255, 255, 255, 0.07);
    --surface-favorite: rgba(25, 34, 29, 0.82);
    --surface-button-glass: rgba(255, 255, 255, 0.08);
    --surface-sage-note: rgba(49, 71, 58, 0.52);
    --surface-sage-panel: rgba(49, 71, 58, 0.72);
    --surface-clay-panel: rgba(85, 56, 45, 0.76);
    --sheet-border: rgba(255, 255, 255, 0.1);
    --stat-border: rgba(255, 255, 255, 0.1);
    --body-glow: rgba(202, 167, 109, 0.08);
    --photo-sheen-start: rgba(255, 255, 255, 0.08);
    --photo-sheen-end: rgba(255, 255, 255, 0.01);
    --progress-track: #2a352e;
    --photo-placeholder: #2a352e;
    --collage-placeholder: #263229;
    --idea-placeholder-a: #2b382f;
    --idea-placeholder-b: #304238;
    --quick-neutral: #3b392f;
    --quick-blue: #2d3b42;
    --archive-ink: #d2ccc4;
    --archive-bg: #3a3d3a;
    --deleted-ink: #ffc0ad;
    --deleted-bg: #56342f;
    --warning-ink: #f1d99e;
    --warning-bg: #443a25;
    --warning-line: #806b3c;
    --danger-ink: #ffb3a5;
    --danger-bg: #4b2f2b;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --soft-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% -10%, var(--body-glow), transparent 28rem),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

button,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(200, 111, 77, 0.42);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.side-rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 34px 24px 28px;
  border-right: 1px solid var(--line);
  background: var(--surface-rail);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  color: var(--paper-2);
  background: var(--green);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 21px;
  letter-spacing: 0.04em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.desktop-nav {
  display: grid;
  gap: 8px;
  margin-top: 48px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 15px;
  border: 0;
  border-radius: 16px;
  color: var(--label);
  background: transparent;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-button:hover {
  background: var(--surface-hover);
}

.nav-button.is-active {
  color: var(--white);
  background: var(--green);
  box-shadow: 0 12px 22px rgba(36, 55, 45, 0.16);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  font-size: 18px;
}

.local-note {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgba(73, 99, 84, 0.12);
  border-radius: 17px;
  color: var(--muted);
  background: var(--surface-sage-note);
  font-size: 12px;
  line-height: 1.55;
}

.local-note p {
  margin: 0;
}

.local-note strong {
  color: var(--ink);
}

.privacy-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: #5d8b69;
  box-shadow: 0 0 0 4px rgba(93, 139, 105, 0.12);
}

.workspace {
  position: relative;
  min-width: 0;
}

.mobile-head,
.mobile-nav {
  display: none;
}

#app {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 44px 0 92px;
}

.loading-view {
  display: grid;
  place-items: center;
  min-height: 60vh;
  color: var(--muted);
}

.loading-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 22px;
  color: var(--paper);
  background: var(--green);
  font-family: Georgia, "Songti SC", serif;
  font-size: 32px;
  animation: breathe 1.6s ease-in-out infinite;
}

@keyframes breathe {
  50% { transform: translateY(-4px); box-shadow: 0 18px 30px rgba(36, 55, 45, 0.18); }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-head h1,
.hero-copy h1,
.sheet-head h2,
.detail-copy h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-weight: 500;
}

.page-head h1 {
  font-size: clamp(32px, 4vw, 50px);
  letter-spacing: -0.035em;
}

.page-head p {
  max-width: 590px;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--clay);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.head-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.round-button,
.icon-button,
.chip,
.segmented button,
.text-button {
  min-height: 44px;
  border-radius: 14px;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  padding: 0 18px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  color: white;
  background: var(--green);
  box-shadow: 0 10px 24px rgba(36, 55, 45, 0.16);
}

.primary-button.clay {
  background: var(--clay);
  box-shadow: 0 10px 24px rgba(200, 111, 77, 0.18);
}

.secondary-button {
  color: var(--green-ink);
  border-color: rgba(36, 55, 45, 0.18);
  background: var(--white);
}

.ghost-button {
  color: var(--ink);
  border-color: var(--line);
  background: transparent;
}

.danger-button {
  color: var(--danger-ink);
  border-color: rgba(151, 63, 52, 0.16);
  background: var(--danger-bg);
}

.text-button {
  padding: 0 8px;
  border: 0;
  color: var(--clay);
  background: transparent;
  font-weight: 700;
}

.round-button,
.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface-icon);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, 0.75fr);
  gap: 22px;
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  min-height: 340px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  color: #f8f5ef;
  background:
    radial-gradient(circle at 80% 12%, rgba(255, 255, 255, 0.13), transparent 13rem),
    var(--green);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 42px 12px 38px 42px;
}

.hero-copy h1 {
  max-width: 520px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.hero-copy p {
  max-width: 440px;
  margin: 18px 0 28px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions .primary-button {
  color: var(--green);
  background: #f5f0e7;
}

.hero-actions .ghost-button {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.hero-wardrobe {
  position: relative;
  align-self: end;
  height: 300px;
  margin: 0 22px 0 0;
}

.wardrobe-arch {
  position: absolute;
  right: 4px;
  bottom: -24px;
  width: 210px;
  height: 292px;
  border-radius: 110px 110px 0 0;
  background: #d7c39d;
  box-shadow: inset -20px 0 0 rgba(0, 0, 0, 0.05);
}

.wardrobe-arch::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(36, 55, 45, 0.18);
  border-radius: 94px 94px 0 0;
}

.wardrobe-line {
  position: absolute;
  top: 104px;
  left: 38px;
  width: 130px;
  height: 2px;
  background: rgba(36, 55, 45, 0.58);
}

.hanger {
  position: absolute;
  top: 91px;
  width: 44px;
  height: 72px;
  border: 2px solid rgba(36, 55, 45, 0.65);
  border-top: 0;
  border-radius: 3px 3px 16px 16px;
  transform: skew(-2deg);
}

.hanger::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 18px;
  width: 9px;
  height: 17px;
  border: 2px solid rgba(36, 55, 45, 0.65);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}

.hanger.one { left: 54px; background: #f4efe4; }
.hanger.two { left: 101px; height: 88px; background: #a75f49; }
.hanger.three { left: 143px; height: 65px; background: #657b73; }

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

.stat-card {
  min-height: 162px;
  padding: 24px;
  border: 1px solid var(--stat-border);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  box-shadow: var(--soft-shadow);
}

.stat-card.wide {
  grid-column: 1 / -1;
  min-height: 148px;
}

.stat-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  display: block;
  margin: 17px 0 4px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 42px;
  font-weight: 500;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.section-block {
  margin-top: 40px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 27px;
  font-weight: 500;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.quick-card {
  min-height: 154px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: left;
  background: var(--surface-card-soft);
  cursor: pointer;
  transition: 150ms ease;
}

.quick-card:hover {
  transform: translateY(-3px);
  border-color: rgba(36, 55, 45, 0.22);
  box-shadow: var(--soft-shadow);
}

.quick-card .quick-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--sage);
  font-size: 20px;
}

.quick-card:nth-child(2) .quick-icon { background: var(--clay-soft); }
.quick-card:nth-child(3) .quick-icon { background: var(--quick-neutral); }
.quick-card:nth-child(4) .quick-icon { background: var(--quick-blue); }

.quick-card strong,
.quick-card small {
  display: block;
}

.quick-card strong {
  margin-top: 18px;
  font-size: 16px;
}

.quick-card small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 24px;
  padding: 14px 16px 14px 18px;
  border: 1px solid rgba(200, 111, 77, 0.16);
  border-radius: 17px;
  color: var(--clay-ink);
  background: var(--surface-clay-panel);
  font-size: 13px;
  line-height: 1.5;
}

.demo-banner button {
  flex: 0 0 auto;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.search-field {
  position: relative;
  display: flex;
  flex: 1 1 340px;
  align-items: center;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-control-strong);
}

.search-field span {
  color: var(--muted);
  font-size: 18px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-field button {
  display: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  cursor: pointer;
}

.search-field.has-value button {
  display: grid;
  place-items: center;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-control);
}

.segmented button {
  min-height: 40px;
  padding: 0 13px;
  border: 0;
  color: var(--muted);
  background: transparent;
}

.segmented button.is-active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 4px 14px rgba(50, 48, 40, 0.08);
}

.filter-row {
  display: flex;
  gap: 9px;
  margin-bottom: 24px;
  padding: 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar { display: none; }

.filter-row.occasion-filter,
.occasion-filter {
  margin-top: -4px;
  margin-bottom: 20px;
}

.chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  color: var(--label);
  background: var(--surface-control);
}

.chip.is-active {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

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

.item-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  background: var(--surface-card);
  box-shadow: 0 8px 26px rgba(50, 48, 40, 0.045);
  transition: 160ms ease;
}

.item-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--soft-shadow);
}

.item-card.is-archived {
  border-color: color-mix(in srgb, var(--archive-ink) 22%, transparent);
}

.item-card.is-deleted {
  border-color: color-mix(in srgb, var(--deleted-ink) 28%, transparent);
  background: color-mix(in srgb, var(--deleted-bg) 18%, var(--surface-card));
}

.item-card.is-deleted .item-photo img,
.item-card.is-deleted .garment-glyph {
  filter: grayscale(0.72);
  opacity: 0.56;
}

.item-card.is-deleted .favorite-button {
  display: none;
}

.item-card-main {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.item-photo {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background:
    linear-gradient(145deg, var(--photo-sheen-start), var(--photo-sheen-end)),
    var(--tone, #ddd5c7);
}

.item-photo::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--border-faint);
  border-radius: 16px;
  pointer-events: none;
}

.item-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.garment-glyph {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 68%;
  height: 68%;
  filter: drop-shadow(0 12px 14px rgba(36, 55, 45, 0.11));
}

.garment-glyph svg {
  width: 100%;
  height: 100%;
}

.favorite-button {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border-faint);
  border-radius: 50%;
  color: var(--label);
  background: var(--surface-favorite);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.favorite-button.is-active {
  color: #b85d47;
}

.item-card-copy {
  padding: 15px 16px 17px;
}

.item-card-copy strong,
.item-card-copy small {
  display: block;
}

.item-card-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.item-card-copy small {
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.item-list .item-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  min-height: 104px;
}

.item-list .item-card-main {
  display: contents;
}

.item-list .item-photo {
  grid-row: 1;
  aspect-ratio: auto;
  min-height: 104px;
}

.item-list .item-card-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-right: 62px;
}

.empty-card {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 330px;
  padding: 40px;
  border: 1px dashed var(--border-dashed);
  border-radius: var(--radius-xl);
  text-align: center;
  background: var(--surface-card-faint);
}

.empty-illustration {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 30px;
  color: var(--green-ink);
  background: var(--sage);
  font-family: Georgia, "Songti SC", serif;
  font-size: 34px;
}

.empty-card h2 {
  margin: 22px 0 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 26px;
  font-weight: 500;
}

.empty-card p {
  max-width: 390px;
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.65;
}

.outfit-overview {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.outfit-group-heading {
  flex: 1 1 auto;
}

.outfit-swipe-item {
  display: grid;
  gap: 4px;
  flex: 0 0 104px;
  width: 104px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  scroll-snap-align: start;
  cursor: pointer;
}
.outfit-swipe-collage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 104px;
  height: 94px;
  overflow: hidden;
  border: 1px solid var(--border-faint);
  border-radius: 11px;
  background: var(--photo-placeholder);
}
.outfit-swipe-collage .item-photo { width: 100%; height: 100%; aspect-ratio: auto; }
.outfit-swipe-collage .item-photo:only-child,
.outfit-swipe-collage .item-photo:nth-child(3):last-child,
.outfit-swipe-collage .outfit-group-placeholder { grid-column: 1 / -1; }
.outfit-swipe-collage .item-photo::after { display: none; }
.outfit-swipe-collage .garment-glyph { width: 75%; height: 75%; }
.outfit-group-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 36px; }
.outfit-swipe-name { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.outfit-group-empty { min-height: 88px; margin: 7px 15px 0; padding: 0 14px; border: 1px dashed var(--border-subtle); border-radius: 11px; color: var(--muted); background: var(--surface-rail); cursor: pointer; }

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

.outfit-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-card);
  box-shadow: 0 8px 26px rgba(50, 48, 40, 0.045);
}

.outfit-card > button {
  width: 100%;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.outfit-collage {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  height: 270px;
  overflow: hidden;
  background: var(--collage-placeholder);
}

.outfit-collage .item-photo {
  aspect-ratio: auto;
  border-radius: 0;
}

.outfit-collage .item-photo:only-child {
  grid-column: 1 / -1;
}

.outfit-collage .item-photo:nth-child(3):last-child {
  grid-column: 1 / -1;
}

.outfit-collage .item-photo::after { inset: 6px; border-radius: 8px; }
.outfit-collage .garment-glyph { width: 62%; height: 62%; }

.outfit-copy {
  padding: 18px;
}

.outfit-copy strong,
.outfit-copy span,
.outfit-copy small {
  display: block;
}

.outfit-copy strong { font-size: 17px; }
.outfit-copy span { margin-top: 7px; color: var(--clay); font-size: 12px; font-weight: 700; }
.outfit-copy small { margin-top: 7px; color: var(--muted); }

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

.idea-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-card);
  box-shadow: 0 8px 26px rgba(50, 48, 40, 0.045);
  transition: 160ms ease;
}

.idea-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--soft-shadow);
}

.idea-card > button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.idea-photo,
.idea-detail-photo {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, var(--idea-placeholder-a), var(--idea-placeholder-b));
}

.idea-photo {
  aspect-ratio: 4 / 3;
}

.idea-photo img,
.idea-detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.idea-placeholder {
  color: var(--green-ink);
}

.idea-placeholder b,
.idea-placeholder small {
  display: block;
  text-align: center;
}

.idea-placeholder b {
  font-family: Georgia, "Songti SC", serif;
  font-size: 44px;
  font-weight: 400;
}

.idea-placeholder small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.idea-copy {
  display: block;
  padding: 18px;
}

.idea-copy strong,
.idea-copy span,
.idea-copy small {
  display: block;
}

.idea-copy strong { font-size: 17px; }
.idea-copy span {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.idea-copy small { margin-top: 12px; color: var(--clay); }

.idea-detail-photo {
  min-height: 320px;
  max-height: min(520px, 58vh);
  border-radius: 22px;
}

.idea-detail-copy { margin-top: 22px; }
.section-head.compact { align-items: center; margin-top: 28px; }
.section-head.compact h2 { font-size: 20px; }
.compact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.65fr);
  gap: 22px;
}

.calendar-card,
.timeline-card,
.panel-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-card-soft);
  box-shadow: 0 8px 26px rgba(50, 48, 40, 0.04);
}

.calendar-card { padding: 24px; }

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.calendar-toolbar strong {
  font-family: Georgia, "Songti SC", serif;
  font-size: 23px;
  font-weight: 500;
}

.calendar-nav {
  display: flex;
  gap: 8px;
}

.calendar-nav button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
}

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

.calendar-week span {
  padding: 8px 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.calendar-day {
  position: relative;
  min-height: 78px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
  background: var(--surface-day);
  cursor: pointer;
}

.calendar-day:hover { border-color: rgba(36, 55, 45, 0.14); }
.calendar-day.is-outside { opacity: 0.3; }
.calendar-day.is-today { border-color: var(--clay); }
.calendar-day.has-log { background: var(--sage); }
.calendar-day.is-selected { color: white; background: var(--green); }

.calendar-day b {
  font-size: 13px;
  font-weight: 600;
}

.calendar-dots {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 3px;
}

.calendar-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clay);
}

.timeline-card {
  padding: 24px;
}

.timeline-card h2 {
  margin: 0 0 18px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 23px;
  font-weight: 500;
}

.wear-entry {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 13px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.wear-entry:first-of-type { border-top: 0; }

.wear-date {
  display: grid;
  place-items: center;
  align-self: start;
  width: 46px;
  height: 50px;
  border-radius: 14px;
  color: var(--green-ink);
  background: var(--sage);
}

.wear-date b,
.wear-date small { display: block; text-align: center; }
.wear-date b { font-size: 17px; }
.wear-date small { font-size: 9px; text-transform: uppercase; }

.wear-entry strong,
.wear-entry small { display: block; }
.wear-entry small { margin-top: 5px; color: var(--muted); line-height: 1.45; }

.settings-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
}

.panel-card {
  padding: 24px;
}

.panel-card h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
  font-weight: 500;
}

.panel-card > p {
  margin: 7px 0 20px;
  color: var(--muted);
  line-height: 1.6;
}

.overview-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.overview-cell {
  padding: 16px;
  border-radius: 16px;
  background: var(--paper);
}

.overview-cell strong,
.overview-cell small { display: block; }
.overview-cell strong { font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.overview-cell small { margin-top: 4px; color: var(--muted); }

.stat-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.progress-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.progress-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--progress-track);
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green-2);
}

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

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  background: var(--white);
  cursor: pointer;
}

.settings-row span,
.settings-row small { display: block; }
.settings-row small { margin-top: 4px; color: var(--muted); }
.settings-row b { color: var(--muted); font-weight: 500; }

.settings-row.is-disabled {
  cursor: default;
  background: var(--surface-disabled);
}

.settings-row.is-disabled b {
  flex: 0 0 auto;
  font-size: 11px;
}

.settings-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 24px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.settings-section-title:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.settings-section-title h3,
.settings-section-title strong {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 19px;
  font-weight: 500;
}

.settings-section-title p,
.settings-section-title small {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.compact-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-option {
  position: relative;
  flex: 0 0 auto;
}

.compact-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.compact-option > span,
button.compact-option {
  display: grid;
  place-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--label);
  background: var(--surface-control);
  cursor: pointer;
}

.compact-option input:checked + span,
button.compact-option.is-active,
button.compact-option[aria-pressed="true"] {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.compact-option input:focus-visible + span,
button.compact-option:focus-visible {
  outline: 3px solid rgba(200, 111, 77, 0.42);
  outline-offset: 2px;
}

.module-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
}

.module-toggle-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.module-toggle > span,
.module-toggle > div {
  min-width: 0;
}

.module-toggle strong,
.module-toggle small {
  display: block;
}

.module-toggle small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.module-toggle input[type="checkbox"] {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 28px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  appearance: none;
  background: var(--progress-track);
  cursor: pointer;
  transition: 160ms ease;
}

.module-toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper-2);
  box-shadow: 0 2px 7px rgba(24, 30, 26, 0.22);
  transition: transform 160ms ease, background 160ms ease;
}

.module-toggle input[type="checkbox"]:checked {
  border-color: var(--green-2);
  background: var(--green-2);
}

.module-toggle input[type="checkbox"]:checked::after {
  background: #fff;
  transform: translateX(18px);
}

.module-toggle input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(200, 111, 77, 0.42);
  outline-offset: 2px;
}

.module-toggle:has(input:disabled) {
  opacity: 0.56;
}

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

.measurement-grid .field input {
  min-height: 44px;
}

.measurement-input {
  position: relative;
  display: block;
}

.measurement-input input {
  padding-right: 42px;
}

.measurement-input small {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

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

.recycle-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: inherit;
  text-align: left;
  background: var(--white);
}

button.recycle-card {
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

button.recycle-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--soft-shadow);
}

.recycle-card.memory,
.recycle-card[data-status="archived"] {
  border-color: color-mix(in srgb, var(--archive-ink) 24%, transparent);
  background: color-mix(in srgb, var(--archive-bg) 38%, var(--white));
}

.recycle-card.deleted,
.recycle-card[data-status="deleted"] {
  border-color: color-mix(in srgb, var(--deleted-ink) 24%, transparent);
  background: color-mix(in srgb, var(--deleted-bg) 32%, var(--white));
}

.recycle-card strong,
.recycle-card small,
.recycle-card b {
  display: block;
}

.recycle-card strong {
  font-size: 16px;
}

.recycle-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.recycle-card b {
  align-self: end;
  font-family: Georgia, "Songti SC", serif;
  font-size: 30px;
  font-weight: 500;
}

.recycle-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.recycle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.recycle-item > span {
  min-width: 0;
}

.recycle-item strong,
.recycle-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recycle-item small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.privacy-panel {
  margin-top: 16px;
  padding: 18px;
  border-radius: 18px;
  color: var(--sage-ink);
  background: var(--surface-sage-panel);
  line-height: 1.65;
}

.privacy-panel strong { display: block; margin-bottom: 5px; color: var(--green-ink); }

.fab {
  position: fixed;
  z-index: 30;
  right: max(28px, calc((100vw - 248px - 1180px) / 2 + 24px));
  bottom: 28px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 21px;
  color: white;
  background: var(--clay);
  box-shadow: 0 18px 36px rgba(200, 111, 77, 0.28);
  cursor: pointer;
  transition: 140ms ease;
}

.fab:hover { transform: translateY(-2px) rotate(2deg); }
.fab span { font-size: 30px; font-weight: 300; line-height: 1; }
.fab[hidden] { display: none; }

.overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(27, 36, 31, 0.46);
  backdrop-filter: blur(8px);
  animation: overlayIn 160ms ease both;
}

.discard-layer {
  position: fixed;
  z-index: 420;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(27, 36, 31, 0.62);
  backdrop-filter: blur(5px);
}

.discard-sheet {
  width: min(430px, 100%);
  padding: 28px;
  border: 1px solid var(--sheet-border);
  border-radius: 24px;
  background: var(--paper-2);
  box-shadow: 0 34px 90px rgba(24, 30, 26, 0.32);
  animation: sheetIn 160ms ease both;
}

.discard-sheet h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 24px;
  font-weight: 500;
}

.discard-sheet p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.discard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

@keyframes overlayIn { from { opacity: 0; } }

.sheet {
  width: min(720px, 100%);
  max-height: min(880px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--sheet-border);
  border-radius: 28px;
  background: var(--paper-2);
  box-shadow: 0 34px 90px rgba(24, 30, 26, 0.25);
  animation: sheetIn 190ms ease both;
}

.sheet.sheet-wide { width: min(960px, 100%); }

@keyframes sheetIn {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
}

.sheet-head {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-sticky);
  backdrop-filter: blur(16px);
}

.sheet-head h2 { font-size: 27px; }
.sheet-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }

.sheet-body { padding: 24px 26px 30px; }

.sheet-actions {
  position: sticky;
  z-index: 4;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 26px calc(16px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface-sticky);
  backdrop-filter: blur(16px);
}

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

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

.field.full { grid-column: 1 / -1; }
.form-grid > .full { grid-column: 1 / -1; }

.field > span,
.fieldset legend {
  color: var(--label);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  color: var(--ink);
  background: var(--white);
}

.field textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.55;
}

.field-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.fieldset {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
}

.fieldset legend { margin-bottom: 10px; }

.option-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.option-pill {
  position: relative;
}

.option-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-pill span {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: var(--white);
  cursor: pointer;
}

.option-pill input:checked + span {
  color: white;
  border-color: var(--green);
  background: var(--green);
}

.option-pill input:focus-visible + span,
.color-option input:focus-visible + span,
.selectable-item input:focus-visible + label,
.photo-actions label:has(input:focus-visible) {
  outline: 3px solid rgba(200, 111, 77, 0.42);
  outline-offset: 3px;
}

.photo-picker {
  position: relative;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px dashed var(--border-dashed);
  border-radius: 20px;
  background: var(--surface-photo-picker);
}

.photo-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 16px;
  color: var(--muted);
  background: var(--photo-placeholder);
  text-align: center;
  font-size: 12px;
}

.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview span { display: block; font-size: 28px; }

.photo-picker-copy strong,
.photo-picker-copy small { display: block; }
.photo-picker-copy small { margin: 7px 0 12px; color: var(--muted); line-height: 1.5; }
.photo-picker input { position: absolute; opacity: 0; pointer-events: none; }

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-actions .secondary-button,
.photo-actions .ghost-button {
  min-height: 44px;
}

.create-menu {
  display: grid;
  gap: 8px;
}

.create-menu-row {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  color: var(--ink);
  background: var(--white);
  text-align: left;
  cursor: pointer;
}

.create-menu-row:hover { border-color: rgba(36, 55, 45, 0.28); background: var(--surface-control); }
.create-menu-row > span:nth-child(2) { min-width: 0; }
.create-menu-row strong, .create-menu-row small { display: block; }
.create-menu-row small { margin-top: 4px; color: var(--muted); line-height: 1.45; }
.create-menu-row b { color: var(--muted); font-size: 22px; }
.create-menu-row input { position: absolute; opacity: 0; pointer-events: none; }

.create-menu-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--green-ink);
  background: var(--sage);
  font-size: 22px;
}

.photo-picker-multiple { grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr); align-items: start; }
.photo-empty { display: grid; place-items: center; align-content: center; min-height: 170px; border-radius: 16px; color: var(--muted); background: var(--photo-placeholder); }
.photo-empty span { font-size: 30px; }
.photo-empty small { margin-top: 5px; }

.photo-draft-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.photo-draft {
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 5;
  overflow: visible;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--photo-placeholder);
}

.photo-draft.is-cover { border-color: var(--clay); }
.photo-draft > img { width: 100%; height: 100%; border-radius: 11px; object-fit: cover; }
.photo-draft-badge { position: absolute; top: 7px; left: 7px; padding: 4px 7px; border-radius: 999px; color: white; background: rgba(24, 30, 26, 0.74); font-size: 10px; font-weight: 800; }
.photo-edit-trigger { position: absolute; right: 7px; bottom: 39px; z-index: 2; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; color: #384bc7; background: rgba(243, 245, 255, 0.94); box-shadow: 0 5px 18px rgba(22, 28, 25, 0.22); cursor: pointer; font-size: 17px; font-weight: 800; }
.photo-edit-menu { position: absolute; right: 5px; bottom: 74px; z-index: 8; display: grid; min-width: 122px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: var(--shadow); }
.photo-edit-menu button,
.photo-edit-menu label { position: relative; display: block; min-height: 44px; padding: 11px 17px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: center; font: inherit; cursor: pointer; }
.photo-edit-menu > :last-child { border-bottom: 0; }
.photo-edit-menu input { position: absolute; opacity: 0; pointer-events: none; }
.photo-draft-actions { position: absolute; right: 5px; bottom: 5px; left: 5px; display: flex; gap: 4px; }
.photo-draft-actions button { min-height: 28px; padding: 0 7px; border: 0; border-radius: 8px; color: white; background: rgba(24, 30, 26, 0.76); font-size: 10px; cursor: pointer; }

.photo-editor-layer {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: grid;
  background: #000;
}

html.photo-editor-open,
html.photo-editor-open body { overflow: hidden; }

.photo-editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  color: #252827;
  background: #000;
}

.photo-editor-head {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: calc(70px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 18px 0;
  background: #fff;
}

.photo-editor-head h2 { margin: 0; font-size: 24px; }
.photo-editor-head > button { min-width: 48px; min-height: 44px; border: 0; border-radius: 22px; background: transparent; font-size: 30px; cursor: pointer; }
.photo-editor-head .photo-editor-save { min-width: 84px; padding: 0 20px; color: white; background: #384bc7; font-size: 17px; }
.photo-editor-head .photo-editor-save:disabled { opacity: 0.45; cursor: wait; }

.photo-editor-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.photo-editor-stage canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background-color: transparent;
  background-image: conic-gradient(#c6c6c6 25%, #f4f4f4 0 50%, #c6c6c6 0 75%, #f4f4f4 0);
  background-size: 28px 28px;
  touch-action: none;
}

.photo-editor-stage canvas:focus-visible {
  outline: 3px solid #9eabff;
  outline-offset: -3px;
}

.photo-crop-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.photo-editor-controls {
  position: relative;
  z-index: 3;
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
}

.photo-editor-replace-note {
  position: relative;
  z-index: 3;
  margin: 0;
  padding: 8px 18px;
  color: #5b3b05;
  background: #fff3cf;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.photo-editor-replace-note[hidden] { display: none !important; }
.photo-editor-replace-note:not([hidden]):has(+ .cutout-controls) {
  display: block;
  min-height: 56px;
  padding: 8px 158px 8px 18px;
  text-align: left;
}
.web-import-image-note { max-width: 78px; color: var(--muted); font-size: 12px; line-height: 1.35; text-align: center; }

.crop-ratio-row { display: flex; justify-content: center; gap: 4px; padding: 15px 10px; overflow-x: auto; }
.crop-ratio-row button { min-height: 40px; padding: 0 11px; border: 0; border-radius: 10px; color: #202423; background: transparent; font-size: 16px; white-space: nowrap; cursor: pointer; }
.crop-ratio-row button.is-active { color: #384bc7; background: #f1f3ff; }
.crop-transform-controls { max-height: min(330px, 45vh); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.crop-transform-sliders { display: grid; gap: 10px; padding: 2px 18px 4px; }
.photo-transform-slider { display: grid; grid-template-columns: 72px minmax(0, 1fr) 48px; gap: 10px; align-items: center; min-width: 0; color: #404442; }
.photo-transform-slider > span { font-size: 14px; font-weight: 700; white-space: nowrap; }
.photo-transform-slider input { width: 100%; min-width: 0; accent-color: #384bc7; }
.photo-transform-slider output { color: #384bc7; font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 800; text-align: right; }
.crop-gesture-tip { margin: 5px 18px 4px; text-align: center; }
.photo-tool-row { display: flex; justify-content: space-around; gap: 4px; padding: 11px 10px 14px; border-top: 1px solid #eceeed; }
.photo-tool-row button { display: grid; place-items: center; gap: 3px; min-width: 76px; min-height: 58px; padding: 4px 10px; border: 0; color: #303433; background: transparent; cursor: pointer; font-size: 14px; }
.photo-tool-row button span { font-size: 27px; line-height: 1; }
.photo-tool-row button.is-active { color: #384bc7; }
.photo-tool-row button:disabled { color: #9da3a0; }

.cutout-controls { min-height: 158px; }
.photo-history-row { position: absolute; right: 12px; top: -56px; display: flex; gap: 9px; }
.photo-history-row button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; color: #303433; background: rgba(255, 255, 255, 0.96); box-shadow: 0 5px 18px rgba(0, 0, 0, 0.22); cursor: pointer; font-size: 24px; }
.photo-history-row button:disabled { opacity: 0.4; }
.photo-editor-slider { display: flex; align-items: center; gap: 12px; padding: 0 20px 14px; color: #404442; }
.photo-editor-slider[hidden] { display: none !important; }
.photo-editor-slider span { min-width: 42px; font-weight: 700; }
.photo-editor-slider input { width: 100%; accent-color: #384bc7; }
.photo-editor-tip { margin: -4px 20px 13px; color: #6f7672; font-size: 12px; line-height: 1.45; }

.batch-create-head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 16px; }
.batch-create-head strong, .batch-create-head small { display: block; }
.batch-create-head small { max-width: 520px; color: var(--muted); line-height: 1.5; }
.batch-item-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.batch-item-card { position: relative; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-card); }
.batch-item-photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; margin-bottom: 10px; border-radius: 12px; background: var(--photo-placeholder); }
.batch-item-photo img { width: 100%; height: 100%; object-fit: cover; }
.batch-item-photo span { position: absolute; top: 7px; left: 7px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: white; background: rgba(24, 30, 26, 0.72); font-size: 11px; font-weight: 800; }
.batch-item-card .text-button { margin-top: 7px; }
.batch-common-fields { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }

.web-import-source { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: center; margin-bottom: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-control); }
.web-import-source span { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.web-import-source strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.web-import-preview { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 18px; align-items: center; margin-bottom: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-card); }
.web-import-visual { display: grid; place-items: center; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 13px; color: var(--green-ink); background: var(--sage); font-size: 30px; }
.web-import-visual img { width: 100%; height: 100%; object-fit: cover; }
.web-import-preview strong, .web-import-preview small { display: block; }
.web-import-preview small { margin-top: 6px; color: var(--clay); font-weight: 700; }
.web-import-preview p { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }

.detail-gallery { display: grid; gap: 10px; }
.detail-gallery-main { min-height: 430px; overflow: hidden; border-radius: 22px; background: var(--photo-placeholder); }
.detail-gallery-main img { width: 100%; height: 100%; min-height: 430px; object-fit: cover; }
.detail-gallery-thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.detail-gallery-thumbs button { padding: 0; aspect-ratio: 1; overflow: hidden; border: 2px solid transparent; border-radius: 10px; background: var(--photo-placeholder); cursor: pointer; }
.detail-gallery-thumbs button.is-active { border-color: var(--clay); }
.detail-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.idea-preview {
  aspect-ratio: 4 / 3;
}

.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-option {
  position: relative;
  width: 36px;
  height: 36px;
}

.color-option input { position: absolute; opacity: 0; }

.color-option span {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid var(--paper-2);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.color-option input:checked + span {
  box-shadow: 0 0 0 3px var(--clay);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;
}

.detail-layout.is-deleted .detail-photo {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--deleted-ink) 28%, transparent);
  border-radius: 22px;
  background: var(--deleted-bg);
}

.detail-layout.is-deleted .detail-photo img,
.detail-layout.is-deleted .detail-photo .garment-glyph {
  filter: grayscale(0.72);
  opacity: 0.56;
}

.detail-layout.is-deleted .detail-copy h2 {
  color: var(--deleted-ink);
}

.detail-photo .item-photo {
  min-height: 430px;
  border-radius: 22px;
}

.detail-copy h2 {
  padding-right: 48px;
  font-size: 34px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 22px;
}

.meta-pill {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--label);
  background: var(--sage);
  font-size: 12px;
}

.detail-facts {
  display: grid;
  gap: 0;
  margin: 0;
}

.detail-facts > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.detail-facts dt { color: var(--muted); }
.detail-facts dd { margin: 0; }

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

.detail-note {
  margin-top: 18px;
  padding: 15px;
  border-radius: 15px;
  color: var(--label);
  background: var(--paper);
  line-height: 1.6;
}

.selectable-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.selectable-item {
  position: relative;
}

.selectable-item input {
  position: absolute;
  opacity: 0;
}

.selectable-item label {
  display: block;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--white);
  cursor: pointer;
}

.selectable-item input:checked + label {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(200, 111, 77, 0.12);
}

.selectable-item .item-photo { aspect-ratio: 1 / 1.12; }
.selectable-item strong { display: block; padding: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }

.archived-selection {
  display: inline-block;
  margin-left: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.confirm-card {
  padding: 18px;
  border-radius: 18px;
  color: var(--danger-ink);
  background: var(--clay-soft);
  line-height: 1.65;
}

.location-list {
  display: grid;
  gap: 9px;
}

.location-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px 10px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.location-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.location-row small { color: var(--muted); }

.idea-overview,
.idea-list-view { width: 100%; max-width: 980px; margin: 0 auto; }
.idea-album-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.idea-album-card { min-height: 154px; padding: 16px; border-radius: 18px; background: var(--surface-card); }
.idea-album-heading { display: flex; align-items: baseline; gap: 7px; width: 100%; min-height: 35px; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.idea-album-heading strong { font-size: 19px; font-weight: 650; }
.idea-album-heading small { color: var(--muted); font-size: 14px; }
.idea-album-previews { display: flex; gap: 8px; margin-top: 10px; }
.idea-album-preview,
.idea-album-add { display: grid; place-items: center; flex: 0 0 88px; width: 88px; height: 88px; overflow: hidden; border: 0; border-radius: 10px; background: var(--photo-placeholder); cursor: pointer; }
.idea-album-preview img { width: 100%; height: 100%; object-fit: cover; }
.idea-album-preview span { color: var(--green-ink); font-size: 32px; }
.idea-album-add { color: var(--muted); font-size: 44px; font-weight: 300; }
.idea-list-head { display: flex; align-items: center; gap: 12px; min-height: 58px; margin-bottom: 14px; }
.idea-list-head > button { flex: 0 0 44px; width: 44px; height: 44px; border: 0; border-radius: 12px; color: var(--ink); background: transparent; font-size: 32px; cursor: pointer; }
.idea-list-head > div { flex: 1; min-width: 0; }
.idea-list-head h1 { margin: 0; font-size: 25px; }
.idea-list-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.idea-list-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-bottom: 16px; color: var(--ink); }
.idea-list-toolbar button { border: 0; color: var(--ink); background: transparent; cursor: pointer; }
.idea-sort-trigger { min-height: 44px; padding: 0 6px; font-size: 17px; font-weight: 650; }
.idea-list-tools { display: flex; align-items: center; gap: 3px; }
.idea-list-tools button { min-width: 44px; min-height: 44px; font-size: 23px; }
.idea-manual-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 12px 12px; }
.idea-manual-actions button { min-width: 44px; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface-control-strong); cursor: pointer; }
.idea-manual-actions button:disabled { opacity: 0.35; cursor: default; }
.overlay.idea-sort-overlay { align-items: start; justify-items: start; padding: clamp(150px, 20vh, 220px) 16px 16px; backdrop-filter: none; }
.idea-sort-popover.sheet { width: min(470px, 100%); max-height: none; padding: 18px; border-radius: 16px; background: #fff; }
.idea-sort-options { display: flex; flex-wrap: wrap; gap: 10px; }
.idea-sort-options button { min-height: 48px; padding: 0 16px; border: 0; border-radius: 12px; color: var(--ink); background: var(--surface-control-strong); cursor: pointer; }
.idea-sort-options button.is-active { color: #5367f4; background: #e9ecff; }
.idea-filter-overlay { align-items: end; padding: 0; backdrop-filter: none; }
.idea-filter-sheet.sheet { display: flex; flex-direction: column; width: min(720px, 100%); height: 87vh; max-height: 87vh; border-radius: 26px 26px 0 0; background: #fff; }
.idea-filter-body { flex: 1; overflow: auto; padding: 30px 24px; }
.idea-filter-body h2 { margin: 0 0 18px; font-size: 20px; }
.idea-filter-body h2:not(:first-child) { margin-top: 28px; }
.idea-filter-search { display: flex; align-items: center; min-height: 54px; padding: 0 15px; border-radius: 12px; background: var(--surface-control-strong); }
.idea-filter-search span { color: var(--muted); font-size: 26px; }
.idea-filter-search input { flex: 1; min-width: 0; padding: 10px; border: 0; outline: 0; color: var(--ink); background: transparent; font: inherit; }
.idea-filter-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.idea-filter-chips button { min-width: 90px; min-height: 46px; padding: 0 16px; border: 0; border-radius: 10px; color: var(--ink); background: var(--surface-control-strong); cursor: pointer; }
.idea-filter-chips button.is-active { color: #5367f4; background: #e9ecff; }
.idea-filter-actions { position: sticky; bottom: 0; display: flex; justify-content: space-around; gap: 20px; padding: 16px 24px calc(20px + var(--safe-bottom)); background: #fff; }
.idea-filter-actions button { min-width: 128px; min-height: 52px; border: 1px solid var(--ink); border-radius: 28px; color: var(--ink); background: transparent; font-size: 17px; cursor: pointer; }
.idea-filter-actions button:last-child { border-color: #5969ff; color: #fff; background: #5969ff; }
.idea-list-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: min(62vh, 520px); color: var(--muted); text-align: center; }
.idea-list-empty strong { color: var(--ink); font-size: 20px; font-weight: 500; }
.idea-album-actions { display: flex; align-items: center; gap: 6px; }
.idea-album-delete { display: grid; gap: 12px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--white); }
.idea-album-delete p { margin: 0; color: var(--muted); }
.idea-album-delete .field { margin: 0; }
.idea-album-delete .idea-album-actions { justify-content: flex-end; flex-wrap: wrap; }
.idea-album-ack { display: flex; align-items: center; gap: 9px; line-height: 1.4; }
.idea-album-ack input { width: 18px; height: 18px; }

@media (max-width: 500px) {
  .idea-album-grid { grid-template-columns: 1fr; }
}

.wardrobe-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  margin-bottom: 18px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--white);
  text-align: left;
  cursor: pointer;
}

.wardrobe-switcher span,
.wardrobe-select span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.wardrobe-switcher small,
.wardrobe-select small,
.wardrobe-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.wardrobe-switcher strong,
.wardrobe-select strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.wardrobe-switcher b,
.wardrobe-select b {
  flex: 0 0 auto;
  color: var(--green-2);
  font-size: 12px;
}

.wardrobe-list {
  display: grid;
  gap: 9px;
}

.wardrobe-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.wardrobe-select {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--white);
  text-align: left;
  cursor: pointer;
}

.wardrobe-select.is-active {
  border-color: var(--green-2);
  background: var(--surface-sage-panel);
}

.wardrobe-row > .text-button {
  min-width: 52px;
  min-height: 48px;
}

.wardrobe-note {
  margin: 12px 2px 0;
}

.option-tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}

.option-tabs .chip { flex: 0 0 auto; }

.option-defaults-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-sage-note);
  font-size: 13px;
}

.option-defaults-panel button { min-height: 44px; }

.option-manage-list { display: grid; gap: 8px; margin-top: 14px; }

.option-manage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.option-manage-name { display: flex; align-items: center; min-width: 0; gap: 9px; }
.option-manage-name > span { display: grid; min-width: 0; gap: 2px; }
.option-manage-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.option-manage-name small { color: var(--muted); font-size: 12px; }
.option-manage-swatch { flex: 0 0 24px; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; background: var(--swatch); }
.option-manage-actions { display: flex; align-items: center; gap: 1px; }
.option-manage-actions .text-button { min-height: 44px; padding: 0 5px; font-size: 12px; }

.option-manage-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.option-manage-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.option-manage-form-actions > button { min-height: 44px; }

.inline-form {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}

.inline-form input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.backup-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.backup-card {
  min-height: 130px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  text-align: left;
  background: var(--white);
  cursor: pointer;
}

.backup-card span { display: block; font-size: 23px; }
.backup-card strong { display: block; margin-top: 12px; }
.backup-card small { display: block; margin-top: 6px; color: var(--muted); line-height: 1.45; }

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(28px + var(--safe-bottom));
  max-width: min(440px, calc(100% - 32px));
  padding: 12px 17px;
  border-radius: 14px;
  color: white;
  background: rgba(36, 55, 45, 0.94);
  box-shadow: 0 18px 36px rgba(24, 30, 26, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript-card {
  position: fixed;
  z-index: 999;
  inset: 24px 24px auto;
  padding: 18px;
  border-radius: 16px;
  color: white;
  background: #8f4339;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #496354;
  background: var(--sage);
  font-size: 11px;
  font-weight: 700;
}

.badge.archived,
.badge.memory {
  color: var(--archive-ink);
  background: var(--archive-bg);
}

.badge.deleted {
  color: var(--deleted-ink);
  background: var(--deleted-bg);
}

.sync-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 13px 16px;
  border: 1px solid var(--warning-line);
  border-radius: 16px;
  color: var(--warning-ink);
  background: var(--warning-bg);
  line-height: 1.45;
}

.sync-banner span { flex: 1; font-size: 13px; }
.sync-banner button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(101, 80, 45, .22);
  border-radius: 11px;
  color: inherit;
  background: var(--surface-button-glass);
  font-weight: 700;
  cursor: pointer;
}

.server-account {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
}

.server-account .brand-mark { flex: 0 0 auto; }
.server-account > span:last-child { display: grid; gap: 3px; min-width: 0; }
.server-account small { color: var(--muted); line-height: 1.45; }
.danger-row strong { color: var(--deleted-ink); }

.fatal-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 520px;
  margin: 12vh auto 0;
  padding: 42px 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--paper-light);
  box-shadow: var(--shadow);
  text-align: center;
}

.fatal-card h1 { margin: 6px 0 0; }
.fatal-card p { max-width: 380px; margin: 0 0 8px; color: var(--muted); line-height: 1.7; }
.fatal-card a { display: inline-grid; place-items: center; text-decoration: none; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 214px minmax(0, 1fr); }
  .side-rail { padding-inline: 18px; }
  #app { width: min(100% - 42px, 1040px); }
  .hero-card { grid-template-columns: minmax(0, 1fr) 190px; }
  .wardrobe-arch { width: 174px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .idea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fab { right: 24px; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .side-rail { display: none; }
  .workspace { min-height: 100vh; }
  .mobile-head {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    padding: max(10px, env(safe-area-inset-top)) 16px 10px;
    border-bottom: 1px solid var(--border-faint);
    background: var(--surface-mobile-head);
    backdrop-filter: blur(18px);
  }
  .brand-mobile { width: auto; }
  .brand-mobile .brand-mark { width: 38px; height: 38px; border-radius: 13px; font-size: 20px; }
  .brand-mobile strong { font-size: 17px; }
  .brand-mobile small { font-size: 9px; }
  #app { width: auto; margin: 0; padding: 26px 16px calc(112px + var(--safe-bottom)); }
  .workspace.is-idea-overview .mobile-head,
  .workspace.is-idea-list .mobile-head,
  .workspace.is-idea-list .mobile-nav { display: none; }
  .workspace.is-idea-overview #app,
  .workspace.is-idea-list #app { padding-top: 16px; }
  .workspace.is-idea-list #app { padding-bottom: calc(80px + var(--safe-bottom)); }
  .workspace.is-idea-list .fab { bottom: calc(22px + var(--safe-bottom)); }
  .mobile-nav {
    position: fixed;
    z-index: 45;
    right: 12px;
    bottom: calc(10px + var(--safe-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 66px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 23px;
    background: rgba(36, 55, 45, 0.95);
    box-shadow: 0 18px 42px rgba(24, 30, 26, 0.25);
    backdrop-filter: blur(18px);
  }
  .mobile-nav.has-fab { padding-right: 74px; }
  .mobile-nav .nav-button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    min-height: 52px;
    padding: 0;
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 10px;
  }
  .mobile-nav .nav-button.is-active { color: white; background: rgba(255, 255, 255, 0.1); box-shadow: none; }
  .mobile-nav .nav-icon { width: auto; font-size: 17px; }
  .fab {
    z-index: 50;
    right: 24px;
    bottom: calc(17px + var(--safe-bottom));
    width: 52px;
    height: 52px;
    border-radius: 18px;
  }
  .page-head { align-items: flex-start; margin-bottom: 22px; }
  .page-head h1 { font-size: 34px; }
  .page-head p { margin-top: 7px; font-size: 13px; }
  .head-actions { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { min-height: 340px; grid-template-columns: minmax(0, 1fr) 150px; }
  .hero-copy { padding: 34px 0 32px 28px; }
  .hero-copy h1 { font-size: 43px; }
  .hero-copy p { margin: 16px 0 22px; font-size: 13px; }
  .hero-wardrobe { height: 300px; margin-right: 8px; }
  .wardrobe-arch { right: -10px; width: 158px; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .stat-card, .stat-card.wide { grid-column: auto; min-height: 120px; padding: 18px; }
  .stat-card strong { margin-top: 14px; font-size: 34px; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .outfit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .idea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-layout, .settings-grid { grid-template-columns: 1fr; }
  .measurement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-day { min-height: 70px; }
  .overlay { align-items: end; padding: 0; }
  .sheet, .sheet.sheet-wide {
    width: 100%;
    max-height: calc(100vh - 18px);
    border-radius: 28px 28px 0 0;
  }
  .sheet-head { padding: 20px 18px 15px; }
  .sheet-body { padding: 20px 18px 26px; }
  .sheet-actions { padding: 14px 18px calc(14px + var(--safe-bottom)); }
  .detail-layout { grid-template-columns: 0.8fr 1.2fr; gap: 20px; }
  .detail-photo .item-photo { min-height: 350px; }
}

@media (max-width: 600px) {
  .outfit-group-grid { grid-template-columns: 1fr; gap: 12px; }
  .outfit-group-card { min-height: 148px; }
  .option-manage-row { grid-template-columns: minmax(0, 1fr); }
  .option-manage-actions { justify-content: flex-end; }
  .sync-banner { align-items: flex-start; flex-wrap: wrap; }
  .sync-banner span { flex-basis: calc(100% - 90px); }
  .demo-banner { align-items: flex-start; }
  .demo-banner button { min-height: 40px; padding-inline: 12px; }
  .hero-card { display: block; min-height: 440px; }
  .hero-copy { padding: 30px 26px 0; }
  .hero-copy h1 { max-width: 310px; font-size: 40px; }
  .hero-wardrobe { position: absolute; right: 0; bottom: 0; width: 184px; height: 245px; }
  .wardrobe-arch { width: 178px; height: 248px; }
  .wardrobe-line { top: 96px; left: 34px; width: 112px; }
  .hanger { top: 84px; }
  .hanger.one { left: 43px; }
  .hanger.two { left: 88px; }
  .hanger.three { left: 127px; }
  .hero-stats { gap: 9px; }
  .stat-card, .stat-card.wide { min-height: 106px; padding: 15px 12px; }
  .stat-card strong { font-size: 29px; }
  .stat-card span { font-size: 10px; }
  .quick-grid { gap: 10px; }
  .quick-card { min-height: 144px; padding: 17px; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .search-field { flex-basis: 100%; }
  .segmented { margin-left: auto; }
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .item-card { border-radius: 18px; }
  .item-card-copy { padding: 12px 12px 14px; }
  .item-list .item-card { grid-template-columns: 88px minmax(0, 1fr); min-height: 88px; }
  .item-list .item-photo { min-height: 88px; }
  .outfit-grid { grid-template-columns: 1fr; }
  .idea-grid { grid-template-columns: 1fr; }
  .outfit-collage { height: 250px; }
  .calendar-card { padding: 14px 11px; }
  .calendar-week, .calendar-grid { gap: 3px; }
  .calendar-day { min-height: 58px; padding: 6px; border-radius: 11px; }
  .calendar-dots { right: 5px; bottom: 5px; }
  .timeline-card, .panel-card { padding: 19px; }
  .overview-row { gap: 7px; }
  .overview-cell { padding: 13px 9px; }
  .overview-cell strong { font-size: 26px; }
  .overview-cell small { font-size: 10px; }
  .settings-section-title { align-items: flex-start; }
  .recycle-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .field.full, .fieldset { grid-column: auto; }
  .photo-picker { grid-template-columns: 112px minmax(0, 1fr); gap: 13px; }
  .photo-picker-multiple { grid-template-columns: 1fr; }
  .photo-draft-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .batch-item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-create-head { display: block; }
  .batch-create-head small { margin-top: 6px; }
  .web-import-preview { grid-template-columns: 96px minmax(0, 1fr); gap: 13px; }
  .detail-gallery-main, .detail-gallery-main img { min-height: 0; aspect-ratio: 4 / 4.2; }
  .photo-actions { display: grid; }
  .compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .selectable-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-photo .item-photo { min-height: 0; aspect-ratio: 4 / 4.2; }
  .detail-copy h2 { font-size: 29px; }
  .detail-facts > div { grid-template-columns: 74px minmax(0, 1fr); }
  .backup-actions { grid-template-columns: 1fr; }
  .sheet-actions > button { flex: 1; }
  .discard-layer { align-items: end; padding: 14px; }
  .discard-sheet { width: 100%; padding: 24px 20px calc(20px + var(--safe-bottom)); border-radius: 24px; }
  .discard-actions > button { flex: 1; }
}

@media (max-width: 380px) {
  .mobile-nav { right: 8px; left: 8px; }
  .mobile-nav.has-fab { padding-right: 66px; }
  .fab { right: 17px; }
  .hero-card { min-height: 420px; }
  .hero-copy h1 { font-size: 36px; }
  .hero-actions .ghost-button { display: none; }
  .stat-card strong { font-size: 25px; }
  .quick-card { min-height: 136px; }
  .measurement-grid { grid-template-columns: 1fr; }
  .selectable-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-draft-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .batch-item-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile visual shell: keep the existing desktop and dark palettes, while the
   light phone experience uses a flatter neutral surface and a blue accent. */
@media (max-width: 900px) {
  :root {
    --ink: #202124;
    --muted: #7a7f87;
    --paper: #f4f5f7;
    --paper-2: #f4f5f7;
    --white: #ffffff;
    --line: #e5e7eb;
    --green: #3974f6;
    --green-2: #3974f6;
    --sage: #edf3ff;
    --clay: #3974f6;
    --clay-soft: #eaf1ff;
    --gold: #3974f6;
    --paper-light: #ffffff;
    --label: #4f545c;
    --green-ink: #2f65dd;
    --sage-ink: #3f609d;
    --clay-ink: #2f65dd;
    --border-subtle: #e7e9ed;
    --border-faint: #eceef1;
    --border-dashed: #d9dde3;
    --surface-card: #ffffff;
    --surface-card-soft: #ffffff;
    --surface-card-faint: #ffffff;
    --surface-control: #ffffff;
    --surface-control-strong: #ffffff;
    --surface-disabled: #f0f1f3;
    --surface-rail: #ffffff;
    --surface-sticky: rgba(255, 255, 255, 0.96);
    --surface-mobile-head: rgba(255, 255, 255, 0.97);
    --surface-day: #ffffff;
    --surface-photo-picker: #f7f8fa;
    --surface-hover: #f3f6fc;
    --surface-icon: transparent;
    --surface-favorite: rgba(255, 255, 255, 0.94);
    --surface-button-glass: #ffffff;
    --surface-sage-note: #edf3ff;
    --surface-sage-panel: #edf3ff;
    --surface-clay-panel: #eaf1ff;
    --sheet-border: transparent;
    --stat-border: #e7e9ed;
    --body-glow: transparent;
    --progress-track: #e8eaf0;
    --photo-placeholder: #eef0f3;
    --collage-placeholder: #eef0f3;
    --idea-placeholder-a: #eef0f3;
    --idea-placeholder-b: #e8edf7;
    --quick-neutral: #eef0f3;
    --quick-blue: #edf3ff;
    --shadow: 0 12px 34px rgba(27, 31, 38, 0.12);
    --soft-shadow: none;
    --radius-xl: 10px;
    --radius-lg: 10px;
    --radius-md: 10px;
  }

  html,
  body {
    background: var(--paper);
  }

  body {
    background-image: none;
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  }

  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  [tabindex]:focus-visible {
    outline-color: color-mix(in srgb, var(--clay) 48%, transparent);
  }

  .mobile-head {
    min-height: calc(44px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 8px 0 12px;
    border-bottom: 0;
    background: var(--surface-mobile-head);
    box-shadow: inset 0 -1px var(--line);
    backdrop-filter: blur(14px);
  }

  .brand-mobile {
    gap: 8px;
    min-height: 44px;
    padding: 0 4px;
  }

  .brand-mobile .brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    box-shadow: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
  }

  .brand-mobile strong {
    font-family: inherit;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: 0;
  }

  .brand-mobile small {
    display: none;
  }

  .mobile-head .round-button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-weight: 700;
  }

  #app {
    padding: 18px 12px calc(116px + var(--safe-bottom));
  }

  .page-head,
  .section-head {
    gap: 12px;
  }

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

  .page-head h1,
  .hero-copy h1,
  .sheet-head h2,
  .detail-copy h2,
  .panel-card h2,
  .empty-card h2,
  .settings-section-title h3,
  .settings-section-title strong,
  .discard-sheet h2 {
    font-family: inherit;
    font-weight: 650;
    letter-spacing: -0.02em;
  }

  .page-head h1 {
    font-size: 26px;
    line-height: 1.2;
  }

  .page-head p {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.5;
  }

  .eyebrow {
    gap: 0;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .eyebrow::before {
    display: none;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .danger-button,
  .round-button,
  .icon-button,
  .chip,
  .segmented button,
  .text-button {
    min-height: 44px;
    border-radius: 10px;
  }

  .primary-button,
  .primary-button.clay {
    background: var(--clay);
    box-shadow: none;
  }

  .secondary-button,
  .ghost-button {
    border-color: var(--line);
    background: var(--white);
  }

  .mobile-nav {
    right: 0;
    bottom: 0;
    left: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(49px + var(--safe-bottom));
    padding: 0 0 var(--safe-bottom);
    border: 0;
    border-radius: 0;
    background: var(--white);
    box-shadow: inset 0 1px var(--line), 0 -2px 12px rgba(28, 32, 39, 0.05);
    backdrop-filter: none;
  }

  .mobile-nav.has-fab {
    padding-right: 0;
  }

  .mobile-nav .nav-button {
    gap: 0;
    min-width: 0;
    min-height: 49px;
    padding: 3px 0 2px;
    border-radius: 0;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.15;
  }

  .mobile-nav .nav-button.is-active {
    color: var(--clay);
    background: transparent;
  }

  .mobile-nav .nav-icon {
    min-height: 25px;
    font-size: 17px;
    line-height: 25px;
  }

  .fab {
    right: 14px;
    bottom: calc(61px + var(--safe-bottom));
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--clay);
    box-shadow: 0 5px 14px color-mix(in srgb, var(--clay) 28%, transparent);
  }

  .fab span {
    font-size: 28px;
  }

  .toolbar {
    gap: 8px;
    margin-bottom: 14px;
  }

  .search-field {
    min-height: 44px;
    padding: 0 12px;
    border-color: transparent;
    border-radius: 10px;
    background: var(--white);
  }

  .search-field input {
    min-height: 44px;
    padding: 0 9px;
  }

  .search-field button {
    width: 44px;
    height: 44px;
    margin-right: -10px;
  }

  .segmented {
    gap: 0;
    padding: 2px;
    border-color: transparent;
    border-radius: 10px;
    background: var(--white);
  }

  .segmented button {
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
  }

  .segmented button.is-active {
    color: var(--clay);
    background: var(--sage);
    box-shadow: none;
  }

  .filter-row {
    gap: 7px;
    margin-right: -12px;
    margin-bottom: 16px;
    padding-right: 12px;
  }

  .chip {
    min-height: 44px;
    padding: 0 14px;
    border-color: transparent;
    background: var(--white);
  }

  .chip.is-active {
    color: #fff;
    border-color: var(--clay);
    background: var(--clay);
  }

  .item-card,
  .outfit-card,
  .idea-card,
  .panel-card,
  .timeline-card,
  .calendar-card,
  .stat-card,
  .quick-card,
  .batch-item-card,
  .web-import-preview,
  .backup-card,
  .recycle-card {
    border-color: transparent;
    border-radius: 10px;
    background: var(--white);
    box-shadow: none;
  }

  .item-card:hover,
  .outfit-card:hover,
  .idea-card:hover,
  button.recycle-card:hover {
    transform: none;
    box-shadow: none;
  }

  .item-photo::after {
    inset: 0;
    border: 0;
  }

  .item-card-copy {
    padding: 11px 11px 13px;
  }

  .item-card-copy small {
    margin-top: 4px;
  }

  .favorite-button {
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    border: 0;
    box-shadow: none;
  }

  .empty-card {
    min-height: 250px;
    padding: 28px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--white);
  }

  .empty-illustration {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 27px;
    font-weight: 650;
  }

  .empty-card h2 {
    margin: 16px 0 7px;
    font-size: 21px;
  }

  .empty-card p {
    margin-bottom: 18px;
    line-height: 1.55;
  }

  .settings-list,
  .module-toggle-list,
  .location-list,
  .create-menu {
    gap: 0;
    overflow: hidden;
    border-radius: 10px;
    background: var(--white);
  }

  .settings-row,
  .module-toggle,
  .location-row,
  .create-menu-row {
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
  }

  .settings-row:last-child,
  .module-toggle:last-child,
  .location-row:last-child,
  .create-menu-row:last-child {
    border-bottom: 0;
  }

  .settings-row {
    min-height: 58px;
    padding: 9px 12px;
  }

  .module-toggle {
    min-height: 56px;
    padding: 8px 12px;
  }

  .overview-cell,
  .detail-note,
  .privacy-panel,
  .confirm-card,
  .sync-banner,
  .server-account {
    border-radius: 10px;
  }

  .overview-cell {
    background: var(--paper);
  }

  .overview-cell strong,
  .recycle-card b {
    font-family: inherit;
    font-weight: 650;
  }

  .overlay {
    background: rgba(20, 24, 31, 0.42);
    backdrop-filter: none;
  }

  .sheet,
  .sheet.sheet-wide {
    max-height: calc(100vh - 10px);
    max-height: calc(100dvh - 10px);
    border: 0;
    border-radius: 16px 16px 0 0;
    background: var(--paper);
    box-shadow: 0 -8px 28px rgba(20, 24, 31, 0.16);
  }

  .sheet-head {
    min-height: 56px;
    padding: 9px 12px 9px 16px;
    border-bottom-color: var(--line);
    background: var(--surface-sticky);
    backdrop-filter: blur(14px);
  }

  .sheet-head h2 {
    font-size: 20px;
    line-height: 1.3;
  }

  .sheet-head p {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.35;
  }

  .sheet-head .icon-button {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 24px;
  }

  .sheet-body {
    padding: 14px 12px 20px;
  }

  .sheet-actions {
    gap: 8px;
    padding: 10px 12px calc(10px + var(--safe-bottom));
    border-top-color: var(--line);
    background: var(--surface-sticky);
    backdrop-filter: blur(14px);
  }

  .sheet-actions > button {
    min-height: 46px;
  }

  .form-grid {
    gap: 14px;
  }

  .field {
    gap: 6px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 44px;
    padding: 10px 12px;
    border-color: var(--line);
    border-radius: 10px;
  }

  .field textarea {
    min-height: 88px;
  }

  .option-grid,
  .compact-options {
    gap: 7px;
  }

  .option-pill span,
  .compact-option > span,
  button.compact-option {
    min-height: 44px;
    border-radius: 10px;
  }

  .photo-picker,
  .photo-preview,
  .photo-empty,
  .photo-draft,
  .photo-draft > img,
  .web-import-visual,
  .detail-gallery-main,
  .detail-gallery-thumbs button,
  .detail-photo .item-photo {
    border-radius: 10px;
  }

  .photo-picker {
    padding: 10px;
    border-style: solid;
    border-color: var(--line);
    background: var(--white);
  }

  .photo-edit-trigger {
    width: 44px;
    height: 44px;
    right: 6px;
    bottom: 56px;
    border-radius: 50%;
    color: var(--clay);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 3px 12px rgba(20, 24, 31, 0.16);
  }

  .photo-edit-menu {
    right: 4px;
    bottom: 105px;
    min-width: 132px;
    border-radius: 10px;
  }

  .create-menu-row {
    grid-template-columns: 40px minmax(0, 1fr) 20px;
    gap: 10px;
    min-height: 64px;
    padding: 8px 12px;
  }

  .photo-draft-actions button,
  .calendar-nav button,
  .sync-banner button,
  .demo-banner button {
    min-width: 44px;
    min-height: 44px;
  }

  .photo-draft-actions button {
    flex: 1 1 0;
    padding-inline: 4px;
  }

  .color-option {
    width: 44px;
    height: 44px;
  }

  .create-menu-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--clay);
    font-size: 19px;
  }

  .sheet:has(.create-menu) .sheet-body {
    padding-top: 10px;
  }

  .sheet:has(.create-menu) .sheet-actions {
    padding-top: 8px;
    border-top: 0;
    background: var(--paper);
  }

  .sheet:has(.create-menu) .sheet-actions .ghost-button {
    flex: 1;
    border: 0;
    background: var(--white);
  }

  .discard-layer {
    padding: 12px;
    background: rgba(20, 24, 31, 0.52);
    backdrop-filter: none;
  }

  .discard-sheet {
    padding: 22px 16px calc(16px + var(--safe-bottom));
    border: 0;
    border-radius: 16px;
    background: var(--white);
    box-shadow: 0 12px 34px rgba(20, 24, 31, 0.18);
  }

  .discard-actions > button {
    min-height: 46px;
  }

  .toast {
    bottom: calc(62px + var(--safe-bottom));
    border-radius: 10px;
    background: rgba(32, 33, 36, 0.94);
    box-shadow: 0 8px 24px rgba(20, 24, 31, 0.2);
  }
}

@media (max-width: 600px) {
  .item-grid {
    gap: 8px;
  }

  .item-card {
    border-radius: 10px;
  }

  .item-list {
    gap: 1px;
    overflow: hidden;
    border-radius: 10px;
    background: var(--line);
  }

  .item-list .item-card {
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 82px;
    border-radius: 0;
  }

  .item-list .item-photo {
    min-height: 82px;
  }

  .timeline-card,
  .panel-card,
  .calendar-card {
    padding: 16px 12px;
  }

  .photo-picker {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .photo-picker-multiple {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 380px) {
  .mobile-nav {
    right: 0;
    left: 0;
  }

  .mobile-nav.has-fab {
    padding-right: 0;
  }

  .fab {
    right: 12px;
  }
}

/* The editor is a dedicated full-screen mobile tool, so it uses the same
   compact header and flat blue toolbar independent of the app shell. */
@media (max-width: 900px) {
  .photo-editor-head {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    min-height: calc(52px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 8px 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .photo-editor-head h2 {
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -0.02em;
  }

  .photo-editor-head > button {
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    font-size: 26px;
  }

  .photo-editor-head .photo-editor-save {
    min-width: 68px;
    min-height: 44px;
    margin-right: 4px;
    padding: 0 14px;
    border-radius: 20px;
    background: #3974f6;
    font-size: 15px;
  }

  .photo-editor-controls {
    border-top: 1px solid #e5e7eb;
  }

  .crop-ratio-row {
    justify-content: flex-start;
    gap: 2px;
    padding: 6px 8px;
  }

  .crop-ratio-row button {
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 14px;
  }

  .crop-ratio-row button.is-active {
    color: #3974f6;
    background: #edf3ff;
  }

  .crop-transform-sliders {
    gap: 7px;
    padding: 3px 14px 5px;
  }

  .photo-transform-slider {
    grid-template-columns: 64px minmax(0, 1fr) 44px;
    min-height: 44px;
  }

  .photo-transform-slider input,
  .photo-editor-slider input {
    min-height: 44px;
    accent-color: #3974f6;
  }

  .photo-transform-slider output {
    color: #3974f6;
  }

  .photo-tool-row {
    gap: 0;
    padding: 4px 6px calc(5px + env(safe-area-inset-bottom));
    border-top-color: #e5e7eb;
  }

  .photo-tool-row button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 54px;
    padding: 4px 2px;
    border-radius: 10px;
    font-size: 12px;
  }

  .photo-tool-row button span {
    font-size: 23px;
  }

  .photo-tool-row button.is-active {
    color: #3974f6;
    background: #edf3ff;
  }

  .cutout-controls {
    min-height: 146px;
  }

  .photo-history-row {
    right: 8px;
    top: -52px;
    gap: 6px;
  }

  .photo-history-row button {
    width: 44px;
    height: 44px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
  }

  .photo-editor-slider {
    min-height: 50px;
    padding: 0 14px 6px;
  }

  .photo-editor-tip {
    margin: 0 14px 9px;
    line-height: 1.35;
  }

  .photo-editor-replace-note:not([hidden]):has(+ .cutout-controls) {
    min-height: 52px;
    padding: 6px 146px 6px 12px;
  }
}

.overlay.idea-albums-overlay { display: block; padding: 0; background: #f8f8f8; backdrop-filter: none; }
.sheet.idea-albums-sheet { display: flex; flex-direction: column; width: 100%; height: 100vh; height: 100dvh; max-height: none; overflow: hidden; border: 0; border-radius: 0; background: #f8f8f8; box-shadow: none; }
.idea-albums-head { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; min-height: 74px; padding: 12px 18px; background: #f8f8f8; }
.idea-albums-head > button:first-child { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; color: #25272a; background: transparent; font-size: 34px; cursor: pointer; }
.idea-albums-head h2 { flex: 1; margin: 0; color: #25272a; font-size: 24px; font-weight: 650; }
.idea-albums-save { min-width: 76px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 24px; color: #fff; background: #5969ff; font-size: 18px; cursor: pointer; }
.idea-albums-content { position: relative; flex: 1; overflow-y: auto; padding: 18px 20px calc(100px + var(--safe-bottom)); }
.idea-albums-rows { display: grid; gap: 12px; }
.idea-albums-row { position: relative; display: flex; align-items: center; min-height: 84px; padding: 12px 14px; border-radius: 14px; background: #fff; }
.idea-albums-row-main { flex: 1; display: flex; align-items: center; gap: 16px; min-width: 0; padding: 0; border: 0; color: #25272a; background: transparent; text-align: left; cursor: pointer; }
.idea-albums-row-main strong { overflow: hidden; font-size: 20px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.idea-albums-thumb { display: grid; place-items: center; flex: 0 0 52px; width: 52px; height: 52px; overflow: hidden; border-radius: 10px; color: #dadde0; background: #f2f3f4; font-size: 24px; }
.idea-albums-thumb img, .idea-album-cover img { width: 100%; height: 100%; object-fit: cover; }
.idea-albums-more { width: 44px; height: 44px; border: 0; border-radius: 10px; color: #555; background: #f2f3f4; font-size: 22px; cursor: pointer; }
.idea-albums-menu { position: absolute; z-index: 8; top: 74px; right: 4px; display: grid; width: 160px; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 12px 34px rgba(0,0,0,0.16); }
.idea-albums-menu button { min-height: 62px; padding: 0 20px; border: 0; border-bottom: 1px solid #eee; color: #25272a; background: transparent; text-align: left; font-size: 18px; cursor: pointer; }
.idea-albums-menu button:disabled { color: #aaa; cursor: default; }
.idea-albums-fab { position: fixed; right: 24px; bottom: calc(24px + var(--safe-bottom)); display: grid; place-items: center; width: 62px; height: 62px; border: 0; border-radius: 50%; color: #fff; background: #5969ff; box-shadow: 0 7px 16px rgba(0,0,0,0.17); font-size: 42px; cursor: pointer; }
.idea-album-form-top { display: flex; align-items: stretch; gap: 14px; }
.idea-album-cover { display: grid; place-items: center; flex: 0 0 78px; width: 78px; height: 78px; overflow: hidden; border: 1px dashed #d5d8db; border-radius: 12px; color: #c6c8cb; background: #fff; font-size: 40px; cursor: pointer; }
.idea-album-form-top input { flex: 1; min-width: 0; padding: 0 22px; border: 0; border-radius: 13px; color: #25272a; background: #fff; font: inherit; font-size: 20px; }
.idea-album-sync { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 28px 0; color: #aaa; font-size: 17px; }
.idea-album-sync input { width: 17px; height: 17px; accent-color: #ddd; }
.idea-album-remove-cover { display: block; min-height: 42px; margin: 0 auto; padding: 0 14px; border: 0; color: #b54f4f; background: transparent; cursor: pointer; }
.idea-cover-chooser { position: absolute; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; overflow: hidden; border-radius: 18px 18px 0 0; background: #fff; box-shadow: 0 -12px 50px rgba(0,0,0,0.16); text-align: center; }
.idea-cover-chooser h3 { margin: 0; padding: 20px 10px; font-size: 18px; }
.idea-cover-chooser button, .idea-cover-chooser label { display: grid; place-items: center; min-height: 62px; border: 0; border-top: 1px solid #eee; color: #25272a; background: #fff; font-size: 18px; cursor: pointer; }
.idea-cover-chooser label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.idea-cover-empty { display: grid; align-content: center; justify-items: center; gap: 12px; min-height: 65vh; color: #b4b4b4; font-size: 17px; }
.idea-cover-empty strong { color: #25272a; font-size: 22px; font-weight: 500; }
.idea-cover-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.idea-cover-grid button { overflow: hidden; padding: 0; border: 0; border-radius: 10px; background: #fff; text-align: left; cursor: pointer; }
.idea-cover-grid img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.idea-cover-grid span { display: block; overflow: hidden; padding: 6px; text-overflow: ellipsis; white-space: nowrap; }

.mobile-calendar-screen { display: none; }
.calendar-month-picker { padding: 4px 0 12px; }
.calendar-month-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.calendar-month-year strong { font-size: 20px; }
.calendar-month-year button { width: 46px; height: 46px; border: 0; background: transparent; font-size: 28px; cursor: pointer; }
.calendar-month-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.calendar-month-choices button { min-height: 51px; border: 0; border-radius: 12px; background: #f3f4f5; font-size: 17px; cursor: pointer; }
.calendar-month-choices button.is-active { color: #fff; background: #5969ff; }
.calendar-choice-list { display: grid; }
.calendar-choice-list button { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 0 8px; border: 0; border-top: 1px solid #eee; background: transparent; text-align: left; font-size: 18px; cursor: pointer; }
.calendar-choice-list button i { color: #5969ff; font-size: 23px; font-style: normal; }
.overlay.calendar-weather-overlay { display: block; padding: 0; background: transparent; backdrop-filter: none; }
.sheet.calendar-weather-popover { position: fixed; right: 8px; width: 120px; max-height: none; margin: 0; overflow: hidden; border: 0; border-radius: 6px; background: #fff; box-shadow: 0 14px 25px #0003; }
.calendar-weather-popover button { display: block; width: 100%; height: 52px; padding: 0; border: 0; border-bottom: 1px solid #ededed; color: #333; background: transparent; text-align: center; font: inherit; font-size: 17px; cursor: pointer; }
.calendar-weather-popover button:last-child { border-bottom: 0; }
.calendar-weather-popover button:focus-visible { outline: 3px solid #5969ff; outline-offset: -3px; }

@media (max-width: 900px) {
  .workspace.is-calendar { background: #f8f8f8; }
  .workspace.is-calendar .mobile-head,
  .workspace.is-calendar .page-head,
  .workspace.is-calendar .calendar-layout { display: none; }
  .workspace.is-calendar-timeline .mobile-nav,
  .workspace.is-calendar-timeline .fab,
  .workspace.is-calendar-settings .mobile-nav,
  .workspace.is-calendar-settings .fab { display: none; }
  .workspace.is-calendar #app { padding: 0 0 calc(114px + var(--safe-bottom)); }
  .mobile-calendar-screen { display: block; min-height: calc(100dvh - 116px); background: #f8f8f8; }
  .mobile-calendar-screen[data-calendar-view="month"] { display: flex; flex-direction: column; height: calc(100vh - 49px); min-height: calc(100vh - 49px); }
  .mobile-calendar-head { display: flex; align-items: center; justify-content: space-between; min-height: 54px; padding: 4px 16px; color: #262626; }
  .mobile-calendar-screen[data-calendar-view="month"] .mobile-calendar-head,
  .mobile-calendar-screen[data-calendar-view="month"] .mobile-calendar-week,
  .mobile-calendar-screen[data-calendar-view="month"] .mobile-calendar-grid { flex-shrink: 0; }
  .mobile-calendar-head strong { flex: 1; margin-left: 14px; font-size: 23px; font-weight: 600; }
  .mobile-calendar-head button { min-width: 44px; min-height: 44px; padding: 0 3px; border: 0; color: inherit; background: transparent; font-size: 30px; cursor: pointer; }
  .mobile-calendar-head .mobile-calendar-month-title { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0; text-align: left; font-size: 22px; font-weight: 650; white-space: nowrap; }
  .mobile-calendar-month-title i { width: 0; height: 0; border-right: 5px solid transparent; border-left: 5px solid transparent; border-top: 6px solid currentColor; }
  .mobile-calendar-head-actions { display: flex; align-items: center; gap: 0; }
  .mobile-calendar-head-actions button:first-child { font-size: 32px; }
  .mobile-calendar-head-actions svg { display: block; width: 26px; height: 26px; margin: auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
  .mobile-calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); height: 27px; align-items: center; color: #999; text-align: center; font-size: 14px; }
  .mobile-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(var(--calendar-rows), 68px); gap: 2px; background: #f4f4f4; }
  .mobile-calendar-grid.is-compact { grid-template-rows: repeat(var(--calendar-rows), 41px); gap: 0; background: #f8f8f8; }
  .mobile-calendar-day { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; overflow: hidden; padding: 5px 4px; border: 0; color: #333; background: #fff; text-align: left; font: inherit; font-size: 15px; cursor: pointer; }
  .mobile-calendar-grid.is-compact .mobile-calendar-day { align-items: center; justify-content: center; padding: 0; background: #f8f8f8; font-size: 15px; }
  .mobile-calendar-grid.is-compact .mobile-calendar-day.is-today span { min-width: 35px; height: 35px; margin: 0; }
  .mobile-calendar-day.is-outside { color: #c4c4c4; }
  .mobile-calendar-day.is-today span { display: grid; place-items: center; min-width: 23px; height: 23px; margin: -3px 0 0 -3px; border-radius: 50%; color: #fff; background: #5969ff; }
  .mobile-calendar-day.is-selected:not(.is-today) span { color: #5969ff; font-weight: 700; }
  .mobile-calendar-day i { position: absolute; right: 7px; bottom: 7px; width: 5px; height: 5px; border-radius: 50%; background: #5969ff; }
  .mobile-calendar-cover { display: block; flex: 0 0 30px; width: 30px; height: 30px; margin-top: 2px; border-radius: 4px; object-fit: cover; }
  .mobile-calendar-selected { flex: 1; min-height: 270px; padding: 16px; background: #fff; }
  .mobile-calendar-selected-head { display: flex; align-items: center; justify-content: space-between; }
  .mobile-calendar-selected h2 { margin: 0; color: #333; font-size: 20px; font-weight: 400; }
  .mobile-calendar-selected-head button { display: grid; place-items: center; width: 26px; height: 26px; padding: 2px; border: 0; border-radius: 5px; color: #9a9a9a; background: #f1f1f1; cursor: pointer; }
  .mobile-calendar-selected-head svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
  .mobile-calendar-day-empty { display: grid; justify-items: center; align-content: center; gap: 17px; min-height: 140px; }
  .mobile-calendar-day-empty strong { color: #333; font-size: 21px; font-weight: 400; }
  .mobile-calendar-day-empty span { color: #bdbdbd; font-size: 17px; }
  .mobile-calendar-timeline { padding: 16px; }
  .mobile-calendar-timeline section { margin-bottom: 12px; padding: 14px 16px; border-radius: 14px; background: #fff; }
  .mobile-calendar-timeline h2 { margin: 0 0 7px; font-size: 19px; font-weight: 500; }
  .mobile-calendar-timeline-empty { position: fixed; top: 50%; right: 0; left: 0; display: grid; justify-items: center; gap: 16px; transform: translateY(-50%); text-align: center; }
  .mobile-calendar-timeline-empty strong { color: #333; font-size: 20px; font-weight: 400; }
  .mobile-calendar-timeline-empty span { color: #bdbdbd; font-size: 16px; }
  .mobile-calendar-settings { min-height: 100vh; min-height: 100dvh; background: #f8f8f8; }
  .calendar-settings-body { display: grid; gap: 14px; padding: 12px 16px 56px; }
  .calendar-settings-card { overflow: hidden; border-radius: 14px; background: #fff; }
  .calendar-settings-row { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 60px; padding: 13px 17px; border: 0; border-bottom: 1px solid #f4f4f4; color: #303030; background: transparent; text-align: left; font: inherit; cursor: pointer; }
  .calendar-settings-row:last-child { border-bottom: 0; }
  .calendar-settings-row span { display: grid; gap: 6px; }
  .calendar-settings-row strong { font-size: 18px; font-weight: 400; }
  .calendar-settings-row small { color: #999; font-size: 13px; }
  .calendar-settings-row em { color: #707070; font-size: 17px; font-style: normal; white-space: nowrap; }
  .calendar-settings-switch { position: relative; flex: 0 0 37px; width: 37px; height: 23px; border-radius: 20px; background: #d9dce5; }
  .calendar-settings-switch::after { position: absolute; top: 1px; left: 1px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px #0002; content: ""; }
  .calendar-settings-switch.is-on { background: #aeb5ff; }
  .calendar-settings-switch.is-on::after { left: 15px; background: #5969ff; }
  .calendar-settings-order-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 5px 0; font-size: 16px; }
  .calendar-settings-order-head button { padding: 6px; border: 0; color: #555; background: transparent; font-size: 15px; cursor: pointer; }
  .calendar-settings-order-row { display: flex; align-items: center; justify-content: space-between; min-height: 58px; padding: 0 18px; border-bottom: 1px solid #f4f4f4; }
  .calendar-settings-order-row:last-child { border-bottom: 0; }
  .calendar-settings-order-row strong { font-size: 18px; font-weight: 400; }
  .calendar-settings-order-row span { display: flex; gap: 4px; }
  .calendar-settings-order-row button { width: 37px; height: 37px; border: 0; border-radius: 10px; color: #5969ff; background: #f4f5ff; font-size: 19px; cursor: pointer; }
  .calendar-settings-order-row button:disabled { color: #c4c4c4; background: #f6f6f6; }
}

.overlay.diary-overlay { display: block; padding: 0; background: #fff; backdrop-filter: none; }
.weather-entry { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 9px 0; border: 0; color: #333; background: transparent; text-align: left; font: inherit; }
.weather-entry-icon { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; border-radius: 6px; color: #5969ff; background: #f1f3ff; font-size: 27px; }
.weather-entry > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.weather-entry strong { font-size: 16px; font-weight: 500; }
.weather-entry small { overflow: hidden; color: #888; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.weather-entry b { margin-left: auto; color: #aaa; font-size: 21px; font-weight: 400; }
.overlay.weather-overlay { display: block; padding: 0; background: #f8f8f8; backdrop-filter: none; }
.weather-sheet.sheet { width: min(100%, 620px); height: 100%; max-height: 100%; margin: 0 auto; border-radius: 0; background: #f8f8f8; overflow-y: auto; }
.weather-sheet form { min-height: 100%; }
.weather-head { display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 4px 16px; }
.weather-head strong { flex: 1; font-size: 21px; font-weight: 500; }
.weather-head button { min-width: 44px; min-height: 44px; border: 0; color: #303030; background: transparent; font: inherit; font-size: 27px; }
.weather-head button[type="submit"] { min-width: 64px; min-height: 40px; padding: 0 14px; border-radius: 24px; color: #fff; background: #5969ff; font-size: 17px; }
.weather-editor { padding: 4px 16px 40px; }
.weather-fields { overflow: hidden; border-radius: 14px; background: #fff; }
.weather-field { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; }
.weather-field strong { flex: 0 0 88px; font-size: 18px; font-weight: 500; }
.weather-field input, .weather-field select { flex: 1; min-width: 0; max-width: 100%; border: 0; outline: 0; color: #333; background: transparent; font: inherit; font-size: 17px; text-align: right; }
.weather-field input::placeholder { color: #bfc0c4; }
.weather-date > button { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex: 1; min-height: 52px; padding: 0; border: 0; background: transparent; color: #333; font: inherit; font-size: 17px; cursor: pointer; }
.weather-date > button b { color: #aaa; font-size: 25px; font-weight: 400; }
.weather-date-layer { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center; background: #0008; }
.weather-date-sheet { width: min(100%, 620px); min-height: 256px; padding: 4px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: #fff; outline: 0; }
.weather-date-sheet header { display: flex; align-items: center; justify-content: space-between; min-height: 45px; }
.weather-date-sheet header strong { font-size: 20px; font-weight: 500; }
.weather-date-sheet header button { border: 0; color: #5969ff; background: transparent; font: inherit; font-size: 19px; cursor: pointer; }
.weather-date-wheels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 32px 50px 0; }
.weather-date-wheel-wrap { position: relative; height: 144px; }
.weather-date-wheel-wrap::before, .weather-date-wheel-wrap::after { position: absolute; right: 0; left: 0; z-index: 1; height: 2px; background: #555; content: ''; pointer-events: none; }
.weather-date-wheel-wrap::before { top: 47px; }
.weather-date-wheel-wrap::after { top: 95px; }
.weather-date-wheel { height: 144px; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.weather-date-wheel::-webkit-scrollbar { display: none; }
.weather-date-wheel-spacer { height: 48px; scroll-snap-align: center; }
.weather-date-wheel button { display: block; width: 100%; height: 48px; padding: 0; border: 0; color: #b9b9b9; background: transparent; font: inherit; font-size: 17px; text-align: center; scroll-snap-align: center; }
.weather-date-wheel button.is-selected { color: #333; }
.weather-date-cancel { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.weather-condition > button { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex: 1; min-height: 52px; padding: 0; border: 0; background: transparent; color: #333; font: inherit; font-size: 17px; cursor: pointer; }
.weather-condition > button b { color: #aaa; font-size: 25px; font-weight: 400; }
.weather-condition > button span { display: inline-flex; align-items: center; gap: 8px; }
.weather-condition > button em { color: #bfc0c4; font-style: normal; }
.weather-condition i, .weather-condition-options i { display: inline-grid; place-items: center; flex: 0 0 20px; width: 20px; height: 24px; color: #444; font-style: normal; }
.weather-condition i svg, .weather-condition-options i svg { display: block; width: 20px; height: 20px; }
.weather-condition-layer { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center; background: #0008; }
.weather-condition-sheet { width: min(100%, 620px); min-height: 364px; padding: 8px 16px 0; border-radius: 10px 10px 0 0; background: #fff; outline: 0; }
.weather-condition-sheet header { display: flex; align-items: center; min-height: 44px; }
.weather-condition-sheet header strong { font-size: 18px; font-weight: 500; }
.weather-condition-options { display: grid; margin-top: 4px; }
.weather-condition-options button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0; border: 0; color: #333; background: transparent; text-align: left; font: inherit; font-size: 16px; cursor: pointer; }
.weather-condition-options button:focus-visible { outline: 3px solid #5969ff; outline-offset: -3px; }
.weather-temperature > button { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex: 1; min-height: 52px; padding: 0; border: 0; background: transparent; color: #333; font: inherit; font-size: 17px; cursor: pointer; }
.weather-temperature > button b { color: #aaa; font-size: 25px; font-weight: 400; }
.weather-picker-layer { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center; background: #0008; }
.weather-picker-sheet { width: min(100%, 620px); min-height: 220px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: #fff; outline: 0; }
.weather-picker-sheet header { display: flex; align-items: center; justify-content: space-between; min-height: 45px; }
.weather-picker-sheet header strong { font-size: 20px; font-weight: 500; }
.weather-picker-sheet header button { border: 0; color: #5969ff; background: transparent; font: inherit; font-size: 19px; cursor: pointer; }
.weather-picker-value { display: grid; place-items: center; min-height: 74px; color: #333; font-size: 19px; }
.weather-picker-scale { display: flex; align-items: center; gap: 12px; padding: 2px 5px 5px; }
.weather-picker-scale > span { color: #999; font-size: 18px; filter: grayscale(1); }
.weather-picker-track { position: relative; flex: 1; height: 32px; touch-action: none; }
.weather-picker-track::before, .weather-picker-track::after { position: absolute; top: 13px; height: 6px; border-radius: 4px; content: ''; }
.weather-picker-track::before { right: 0; left: 0; background: #e6e6e6; }
.weather-picker-track::after { left: var(--weather-low); width: calc(var(--weather-high) - var(--weather-low)); background: #5969ff; }
.weather-picker-track:not(.is-selected)::after { display: none; }
.weather-picker-track button { position: absolute; top: 4px; z-index: 1; width: 24px; height: 24px; padding: 0; transform: translateX(-50%); border: 1px solid #ddd; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0002; cursor: grab; touch-action: none; }
.weather-picker-track button:focus-visible { outline: 3px solid #5969ff; outline-offset: 2px; }
.weather-picker-cancel { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.weather-offline-note { width: fit-content; margin: 22px auto 0; padding: 8px 12px; border-radius: 8px; color: #777; background: #eceef0; text-align: center; font-size: 16px; }
.weather-offline-note small { display: block; margin-top: 3px; font-size: 12px; }
.weather-delete { display: block; margin: 36px auto 0; border: 0; color: #c44; background: transparent; font: inherit; font-size: 15px; }
.tag-row-main{display:flex;flex:1;min-width:0;align-items:center;justify-content:space-between;gap:12px;border:0;background:none;color:inherit;text-align:left;font:inherit;cursor:pointer}
.tag-row-main small{color:var(--muted);white-space:nowrap}
.grouped-tag-choices{display:grid;gap:10px}
.grouped-tag-choices .fieldset{margin:0}
