body.cabinet-page{
  --cabinet-time-angle:180;
  width:100%;
  height:100svh;
  min-height:620px;
  overflow:hidden;
  background:var(--tr-paper);
}

body.cabinet-page:before{display:none}

body.cabinet-page button,
body.cabinet-page a{
  -webkit-tap-highlight-color:transparent;
}

body.cabinet-page .visually-hidden{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}

body.cabinet-page .skip-link{
  position:fixed;
  z-index:100;
  top:12px;
  left:16px;
  padding:10px 14px;
  transform:translateY(-160%);
}

body.cabinet-page .skip-link:focus{
  transform:translateY(0);
}

.cabinet-stage,
.cabinet-room-root,
.cabinet-light-layer,
.cabinet-scene-layer{
  position:absolute;
  inset:0;
}

.cabinet-stage{
  z-index:0;
  overflow:hidden;
  background:var(--tr-paper);
}

body.cabinet-page>main.cabinet-stage{
  width:100%;
  max-width:none;
  margin:0;
  padding:0;
}

.cabinet-room-root{
  isolation:isolate;
  overflow:hidden;
}

.cabinet-light-layer{
  z-index:0;
  display:block;
  width:100%;
  max-width:none;
  height:100%;
  object-fit:cover;
  object-position:50% 62%;
  opacity:1;
  transition:none;
}

.cabinet-light-layer-b{z-index:1}
#cabinet-toy-shadow-layer{z-index:2;pointer-events:none}
#cabinet-toy-layer{z-index:3}
#cabinet-occlusion-layer{z-index:4;pointer-events:none}

.cabinet-portrait-canvas{
  position:absolute;
  top:calc((100vh - max(100vh,calc(100vw * 9 / 16))) * .62);
  bottom:auto;
  left:50%;
  width:max(100vw,calc(100vh * 16 / 9));
  height:max(100vh,calc(100vw * 9 / 16));
  transform:translateX(-50%);
  container-type:inline-size;
  pointer-events:none;
}

.cabinet-drawer-targets{
  position:absolute;
  top:calc((100vh - max(100vh,calc(100vw * 9 / 16))) * .62);
  left:50%;
  width:max(100vw,calc(100vh * 16 / 9));
  height:max(100vh,calc(100vw * 9 / 16));
  z-index:5;
  pointer-events:none;
  transform:translateX(-50%);
}

.cabinet-portrait-slot{
  position:absolute;
  left:var(--portrait-x);
  top:var(--portrait-y);
  width:var(--portrait-width);
  height:var(--portrait-height);
  margin:0;
  overflow:hidden;
  border-radius:.8%;
  background:transparent;
}

.cabinet-portrait-button{
  display:block;
  width:100%;
  height:100%;
  padding:0;
  border:0;
  border-radius:inherit;
  background:transparent;
  cursor:pointer;
  pointer-events:auto;
}

.cabinet-portrait-slot img,
.cabinet-portrait-button img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
}

.cabinet-portrait-nameplate{
  position:absolute;
  display:grid;
  place-items:center;
  margin:0;
  padding:0;
  overflow:hidden;
  border:0;
  background:transparent;
  color:#3d2d1f;
  font-family:var(--tr-cn);
  font-size:1.25cqw;
  font-weight:500;
  line-height:1;
  text-align:center;
  text-shadow:0 1px rgba(255,255,255,.52);
  white-space:nowrap;
  cursor:pointer;
  pointer-events:auto;
}

.cabinet-portrait-story-photo,
.cabinet-portrait-memento,
.cabinet-portrait-caption{
  position:absolute;
  margin:0;
  pointer-events:none;
}

.cabinet-portrait-story-photo,
.cabinet-portrait-memento{
  box-sizing:border-box;
  display:grid;
  overflow:hidden;
  place-items:center;
}

.cabinet-portrait-story-photo{padding:.38cqw .48cqw}
.cabinet-portrait-memento{padding:0}

.cabinet-portrait-story-photo img,
.cabinet-portrait-memento img{
  display:block;
  width:100%;
  height:100%;
}

.cabinet-portrait-story-photo img{object-fit:cover}
.cabinet-portrait-memento img{
  min-width:0;
  min-height:0;
  width:62%;
  height:62%;
  object-fit:contain;
  filter:drop-shadow(0 .22cqw .18cqw rgba(78,51,37,.16));
}

.cabinet-portrait-caption{
  display:-webkit-box;
  overflow:hidden;
  box-sizing:border-box;
  padding:.08cqw .3cqw;
  align-content:center;
  color:#5b4132;
  font:500 clamp(7px,.52cqw,12px)/1.2 var(--tr-cn);
  text-align:left;
  text-overflow:ellipsis;
  text-shadow:0 1px rgba(255,255,255,.56);
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}

.cabinet-drawer-target{
  position:absolute;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
  cursor:pointer;
  pointer-events:auto;
}

.cabinet-drawer-label{
  position:absolute;
  display:grid;
  overflow:hidden;
  place-items:center;
  color:#5c4432;
  font-family:var(--tr-cn);
  font-weight:500;
  line-height:1;
  text-align:center;
  text-shadow:0 1px rgba(255,255,255,.72);
  white-space:nowrap;
  pointer-events:none;
}

/* Original 3840 x 2160 picture-opening coordinates, measured inside the brown frame edge. */
.cabinet-portrait-slot[data-portrait-slot="portrait-1"]{--portrait-x:5.104167%;--portrait-y:16.481481%;--portrait-width:11.666667%;--portrait-height:20.740741%}
.cabinet-portrait-slot[data-portrait-slot="portrait-2"]{--portrait-x:36.770833%;--portrait-y:16.481481%;--portrait-width:11.875%;--portrait-height:20.740741%}
.cabinet-portrait-slot[data-portrait-slot="portrait-3"]{--portrait-x:69.270833%;--portrait-y:16.481481%;--portrait-width:11.875%;--portrait-height:20.740741%}
.cabinet-portrait-slot[data-portrait-slot="portrait-4"]{--portrait-x:5.104167%;--portrait-y:50%;--portrait-width:11.666667%;--portrait-height:21.111111%}
.cabinet-portrait-slot[data-portrait-slot="portrait-5"]{--portrait-x:36.666667%;--portrait-y:50%;--portrait-width:11.875%;--portrait-height:21.111111%}
.cabinet-portrait-slot[data-portrait-slot="portrait-6"]{--portrait-x:69.270833%;--portrait-y:50%;--portrait-width:11.770833%;--portrait-height:21.111111%}

.cabinet-header{
  position:absolute;
  z-index:20;
  top:20px;
  right:4.5%;
  left:4.5%;
  display:grid;
  min-height:48px;
  grid-template-columns:220px 1fr 220px;
  align-items:center;
}

.cabinet-brand{
  justify-self:start;
}

.cabinet-nav{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:38px;
  font-family:var(--tr-cn);
}

.cabinet-nav a,
.cabinet-nav button{
  position:relative;
  display:inline-flex;
  min-height:44px;
  align-items:center;
  padding:0;
  border:0;
  background:none;
  color:var(--tr-ink);
  font-family:var(--tr-cn);
  font-size:15px;
  font-weight:500;
  line-height:1;
  text-decoration:none;
  white-space:nowrap;
  cursor:pointer;
}

.cabinet-nav [aria-current="page"]{
  color:var(--tr-coral);
}

.cabinet-nav [aria-current="page"]:after{
  content:"";
  position:absolute;
  bottom:4px;
  left:50%;
  width:5px;
  height:5px;
  border-radius:50%;
  background:currentColor;
  transform:translateX(-50%);
}

.cabinet-utility{
  display:flex;
  justify-content:flex-end;
  gap:6px;
}

.cabinet-utility-control{
  display:grid;
  width:44px;
  height:44px;
  padding:0;
  place-items:center;
  border:0;
  border-radius:50%;
  background:transparent;
  color:var(--tr-ink);
  cursor:pointer;
  text-decoration:none;
}

.cabinet-utility-control svg{
  width:25px;
  height:25px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.cabinet-quick-actions{
  position:absolute;
  z-index:18;
  top:50%;
  left:16px;
  display:flex;
  flex-direction:column;
  gap:14px;
  transform:translateY(-50%);
}

.cabinet-quick-action{
  position:relative;
  display:grid;
  width:54px;
  height:54px;
  padding:0;
  place-items:center;
  border:1px solid rgba(255,255,255,.36);
  border-radius:50%;
  background:rgba(255,250,246,.28);
  color:var(--tr-ink);
  box-shadow:0 1px 0 rgba(255,255,255,.6) inset,0 10px 28px rgba(76,48,30,.08);
  backdrop-filter:blur(10px) saturate(120%);
  cursor:pointer;
}

.cabinet-quick-action svg{
  width:27px;
  height:27px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.cabinet-quick-action:after{
  content:attr(aria-label);
  position:absolute;
  left:calc(100% + 12px);
  width:max-content;
  max-width:180px;
  padding:7px 10px;
  border-radius:8px;
  background:rgba(59,39,24,.92);
  color:#fff;
  font-family:var(--tr-cn);
  font-size:12px;
  font-weight:500;
  line-height:1;
  opacity:0;
  pointer-events:none;
  transform:translateX(-4px);
  transition:opacity 140ms ease,transform 160ms ease;
}

.cabinet-quick-action:hover:after,
.cabinet-quick-action:focus-visible:after{
  opacity:1;
  transform:translateX(0);
}

.cabinet-time-dial{
  position:absolute;
  z-index:16;
  top:50%;
  right:14px;
  width:40px;
  height:clamp(430px,62vh,560px);
  color:var(--tr-ink);
  font-variant-numeric:tabular-nums;
  -webkit-user-select:none;
  user-select:none;
  transform:translateY(-50%);
}

.cabinet-dial-face{
  position:relative;
  width:100%;
  height:calc(100% - 42px);
  overflow:visible;
  border:1px solid rgba(255,255,255,.72);
  border-radius:30px;
  background:rgba(255,250,246,.34);
  box-shadow:0 1px 0 rgba(255,255,255,.86) inset,0 14px 38px rgba(82,55,35,.12);
  -webkit-backdrop-filter:blur(14px) saturate(112%);
  backdrop-filter:blur(14px) saturate(112%);
  cursor:grab;
  touch-action:none;
}

.cabinet-dial-face:before{
  content:"";
  position:absolute;
  z-index:0;
  inset:3px;
  border:1px solid rgba(255,255,255,.28);
  border-radius:27px;
  box-shadow:0 0 0 1px rgba(103,74,52,.02) inset;
  pointer-events:none;
}

.cabinet-dial-face:active{cursor:grabbing}

.cabinet-dial-ticks{
  position:absolute;
  z-index:1;
  inset:0;
  pointer-events:none;
}

.cabinet-dial-tick{
  position:absolute;
  top:var(--dial-tick-position);
  left:50%;
  width:11px;
  height:1.5px;
  border-radius:999px;
  background:var(--dial-tick-color,rgba(92,65,44,.56));
  opacity:.48;
  transform:translate(-50%,-50%);
}

.cabinet-dial-tick.is-hour{width:18px;height:2px;opacity:.62}

.cabinet-dial-label{
  position:absolute;
  z-index:2;
  left:50%;
  width:18px;
  color:rgba(59,39,24,.72);
  font-family:var(--tr-body);
  font-size:10px;
  font-weight:400;
  line-height:1;
  text-align:center;
  transform:translate(-50%,-50%);
}

.label-24{top:8%}
.label-6{top:29%}
.label-12{top:50%}
.label-18{top:71%}

.cabinet-dial-marker-track{
  position:absolute;
  z-index:3;
  top:var(--cabinet-time-position,50%);
  left:50%;
  width:22px;
  height:2px;
  border-radius:999px;
  background:var(--tr-coral);
  box-shadow:0 4px 12px rgba(238,91,48,.16);
  pointer-events:none;
  transform:translate(-50%,-50%);
}

.cabinet-dial-marker-track i{
  position:absolute;
  top:50%;
  right:0;
  width:14px;
  height:14px;
  border-radius:50%;
  background:var(--tr-coral);
  box-shadow:0 5px 14px rgba(238,91,48,.3),0 1px 0 rgba(255,255,255,.72) inset;
  transform:translate(50%,-50%);
}

.cabinet-sun,
.cabinet-moon{
  position:absolute;
  z-index:2;
  right:11px;
  width:15px;
  height:15px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.55;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.cabinet-sun{top:11px}
.cabinet-moon{right:12px;bottom:11px;width:13px;height:13px;fill:currentColor;stroke-width:1.15}

.cabinet-time-value{
  position:absolute;
  z-index:4;
  top:-42px;
  left:50%;
  min-width:60px;
  padding:7px 8px 6px;
  border:1px solid rgba(255,255,255,.72);
  border-radius:14px;
  background:rgba(255,250,246,.7);
  color:var(--tr-ink);
  font-family:var(--tr-body);
  font-size:15px;
  font-weight:400;
  line-height:1;
  letter-spacing:-.02em;
  text-align:center;
  box-shadow:0 1px 0 rgba(255,255,255,.82) inset,0 8px 20px rgba(76,48,30,.1);
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  transform:translateX(-50%);
}

.cabinet-time-status{
  position:absolute;
  z-index:4;
  right:auto;
  bottom:-20px;
  left:50%;
  width:max-content;
  color:rgba(59,39,24,.72);
  font-family:var(--tr-cn);
  font-size:10px;
  font-weight:400;
  transform:translateX(-50%);
}

.cabinet-time-toggle{
  position:absolute;
  z-index:5;
  bottom:0;
  left:50%;
  display:grid;
  width:34px;
  height:34px;
  padding:0;
  place-items:center;
  border:1px solid rgba(255,255,255,.72);
  border-radius:50%;
  background:rgba(255,250,246,.52);
  color:var(--tr-ink);
  box-shadow:0 1px 0 rgba(255,255,255,.82) inset,0 8px 20px rgba(76,48,30,.1);
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  transform:translateX(-50%);
  cursor:pointer;
}

.cabinet-time-toggle:before{
  content:"";
  position:absolute;
  inset:-5px;
}

.cabinet-time-toggle svg{
  width:14px;
  height:14px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.cabinet-time-toggle [data-pause-icon],
.cabinet-time-toggle [data-play-icon]{
  transform-box:fill-box;
  transform-origin:center;
  transition:opacity 180ms cubic-bezier(.23,1,.32,1),transform 180ms cubic-bezier(.23,1,.32,1);
}

.cabinet-time-toggle [data-pause-icon]{
  opacity:1;
  transform:scale(1);
}

.cabinet-time-toggle [data-play-icon]{
  opacity:0;
  transform:scale(.68);
}

.cabinet-time-toggle[aria-pressed="true"] [data-pause-icon]{
  opacity:0;
  transform:scale(.68);
}

.cabinet-time-toggle[aria-pressed="true"] [data-play-icon]{
  opacity:1;
  transform:scale(1);
}

.cabinet-toast{
  position:fixed;
  z-index:60;
  bottom:max(18px,env(safe-area-inset-bottom));
  left:50%;
  width:max-content;
  max-width:min(420px,calc(100vw - 32px));
  padding:11px 15px;
  border-radius:8px;
  background:rgba(59,39,24,.94);
  color:#fff;
  font-family:var(--tr-cn);
  font-size:14px;
  font-weight:500;
  line-height:1.5;
  text-align:center;
  opacity:0;
  pointer-events:none;
  box-shadow:0 12px 30px rgba(59,39,24,.2);
  transform:translate(-50%,12px);
  transition:opacity 180ms ease,transform 180ms ease;
}

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

body.keepsake-open [data-cabinet-surface]{
  filter:none;
  pointer-events:none;
  transition:filter 180ms cubic-bezier(.23,1,.32,1);
}

.cabinet-keepsake-overlay[hidden]{display:none}

.cabinet-keepsake-overlay{
  position:fixed;
  z-index:46;
  inset:0;
  display:grid;
  padding:clamp(18px,3vw,44px);
  place-items:center;
  opacity:0;
  transition:opacity 180ms cubic-bezier(.23,1,.32,1);
}

.cabinet-keepsake-overlay.is-open{opacity:1}

.cabinet-keepsake-backdrop{
  position:absolute;
  inset:0;
  background:rgba(255,249,243,.025);
  -webkit-backdrop-filter:none;
  backdrop-filter:none;
}

.cabinet-keepsake-shell{
  position:relative;
  width:min(1050px,calc((100svh - 64px) * 4 / 3),92vw);
  aspect-ratio:4/3;
  filter:drop-shadow(0 26px 52px rgba(68,43,23,.22));
  transform:scale(.985);
  transition:transform 200ms cubic-bezier(.23,1,.32,1);
}

.cabinet-keepsake-overlay.is-open .cabinet-keepsake-shell{transform:scale(1)}

.cabinet-keepsake-frame{
  position:absolute;
  inset:0;
  overflow:hidden;
}

.cabinet-keepsake-artwork{
  position:absolute;
  inset:0;
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  pointer-events:none;
  user-select:none;
}

.cabinet-keepsake-main-photo,
.cabinet-keepsake-story-photo,
.cabinet-keepsake-memento,
.cabinet-keepsake-name,
.cabinet-keepsake-story-text{
  position:absolute;
  z-index:2;
  margin:0;
}

.cabinet-keepsake-main-photo{
  top:16.35%;
  left:12.25%;
  width:34.85%;
  height:57.2%;
  overflow:hidden;
}

.cabinet-keepsake-story-photo{
  top:15.3%;
  left:55.55%;
  width:32.8%;
  height:31.05%;
}

.cabinet-keepsake-memento{
  top:55.55%;
  left:55.6%;
  width:33.15%;
  height:19.05%;
}

.cabinet-keepsake-story-photo,
.cabinet-keepsake-memento{
  overflow:hidden;
  border:0;
  background:transparent;
  cursor:pointer;
}

.cabinet-keepsake-story-photo{padding:2.2% 2.6%}
.cabinet-keepsake-memento{padding:2.8% 8% 2.2%}

.cabinet-keepsake-story-photo:disabled,
.cabinet-keepsake-memento:disabled{
  cursor:default;
}

.cabinet-keepsake-main-photo img,
.cabinet-keepsake-story-photo img,
.cabinet-keepsake-memento img{
  display:block;
  width:100%;
  height:100%;
}

.cabinet-keepsake-main-photo img{object-fit:cover}
.cabinet-keepsake-story-photo img,
.cabinet-keepsake-memento img{object-fit:contain}

.cabinet-keepsake-name{
  top:80.15%;
  left:18.25%;
  display:grid;
  width:21.7%;
  height:7.7%;
  place-items:center;
  overflow:hidden;
  padding:0;
  border:0;
  background:transparent;
  color:#3b2a1d;
  font-family:var(--tr-cn);
  font-size:clamp(12px,1.25vw,22px);
  font-weight:500;
  line-height:1;
  text-align:center;
  text-shadow:0 1px rgba(255,255,255,.55);
  white-space:nowrap;
  cursor:pointer;
}

.cabinet-keepsake-profile[hidden],
.cabinet-keepsake-profile-view[hidden],
.cabinet-keepsake-profile-form[hidden]{display:none}

.cabinet-keepsake-profile{
  position:absolute;
  z-index:4;
  top:17%;
  right:9.5%;
  bottom:auto;
  left:51%;
  display:grid;
  max-height:66%;
  min-width:0;
  min-height:0;
  grid-template-rows:auto auto;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.62);
  border-radius:16px;
  background:rgba(255,249,243,.9);
  color:#493936;
  box-shadow:0 22px 54px rgba(66,42,30,.18);
  -webkit-backdrop-filter:blur(18px) saturate(1.06);
  backdrop-filter:blur(18px) saturate(1.06);
}

.cabinet-keepsake-profile-header{
  display:flex;
  min-height:clamp(42px,6vw,64px);
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:clamp(8px,1.25vw,15px) clamp(12px,2vw,24px);
  border-bottom:1px solid rgba(73,57,54,.12);
}

.cabinet-keepsake-profile-header h2{
  margin:0;
  overflow:hidden;
  font:500 clamp(18px,2.4vw,32px)/1.08 Georgia,"Songti SC",serif;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.cabinet-keepsake-profile-close{
  display:grid;
  flex:0 0 auto;
  width:clamp(36px,4.5vw,44px);
  height:clamp(36px,4.5vw,44px);
  padding:0;
  place-items:center;
  border:1px solid rgba(73,57,54,.14);
  border-radius:50%;
  background:rgba(255,255,255,.52);
  color:#493936;
  cursor:pointer;
}

.cabinet-keepsake-profile-close svg{
  width:48%;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
}

.cabinet-keepsake-profile-view{
  display:grid;
  min-height:0;
  grid-template-rows:auto auto;
  align-content:center;
  gap:clamp(7px,1vw,12px);
  padding:clamp(10px,1.7vw,20px) clamp(12px,2vw,24px) clamp(12px,1.8vw,20px);
}

.cabinet-keepsake-profile-view dl{
  display:grid;
  min-height:0;
  margin:0;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-content:start;
  gap:clamp(5px,.75vw,9px) clamp(14px,2vw,24px);
}

.cabinet-keepsake-profile-view dl div{
  display:grid;
  min-width:0;
  grid-template-columns:clamp(38px,5vw,58px) minmax(0,1fr);
  gap:clamp(5px,.7vw,9px);
  padding-bottom:clamp(5px,.7vw,9px);
  border-bottom:1px solid rgba(73,57,54,.1);
}

.cabinet-keepsake-profile-view dl .is-wide{grid-column:1/-1}
.cabinet-keepsake-profile-view dt{color:#8d756d;font-size:clamp(9px,.9vw,12px)}
.cabinet-keepsake-profile-view dd{margin:0;overflow:hidden;color:#493936;font-size:clamp(10px,1vw,14px);font-weight:600;line-height:1.35;text-overflow:ellipsis}

.cabinet-keepsake-profile-edit,
.cabinet-keepsake-profile-actions button{
  min-height:clamp(38px,4.5vw,46px);
  border:1px solid rgba(73,57,54,.16);
  border-radius:999px;
  background:rgba(255,255,255,.62);
  color:#493936;
  font-weight:600;
  cursor:pointer;
}

.cabinet-keepsake-profile-edit{width:min(190px,42%);justify-self:end;padding:0 20px}
.cabinet-keepsake-more-settings{grid-column:1/-1;margin-top:4px;color:#806a63;font-family:var(--tr-cn);font-size:12px}
.cabinet-keepsake-more-settings summary{min-height:38px;display:flex;align-items:center;justify-content:flex-end;cursor:pointer;list-style:none}
.cabinet-keepsake-more-settings summary::-webkit-details-marker{display:none}
.cabinet-keepsake-more-settings p{margin:0 0 8px;text-align:right;color:#9b8379}
.cabinet-keepsake-delete{display:block;min-width:116px;min-height:40px;margin-left:auto;border:1px solid rgba(183,72,70,.2);border-radius:13px;background:rgba(255,242,239,.46);color:#aa4a49;font:13px var(--tr-cn);cursor:pointer}

.cabinet-keepsake-profile-form{
  display:grid;
  min-height:0;
  grid-template-rows:auto auto;
  align-content:center;
  gap:clamp(7px,1vw,12px);
  padding:clamp(8px,1.25vw,15px) clamp(12px,2vw,24px) clamp(10px,1.5vw,18px);
}

.cabinet-keepsake-profile-fields{
  display:grid;
  min-height:0;
  grid-template-columns:repeat(2,minmax(0,1fr));
  align-content:start;
  gap:clamp(5px,.7vw,9px) clamp(9px,1.3vw,16px);
}

.cabinet-keepsake-profile-fields label{display:grid;min-width:0;gap:3px;color:#806a63;font-size:clamp(8px,.8vw,11px);font-weight:600}
.cabinet-keepsake-profile-fields .is-wide{grid-column:1/-1}
.cabinet-keepsake-profile-fields input,
.cabinet-keepsake-profile-fields textarea{
  width:100%;
  min-height:clamp(30px,3.4vw,38px);
  padding:clamp(5px,.65vw,8px) clamp(8px,1vw,12px);
  border:1px solid rgba(73,57,54,.16);
  border-radius:10px;
  outline:0;
  background:rgba(255,255,255,.72);
  color:#493936;
  font:500 clamp(9px,.95vw,13px)/1.3 var(--tr-cn);
  resize:none;
}

.cabinet-keepsake-profile-fields input:focus,
.cabinet-keepsake-profile-fields textarea:focus{border-color:#d96370;box-shadow:0 0 0 3px rgba(217,99,112,.12)}
.cabinet-keepsake-profile-actions{display:flex;justify-content:flex-end;gap:8px}
.cabinet-keepsake-profile-actions button{min-width:clamp(92px,13vw,138px);padding:0 16px}
.cabinet-keepsake-profile-save{border-color:transparent!important;background:#493936!important;color:#fff!important}

.cabinet-keepsake-story-text{
  top:80.1%;
  left:52.7%;
  display:flex;
  width:32.8%;
  height:9.8%;
  align-items:center;
  overflow:hidden;
  color:#5a4634;
  font-family:var(--tr-cn);
  font-size:clamp(10px,.95vw,17px);
  font-weight:500;
  line-height:1.45;
}

.cabinet-keepsake-close{
  position:absolute;
  z-index:5;
  top:clamp(8px,1.2vw,16px);
  right:clamp(8px,1.2vw,16px);
  display:grid;
  width:44px;
  height:44px;
  padding:0;
  place-items:center;
  border:1px solid rgba(255,255,255,.62);
  border-radius:50%;
  background:rgba(255,250,246,.42);
  color:var(--tr-ink);
  box-shadow:0 1px 0 rgba(255,255,255,.82) inset,0 10px 26px rgba(76,48,30,.1);
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
  cursor:pointer;
}

.cabinet-keepsake-close svg{
  width:21px;
  height:21px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
}

body.creator-open [data-cabinet-surface]{
  filter:blur(6px);
  pointer-events:none;
  transition:filter 180ms cubic-bezier(.23,1,.32,1);
}

.cabinet-creator-overlay[hidden]{display:none}

.cabinet-creator-overlay{
  position:fixed;
  z-index:80;
  inset:0;
  display:grid;
  place-items:center;
  padding:clamp(24px,4vh,48px) clamp(24px,4vw,64px);
  opacity:0;
  transition:opacity 180ms cubic-bezier(.23,1,.32,1);
}

.cabinet-creator-overlay.is-open{opacity:1}

.cabinet-creator-backdrop{
  position:absolute;
  inset:0;
  background:transparent;
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(10px);
}

.cabinet-creator-panel{
  position:relative;
  display:grid;
  width:min(1100px,64vw);
  height:min(78vh,740px);
  min-width:780px;
  min-height:570px;
  overflow:hidden;
  grid-template-rows:auto minmax(0,1fr);
  border:1px solid rgba(255,255,255,.7);
  border-radius:26px;
  background:rgba(255,249,243,.18);
  color:var(--tr-ink);
  box-shadow:0 1px 0 rgba(255,255,255,.9) inset,0 28px 80px rgba(62,40,27,.2);
  -webkit-backdrop-filter:blur(22px) saturate(118%);
  backdrop-filter:blur(24px) saturate(118%);
  transform:scale(.985);
  transition:transform 200ms cubic-bezier(.23,1,.32,1);
}

.cabinet-creator-overlay.is-open .cabinet-creator-panel{transform:scale(1)}

.cabinet-creator-header{
  display:flex;
  min-height:76px;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:17px 20px 15px 25px;
  border-bottom:0;
  background:transparent;
}

.cabinet-creator-header h2,
.cabinet-creator-header p{margin:0}

.cabinet-creator-header h2{
  font-family:var(--tr-cn);
  font-size:21px;
  font-weight:500;
  letter-spacing:-.01em;
}

.cabinet-creator-header p{
  margin-top:3px;
  color:var(--tr-muted);
  font-family:var(--tr-cn);
  font-size:12px;
}

.cabinet-creator-cancel{
  display:grid;
  width:44px;
  height:44px;
  flex:0 0 auto;
  padding:0;
  place-items:center;
  border:1px solid rgba(255,255,255,.58);
  border-radius:50%;
  background:rgba(255,250,246,.35);
  color:var(--tr-ink);
  box-shadow:0 1px 0 rgba(255,255,255,.7) inset,0 8px 24px rgba(76,48,30,.07);
  cursor:pointer;
}

.cabinet-creator-cancel svg{
  width:21px;
  height:21px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
}

.cabinet-creator-content{
  display:block;
  width:100%;
  height:100%;
  background:transparent;
  overflow:hidden;
}

.cabinet-header a:focus-visible,
.cabinet-header button:focus-visible,
.cabinet-quick-action:focus-visible,
.cabinet-portrait-button:focus-visible,
.cabinet-drawer-target:focus-visible,
.cabinet-keepsake-overlay button:focus-visible,
.cabinet-dial-face:focus-visible,
  .cabinet-time-toggle:focus-visible{
  outline:3px solid var(--tr-focus);
  outline-offset:4px;
}

@media (hover:hover) and (pointer:fine){
  .cabinet-nav a,
  .cabinet-nav button,
  .cabinet-utility-control,
  .cabinet-quick-action,
  .cabinet-time-toggle,
    .cabinet-creator-cancel,
    .cabinet-keepsake-close{
    transition:color 160ms ease,background-color 160ms ease,box-shadow 180ms ease;
  }

  .cabinet-nav a:hover,
  .cabinet-nav button:hover{color:var(--tr-coral)}

    .cabinet-utility-control:hover,
    .cabinet-creator-cancel:hover,
    .cabinet-keepsake-close:hover{background:rgba(255,255,255,.62)}

  .cabinet-portrait-button:hover img,
  .cabinet-keepsake-story-photo:not(:disabled):hover img,
  .cabinet-keepsake-memento:not(:disabled):hover img{
    filter:brightness(1.035);
  }

  .cabinet-quick-action:hover{
    border-color:rgba(255,255,255,.66);
    background:rgba(255,250,246,.5);
    color:var(--tr-coral-dark);
    box-shadow:0 1px 0 rgba(255,255,255,.7) inset,0 14px 32px rgba(76,48,30,.12);
  }
}

@media (max-width:1100px) and (min-width:901px){
  .cabinet-header{right:4.5%;left:4.5%;grid-template-columns:180px 1fr 160px}
  .cabinet-nav{gap:22px}
  .cabinet-quick-actions{left:14px}
  .cabinet-creator-panel{width:86vw;min-width:0}
}

@media (max-width:900px){
  body.cabinet-page{min-height:620px}

  .cabinet-header{
    position:absolute;
    top:0;
    right:0;
    left:0;
    grid-template-areas:"brand utility" "nav nav";
    grid-template-columns:1fr auto;
    row-gap:8px;
    padding:calc(13px + env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) 7px max(20px,env(safe-area-inset-left));
  }

  .cabinet-brand{grid-area:brand}
  .cabinet-nav{grid-area:nav;justify-content:space-between;gap:12px;border-top:1px solid rgba(59,39,24,.08)}
  .cabinet-nav a,.cabinet-nav button{font-size:14px}
  .cabinet-utility{grid-area:utility}

  .cabinet-quick-actions{
    top:auto;
    bottom:max(24px,env(safe-area-inset-bottom));
    left:max(20px,env(safe-area-inset-left));
    flex-direction:row;
    transform:none;
  }

  .cabinet-time-dial{
    top:50%;
    right:max(10px,env(safe-area-inset-right));
    bottom:auto;
    width:38px;
    height:min(520px,62svh);
    transform:translateY(-50%);
  }

  .cabinet-creator-overlay{padding:18px}
  .cabinet-creator-panel{width:calc(100vw - 36px);height:calc(100svh - 36px);min-width:0;min-height:0;border-radius:22px}
}

@media (max-width:620px){
  .cabinet-keepsake-overlay{padding:12px}
  .cabinet-keepsake-shell{width:min(96vw,calc((100svh - 24px) * 4 / 3))}
  .cabinet-keepsake-close{top:6px;right:6px;width:42px;height:42px}
}

@media (prefers-reduced-motion:reduce){
  .cabinet-keepsake-overlay,
  .cabinet-keepsake-shell{transition:none}
}

@media (max-width:900px) and (min-aspect-ratio:4/3){
  .cabinet-creator-overlay{padding:18px}
  .cabinet-creator-panel{
    width:76vw;
    height:76svh;
    min-width:0;
    min-height:0;
  }
}

@media (max-width:560px){
  .cabinet-header{row-gap:5px;padding:calc(10px + env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 5px max(14px,env(safe-area-inset-left))}
  .cabinet-nav{gap:5px}
  .cabinet-utility{gap:0}
  .cabinet-utility-control{width:44px;height:44px}
  .cabinet-utility-control svg{width:22px;height:22px}
  .cabinet-quick-actions{bottom:max(18px,env(safe-area-inset-bottom));left:max(14px,env(safe-area-inset-left));gap:9px}
  .cabinet-quick-action{width:48px;height:48px}
  .cabinet-quick-action svg{width:24px;height:24px}
  .cabinet-time-dial{top:50%;right:max(7px,env(safe-area-inset-right));bottom:auto;width:36px;height:min(440px,52svh);transform:translateY(-50%)}
  .cabinet-time-value{min-width:56px;padding:6px 7px;font-size:13px}
  .cabinet-time-status{font-size:9px}
  .cabinet-creator-overlay{padding:10px}
  .cabinet-creator-panel{width:calc(100vw - 20px);height:calc(100svh - 20px);border-radius:18px}
  .cabinet-creator-header{min-height:70px;padding:14px 14px 13px 18px}
  .cabinet-creator-header p{display:none}
}

@media (prefers-reduced-motion:reduce){
  .cabinet-nav a,
  .cabinet-nav button,
  .cabinet-utility-control,
  .cabinet-quick-action,
  .cabinet-time-toggle,
  .cabinet-time-toggle [data-pause-icon],
  .cabinet-time-toggle [data-play-icon],
  .cabinet-toast,
  .cabinet-creator-overlay,
  .cabinet-creator-panel{transition:none}
}

.cabinet-wallet-trigger svg circle:not(:first-child){fill:currentColor;stroke:none}

body.wallet-open [data-cabinet-surface]{
  filter:blur(5px);
  pointer-events:none;
  transition:filter 180ms cubic-bezier(.23,1,.32,1);
}

.cabinet-wallet-overlay[hidden]{display:none}
.cabinet-wallet-overlay{
  position:fixed;
  z-index:82;
  inset:0;
  display:grid;
  place-items:center;
  padding:24px;
  background:rgba(68,50,43,.12);
  backdrop-filter:blur(7px) saturate(1.08);
}

.cabinet-wallet-panel{
  width:min(430px,calc(100vw - 32px));
  max-height:min(620px,calc(100svh - 36px));
  overflow:hidden;
  padding:24px;
  border:1px solid rgba(255,255,255,.68);
  border-radius:28px;
  background:linear-gradient(145deg,rgba(255,251,247,.88),rgba(247,232,222,.72));
  color:var(--tr-ink);
  box-shadow:0 24px 70px rgba(70,45,35,.18),0 4px 14px rgba(70,45,35,.1);
  backdrop-filter:blur(22px) saturate(1.16);
}

.cabinet-wallet-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}
.cabinet-wallet-header h2,.cabinet-wallet-history h3{margin:0;color:var(--tr-ink)}
.cabinet-wallet-header h2{font-family:var(--tr-display);font-size:30px;line-height:1.08}
.cabinet-wallet-header p{max-width:29ch;margin:7px 0 0;color:var(--tr-muted);font-size:13px;line-height:1.55}

.cabinet-wallet-close{
  display:grid;
  flex:0 0 44px;
  width:44px;
  height:44px;
  padding:0;
  place-items:center;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.48);
  color:var(--tr-ink);
  cursor:pointer;
}
.cabinet-wallet-close svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}

.cabinet-wallet-balance{
  display:flex;
  align-items:center;
  gap:16px;
  margin:24px 0 20px;
  padding:18px 20px;
  border-radius:18px;
  background:rgba(255,255,255,.46);
  box-shadow:0 8px 24px rgba(88,58,45,.08);
}
.cabinet-wallet-balance svg{width:48px;height:48px;fill:none;stroke:var(--tr-action);stroke-width:1.8}
.cabinet-wallet-balance svg circle:not(:first-child){fill:var(--tr-action);stroke:none}
.cabinet-wallet-balance span{display:block;color:var(--tr-muted);font-size:13px}
.cabinet-wallet-balance strong{display:block;margin-top:2px;font-size:34px;font-variant-numeric:tabular-nums;line-height:1}

.cabinet-wallet-history{min-height:150px}
.cabinet-wallet-history h3{font-size:15px}
.cabinet-wallet-history ul{max-height:210px;margin:12px 0 0;padding:0;overflow:auto;list-style:none}
.cabinet-wallet-history li{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 2px;border-bottom:1px solid rgba(78,58,51,.1);font-size:14px}
.cabinet-wallet-history strong{font-variant-numeric:tabular-nums}
.cabinet-wallet-history .is-earned{color:#8b624d}
.cabinet-wallet-history .is-spent{color:var(--tr-muted)}
.cabinet-wallet-history .cabinet-wallet-empty{justify-content:center;border:0;color:var(--tr-muted);padding:34px 0}

.cabinet-wallet-recharge{
  width:100%;
  min-height:46px;
  margin-top:18px;
  border:1px solid rgba(93,69,58,.14);
  border-radius:14px;
  background:rgba(255,255,255,.38);
  color:var(--tr-muted);
  font:500 14px/1 var(--tr-cn);
}
.cabinet-wallet-status{min-height:20px;margin:10px 0 0;color:var(--tr-muted);font-size:12px;text-align:center}
.cabinet-wallet-close:focus-visible,.cabinet-wallet-recharge:focus-visible{outline:3px solid var(--tr-focus);outline-offset:3px}

@media (prefers-reduced-motion:reduce){
  .cabinet-wallet-overlay,
  .cabinet-wallet-panel{transition:none}
}
