﻿/* ==========================================================================
   拾光小屋 · 房间影像日记
   设计说明见 DESIGN.md
   ========================================================================== */

:root {
  --paper: #ebe9e2;
  --paper-deep: #e0ddd3;
  --surface: #f7f6f1;
  --surface-soft: #efede6;
  --surface-strong: #fbfaf6;
  --ink: #2b302d;
  --ink-soft: #545b55;
  --muted: #6f766f;
  --muted-light: #8f948c;
  --line: #d9d5c9;
  --line-strong: #c6c1b3;
  --sage: #7e8f78;
  --sage-deep: #556a51;
  --sage-soft: #e4e9e0;
  --pine: #37433c;
  --pine-deep: #2c3731;
  --mist: #c6d3d7;
  --denim: #5b6f84;
  --brass: #a88a61;
  --brass-soft: #efe6d6;
  --rose: #a9705f;
  --rose-soft: #f1e4df;
  --cream: #f2eee4;
  --cream-dim: rgba(242, 238, 228, 0.62);
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Instrument Serif", "Noto Serif SC", Georgia, "Songti SC", serif;
  --shadow-soft: 0 10px 30px rgba(43, 48, 45, 0.07);
  --shadow-lift: 0 26px 64px rgba(35, 42, 37, 0.18);
  --radius-photo: 18px;
  --radius-input: 10px;
  --radius-modal: 20px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --rail: 232px;
  --content: 1160px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 88% -10%, rgba(198, 211, 215, 0.22), transparent 62%),
    radial-gradient(760px 480px at -8% 104%, rgba(126, 143, 120, 0.1), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open,
body.focus-active,
body.is-booting {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: rgba(126, 143, 120, 0.28);
}

:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(43, 48, 45, 0.16);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.eyebrow {
  display: none;
}

/* 全站胶片颗粒 */
.grain-layer {
  position: fixed;
  inset: 0;
  z-index: 550;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Type helpers
   -------------------------------------------------------------------------- */

.profile-name,
.page-title,
.auth-form-heading h2,
.modal-head h2,
.room-title,
.achievement-hero-copy h2,
.focus-success h2 {
  font-weight: 300;
}

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

.page-title {
  font-size: clamp(30px, 3.2vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.page-sub {
  margin-top: 8px;
  max-width: 58ch;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.balance-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}

.balance-chip strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
}

/* --------------------------------------------------------------------------
   Brand
   -------------------------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 11px;
  background: var(--pine);
  color: var(--cream);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.brand-text small {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}

.brand-light {
  color: var(--cream);
}

.brand-light .brand-mark {
  background: transparent;
  border: 1px solid rgba(242, 238, 228, 0.32);
  color: var(--cream);
}

.brand-light .brand-text small {
  color: var(--cream-dim);
}

.brand-mobile {
  display: none;
}

.avatar {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--sage-soft);
  color: var(--pine);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

.avatar-top {
  width: 34px;
  height: 34px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* --------------------------------------------------------------------------
   Buttons, links, form atoms
   -------------------------------------------------------------------------- */

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.btn svg {
  width: 14px;
  height: 14px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn-primary {
  background: var(--pine);
  border-color: var(--pine);
  color: var(--cream);
}

.btn-primary:hover:not(:disabled) {
  background: var(--pine-deep);
  border-color: var(--pine-deep);
}

.btn-secondary {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--ink-soft);
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
}

.btn-danger {
  background: transparent;
  border-color: rgba(169, 112, 95, 0.5);
  color: var(--rose);
}

.btn-danger:hover:not(:disabled) {
  background: var(--rose-soft);
  border-color: var(--rose);
}

.btn-danger-ghost {
  color: var(--rose);
}

.btn-sm {
  min-height: 34px;
  padding: 0 15px;
  font-size: 11.5px;
}

.btn-xs {
  min-height: 28px;
  padding: 0 10px;
  font-size: 10.5px;
}

.btn-icon {
  display: none;
}

.btn.is-busy {
  cursor: progress;
  opacity: 0.8;
}

.btn .loading-ring {
  width: 13px;
  height: 13px;
  border-width: 1.5px;
  border-color: currentColor;
  border-right-color: transparent;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.6;
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.text-btn:hover {
  color: var(--ink);
  border-bottom-color: var(--line-strong);
}

.text-btn svg,
.text-link svg,
.panel-cta svg,
.history-more svg {
  display: none;
}

.text-link {
  color: var(--denim);
  font-size: 11.5px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.16s var(--ease);
}

.text-link:hover {
  border-bottom-color: rgba(91, 111, 132, 0.4);
}

.fragment-icon {
  display: inline-flex;
  color: var(--brass);
}

.fragment-icon svg {
  width: 13px;
  height: 13px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  color: var(--muted-light);
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

.icon-btn:hover {
  color: var(--ink);
  background: rgba(43, 48, 45, 0.05);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.input-wrap {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-left: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-input);
  background: var(--surface);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.input-wrap:focus-within {
  border-color: var(--pine);
  box-shadow: 0 0 0 3px rgba(55, 67, 60, 0.08);
}

.input-wrap.is-invalid {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(169, 112, 95, 0.08);
}

.input-icon {
  display: inline-flex;
  color: var(--muted-light);
}

.input-icon svg {
  width: 15px;
  height: 15px;
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font-size: 12.5px;
  outline: none;
}

.input-wrap input::placeholder {
  color: var(--muted-light);
}

.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
}

.password-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--muted-light);
  border-radius: 0 var(--radius-input) var(--radius-input) 0;
}

.password-toggle:hover {
  color: var(--ink-soft);
}

.password-toggle svg {
  width: 15px;
  height: 15px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-error {
  color: var(--rose);
  font-size: 11.5px;
  line-height: 1.6;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group-label {
  color: var(--muted);
  font-size: 11px;
}

.form-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.form-section h3 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.form-section-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

/* --------------------------------------------------------------------------
   Loading / view
   -------------------------------------------------------------------------- */

.view {
  animation: viewIn 0.5s var(--ease-out) both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-loading {
  min-height: 46vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.loading-ring {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  border-top-color: var(--pine);
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  width: var(--rail);
  height: 100dvh;
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 22px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 46px;
}

.nav-label {
  margin: 0 12px 6px;
  color: var(--muted-light);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.nav-label-spaced {
  margin-top: 24px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: transparent;
  transform: translateY(-50%);
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(247, 246, 241, 0.7);
}

.nav-item.is-active {
  color: var(--ink);
}

.nav-item.is-active::before {
  background: var(--ink);
}

.nav-icon {
  display: inline-flex;
  color: currentColor;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
}

.nav-pip {
  width: 5px;
  height: 5px;
  margin-left: auto;
  border: 1px solid var(--sage);
  border-radius: 50%;
  background: transparent;
}

.nav-badge {
  min-width: 17px;
  height: 17px;
  margin-left: auto;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--pine);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 1;
}

.sidebar-note {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.sidebar-note-icon {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--sage);
}

.sidebar-note-icon svg {
  width: 14px;
  height: 14px;
}

.sidebar-note strong {
  color: var(--ink-soft);
  font-weight: 500;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 6px 0;
  border-top: 1px solid var(--line);
  text-align: left;
}

.sidebar-user-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.sidebar-user-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-settings {
  margin-left: auto;
  color: var(--muted-light);
}

.sidebar-settings svg {
  width: 15px;
  height: 15px;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 32;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 40px;
  background: rgba(235, 233, 226, 0.82);
  border-bottom: 1px solid rgba(217, 213, 201, 0.55);
  backdrop-filter: blur(12px);
}

.topbar-brand {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
}

.topbar-brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--pine);
  color: var(--cream);
}

.topbar-brand-mark svg {
  width: 20px;
  height: 20px;
}

.topbar-date {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.fragment-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10.5px;
}

.fragment-pill strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}

.fragment-label {
  letter-spacing: 0.04em;
}

.view-root {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 40px 40px 80px;
  flex: 1;
}

.view-root:focus {
  outline: none;
}

.app-footer {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 20px 40px 34px;
  color: var(--muted-light);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.footer-mark {
  color: var(--brass);
}

.footer-mark svg {
  width: 12px;
  height: 12px;
}

.mobile-nav {
  display: none;
}

/* --------------------------------------------------------------------------
   Boot
   -------------------------------------------------------------------------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--paper);
  transition: opacity 0.45s var(--ease);
}

.boot-screen.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.boot-logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  color: var(--pine);
  animation: bootBreathe 2.4s ease-in-out infinite;
}

.boot-logo svg {
  width: 30px;
  height: 30px;
}

.boot-screen p {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.12em;
}

@keyframes bootBreathe {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Auth
   -------------------------------------------------------------------------- */

.auth-screen {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  min-height: 100dvh;
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 40px 48px 34px;
  background:
    radial-gradient(120% 90% at 82% 8%, rgba(198, 211, 215, 0.14), transparent 58%),
    radial-gradient(90% 70% at 4% 100%, rgba(126, 143, 120, 0.16), transparent 62%),
    #222b25;
  color: var(--cream);
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

.auth-visual-glow {
  position: absolute;
  left: -10%;
  top: 32%;
  width: 70%;
  height: 60%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(200, 214, 198, 0.14), transparent);
  filter: blur(20px);
}

.auth-topline {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.auth-top-note {
  color: var(--cream-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.auth-copy {
  position: relative;
  z-index: 2;
  margin-top: clamp(36px, 6vh, 64px);
  max-width: 520px;
}

.auth-copy h1 {
  font-size: clamp(32px, 3.6vw, 46px);
  font-weight: 300;
  line-height: 1.28;
  letter-spacing: 0.01em;
}

.auth-lead {
  margin-top: 18px;
  color: var(--cream-dim);
  font-size: 12.5px;
  line-height: 2;
}

.auth-room-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 470px;
  margin-top: clamp(28px, 5vh, 54px);
}

.auth-room {
  position: relative;
  aspect-ratio: 1.38;
  overflow: hidden;
  border-radius: var(--radius-photo);
  background: #d8d0c0;
  box-shadow: 0 30px 60px rgba(12, 18, 14, 0.3);
}

.auth-room-wall {
  position: absolute;
  inset: 0 0 34% 0;
  background: linear-gradient(180deg, #e6dfd1, #dcd2c0);
}

.auth-window {
  position: absolute;
  left: 13%;
  top: 15%;
  width: 33%;
  height: 54%;
  padding: 6px;
  border-radius: 2px;
  background: #f1ece2;
  box-shadow: 0 0 0 1px rgba(105, 90, 69, 0.12);
}

.auth-window-sky {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #bccfd5, #dce4e1 52%, #efe6d3);
}

.auth-sun {
  position: absolute;
  top: 17%;
  right: 16%;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ead3a6;
}

.auth-cloud {
  position: absolute;
  width: 26%;
  height: 7%;
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.72);
}

.cloud-one {
  top: 24%;
  left: 12%;
}

.cloud-two {
  top: 40%;
  right: 12%;
  width: 18%;
}

.auth-hill {
  position: absolute;
  bottom: -12%;
  width: 84%;
  height: 42%;
  border-radius: 50% 50% 0 0;
  background: #a8b49e;
}

.hill-one {
  left: -22%;
}

.hill-two {
  right: -26%;
  bottom: -18%;
  width: 92%;
  height: 48%;
  background: #93a38c;
}

.window-mullion {
  position: absolute;
  background: rgba(241, 236, 226, 0.9);
}

.window-mullion-v {
  left: 50%;
  top: 6px;
  bottom: 6px;
  width: 1.5px;
}

.window-mullion-h {
  top: 50%;
  left: 6px;
  right: 6px;
  height: 1.5px;
}

.auth-string-lights {
  position: absolute;
  top: 9%;
  left: 6%;
  right: 6%;
  height: 22px;
  border-top: 1px solid rgba(84, 78, 64, 0.28);
  border-radius: 50%;
}

.auth-string-lights span {
  position: absolute;
  top: -3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f0d9a8;
  box-shadow: 0 0 7px rgba(240, 217, 168, 0.8);
}

.auth-string-lights span:nth-child(1) { left: 8%; }
.auth-string-lights span:nth-child(2) { left: 28%; top: 5px; }
.auth-string-lights span:nth-child(3) { left: 48%; top: 8px; }
.auth-string-lights span:nth-child(4) { left: 68%; top: 5px; }
.auth-string-lights span:nth-child(5) { left: 88%; }

.auth-room-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(58% 52% at 70% 78%, rgba(255, 240, 205, 0.34), transparent 70%);
}

.auth-room-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34%;
  background: linear-gradient(180deg, #cdb99d, #c0aa8b);
}

.auth-preview-items {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.auth-preview-item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  opacity: 0;
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 8px 10px rgba(58, 42, 24, 0.18));
  transition: opacity 0.9s var(--ease);
}

.auth-preview-items.is-ready .auth-preview-item {
  opacity: 1;
}

.auth-preview-item svg {
  width: 100%;
  height: auto;
}

.auth-dust {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 245, 222, 0.6);
  z-index: 4;
  animation: dustFloat 9s ease-in-out infinite;
}

.dust-one { left: 22%; top: 40%; }
.dust-two { left: 64%; top: 30%; animation-delay: -3s; }
.dust-three { left: 82%; top: 56%; animation-delay: -6s; }

@keyframes dustFloat {
  0%, 100% { opacity: 0.15; transform: translateY(0); }
  50% { opacity: 0.7; transform: translateY(-10px); }
}

.auth-room-caption {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: var(--cream-dim);
  font-size: 10px;
}

.caption-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sage);
}

.auth-visual-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: auto;
  padding-top: 24px;
}

.auth-proof {
  display: flex;
  align-items: center;
  gap: 0;
  color: var(--cream-dim);
  font-size: 10.5px;
}

.proof-avatar {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  margin-left: -5px;
  border-radius: 50%;
  border: 1px solid rgba(242, 238, 228, 0.24);
  background: #2f3a33;
  color: var(--cream);
  font-size: 9px;
}

.proof-avatar:first-child {
  margin-left: 0;
}

.auth-proof p {
  margin-left: 10px;
}

.auth-quote {
  max-width: 220px;
  color: var(--cream-dim);
  font-size: 10.5px;
  line-height: 1.9;
  text-align: right;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 44px 48px;
  background: var(--paper);
}

.auth-panel-inner {
  width: min(100%, 356px);
}

.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  height: 40px;
  color: var(--muted);
  font-size: 12.5px;
  transition: color 0.16s var(--ease);
}

.auth-tab:hover {
  color: var(--ink-soft);
}

.auth-tab.is-active {
  color: var(--ink);
}

.auth-tab-indicator {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 50%;
  height: 1px;
  background: var(--ink);
  transition: transform 0.32s var(--ease-out);
}

.auth-tabs[data-active="register"] .auth-tab-indicator {
  transform: translateX(100%);
}

.auth-form-heading h2 {
  font-size: 26px;
  line-height: 1.3;
}

.auth-form-heading p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.btn-auth {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

.auth-switch {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.auth-switch button {
  color: var(--denim);
  border-bottom: 1px solid transparent;
}

.auth-switch button:hover {
  border-bottom-color: rgba(91, 111, 132, 0.4);
}

.auth-trust {
  display: flex;
  gap: 8px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.8;
}

.auth-trust span {
  margin-top: 2px;
}

.auth-trust svg {
  width: 12px;
  height: 12px;
}

/* --------------------------------------------------------------------------
   Home
   -------------------------------------------------------------------------- */

.profile-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  padding-bottom: 30px;
}

.profile-avatar {
  box-shadow: 0 0 0 1px var(--line-strong);
}

.profile-copy {
  min-width: 0;
}

.profile-name {
  font-size: clamp(27px, 3.3vw, 38px);
  line-height: 1.25;
  letter-spacing: -0.005em;
}

.profile-line {
  margin-top: 7px;
  max-width: 56ch;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.profile-stats {
  display: flex;
  align-items: baseline;
  gap: 34px;
  margin-top: 16px;
}

.profile-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.profile-stat strong {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}

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

.home-photo {
  position: relative;
}

.home-photo-frame {
  display: block;
  border-radius: var(--radius-photo);
  overflow: hidden;
  animation: photoDevelop 0.95s var(--ease-out) 0.05s both;
}

.home-photo-frame:focus-visible {
  outline-offset: 4px;
}

@keyframes photoDevelop {
  from { opacity: 0; filter: blur(6px); transform: scale(1.015); }
  to { opacity: 1; filter: blur(0); transform: scale(1); }
}

.home-canvas.room-canvas {
  aspect-ratio: 1.92;
  min-height: 320px;
}

.photo-caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: start;
  padding: 14px 2px 0;
}

.photo-caption-copy strong {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
}

.photo-room-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 10px;
}

.photo-caption-copy p {
  margin-top: 8px;
  max-width: 54ch;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
}

.photo-goal {
  min-width: 150px;
  text-align: right;
}

.photo-goal-label {
  display: block;
  color: var(--muted-light);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.photo-goal-value {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 2px;
}

.photo-goal-value strong {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.05;
  font-variant-numeric: lining-nums tabular-nums;
}

.photo-goal-value span {
  color: var(--muted);
  font-size: 10px;
}

.photo-goal-track {
  display: block;
  width: 100%;
  height: 2px;
  margin-top: 7px;
  background: var(--line);
  overflow: hidden;
}

.photo-goal-fill {
  display: block;
  height: 100%;
  background: var(--sage);
}

.photo-goal-edit {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr);
  gap: 64px;
  margin-top: 52px;
}

.tasks-panel .section-head {
  margin-bottom: 2px;
}

.task-list {
  display: flex;
  flex-direction: column;
}

.task-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px 2px;
  border-bottom: 1px solid rgba(217, 213, 201, 0.7);
}

.task-card:last-child {
  border-bottom: 0;
}

.task-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--task-color) 13%, var(--surface));
  font-size: 17px;
  line-height: 1;
}

.task-main {
  min-width: 0;
}

.task-title-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.task-title-row h3 {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-category {
  flex: none;
  color: var(--muted-light);
  font-size: 10.5px;
}

.task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.5px;
}

.task-meta svg {
  width: 11px;
  height: 11px;
  margin-right: -4px;
}

.meta-dot {
  display: none;
}

.task-today {
  color: var(--muted-light);
}

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

.task-edit {
  opacity: 0;
}

.task-card:hover .task-edit,
.task-edit:focus-visible {
  opacity: 1;
}

.task-play {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  background: var(--pine);
  color: var(--cream);
  font-size: 11px;
  transition: background 0.16s var(--ease);
}

.task-play:hover {
  background: var(--pine-deep);
}

.task-play svg {
  width: 11px;
  height: 11px;
}

.empty-tasks {
  padding: 26px 0 8px;
}

.empty-art {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--sage);
}

.empty-art svg {
  width: 19px;
  height: 19px;
}

.empty-tasks h3 {
  font-size: 15px;
  font-weight: 500;
}

.empty-tasks p {
  margin-top: 4px;
  max-width: 46ch;
  color: var(--muted);
  font-size: 11.5px;
}

.quick-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.template-chip {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 10.5px;
  transition: border-color 0.16s var(--ease);
}

.template-chip:hover {
  border-color: var(--line-strong);
}

.empty-actions {
  margin-top: 16px;
}

.home-side {
  display: flex;
  flex-direction: column;
  gap: 44px;
  min-width: 0;
}

.week-total {
  color: var(--muted);
  font-size: 10.5px;
}

.week-total small {
  font-size: 10.5px;
}

.week-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  height: 130px;
  margin-top: 16px;
}

.week-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.week-bar-zone {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.week-bar {
  width: 4px;
  min-height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: height 0.5s var(--ease-out);
}

.week-column.is-today .week-bar {
  background: var(--sage-deep);
}

.week-value {
  margin-top: 6px;
  color: var(--muted-light);
  font-family: var(--font-display);
  font-size: 10.5px;
  line-height: 1;
  white-space: nowrap;
}

.week-column.is-today .week-value {
  color: var(--ink-soft);
}

.week-day {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.week-column.is-today .week-day {
  color: var(--ink);
}

.week-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted-light);
  font-size: 10.5px;
}

.week-footer strong {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 400;
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(217, 213, 201, 0.7);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-dot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--activity-color) 12%, var(--surface));
  font-size: 12px;
  line-height: 1;
}

.activity-copy {
  min-width: 0;
}

.activity-copy p {
  overflow: hidden;
  font-size: 11px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-copy strong {
  font-weight: 500;
}

.activity-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted-light);
  font-size: 10.5px;
}

.activity-fragment {
  color: var(--brass);
  font-family: var(--font-display);
  font-size: 12px;
}

.mini-empty {
  display: flex;
  gap: 8px;
  padding: 18px 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.8;
}

.mini-empty svg {
  width: 14px;
  height: 14px;
  margin-top: 3px;
  flex: none;
  color: var(--sage);
}

/* --------------------------------------------------------------------------
   Room scene
   -------------------------------------------------------------------------- */

.room-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 1.62;
  min-height: 380px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(43, 48, 45, 0.08);
  border-radius: var(--radius-photo);
  background: #ded5c5;
  user-select: none;
}

.room-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.room-wall {
  position: absolute;
  inset: 0 0 36% 0;
  background: linear-gradient(180deg, #e8e1d3, #ddd4c3);
}

.room-wall::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.6;
  background: repeating-linear-gradient(90deg, transparent 0 119px, rgba(118, 102, 79, 0.05) 119px 120px);
}

.room-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  background: linear-gradient(180deg, #cbb99d, #bda88a);
}

.room-floor::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background:
    repeating-linear-gradient(90deg, transparent 0 74px, rgba(105, 84, 56, 0.13) 74px 75px),
    linear-gradient(180deg, rgba(255, 245, 222, 0.2), transparent 40%);
}

.room-window {
  position: absolute;
  left: 13%;
  top: 12%;
  width: 28%;
  height: 44%;
  padding: 7px;
  border-radius: 3px;
  background: #f2ede3;
  box-shadow: 0 0 0 1px rgba(105, 90, 69, 0.12);
}

.room-window-sky {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #bccfd5, #dce4e1 52%, #efe6d3);
}

.room-window-sky::before {
  content: "";
  position: absolute;
  top: 15%;
  right: 15%;
  width: 33%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ead3a6;
}

.room-window-sky::after {
  content: "";
  position: absolute;
  left: -22%;
  right: -22%;
  bottom: -15%;
  height: 45%;
  border-radius: 50% 50% 0 0;
  background: #a9b7a1;
}

.room-window-bar-v,
.room-window-bar-h {
  position: absolute;
  background: rgba(242, 237, 227, 0.92);
}

.room-window-bar-v {
  left: 50%;
  top: 7px;
  bottom: 7px;
  width: 1.5px;
}

.room-window-bar-h {
  top: 50%;
  left: 7px;
  right: 7px;
  height: 1.5px;
}

.room-window-curtain {
  position: absolute;
  top: -8%;
  width: 23%;
  height: 108%;
  z-index: 2;
  background: linear-gradient(90deg, rgba(247, 243, 233, 0.96), rgba(230, 223, 210, 0.82));
}

.room-window-curtain.left {
  left: -11%;
}

.room-window-curtain.right {
  right: -11%;
}

.room-ceiling-light {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 8%;
  background: rgba(90, 80, 65, 0.24);
}

.room-ceiling-light::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 26px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 0 0 50% 50%;
  background: #d9c7a4;
  box-shadow: 0 0 20px rgba(255, 230, 180, 0.45);
}

.room-sun-patch {
  position: absolute;
  left: 15%;
  top: 53%;
  width: 38%;
  height: 28%;
  background: rgba(255, 238, 200, 0.3);
  transform: skewX(-17deg);
  filter: blur(7px);
}

.room-items {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.room-item {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: var(--z, 5);
  width: var(--item-width);
  transform: translate(-50%, -100%);
  transform-origin: 50% 100%;
  filter: drop-shadow(0 8px 10px rgba(57, 43, 26, 0.14));
  transition: filter 0.2s var(--ease);
}

.room-item svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.room-item.is-new {
  animation: furnitureDrop 0.52s var(--ease-out) both;
}

@keyframes furnitureDrop {
  from { opacity: 0; transform: translate(-50%, -108%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -100%) scale(1); }
}

.room-canvas.is-editing .room-item {
  cursor: grab;
  touch-action: none;
}

.room-canvas.is-editing .room-item:hover {
  filter: drop-shadow(0 12px 14px rgba(57, 43, 26, 0.2));
}

.room-canvas.is-editing .room-item.is-selected::after {
  content: "";
  position: absolute;
  inset: -7px -6px -4px;
  border: 1px dashed rgba(55, 67, 60, 0.55);
  border-radius: 10px;
  pointer-events: none;
}

.room-item.is-dragging {
  z-index: 60 !important;
  cursor: grabbing;
  transition: none;
  filter: drop-shadow(0 18px 18px rgba(57, 43, 26, 0.26));
}

.room-item-name {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(43, 48, 45, 0.82);
  color: var(--cream);
  font-size: 9.5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.room-canvas.is-editing .room-item:hover .room-item-name {
  opacity: 1;
}

.room-fallback {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid rgba(99, 71, 44, 0.14);
  background: rgba(247, 246, 241, 0.7);
  color: var(--muted);
}

.room-fallback svg {
  width: 40%;
  height: 40%;
}

.room-empty {
  position: absolute;
  left: 50%;
  top: 66%;
  z-index: 6;
  width: min(300px, 74%);
  transform: translate(-50%, -50%);
  text-align: center;
  color: rgba(43, 48, 45, 0.62);
  pointer-events: none;
}

.room-empty svg {
  width: 22px;
  height: 22px;
  margin: 0 auto 8px;
  color: rgba(85, 106, 81, 0.7);
}

.room-empty strong {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
}

.room-empty p {
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.7;
}

.room-selected-bar {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 38px;
  padding: 0 8px 0 16px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--pine);
  color: var(--cream);
  font-size: 10.5px;
  box-shadow: var(--shadow-soft);
}

.room-selected-bar button {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(242, 238, 228, 0.12);
  font-size: 10px;
}

.room-selected-bar button:hover {
  background: rgba(242, 238, 228, 0.2);
}

.room-vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 70px rgba(64, 48, 30, 0.12);
}

/* --------------------------------------------------------------------------
   Room page
   -------------------------------------------------------------------------- */

.room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 44px;
  align-items: start;
}

.room-panel {
  min-width: 0;
}

.room-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 10.5px;
}

.room-toolbar-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-toolbar-stats strong {
  color: var(--ink-soft);
  font-weight: 500;
}

.room-level-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sage);
}

.room-edit-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--sage-deep);
  font-size: 10.5px;
}

.room-edit-hint svg {
  width: 12px;
  height: 12px;
}

.room-canvas-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  color: var(--muted-light);
  font-size: 10.5px;
}

.room-canvas-footer p {
  display: flex;
  align-items: center;
  gap: 5px;
}

.room-canvas-footer svg {
  width: 12px;
  height: 12px;
}

.room-canvas-footer strong {
  color: var(--muted);
  font-weight: 400;
}

.room-side {
  display: flex;
  flex-direction: column;
  gap: 30px;
  min-width: 0;
}

.room-stats-card,
.storage-panel {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.room-emblem {
  display: inline-flex;
  color: var(--sage);
}

.room-emblem svg {
  width: 20px;
  height: 20px;
}

.room-stats-card h2 {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

.room-title {
  margin-top: 2px;
  font-size: 24px;
  line-height: 1.3;
}

.room-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.room-stat-row div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.room-stat-row strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.1;
}

.room-stat-row span {
  color: var(--muted);
  font-size: 10px;
}

.room-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10.5px;
}

.room-progress-track {
  height: 2px;
  margin-top: 7px;
  background: var(--line);
}

.room-progress-track span {
  display: block;
  height: 100%;
  background: var(--sage);
}

.room-progress-copy {
  margin-top: 8px;
  color: var(--muted-light);
  font-size: 10.5px;
  line-height: 1.8;
}

.storage-panel .panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.storage-panel .panel-head h3 {
  font-size: 14px;
  font-weight: 400;
}

.storage-head-count {
  color: var(--muted-light);
  font-size: 10.5px;
}

.storage-list {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

.storage-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(217, 213, 201, 0.65);
}

.storage-thumb {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
}

.storage-thumb svg {
  width: 30px;
  height: 30px;
}

.storage-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.4;
}

.storage-copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.storage-copy span {
  color: var(--muted-light);
  font-size: 10px;
}

.storage-place {
  color: var(--denim);
  font-size: 10px;
  border-bottom: 1px solid transparent;
}

.storage-place:hover {
  border-bottom-color: rgba(91, 111, 132, 0.4);
}

.storage-empty {
  padding: 16px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.panel-cta {
  display: inline-block;
  margin-top: 12px;
  color: var(--denim);
  font-size: 10.5px;
}

.panel-cta:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Shop
   -------------------------------------------------------------------------- */

.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 26px 0 22px;
}

.chip-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-chip {
  min-height: 30px;
  padding: 0 9px;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font-size: 11.5px;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.filter-chip:hover {
  color: var(--ink);
}

.filter-chip.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.shop-note {
  color: var(--muted-light);
  font-size: 10.5px;
}

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

.shop-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shop-art {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(165deg, #e7e1d4, #d9d0be);
}

.shop-art.cat-furniture {
  background: linear-gradient(165deg, #e8e1d2, #d8cdb8);
}

.shop-art.cat-soft {
  background: linear-gradient(165deg, #ebe2dc, #dccfc7);
}

.shop-art.cat-plant {
  background: linear-gradient(165deg, #e3e8df, #d2dbcd);
}

.shop-art.cat-light {
  background: linear-gradient(165deg, #f0e8d6, #e2d3b5);
}

.shop-art.cat-wall {
  background: linear-gradient(165deg, #e6e6e0, #d5d8d2);
}

.shop-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(43, 48, 45, 0.06);
  border-radius: inherit;
}

.shop-art-inner {
  position: absolute;
  inset: 13%;
  display: grid;
  place-items: center;
}

.shop-art-inner svg {
  width: 100%;
  height: auto;
  max-height: 100%;
  filter: drop-shadow(0 10px 12px rgba(60, 45, 28, 0.14));
}

.item-tag {
  position: absolute;
  top: 11px;
  left: 12px;
  z-index: 2;
  color: rgba(43, 48, 45, 0.52);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.owned-mark,
.lock-mark {
  position: absolute;
  top: 10px;
  right: 11px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
}

.owned-mark {
  color: var(--sage-deep);
}

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

.owned-mark svg,
.lock-mark svg {
  width: 10px;
  height: 10px;
}

.shop-card-body {
  padding: 11px 2px 0;
}

.shop-title-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.shop-title-row h3 {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
}

.item-en {
  color: var(--muted-light);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.shop-desc {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.shop-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}

.price {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1;
}

.price small {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 9.5px;
}

.price .fragment-icon {
  align-self: center;
}

.shop-card-footer .btn {
  min-height: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--denim);
  font-size: 10.5px;
}

.shop-card-footer .btn:hover:not(:disabled) {
  border-bottom-color: rgba(91, 111, 132, 0.4);
  background: transparent;
  color: var(--denim);
}

.shop-card-footer .btn:disabled {
  color: var(--muted-light);
  opacity: 1;
}

.shop-lock-hint {
  margin-top: 6px;
  color: var(--sage-deep);
  font-size: 10px;
}

.shop-card.is-locked .shop-art {
  opacity: 0.72;
}

.shop-card.is-locked .shop-art-inner {
  opacity: 0.55;
}

.shop-grid-empty {
  grid-column: 1 / -1;
  padding: 60px 0;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Calendar
   -------------------------------------------------------------------------- */

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 44px;
  align-items: start;
}

.calendar-panel {
  min-width: 0;
}

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

.month-switch {
  display: flex;
  align-items: center;
  gap: 10px;
}

.month-switch h2 {
  min-width: 118px;
  font-size: 18px;
  font-weight: 400;
  text-align: center;
}

.month-nav-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.month-nav-btn:hover:not(:disabled) {
  border-color: var(--line-strong);
  color: var(--ink);
}

.month-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.month-nav-btn svg {
  width: 13px;
  height: 13px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.calendar-weekdays span {
  color: var(--muted-light);
  font-size: 10.5px;
  text-align: center;
}

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

.cal-day {
  position: relative;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px 6px;
  border-radius: 10px;
  color: var(--ink-soft);
  text-align: center;
  transition: background 0.16s var(--ease);
}

.cal-day:hover:not(.is-empty) {
  background: rgba(247, 246, 241, 0.85);
}

.cal-day.is-empty {
  pointer-events: none;
}

.cal-day.is-future {
  color: var(--muted-light);
  opacity: 0.55;
}

.cal-day-num {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
}

.cal-day.is-today .cal-day-num {
  background: var(--pine);
  color: var(--cream);
}

.cal-day.is-selected {
  background: rgba(247, 246, 241, 0.95);
  box-shadow: inset 0 0 0 1px rgba(55, 67, 60, 0.28);
}

.cal-day-meta {
  margin-top: 5px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.4;
  white-space: nowrap;
}

.cal-day.is-today .cal-day-meta {
  color: var(--sage-deep);
}

.cal-day-dots {
  display: flex;
  gap: 2px;
  margin-top: 4px;
}

.cal-day-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sage);
}

.cal-day.heat-1 .cal-day-dots i { opacity: 0.4; }
.cal-day.heat-2 .cal-day-dots i { opacity: 0.62; }
.cal-day.heat-3 .cal-day-dots i { opacity: 0.85; }
.cal-day.heat-4 .cal-day-dots i { opacity: 1; background: var(--sage-deep); }

.calendar-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted-light);
  font-size: 9.5px;
}

.legend-swatches {
  display: flex;
  gap: 3px;
}

.legend-swatches i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sage);
}

.legend-swatches i:nth-child(1) { opacity: 0.35; }
.legend-swatches i:nth-child(2) { opacity: 0.55; }
.legend-swatches i:nth-child(3) { opacity: 0.78; }
.legend-swatches i:nth-child(4) { opacity: 1; background: var(--sage-deep); }

.day-detail-panel {
  position: sticky;
  top: 96px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.day-detail-head h2 {
  font-size: 18px;
  font-weight: 400;
}

.day-detail-summary {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.day-detail-summary strong {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
  margin-right: 2px;
}

.day-detail-list {
  margin-top: 12px;
}

.day-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(217, 213, 201, 0.65);
}

.day-entry-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--entry-color) 12%, var(--surface));
  font-size: 13px;
  line-height: 1;
}

.day-entry-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.day-entry-copy strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-entry-copy span {
  color: var(--muted-light);
  font-size: 10px;
}

.day-entry-mins {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  white-space: nowrap;
}

.day-detail-empty {
  padding: 34px 0;
  text-align: center;
  color: var(--muted);
}

.day-detail-empty-art {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--sage);
}

.day-detail-empty-art svg {
  width: 22px;
  height: 22px;
}

.day-detail-empty strong {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

.day-detail-empty p {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.8;
}

.history-panel {
  margin-top: 52px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.history-list {
  margin-top: 8px;
}

.history-row {
  display: grid;
  grid-template-columns: 66px 30px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(217, 213, 201, 0.65);
}

.history-date {
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.history-date strong {
  font-size: 10.5px;
  font-weight: 500;
}

.history-date span {
  color: var(--muted-light);
  font-family: var(--font-display);
  font-size: 10px;
}

.history-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--history-color) 12%, var(--surface));
  font-size: 13px;
  line-height: 1;
}

.history-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.4;
}

.history-copy strong {
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-copy span {
  color: var(--muted-light);
  font-size: 10px;
}

.history-mins {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  white-space: nowrap;
}

.history-plus {
  color: var(--brass);
  font-size: 10px;
  white-space: nowrap;
}

.history-empty {
  padding: 34px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.history-more-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.history-more {
  color: var(--muted);
  font-size: 10.5px;
}

/* --------------------------------------------------------------------------
   Achievements
   -------------------------------------------------------------------------- */

.achievement-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 22px 0 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.achievement-medal {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--brass);
}

.achievement-medal svg {
  width: 22px;
  height: 22px;
}

.achievement-hero-copy h2 {
  font-size: 21px;
}

.achievement-hero-copy p:last-child {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
}

.achievement-hero-stats {
  display: flex;
  gap: 28px;
}

.achievement-hero-stats div {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.achievement-hero-stats strong {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
}

.achievement-hero-stats span {
  color: var(--muted);
  font-size: 10px;
}

.ach-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 4px;
}

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

.achievement-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 0 16px;
  border-top: 1px solid var(--line);
}

.achievement-card.is-claimed {
  opacity: 0.62;
}

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

.ach-icon {
  font-size: 20px;
  line-height: 1;
}

.ach-reward {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--brass);
  font-size: 9.5px;
}

.ach-reward svg {
  width: 10px;
  height: 10px;
}

.ach-body h3 {
  font-size: 13px;
  font-weight: 500;
}

.ach-body p {
  margin-top: 2px;
  min-height: 32px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.ach-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted-light);
  font-size: 9.5px;
}

.ach-progress-track {
  height: 2px;
  margin-top: 5px;
  background: var(--line);
}

.ach-progress-track span {
  display: block;
  height: 100%;
  background: var(--sage);
}

.ach-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.ach-claim {
  min-height: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--pine);
  font-size: 10px;
}

.ach-claim:hover {
  background: transparent;
  border-bottom-color: rgba(55, 67, 60, 0.4);
}

.ach-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-light);
  font-size: 10px;
}

.ach-status svg {
  width: 10px;
  height: 10px;
}

.ach-status.claimed {
  color: var(--sage-deep);
}

.achievements-empty {
  grid-column: 1 / -1;
  padding: 54px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(30, 36, 31, 0.3);
  backdrop-filter: blur(5px);
  animation: backdropIn 0.24s var(--ease) both;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 221;
  width: min(540px, calc(100vw - 32px));
  max-height: 88dvh;
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-modal);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  transform: translate(-50%, -50%);
  animation: modalIn 0.32s var(--ease-out) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)) scale(0.985); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal-card.modal-wide {
  width: min(600px, calc(100vw - 32px));
}

.modal-card.modal-sm {
  width: min(390px, calc(100vw - 32px));
  padding: 28px;
  text-align: center;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.modal-head h2 {
  font-size: 24px;
  line-height: 1.3;
}

.modal-head p {
  margin-top: 5px;
  max-width: 52ch;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.75;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  color: var(--muted);
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.modal-close:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.modal-close svg {
  width: 15px;
  height: 15px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-form .input-wrap {
  min-height: 44px;
}

.modal-form .input-icon {
  width: 34px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.choice-chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease);
}

.choice-chip:hover {
  border-color: var(--line-strong);
}

.choice-chip.is-active {
  border-color: var(--pine);
  background: var(--pine);
  color: var(--cream);
}

.duration-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.duration-chip {
  min-width: 44px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease);
}

.duration-chip:hover {
  border-color: var(--line-strong);
}

.duration-chip.is-active {
  border-color: var(--pine);
  background: var(--pine);
  color: var(--cream);
}

.custom-duration {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10.5px;
}

.custom-duration input {
  width: 54px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 11px;
  text-align: center;
  outline: none;
}

.custom-duration input:focus {
  border-color: var(--pine);
}

.icon-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.icon-choice {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}

.icon-choice:hover {
  background: var(--surface-soft);
}

.icon-choice.is-active {
  border-color: var(--line-strong);
  background: var(--surface);
}

.color-choice {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(43, 48, 45, 0.08);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.color-choice.is-active {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--swatch);
}

.task-preview {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.task-preview-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface);
  font-size: 17px;
  line-height: 1;
}

.task-preview-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.4;
}

.task-preview-copy strong {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-preview-copy span {
  color: var(--muted);
  font-size: 10.5px;
}

.task-preview {
  border-left: 2px solid var(--preview-color, var(--sage));
}

.confirm-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin: 2px auto 12px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--sage-deep);
}

.confirm-icon.danger {
  background: var(--rose-soft);
  color: var(--rose);
}

.confirm-icon svg {
  width: 19px;
  height: 19px;
}

.modal-card.modal-sm h2 {
  font-size: 21px;
}

.modal-card.modal-sm > p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.8;
}

.modal-card.modal-sm .modal-actions {
  justify-content: center;
  margin-top: 20px;
}

.modal-card.modal-sm .modal-actions .btn {
  min-width: 104px;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 4px;
}

.profile-summary .avatar {
  width: 52px;
  height: 52px;
  font-size: 17px;
}

.profile-summary-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.45;
}

.profile-summary-copy strong {
  font-size: 13px;
  font-weight: 500;
}

.profile-summary-copy span {
  color: var(--muted);
  font-size: 10px;
}

.profile-summary-copy em {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 10px;
  font-style: normal;
}

.profile-goal-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.goal-chip {
  height: 27px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.goal-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.goal-chip.is-active {
  border-color: var(--pine);
  color: var(--ink);
}

.profile-logout {
  margin-right: auto;
}

.purchase-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.purchase-art {
  aspect-ratio: 1;
  border-radius: 14px;
}

.purchase-art .shop-art-inner {
  inset: 14%;
}

.purchase-copy h2 {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 300;
}

.purchase-copy > p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.8;
}

.item-tag-static {
  color: var(--muted-light);
  font-size: 10px;
}

.purchase-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.purchase-balance {
  color: var(--muted-light);
  font-size: 10.5px;
}

.purchase-balance strong {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 400;
}

.purchase-copy .modal-actions {
  justify-content: flex-start;
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */

.toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(340px, calc(100vw - 40px));
  padding: 10px 15px;
  border-radius: 999px;
  background: var(--pine);
  color: var(--cream);
  box-shadow: var(--shadow-soft);
  animation: toastIn 0.3s var(--ease-out) both;
}

.toast.is-leaving {
  animation: toastOut 0.26s var(--ease) both;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px); }
}

.toast-icon {
  display: inline-flex;
  flex: none;
  opacity: 0.8;
}

.toast-icon svg {
  width: 13px;
  height: 13px;
}

.toast-copy strong {
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.6;
}

.toast-error {
  background: #6d3f34;
}

.toast-success .toast-icon {
  color: #c9d8c2;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 300;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Focus
   -------------------------------------------------------------------------- */

.focus-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-y: auto;
  padding: 0 40px 26px;
  background:
    radial-gradient(80% 60% at 74% 16%, rgba(141, 164, 150, 0.18), transparent 62%),
    radial-gradient(70% 60% at 16% 84%, rgba(198, 211, 215, 0.12), transparent 64%),
    #212a24;
  color: var(--cream);
}

.focus-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2'/%3E%3C/filter%3E%3Crect width='170' height='170' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

.focus-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.focus-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
}

.orb-one {
  width: 44vw;
  height: 44vw;
  left: 4%;
  top: -14%;
  background: rgba(126, 143, 120, 0.13);
}

.orb-two {
  width: 38vw;
  height: 38vw;
  right: -6%;
  bottom: -12%;
  background: rgba(198, 211, 215, 0.1);
}

.orb-three {
  width: 22vw;
  height: 22vw;
  left: 44%;
  top: 38%;
  background: rgba(168, 138, 97, 0.07);
}

.focus-star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(242, 238, 228, 0.5);
}

.star-one { left: 18%; top: 24%; }
.star-two { left: 78%; top: 18%; }
.star-three { left: 86%; top: 62%; }
.star-four { left: 10%; top: 68%; }

.focus-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
}

.focus-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--cream-dim);
}

.focus-brand-mark {
  color: var(--brass);
}

.focus-brand-mark svg {
  width: 14px;
  height: 14px;
}

.focus-controls {
  display: flex;
  gap: 8px;
}

.focus-icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(242, 238, 228, 0.16);
  border-radius: 50%;
  color: var(--cream-dim);
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.focus-icon-btn:hover {
  border-color: rgba(242, 238, 228, 0.36);
  color: var(--cream);
}

.focus-icon-btn svg {
  width: 15px;
  height: 15px;
}

.focus-main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 10px 0 32px;
}

.focus-task-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 16px 7px 8px;
  border-radius: 999px;
  background: rgba(242, 238, 228, 0.045);
}

.focus-task-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(242, 238, 228, 0.08);
  font-size: 15px;
  line-height: 1;
}

.focus-task-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.focus-task-copy small {
  color: var(--cream-dim);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.focus-task-copy strong {
  font-size: 12.5px;
  font-weight: 400;
}

.focus-task-duration {
  margin-left: 8px;
  padding-left: 14px;
  border-left: 1px solid rgba(242, 238, 228, 0.14);
  color: var(--cream-dim);
  font-size: 10px;
}

.focus-timer-wrap {
  position: relative;
  width: min(420px, 78vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.focus-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.focus-ring-track {
  fill: none;
  stroke: rgba(242, 238, 228, 0.1);
  stroke-width: 1.5;
}

.focus-ring-ticks {
  fill: none;
  stroke: rgba(242, 238, 228, 0.09);
  stroke-width: 1;
  stroke-dasharray: 1 11;
}

.focus-ring-progress {
  fill: none;
  stroke: var(--brass);
  stroke-width: 1.8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.4s linear, stroke 0.3s var(--ease);
}

.focus-ring-progress.is-near-end {
  stroke: #f0dcb6;
}

.focus-timer-content {
  text-align: center;
}

.focus-time {
  color: var(--cream);
  font-family: var(--font-display);
  font-size: clamp(62px, 9.5vw, 104px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: lining-nums tabular-nums;
}

.focus-remaining {
  margin-top: 12px;
  color: var(--cream-dim);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.focus-pulse-dot {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 14px;
}

.focus-pulse-dot span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(242, 238, 228, 0.35);
  animation: pulseDot 2.4s ease-in-out infinite;
}

.focus-pulse-dot span:nth-child(2) { animation-delay: -0.8s; }
.focus-pulse-dot span:nth-child(3) { animation-delay: -1.6s; }

@keyframes pulseDot {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.8; }
}

.focus-quote {
  max-width: 34ch;
  color: var(--cream-dim);
  font-size: 12px;
  line-height: 1.9;
  text-align: center;
}

.focus-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cream-dim);
  font-size: 10.5px;
}

.focus-reward {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--brass);
}

.focus-reward strong {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 400;
}

.focus-meta-divider {
  width: 1px;
  height: 12px;
  background: rgba(242, 238, 228, 0.14);
}

.focus-meta-row p {
  color: var(--cream-dim);
}

.focus-abandon {
  margin-top: 4px;
  color: rgba(242, 238, 228, 0.42);
  font-size: 10px;
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.focus-abandon:hover {
  color: var(--cream-dim);
  border-bottom-color: rgba(242, 238, 228, 0.24);
}

.focus-footnote {
  position: relative;
  z-index: 2;
  color: rgba(242, 238, 228, 0.24);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  text-align: center;
}

.focus-screen.is-expired .focus-time {
  color: #f0dcb6;
}

.focus-success {
  position: relative;
  z-index: 3;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 20px 0 40px;
}

.success-rays {
  position: absolute;
  width: 620px;
  height: 620px;
  max-width: 120vw;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(240, 220, 182, 0.13), transparent 70%);
  pointer-events: none;
}

.success-card {
  position: relative;
  width: min(520px, calc(100vw - 36px));
  padding: 34px 34px 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
  text-align: center;
  animation: cardIn 0.5s var(--ease-out) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.success-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--brass-soft);
  color: var(--brass);
}

.success-badge svg {
  width: 18px;
  height: 18px;
}

.success-card h2 {
  font-size: 25px;
  line-height: 1.35;
}

.success-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
}

.success-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  text-align: left;
}

.success-task-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 9px;
  background: var(--surface);
  font-size: 15px;
  line-height: 1;
}

.success-task-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.4;
}

.success-task-copy strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.success-task-copy span {
  color: var(--muted);
  font-size: 10px;
}

.success-fragment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  color: var(--brass);
  white-space: nowrap;
}

.success-fragment strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.success-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.success-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.success-stats div + div {
  border-left: 1px solid var(--line);
}

.success-stats span {
  color: var(--muted);
  font-size: 9.5px;
}

.success-stats strong {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.2;
}

.success-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.success-tip {
  margin-top: 14px;
  color: var(--muted-light);
  font-size: 9.5px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1220px) {
  :root {
    --rail: 216px;
  }

  .view-root {
    padding-left: 32px;
    padding-right: 32px;
  }

  .topbar {
    padding: 0 32px;
  }

  .app-footer {
    padding-left: 32px;
    padding-right: 32px;
  }

  .home-columns {
    gap: 48px;
  }

  .room-layout {
    grid-template-columns: minmax(0, 1fr) 248px;
    gap: 32px;
  }

  .calendar-layout {
    grid-template-columns: minmax(0, 1fr) 264px;
    gap: 32px;
  }

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

@media (max-width: 1080px) {
  .sidebar {
    display: none;
  }

  .topbar-brand {
    display: flex;
  }

  .view-root {
    max-width: 980px;
    padding: 30px 28px 96px;
  }

  .topbar {
    padding: 0 28px;
  }

  .app-footer {
    max-width: 980px;
    padding: 18px 28px 120px;
  }

  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(247, 246, 241, 0.92);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
  }

  .mobile-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 46px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 9.5px;
  }

  .mobile-nav-item .nav-icon svg {
    width: 18px;
    height: 18px;
  }

  .mobile-nav-item.is-active {
    color: var(--ink);
    background: var(--surface-soft);
  }

  .mobile-nav-item.is-active::after {
    content: "";
    position: absolute;
    bottom: 5px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--ink);
  }

  .room-layout,
  .calendar-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .room-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
  }

  .day-detail-panel {
    position: static;
  }

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

  .auth-visual {
    padding: 34px 36px 28px;
  }

  .auth-panel {
    padding: 40px 34px;
  }
}

@media (max-width: 900px) {
  .auth-screen {
    display: block;
    min-height: 100dvh;
  }

  .auth-visual {
    display: block;
    min-height: 0;
    padding: 16px 16px 18px;
    background: #222b25;
  }

  .auth-topline,
  .auth-copy,
  .auth-visual-footer,
  .auth-room-caption {
    display: none;
  }

  .auth-room-wrap {
    max-width: none;
    margin: 0;
  }

  .auth-room {
    aspect-ratio: 2.05;
    border-radius: 14px;
  }

  .auth-window {
    left: 10%;
    top: 8%;
    width: 28%;
    height: 62%;
  }

  .auth-panel {
    display: block;
    padding: 30px 22px 54px;
  }

  .auth-panel-inner {
    width: min(100%, 400px);
    margin: 0 auto;
  }

  .brand-mobile {
    display: inline-flex;
    margin-bottom: 26px;
  }

  .auth-tabs {
    margin-bottom: 24px;
  }

  .home-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 42px;
  }

  .home-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

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

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

  .achievement-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .achievement-hero-stats {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }

  .achievement-hero-stats div {
    align-items: flex-start;
  }

  .focus-screen {
    padding: 0 24px 22px;
  }

  .focus-timer-wrap {
    width: min(360px, 82vw);
  }

  .success-card {
    padding: 28px 24px 22px;
  }
}

@media (max-width: 760px) {
  .view-root {
    padding: 24px 20px 96px;
  }

  .topbar {
    padding: 0 20px;
    height: 62px;
  }

  .topbar-date {
    display: none;
  }

  .app-footer {
    padding: 16px 20px 112px;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
  }

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .profile-header {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 14px;
    padding-bottom: 22px;
  }

  .profile-avatar {
    width: 56px;
    height: 56px;
    font-size: 18px;
  }

  .profile-stats {
    gap: 22px;
    margin-top: 12px;
  }

  .profile-stat strong {
    font-size: 21px;
  }

  .home-canvas.room-canvas,
  .room-canvas {
    aspect-ratio: 1.45;
    min-height: 280px;
  }

  .photo-caption {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-top: 12px;
  }

  .photo-goal {
    text-align: left;
    min-width: 0;
  }

  .photo-goal-track {
    max-width: 220px;
  }

  .home-columns {
    margin-top: 40px;
  }

  .home-side {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .room-side {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .room-canvas-footer {
    flex-direction: column;
    gap: 4px;
  }

  .shop-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0 18px;
  }

  .shop-grid {
    gap: 26px 18px;
  }

  .calendar-panel {
    padding: 0;
  }

  .cal-day {
    min-height: 54px;
    padding: 5px 2px 4px;
  }

  .cal-day-num {
    width: 22px;
    height: 22px;
    font-size: 10.5px;
  }

  .cal-day-meta {
    font-size: 9px;
  }

  .history-row {
    grid-template-columns: 56px 28px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .history-plus {
    display: none;
  }

  .history-mins {
    font-size: 11px;
  }

  .achievement-hero {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
  }

  .achievement-medal {
    width: 44px;
    height: 44px;
  }

  .achievement-hero-copy h2 {
    font-size: 18px;
  }

  .achievement-grid {
    gap: 0 20px;
  }

  .ach-body p {
    min-height: 0;
  }

  .focus-screen {
    padding: 0 18px 18px;
  }

  .focus-header {
    padding: 18px 0;
  }

  .focus-main {
    justify-content: flex-start;
    gap: 18px;
    padding-top: 26px;
  }

  .focus-timer-wrap {
    width: min(320px, 84vw);
  }

  .focus-time {
    font-size: clamp(56px, 16vw, 84px);
  }

  .focus-quote {
    font-size: 11px;
  }

  .focus-meta-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .focus-meta-divider {
    display: none;
  }

  .focus-footnote {
    font-size: 9px;
    padding-top: 16px;
  }

  .modal-card {
    width: calc(100vw - 24px);
    max-height: 90dvh;
    padding: 22px;
    border-radius: 18px;
  }

  .modal-card.modal-wide,
  .modal-card.modal-sm {
    width: calc(100vw - 24px);
  }

  .modal-head h2 {
    font-size: 21px;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .profile-logout {
    margin-right: 0;
    width: 100%;
    order: 3;
  }

  .purchase-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .purchase-art {
    aspect-ratio: 1.7;
  }

  .purchase-copy .modal-actions {
    justify-content: flex-end;
  }

  .toast-root {
    right: 12px;
    left: 12px;
    bottom: 86px;
    align-items: center;
  }

  .toast {
    max-width: 100%;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-visual {
    padding: 12px 12px 14px;
  }

  .auth-room {
    aspect-ratio: 1.9;
  }

  .auth-room-caption {
    display: none;
  }

  .auth-panel {
    padding: 26px 20px 48px;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 13.5px;
  }

  .view-root {
    padding: 20px 16px 92px;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar-brand span {
    font-size: 12.5px;
  }

  .topbar-actions {
    gap: 10px;
  }

  .fragment-label {
    display: none;
  }

  .page-title {
    font-size: 28px;
  }

  .profile-name {
    font-size: 23px;
  }

  .profile-line {
    font-size: 11.5px;
  }

  .profile-stats {
    gap: 18px;
  }

  .profile-stat {
    gap: 4px;
  }

  .profile-stat strong {
    font-size: 19px;
  }

  .profile-stat span {
    font-size: 10.5px;
  }

  .home-canvas.room-canvas,
  .room-canvas {
    aspect-ratio: 1.35;
    min-height: 240px;
  }

  .photo-goal-value strong {
    font-size: 26px;
  }

  .section-head h2 {
    font-size: 15.5px;
  }

  .task-card {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 13px 0;
  }

  .task-icon {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .task-title-row h3 {
    font-size: 13px;
  }

  .task-category {
    display: none;
  }

  .task-meta {
    gap: 3px 9px;
    font-size: 10.5px;
  }

  .task-edit {
    display: none;
  }

  .task-play {
    height: 30px;
    padding: 0 11px;
    font-size: 10px;
  }

  .week-chart {
    height: 108px;
  }

  .shop-grid {
    gap: 22px 14px;
  }

  .shop-title-row h3 {
    font-size: 12.5px;
  }

  .shop-desc {
    font-size: 10.5px;
  }

  .price {
    font-size: 15px;
  }

  .shop-card-footer .btn {
    font-size: 10.5px;
  }

  .shop-art {
    border-radius: 12px;
  }

  .calendar-grid {
    gap: 0;
  }

  .cal-day {
    min-height: 46px;
    padding: 4px 0;
  }

  .cal-day-meta {
    display: none;
  }

  .cal-day-num {
    width: 25px;
    height: 25px;
    font-size: 11px;
  }

  .cal-day-dots {
    position: absolute;
    left: 50%;
    bottom: 5px;
    margin: 0;
    transform: translateX(-50%);
  }

  .calendar-weekdays span {
    font-size: 10px;
  }

  .month-switch h2 {
    min-width: 104px;
    font-size: 16px;
  }

  .history-row {
    grid-template-columns: 52px 26px minmax(0, 1fr);
  }

  .history-mins {
    display: none;
  }

  .history-copy span {
    font-size: 9.5px;
  }

  .achievement-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ach-body p {
    min-height: 0;
  }

  .achievement-hero-stats {
    gap: 22px;
  }

  .focus-task-duration {
    display: none;
  }

  .focus-timer-wrap {
    width: min(290px, 82vw);
  }

  .focus-meta-row p {
    display: none;
  }

  .success-card {
    padding: 24px 18px 20px;
  }

  .success-card h2 {
    font-size: 21px;
  }

  .success-stats strong {
    font-size: 16px;
  }

  .success-actions {
    flex-direction: column-reverse;
  }

  .success-actions .btn {
    width: 100%;
  }

  .modal-card,
  .modal-card.modal-wide,
  .modal-card.modal-sm {
    padding: 20px;
  }

  .modal-head {
    margin-bottom: 16px;
  }

  .modal-head h2 {
    font-size: 19px;
  }

  .modal-form {
    gap: 15px;
  }

  .auth-panel {
    padding: 24px 18px 44px;
  }

  .auth-form-heading h2 {
    font-size: 23px;
  }

  .auth-room {
    aspect-ratio: 1.72;
  }

  .auth-trust {
    margin-top: 26px;
  }
}

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

/* --------------------------------------------------------------------------
   Mobile polish: safe areas, tap feedback, iOS input zoom
   -------------------------------------------------------------------------- */

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  overscroll-behavior-y: contain;
}

button,
a,
input,
select,
textarea,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (max-width: 1080px) {
  .topbar {
    height: calc(68px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }
}

@media (max-width: 760px) {
  .topbar {
    height: calc(62px + env(safe-area-inset-top));
  }
}

@media (max-width: 900px) {
  .auth-visual {
    padding-top: calc(16px + env(safe-area-inset-top));
  }

  .focus-header {
    padding-top: calc(24px + env(safe-area-inset-top));
  }

  .focus-screen {
    padding-bottom: calc(26px + env(safe-area-inset-bottom));
    overscroll-behavior: none;
  }
}

/* iOS Safari 会对小于 16px 的输入框自动放大页面 */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 900px) {
    .input-wrap input,
    .custom-duration input {
      font-size: 16px;
    }

    .custom-duration input {
      width: 68px;
      height: 38px;
    }
  }
}


