/* Base layout, components, responsive rules, and compact UI refinements. */
:root {
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans", sans-serif;
}
button, select, input, textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.topbar {
  top: 0;
  z-index: 5;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  flex: 1;
  margin: 0;
  font-size: 17px;
  text-align: center;
}
.icon-btn {
  font-size: 20px;
}
.owner-switch {
  display: flex;
  border-radius: 99px;
}
.owner-switch button {
  border: 0;
  background: none;
  border-radius: 99px;
}
.owner-switch button.on {
  font-weight: 600;
}
.tab {
  display: none;
}
.tab.active {
  display: block;
}
.tabbar {
  position: fixed;
  display: flex;
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
  z-index: 5;
}
.tabbar button {
  border: 0;
  background: none;
  color: var(--muted);
  display: flex;
}
.card {
  background: var(--card);
}
.weather {
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: center;
}
.weather .big {
  font-size: 42px;
  line-height: 1;
  grid-row: span 3;
}
.weather .temps {
  font-size: 22px;
  font-weight: 600;
}
.weather .chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.chip {
  display: inline-block;
  white-space: nowrap;
}
.chip.good {
  color: var(--good);
}
.chip.warn {
  color: var(--warn);
}
.chip.bad {
  background: #f6e0da;
  color: var(--bad);
}
.chip.sel {
  background: var(--accent);
  color: #fff;
}
.controls {
  align-items: center;
  flex-wrap: wrap;
}
.controls select {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13px;
}
.req-bar {
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.req-bar input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--card);
}
.toggle {
  display: flex;
  align-items: center;
  color: var(--muted);
}
.primary {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.ghost {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 7px 12px;
  border-radius: 10px;
}
.danger {
  border: 1px solid #ecc6be;
  background: #fdf3f1;
  color: var(--bad);
  padding: 7px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
}
.danger-solid {
  border: 0;
  background: var(--bad);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
}
.outfit-items {
  display: grid;
}
.oitem {
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.oitem img, .gitem img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #faf8f5;
  display: block;
}
.oitem .meta {
  flex: 1;
}
.oitem .slot {
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.oitem .name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.oitem .owner-tag {
  position: absolute;
}
.oitem .oacts {
  display: flex;
  border-top: 1px solid var(--line);
}
.oitem .oacts button {
  flex: 1;
  border: 0;
  background: none;
  color: var(--ink);
}
.oitem .oacts button + button {
  border-left: 1px solid var(--line);
}
.reason {
  white-space: pre-wrap;
}
.feedback-box {
  border: 1px solid var(--line);
}
.feedback-box textarea, .reason-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  background: var(--card);
  resize: vertical;
}
.quick-chips {
  display: flex;
  flex-wrap: wrap;
}
.quick-chips .chip {
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
}
.quick-chips .chip.sel {
  background: var(--accent);
  color: #fff;
}
.filters {
  display: flex;
  flex-wrap: wrap;
}
.filters input {
  flex: 1;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.filters select {
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
}
.closet-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.grid {
  display: grid;
}
.gitem {
  background: var(--card);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.gitem.picked {
  border-color: var(--accent);
}
.gitem .img-box {
  position: relative;
}
.gitem .cap {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gitem .badge {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  background: #000a;
  color: #fff;
}
.gitem .gcheck {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
}
.gitem.picked .gcheck {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.gitem .opill {
  position: absolute;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 99px;
  box-shadow: 0 1px 2px #0003;
}
.gitem .opill.jie {
  background: #c85a65;
}
.gitem .opill.bao {
  background: #487896;
}
.gitem .opill.shared {
  background: #4f8a5b;
}
.gitem .opill.unk {
  background: #8a837bc0;
}
.gitem .sub-badge {
  position: absolute;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  background: #0008;
  color: #fff;
}
.gitem .avail-badge {
  position: absolute;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
}
.drow {
  display: flex;
  background: var(--card);
  align-items: flex-start;
}
.drow img {
  object-fit: contain;
  flex: none;
}
.drow .body {
  flex: 1;
  min-width: 0;
}
.drow .score {
  font-weight: 700;
  font-size: 18px;
  text-align: center;
  flex: none;
}
.drow .acts {
  display: flex;
  flex-wrap: wrap;
}
.drow .acts button {
  font-size: 12px;
  padding: 4px 9px;
}
dialog {
  padding: 0;
  background: var(--bg);
}
#modalBody {
  overflow: auto;
}
.form {
  display: grid;
  align-items: center;
}
.form label {
  color: var(--muted);
}
.form input, .form select {
  width: 100%;
  padding: 7px 9px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
}
.hero {
  width: 100%;
  object-fit: contain;
}
.bar {
  border-radius: 99px;
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--accent-2);
}
.stat-row {
  display: grid;
  align-items: center;
}
.scope-radios {
  display: flex;
  gap: 8px;
  margin: 8px 0;
  flex-wrap: wrap;
  font-size: 12px;
}
.scope-radios label {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #faf8f5;
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
}
#toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
  z-index: 20;
}
#toast.show {
  opacity: 1;
}
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #fff6;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: -2px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
:root {
  --bg: #f7f8f4;
  --card: #fff;
  --ink: #253b32;
  --muted: #737e76;
  --line: #dfe5dc;
  --accent: #294d3e;
  --accent-2: #a7b895;
  --good: #3c7157;
  --warn: #93682c;
  --bad: #a24c40;
  --r: 18px;
}
body {
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
svg {
  width: 22px;
  height: 22px;
  flex: none;
}
a {
  color: inherit;
}
button {
  touch-action: manipulation;
}
button:disabled {
  cursor: wait;
}
:focus-visible {
  outline: 3px solid #83a991;
  outline-offset: 4px;
}
input, select, textarea {
  min-width: 0;
  max-width: 100%;
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  padding: 10px 18px;
  background: var(--accent);
  color: white;
  z-index: 100;
}
.skip-link:focus {
  top: 10px;
}
.topbar {
  position: relative;
  height: 94px;
  padding: 0;
  display: flex;
  justify-content: space-between;
  margin: 0 48px;
  background: transparent;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: .04em;
}
.brand-mark {
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  width: 42px;
  height: 45px;
  border-radius: 13px 13px 5px 13px;
}
.brand-mark svg {
  width: 28px;
  height: 28px;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: .19em;
  font-weight: 500;
  margin-top: 1px;
  color: var(--muted);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.owner-switch {
  padding: 4px;
  border: 1px solid var(--line);
  background: #eef1e9;
}
.owner-switch button {
  width: 52px;
  min-height: 35px;
  padding: 4px 8px;
  color: var(--muted);
}
.owner-switch button.on {
  background: var(--accent);
  color: white;
  box-shadow: none;
}
.icon-btn {
  border: 1px solid var(--line);
  background: transparent;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.tabbar {
  left: 48px;
  right: auto;
  bottom: 34px;
  width: 190px;
  flex-direction: column;
  gap: 9px;
  background: transparent;
  backdrop-filter: none;
  border: 0;
  padding: 0;
}
.tabbar button {
  flex: 0;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  text-align: left;
}
.tabbar button span {
  flex: 1;
  font-size: 14px;
}
.tabbar button i {
  font: 10px Georgia,serif;
  opacity: .65;
}
.tabbar button.active {
  color: var(--accent);
  background: #e8edde;
  font-weight: 600;
}
.status-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8eaa75;
  margin-right: 4px;
}
main {
  margin: 0 0 0 278px;
  max-width: 1320px;
  padding: 44px 48px 22px 0;
}
.eyebrow {
  color: var(--muted);
  font-size: 9px;
  font-weight: 550;
  letter-spacing: .2em;
  margin: 0 0 10px;
}
h1 {
  font-family: "Songti SC","STSong",Georgia,serif;
  font-size: clamp(28px,2.5vw,38px);
  font-weight: 500;
  letter-spacing: .04em;
  line-height: 1.35;
  margin: 0;
}
.today-layout {
  display: grid;
  grid-template-columns: 300px minmax(0,1fr);
  gap: 28px;
  align-items: start;
}
.day-planner {
  min-width: 0;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: none;
}
.card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}
.weather {
  display: block;
  background: #eaf0df;
  border-color: #e1e8d6;
  padding: 24px 22px 16px;
  overflow: hidden;
}
.weather-location {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: .04em;
}
.weather-location span:first-child::before {
  content: '◦';
  margin-right: 5px;
}
.weather-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 27px;
  gap: 8px;
}
.weather-caption {
  font-size: 10px;
  color: #6b7b5c;
  margin: 0 0 5px;
}
.weather .temps {
  font: 46px/1.1 Georgia,serif;
  letter-spacing: -.08em;
  white-space: nowrap;
}
.temps > span {
  font: 25px Georgia,serif;
  margin: 0 6px;
  opacity: .5;
}
.temps sup {
  font-size: 27px;
  top: -.3em;
  position: relative;
  margin-left: 3px;
}
.weather-symbol {
  font-size: 42px;
  line-height: 1;
}
.weather-description {
  font-size: 12px;
  margin: 17px 0 22px;
}
.weather-description span {
  display: block;
  color: #6b7b5c;
  font-size: 10px;
  margin-top: 3px;
}
.weather-metrics {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  border-top: 1px solid #cfdbc1;
  padding-top: 14px;
  gap: 8px;
}
.weather-metrics div > span {
  display: block;
  font-size: 9px;
  color: #6b7b5c;
}
.weather-metrics strong {
  font-size: 18px;
  font-weight: 500;
}
.weather-metrics small {
  font-size: 9px;
  margin-left: 3px;
  font-weight: 400;
}
.weather-footnote {
  color: #6b7b5c;
  font-size: 9px;
  margin: 15px 0 0;
}
.weather-unavailable {
  padding: 20px 0 8px;
}
.weather-unavailable h2 {
  font-size: 20px;
  font-weight: 500;
  margin: 16px 0 8px;
}
.weather-unavailable p {
  font-size: 12px;
  color: var(--muted);
}
.section-kicker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 12px;
  font-weight: 600;
}
.section-kicker span:last-child {
  font-size: 8px;
  font-weight: 400;
  letter-spacing: .12em;
  color: var(--muted);
}
.planner-form {
  padding: 22px;
}
.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.controls label, .field-label {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.field-label > span {
  font-size: 10px;
  opacity: .7;
  float: right;
}
input:not([type='checkbox']):not([type='radio']):not([type='file']), select, textarea {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 11px 12px;
  min-height: 44px;
}
.controls select, .field-label select {
  display: block;
  width: 100%;
  margin-top: 6px;
  color: var(--ink);
  font-size: 13px;
}
.req-bar {
  display: block;
  margin: 6px 0 0;
}
.req-bar input {
  width: 100%;
  font-size: 12px;
}
::placeholder {
  color: #89938a;
  opacity: 1;
}
.preferences {
  margin: 19px 0;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
summary {
  cursor: pointer;
  font-size: 12px;
  min-height: 30px;
}
.preferences summary > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin: 3px 0 0 15px;
}
.preferences[open] summary {
  margin-bottom: 15px;
}
.toggle {
  gap: 8px;
  margin: 15px 0 0;
  font-size: 12px;
}
input[type='checkbox'], input[type='radio'] {
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
}
.primary, .ghost, .danger, .danger-solid {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 9px;
  font-weight: 500;
  transition: background .15s;
}
.primary {
  border: 1px solid var(--accent);
}
.ghost {
  font-size: 12px;
}
.recommend-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 49px;
  font-size: 13px;
  white-space: normal;
}
.recommend-action span:last-child {
  margin-left: auto;
}
.recommend-action svg {
  width: 18px;
  height: 18px;
}
.outfit-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.outfit-heading .eyebrow {
  font-size: 8px;
  margin-bottom: 4px;
}
.outfit-heading h3 {
  font: 24px "Songti SC","STSong",Georgia,serif;
  margin: 0;
}
.outfit-items {
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 14px;
}
.oitem {
  border-radius: 12px;
  background: #f5f5ef;
  border: 1px solid #eceee5;
}
.oitem img {
  aspect-ratio: 1.13;
  background: #f5f5ef;
  padding: 18px 14px 9px;
  mix-blend-mode: multiply;
}
.oitem .meta {
  padding: 8px 13px 13px;
}
.oitem .slot {
  font-size: 9px;
  gap: 5px;
  flex-wrap: wrap;
}
.oitem .name {
  font-size: 12px;
  font-weight: 550;
  margin-top: 5px;
  white-space: normal;
}
.oitem .owner-tag {
  top: 10px;
  left: 10px;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #ffffffd9;
  color: #63735e;
}
.oitem .owner-tag.shared {
  background: #e0ead5ee;
  color: #48613a;
}
.oitem .oacts {
  border-color: #e5e8dd;
  background: transparent;
}
.oitem .oacts button {
  min-height: 40px;
  padding: 8px 4px;
  font-size: 11px;
}
.oitem .oacts button.rm {
  color: var(--muted);
}
.reason {
  font-size: 12px;
  line-height: 1.9;
  margin: 4px 0 0;
}
.btn-row {
  gap: 8px;
  margin-top: 16px;
}
.btn-row > * {
  flex: 1 1 auto;
}
.outfit-actions .primary {
  flex-basis: 100%;
}
.outfit-placeholder, .empty-state {
  display: grid;
  place-content: center;
  text-align: center;
  padding: 70px 24px;
  border: 1px dashed #cbd6c1;
  border-radius: 18px;
  min-height: 320px;
  background: #f0f3e9;
}
.outfit-placeholder > span {
  margin: auto;
}
.outfit-placeholder svg {
  width: 60px;
  height: 60px;
  opacity: .5;
}
.outfit-placeholder h2 {
  font: 25px "Songti SC",Georgia,serif;
  margin: 24px 0 0;
}
.outfit-placeholder p, .empty-state p {
  color: var(--muted);
  font-size: 12px;
}
.chip {
  padding: 3px 8px;
  border-radius: 5px;
  background: #eff2e9;
  font-size: 10px;
  line-height: 1.6;
}
.chip.good {
  background: #e8f1e8;
}
.chip.warn {
  background: #f7efdf;
}
.chip.ai {
  background: #eaf0e0;
  color: #587246;
}
.feedback-box {
  padding: 16px;
  border-radius: 12px;
  margin-top: 16px;
  background: #f5f7ef;
}
.quick-chips {
  gap: 7px;
  margin: 12px 0;
}
.quick-chips .chip, .scope-radios label {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.filters {
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.filters select {
  font-size: 12px;
}
.closet-filters {
  padding: 15px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.search-field {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 180px;
  gap: 9px;
}
.search-field > span {
  font-size: 27px;
  line-height: 1;
  color: var(--muted);
}
.search-field input {
  width: 100%;
  border: 0 !important;
  padding-left: 0 !important;
  background: transparent !important;
}
.filter-details {
  position: relative;
}
.filter-details summary {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.filter-popover {
  position: absolute;
  top: 52px;
  right: 0;
  background: white;
  border: 1px solid var(--line);
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 12px 30px #253b3215;
  z-index: 4;
  width: 220px;
}
.filter-popover label {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.filter-popover label + label {
  margin-top: 12px;
}
.filter-popover select {
  display: block;
  width: 100%;
  margin-top: 5px;
}
.closet-toolbar {
  min-height: 28px;
}
.toolbar-hint {
  color: #879080;
  margin-left: 8px;
}
.grid {
  grid-template-columns: repeat(auto-fill,minmax(132px,1fr));
  gap: 14px;
}
#closetGrid {
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 20px;
}
.gitem {
  border-radius: 12px;
  border: 1px solid var(--line);
}
.gitem.picked {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.gitem .img-box {
  background: #f0f2e9;
}
.gitem img {
  background: #f0f2e9;
  padding: 12px;
  mix-blend-mode: multiply;
}
.gitem .cap {
  font-size: 12px;
  padding: 12px;
}
.gitem .gcheck {
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border: 1px solid #b9c4b0;
  border-radius: 7px;
  background: #ffffffdc;
  padding: 0;
  box-shadow: none;
}
.gitem .badge, .gitem .sub-badge, .gitem .opill, .gitem .avail-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  background: #ffffffdf;
  color: #57684b;
  box-shadow: none;
}
.gitem .sub-badge {
  right: 8px;
  top: 10px;
}
.gitem .opill {
  right: 8px;
  bottom: 8px;
  color: #fff;
}
.gitem .avail-badge {
  bottom: 8px;
  left: 8px;
  background: #f4e8cc;
  color: var(--warn);
}
.empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
}
.drow {
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
}
.drow img {
  width: 80px;
  height: 90px;
  background: #f3f5ed;
  border-radius: 9px;
}
.drow .score {
  font: 26px Georgia,serif;
  width: 40px;
}
.drow .acts {
  gap: 8px;
  margin-top: 10px;
}
.drow .acts button {
  min-height: 36px;
}
.bar {
  height: 6px;
  background: #edf0e6;
}
.stat-row {
  grid-template-columns: 80px 1fr 48px;
  gap: 12px;
  font-size: 12px;
  margin: 12px 0;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 22px;
  width: min(620px,calc(100vw - 32px));
  max-height: 88dvh;
  color: var(--ink);
  box-shadow: 0 24px 90px #162b3333;
}
dialog::backdrop {
  background: #142b2866;
  backdrop-filter: blur(4px);
}
.modal-close {
  position: sticky;
  top: 12px;
  float: right;
  right: 12px;
  margin: 12px 12px -48px 0;
  z-index: 3;
  width: 36px;
  height: 36px;
  background: #fffffff0;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}
#modalBody {
  padding: 30px 24px 24px;
  max-height: 86dvh;
}
#modalBody > h3:first-child {
  margin-top: 0;
  padding-right: 35px;
  font-size: 20px;
}
.form {
  grid-template-columns: 90px minmax(0,1fr);
  gap: 14px;
}
.form label {
  font-size: 12px;
}
.hero {
  max-height: 300px;
  background: #f0f3e9;
  border-radius: 14px;
}
#toast {
  bottom: calc(30px + var(--safe-b));
  background: #253b32f0;
  padding: 12px 20px;
  max-width: min(520px,90vw);
  width: max-content;
  border-radius: 12px;
}
@media (hover:hover) {
  button:hover:not(:disabled) {
    filter: brightness(.96);
  }
  .gitem:hover, .oitem:hover {
    border-color: #a6b69a;
  }
}
@media (min-width:1500px) {
  main {
    margin-left: 300px;
  }
  .today-layout {
    grid-template-columns: 320px minmax(0,1fr);
    gap: 40px;
  }
  .outfit-items {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}
@media (max-width:1150px) {
  .topbar {
    margin: 0 28px;
  }
  .tabbar {
    left: 20px;
    width: 166px;
  }
  main {
    margin-left: 218px;
    padding-right: 28px;
  }
  .today-layout {
    grid-template-columns: 260px minmax(0,1fr);
    gap: 20px;
  }
  .card {
    padding: 18px;
  }
  .weather {
    padding: 22px 18px 16px;
  }
  .weather .temps {
    font-size: 39px;
  }
  .weather-symbol {
    font-size: 32px;
  }
  #closetGrid {
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 14px;
  }
  .oitem .slot span:last-child {
    display: none;
  }
}
@media (max-width:900px) {
  .tabbar {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    flex-direction: row;
    justify-content: space-around;
    background: #fdfefbf2;
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 7px 12px calc(7px + var(--safe-b));
    gap: 5px;
    z-index: 10;
  }
  .tabbar button {
    flex: 1;
    min-height: 52px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 5px 10px;
    border-radius: 10px;
  }
  .tabbar button svg {
    width: 21px;
    height: 21px;
  }
  .tabbar button span {
    flex: none;
    font-size: 10px;
  }
  .nav-caption,.nav-note,.tabbar button i {
    display: none;
  }
  main {
    margin: 0 auto;
    max-width: 900px;
    padding: 32px 24px calc(100px + var(--safe-b));
  }
  .topbar {
    height: 80px;
    margin: 0 24px;
  }
  .brand {
    font-size: 18px;
  }
  .brand-mark {
    height: 40px;
    width: 38px;
  }
  .today-layout {
    grid-template-columns: 270px minmax(0,1fr);
  }
  #toast {
    bottom: calc(88px + var(--safe-b));
  }
}
@media (max-width:650px) {
  .topbar {
    height: calc(76px + env(safe-area-inset-top,0px));
    padding-top: env(safe-area-inset-top,0px);
    margin: 0 20px;
  }
  .brand {
    font-size: 16px;
    gap: 9px;
  }
  .brand small {
    font-size: 6px;
    letter-spacing: .13em;
  }
  .brand-mark {
    width: 32px;
    height: 36px;
    border-radius: 10px 10px 4px 10px;
  }
  .brand-mark svg {
    width: 23px;
    height: 23px;
  }
  .header-actions {
    gap: 10px;
  }
  .owner-switch {
    padding: 3px;
  }
  .owner-switch button {
    width: 36px;
    min-height: 33px;
    font-size: 13px;
  }
  .icon-btn {
    width: 36px;
    height: 36px;
  }
  main {
    padding: 28px 20px calc(100px + var(--safe-b));
  }
  h1 {
    font-size: 29px;
  }
  .eyebrow {
    font-size: 8px;
  }
  .today-layout {
    display: block;
  }
  .weather {
    padding: 20px 22px 15px;
  }
  .weather-main {
    margin-top: 15px;
  }
  .weather .temps {
    font-size: 48px;
  }
  .weather-symbol {
    font-size: 44px;
  }
  .weather-description {
    margin: 8px 0 16px;
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .weather-description span {
    margin: 0;
  }
  .weather-metrics {
    padding-top: 11px;
  }
  .weather-footnote {
    margin-top: 10px;
  }
  .planner-form {
    padding: 20px;
  }
  .controls {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
  }
  .controls select {
    font-size: 12px;
    padding-left: 9px;
  }
  .section-kicker {
    margin-bottom: 16px;
  }
  .preferences {
    margin: 14px 0;
    padding-top: 12px;
  }
  .preferences summary > span {
    display: inline;
    font-size: 9px;
    margin-left: 9px;
  }
  .outfit-card {
    padding: 17px;
  }
  .outfit-items {
    gap: 10px;
  }
  .outfit-heading {
    margin-bottom: 16px;
  }
  .outfit-heading h3 {
    font-size: 23px;
  }
  .outfit-heading .chip {
    font-size: 9px;
  }
  .oitem img {
    aspect-ratio: .95;
    padding: 20px 10px 6px;
  }
  .oitem .meta {
    padding: 7px 10px 11px;
  }
  .oitem .name {
    line-height: 1.5;
  }
  .oitem .owner-tag {
    top: 7px;
    left: 7px;
    font-size: 8px;
  }
  .oitem .oacts button {
    min-height: 43px;
  }
  .outfit-actions .primary {
    min-height: 48px;
  }
  .card {
    border-radius: 15px;
  }
  #closetGrid {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 13px;
  }
  .gitem img {
    aspect-ratio: .95;
    padding: 17px 10px;
  }
  .gitem .gcheck {
    min-height: 30px;
    width: 30px;
  }
  .gitem .cap {
    padding: 11px 10px;
  }
  .closet-filters {
    padding: 10px;
    gap: 8px;
  }
  .search-field {
    flex-basis: 100%;
    border-bottom: 1px solid var(--line);
    margin-bottom: 3px;
  }
  .closet-filters > select {
    flex: 1;
  }
  .filter-details summary {
    min-width: 80px;
  }
  .toolbar-hint {
    display: block;
    margin: 0;
    font-size: 10px;
  }
  .drow {
    padding: 14px;
    gap: 11px;
  }
  .drow img {
    width: 60px;
    height: 74px;
  }
  .drow .score {
    font-size: 22px;
    width: 27px;
  }
  .drow .acts button {
    font-size: 11px;
    padding: 8px 10px;
  }
  .form {
    grid-template-columns: 72px minmax(0,1fr);
    gap: 12px 9px;
  }
  dialog {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
    max-height: 92dvh;
  }
  #modalBody {
    max-height: 90dvh;
    padding: 28px 20px calc(24px + var(--safe-b));
  }
  .form input,.form select,textarea,.req-bar input,.search-field input {
    font-size: 16px;
  }
  .hero {
    max-height: 240px;
  }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
.planner-options > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  padding: 4px 0 14px;
  font-weight: 550;
}
.planner-options > summary::-webkit-details-marker {
  display: none;
}
.planner-options > summary span:last-child {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
}
.planner-options > summary span:last-child::after {
  content: ' ＋';
}
.planner-options[open] > summary span:last-child::after {
  content: ' −';
}
.planner-options[open] > summary {
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.source-details {
  padding: 8px 0 15px;
  color: var(--muted);
}
.source-details summary {
  font-size: 11px;
}
.garment-details {
  padding: 16px;
  margin-top: 5px;
}
.garment-details > summary {
  font-size: 13px;
}
.garment-details > summary span {
  float: right;
}
.garment-details[open] > summary {
  margin-bottom: 18px;
}
.personal-preferences {
  padding: 18px;
  background: #f0f4e9;
}
.temperature-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.journal-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;
  padding: 20px 0;
  margin: 12px 0 16px;
  border-bottom: 1px solid var(--line);
}
.journal-stats strong {
  display: block;
  font: 42px Georgia,serif;
}
.journal-stats span {
  color: var(--muted);
  font-size: 11px;
}
@media (max-width:650px) {
  .weather {
    padding: 18px 20px 12px;
  }
  .weather-main {
    margin-top: 10px;
  }
  .weather .temps {
    font-size: 40px;
  }
  .weather-description {
    margin: 6px 0 12px;
  }
  .weather-metrics strong {
    font-size: 16px;
  }
  .weather-footnote {
    font-size: 8px;
    margin-top: 8px;
  }
  .planner-form {
    padding: 17px 20px;
  }
  .planner-form .section-kicker {
    margin-bottom: 9px;
  }
  .planner-options > summary {
    padding-bottom: 13px;
  }
  .journal-stats {
    gap: 10px;
  }
  .journal-stats strong {
    font-size: 34px;
  }
}
.item-photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}
.gitem .sub-badge, .gitem .opill, .gitem .avail-badge {
  pointer-events: none;
}
.zodiac-note {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f0f2e9;
}
.zodiac-heading, .zodiac-suggestion {
  display: flex;
  align-items: center;
  gap: 14px;
}
.zodiac-symbol {
  font-size: 26px;
  color: #77865e;
}
.zodiac-heading strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
}
.zodiac-heading div > span {
  display: block;
  font-size: 10px;
  color: var(--muted);
}
.zodiac-heading > small {
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}
.zodiac-suggestion {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.zodiac-color {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  white-space: nowrap;
}
.zodiac-color i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #0001;
}
.zodiac-suggestion p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 650px) {
  .zodiac-note {
    padding: 16px;
    margin-top: 22px;
  }
  .zodiac-suggestion {
    gap: 9px;
  }
  .zodiac-suggestion p {
    flex-basis: 100%;
  }
}
.sun-reminder {
  margin: 12px 0 0;
  font-size: 10px;
  line-height: 1.7;
  color: #647454;
}
.sun-reminder-active {
  padding: 8px 10px;
  border-radius: 7px;
  background: #f7edcf;
  color: #79571e;
}
.uv-metric strong small {
  display: block;
  margin-left: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
main {
  padding-top: 28px;
}
.tabbar {
  top: 122px;
}
.outfit-heading {
  margin-bottom: 14px;
}
.outfit-heading h3 {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}
.planner-options > summary {
  font-size: 14px;
}
.outfit-reason {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.outfit-reason summary {
  font-size: 11px;
  color: var(--muted);
}
.outfit-reason[open] .reason {
  margin-bottom: 12px;
}
.closet-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}
.closet-toolbar {
  margin: 12px 0;
}
.journal-stats {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.zodiac-note {
  margin-top: 18px;
  padding: 14px 18px;
}
@media (max-width: 900px) {
  .tabbar {
    top: auto;
  }
  main {
    padding-top: 18px;
  }
}
@media (max-width: 650px) {
  .topbar {
    height: calc(64px + env(safe-area-inset-top, 0px));
  }
  main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .card {
    margin-bottom: 12px;
  }
  .outfit-actions {
    margin-top: 12px;
  }
}

.photo-picker {
  display: block;
  border: 1px dashed #acbba0;
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  background: #f0f3e9;
  cursor: pointer;
}
.photo-picker:focus-within { outline: 3px solid #83a991; outline-offset: 3px; }
#newPhotoPreview img { display: block; width: 100%; max-height: 260px; object-fit: contain; margin-top: 12px; }
.new-comment-label { display: block; margin: 20px 0 7px; font-size: 13px; }
.new-comment-label span { color: var(--muted); font-size: 11px; margin-left: 6px; }
#new_comment { width: 100%; resize: vertical; }
.enrichment-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 12px; }

/* Overview first: real item photos share one editorial flat-lay surface. */
.outfit-board { margin: 0; }
.lookbook-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.08;
  max-height: 640px;
  overflow: hidden;
  border-radius: 12px;
  background: #f1f1e9;
  isolation: isolate;
}
.lookbook-piece {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%) rotate(var(--piece-angle, 0deg));
  mix-blend-mode: multiply;
}
.lookbook-piece img, .lookbook-piece canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.lookbook-missing { font-size: 11px; color: var(--muted); text-align: center; padding: 10px; border: 1px dashed var(--line); }
.lookbook-extras { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 12px; background: #f1f1e9; }
.lookbook-extra { position: relative; width: 72px; height: 80px; transform: none; }
.lookbook-actions { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; margin-top: 16px; }
.lookbook-actions button { min-height: 48px; font-size: 13px; }
.editor-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 12px; }
.editor-secondary-actions { margin-top: 10px; }
.editor-tips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.today-layout:not(.is-editing) .planner-form { display: none; }
#outfit { scroll-margin-top: 16px; }
@media (max-width: 650px) {
  .today-layout { display: flex; flex-direction: column; gap: 0; }
  .outfit-panel { order: -1; width: 100%; }
  .day-planner { width: 100%; }
  .lookbook-stage { aspect-ratio: 1 / 1.16; }
  .outfit-card-overview { padding: 14px; }
  .lookbook-actions { gap: 8px; margin-top: 12px; }
  .lookbook-actions button { padding: 10px 8px; font-size: 12px; }
}

.lookbook-actions-single { grid-template-columns: 1fr; }

/* Purposeful micro-interactions; no motion is required to understand a state. */
:root { --motion-quick: 140ms; --motion-layout: 210ms; --motion-ease: cubic-bezier(.16, 1, .3, 1); }
button { transition: transform var(--motion-quick) var(--motion-ease), background-color var(--motion-quick), color var(--motion-quick), opacity var(--motion-quick); }
button:not(:disabled):not([aria-pressed]):active { transform: scale(.975); }
#ownerSwitch { position: relative; padding: 4px; isolation: isolate; }
#ownerSwitch::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: calc((100% - 10px) / 2);
  border-radius: 24px;
  background: var(--accent);
  transition: transform var(--motion-layout) var(--motion-ease);
  pointer-events: none;
  z-index: -1;
}
#ownerSwitch[data-active-member="member_b"]::before { transform: translateX(100%); }
#ownerSwitch button { background: transparent; }
#ownerSwitch button.on { background: transparent; box-shadow: none; }
button[data-phase="pending"] { cursor: progress; }
button[data-phase="pending"]::after {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-left: 8px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: spin .7s linear infinite;
}
button[data-phase="error"] { border-color: var(--bad); }
.outfit-heading .chip.good { animation: status-arrive 160ms var(--motion-ease); }
.enrichment-status { transition: background-color var(--motion-quick); }
@keyframes status-arrive { from { opacity: .5; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  button, #ownerSwitch::before, .enrichment-status { transition: none; }
  button:not(:disabled):not([aria-pressed]):active { transform: none; }
  button[data-phase="pending"]::after, .outfit-heading .chip.good { animation: none; }
}


/* Private access gate & simplified settings layout */
[hidden] { display: none !important; }
body.app-locked main {
  margin: 0 auto;
  max-width: 460px;
  padding: 40px 20px 64px;
}
.auth-gate { margin-top: 12px; }
.auth-card { padding: 28px 24px; }
.auth-card h2 {
  font: 500 22px/1.35 "Songti SC", "STSong", Georgia, serif;
  margin: 0 0 8px;
}
.auth-card > p { margin: 0 0 18px; font-size: 13px; }
.auth-form { margin-top: 14px; }
.auth-form input { width: 100%; margin-top: 6px; }
.auth-status { min-height: 20px; margin: 12px 0 0; }
.auth-status.auth-error { color: var(--bad); }

.settings-section { background: #faf8f5; padding: 14px 16px; margin-bottom: 12px; }
.settings-title { font-weight: 600; margin-bottom: 8px; font-size: 13px; }
.account-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.secondary-settings { background: #faf8f5; padding: 12px 16px; margin-bottom: 12px; }
.secondary-settings summary { font-weight: 500; color: var(--muted); min-height: 24px; }
.secondary-settings[open] summary { margin-bottom: 8px; color: var(--ink); }
.secondary-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.file-action-label { display: inline-flex; align-items: center; cursor: pointer; }
