#treasure-open{width:44px;height:44px;padding:8px;border:1px solid #b78568;border-radius:50%;background:#231421c9;color:#eed1ac;display:grid;place-items:center;flex:none;cursor:pointer}#treasure-open svg{width:27px;height:27px}.keepsakes{gap:10px!important}
#treasure-dialog{box-sizing:border-box;width:min(100%,520px);height:100dvh;max-height:100dvh;max-width:100%;margin:auto;padding:0;border:1px solid #b8876d;border-radius:20px;background:linear-gradient(145deg,#391c2f,#1a1220);color:#f5dfcc;overflow:auto;font-family:"Shippori Mincho", "Yu Mincho","Hiragino Mincho ProN",serif}#treasure-dialog::backdrop{background:#0e0710c9;backdrop-filter:blur(5px)}
#treasure-dialog *{box-sizing:border-box}#treasure-dialog [hidden]{display:none!important}.treasure-shell{padding:20px 18px 30px;background:url('assets/images/ui/dialogue-corner.svg') no-repeat left top;background-size:90px}.treasure-heading{display:flex;align-items:center;gap:10px;position:sticky;top:0;background:#261725f5;z-index:2;border-bottom:1px solid #ae795760;padding:8px 0}.treasure-heading h2{font-size:25px;letter-spacing:.15em;flex:1;margin:0}.treasure-heading button{padding:8px 12px}.treasure-intro,.treasure-help{font-size:13px;color:#c9aa9e;line-height:1.8}#treasure-dialog [data-status]{line-height:1.8;color:#f0c6ad}#treasure-dialog [data-status]:empty{display:none}
#treasure-dialog button,#treasure-dialog [data-auth] a{font:inherit;color:#f5dfcc;background:linear-gradient(#54273d,#281827);border:1px solid #b8886b;border-radius:25px;padding:12px 16px;cursor:pointer;text-decoration:none}#treasure-dialog button:disabled{opacity:.5;cursor:wait}#treasure-dialog button:focus-visible,#treasure-dialog input:focus-visible,#treasure-dialog textarea:focus-visible,#treasure-dialog select:focus-visible{outline:2px solid #f7ce92;outline-offset:3px}#treasure-dialog [data-auth]{padding:14px;border:1px solid #b8886b;border-radius:12px;margin-bottom:18px}#treasure-dialog [data-auth] a{display:inline-block;margin-bottom:12px}
.treasure-tools{display:grid;gap:12px;margin:20px 0}.treasure-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}#treasure-dialog .treasure-card{padding:10px;border-radius:14px;text-align:left;overflow:hidden;display:flex;flex-direction:column;gap:7px;min-width:0}.treasure-card img,.treasure-placeholder{width:100%;aspect-ratio:1;object-fit:cover;border-radius:8px;background:#170f19}.treasure-placeholder{display:grid;place-items:center;font-size:50px;color:#cda875}.treasure-card strong{overflow-wrap:anywhere;font-size:16px}.treasure-card span,.treasure-card time{font-size:12px;color:#d2b5a5}.treasure-empty{grid-column:1/-1;text-align:center;padding:45px 10px;line-height:2}.treasure-detail h3{font-size:25px}.treasure-detail h4{color:#d7af85;border-bottom:1px solid #b8886b55;padding-bottom:8px}.treasure-prose{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.9}.treasure-tag{display:inline-block;font-size:13px;color:#d9b292}.treasure-memory{font-size:14px}.treasure-memory small{display:block;color:#bda194;margin-top:8px}.treasure-actions,.treasure-save{display:flex;gap:12px}.treasure-actions button,.treasure-save button{flex:1}.treasure-photos{display:flex;gap:12px;overflow-x:auto;padding:10px 0}.treasure-photos>img{max-width:100%;max-height:420px;object-fit:contain;border-radius:10px}.treasure-photos>div{flex:0 0 120px}.treasure-photos>div img{width:120px;height:120px;object-fit:cover;border-radius:10px}.treasure-photos>div button{font-size:12px!important;padding:6px 10px!important}
.treasure-form{display:grid;gap:17px}.treasure-form>label{display:grid;gap:8px;font-size:15px}#treasure-dialog input:not([type=checkbox]),#treasure-dialog textarea,#treasure-dialog select{font:16px system-ui,sans-serif;color:#f4e5dd;background:#150f1d99;border:1px solid #a7776066;border-radius:10px;padding:12px;width:100%;min-width:0}#treasure-dialog input[type=checkbox]{accent-color:#bc7d88;width:18px;height:18px}.treasure-form .treasure-check{display:flex;align-items:center;gap:10px}.treasure-carry{border:1px solid #a7776066;border-radius:12px;padding:12px;display:flex;flex-wrap:wrap;gap:14px;font-size:13px}.treasure-save{position:sticky;bottom:0;background:#251624ed;padding:12px 0}.treasure-help{margin:0}.treasure-form textarea{resize:vertical}#treasure-dialog [data-close]{font-size:25px;padding:2px 12px}
.treasure-shell{padding-top:max(20px,env(safe-area-inset-top));padding-bottom:max(30px,env(safe-area-inset-bottom))}.treasure-save{padding-bottom:max(12px,env(safe-area-inset-bottom))}
@media(min-width:600px){#treasure-dialog{height:92dvh;max-height:92dvh}}@media(prefers-reduced-motion:no-preference){#treasure-dialog[open]{animation:treasure-appear .2s ease-out}@keyframes treasure-appear{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}}

/* Keep the vault inside the visible viewport, including iPhone safe areas. */
#treasure-dialog{
  width:min(calc(100% - 24px),520px);
  max-width:calc(100% - 24px);
  height:auto;
  max-height:calc(100dvh - max(24px,env(safe-area-inset-top)) - max(24px,env(safe-area-inset-bottom)));
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.treasure-shell{width:100%;min-width:0;padding:20px 16px 24px}
#treasure-dialog [data-content],.treasure-form,.treasure-form>label,.treasure-tools,
.treasure-heading,.treasure-detail,.treasure-carry{min-width:0;max-width:100%}
.treasure-form,.treasure-tools{grid-template-columns:minmax(0,1fr)}
.treasure-heading h2{min-width:0;font-size:clamp(21px,6vw,25px)}
.treasure-heading button{flex-shrink:0}
#treasure-dialog input:not([type=checkbox]),#treasure-dialog textarea,#treasure-dialog select{
  display:block;max-width:100%;min-inline-size:0;
}
#treasure-dialog input[type=date]{
  -webkit-appearance:none;appearance:none;
  inline-size:100%;min-inline-size:0;min-height:46px;
}
#treasure-dialog input[type=date]::-webkit-date-and-time-value{min-width:0;text-align:left}
#treasure-dialog input[type=date]::-webkit-datetime-edit{padding:0;min-width:0}
.treasure-carry{margin:0;min-inline-size:0}
.treasure-save button,.treasure-actions button{min-width:0;padding-inline:10px}
.treasure-save{padding-bottom:12px}
.treasure-detail .treasure-photos{
  display:grid;grid-template-columns:minmax(0,1fr);justify-items:center;
  overflow:visible;gap:16px;
}
.treasure-detail .treasure-photos>img{
  display:block;width:auto;max-width:100%;max-height:min(420px,52dvh);object-fit:contain;
}
.treasure-detail h3{margin:24px 0 16px}
@media(min-width:600px){#treasure-dialog{height:auto;max-height:90dvh}}

/* Empty photo previews must not reserve a form row. */
#treasure-dialog .treasure-photos:empty{display:none}
#treasure-dialog [data-category-edit]{justify-self:start;font-size:13px;padding:7px 12px}

/* Attach the ornament to the sticky title, not to scrolling content. */
.treasure-shell{background-image:none}
.treasure-heading{padding-left:12px;isolation:isolate}
.treasure-heading::before{
  content:"";
  position:absolute;
  top:0;left:-12px;
  width:80px;height:90px;
  background:url('assets/images/ui/dialogue-corner.svg') no-repeat left top / 80px auto;
  pointer-events:none;
  z-index:-1;
}

/* Reserve the same caption row for every registered or pending photo. */
.treasure-form .treasure-photos{align-items:flex-start}
.treasure-form .treasure-photos>div{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:20px 120px auto;
  gap:6px;
  align-content:start;
}
.treasure-form .treasure-photos>div small{
  grid-row:1;
  line-height:20px;
  font-size:12px;
  white-space:nowrap;
  color:#d9b292;
}
.treasure-form .treasure-photos>div img{grid-row:2;display:block}
.treasure-form .treasure-photos>div button{grid-row:3;justify-self:start}
.treasure-date{min-width:0;margin:0;padding:0;border:0}
.treasure-date legend{font-size:15px;margin-bottom:8px}
.treasure-date>div{display:grid;grid-template-columns:minmax(0,1.3fr) repeat(2,minmax(0,1fr));gap:8px}
#treasure-dialog .treasure-date select{padding:12px 6px}
#treasure-dialog [data-clear-date]{font-size:12px;padding:5px 10px;margin-top:8px}
.treasure-tag-suggestions,.treasure-tags{display:flex;flex-wrap:wrap;gap:8px}
#treasure-dialog .treasure-tag-suggestions button{padding:6px 12px;font-size:13px}
.treasure-tags{margin:16px 0}
.treasure-tag{overflow-wrap:anywhere}

.treasure-tag-suggestions>.treasure-help{flex-basis:100%}

.treasure-tag-option{display:inline-flex;align-items:center;gap:5px}
#treasure-dialog [data-delete-tag]{font-size:12px;padding:6px 8px;color:#d2b5a5;background:transparent}

/* Keep the card action and tag links as separate, accessible controls. */
#treasure-dialog article.treasure-card{border:1px solid #b8886b;background:linear-gradient(#54273d,#281827)}
#treasure-dialog .treasure-card-open{border:0;border-radius:0;background:transparent;padding:0;width:100%;min-width:0;display:flex;flex-direction:column;gap:7px;text-align:left}
.treasure-card .treasure-tags{margin:2px 0 0;gap:6px}
#treasure-dialog a.treasure-tag{display:inline-flex;align-items:center;min-height:32px;max-width:100%;padding:5px 9px;border:1px solid #b8886b80;border-radius:16px;color:#e4bea0;background:#25162470;text-decoration:none;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
#treasure-dialog a.treasure-tag:focus-visible{outline:2px solid #f7ce92;outline-offset:2px}
.treasure-tags:empty{display:none}

#treasure-dialog .treasure-card a.treasure-tag{border:0;border-radius:0;padding:2px 0;background:transparent;min-height:28px}
.treasure-card .treasure-tags{column-gap:10px;row-gap:2px}
.treasure-browse{display:flex;flex-wrap:wrap;gap:8px}
#treasure-dialog .treasure-browse button{font-size:13px;padding:9px 12px;text-align:left;max-width:100%;overflow-wrap:anywhere}
.treasure-filter-options{display:grid;gap:10px;margin:20px 0}
#treasure-dialog .treasure-filter-options button{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:48px;text-align:left;border-radius:12px}
.treasure-filter-options span{min-width:0;overflow-wrap:anywhere}
.treasure-filter-options small{flex:none;color:#c9aa9e}
.treasure-heading h2{overflow-wrap:anywhere}

.treasure-detail-navigation{display:flex;gap:10px;margin:24px 0 14px}
#treasure-dialog .treasure-detail-navigation button{flex:1;min-width:0;font-size:14px;padding:10px 8px;background:transparent}
#treasure-dialog [data-back]{flex:none;font-size:22px;padding:2px 10px}

/* Keep editing quiet beside the memory title; deletion belongs in the form. */
.treasure-story-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #b8886b55;margin:24px 0 16px;padding-bottom:8px}
.treasure-detail .treasure-story-heading h4{margin:0;padding:0;border:0}
#treasure-dialog .treasure-edit-link{display:inline-flex;align-items:center;gap:5px;flex:none;min-height:44px;padding:6px 0 6px 10px;border:0;border-radius:4px;background:transparent;color:#c9aa9e;font-size:13px}
.treasure-edit-link svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.treasure-delete-area{border-top:1px solid #a7776033;padding-top:16px;margin-top:8px;text-align:center}
#treasure-dialog .treasure-delete-area button{background:transparent;border:0;border-radius:4px;padding:10px;color:#c9aa9e;font-size:13px;min-height:44px}

.treasure-tag-heading{display:flex;align-items:center;gap:12px;flex-basis:100%}
#treasure-dialog .treasure-tag-heading [data-manage-tags]{padding:6px 8px;border:0;border-radius:4px;background:transparent;color:#c9aa9e;font-size:12px;min-height:36px}

/* A quiet set of controls for tracing memories, not a management form. */
.treasure-tools{gap:10px;margin:18px 0 20px}
.treasure-search{position:relative;display:block;min-width:0}
.treasure-search svg{position:absolute;left:13px;top:50%;transform:translateY(-50%);width:17px;height:17px;fill:none;stroke:#d9b292;stroke-width:1.5;pointer-events:none}
#treasure-dialog .treasure-search input{padding:13px 12px 13px 39px;border-color:#b8886b80;background:linear-gradient(135deg,#2e1a2c,#1b1321);border-radius:16px;font-size:14px;transition:box-shadow .2s,border-color .2s}
#treasure-dialog .treasure-search input:focus-visible{outline:0;border-color:#ddb692;box-shadow:0 0 0 2px #d9b29220,0 0 14px #bc7d8830}
.treasure-browse{gap:7px;align-items:center}
#treasure-dialog .treasure-browse button{min-height:40px;padding:8px 11px;border-color:#b8886b90;background:linear-gradient(135deg,#301c30,#211624);font-size:12px;line-height:1.5}
.treasure-browse button span{color:#e4bea0}
#treasure-dialog .treasure-browse button[data-active=true],#treasure-dialog .treasure-browse button[aria-pressed=true]{background:linear-gradient(135deg,#583045,#392538);border-color:#cda875;color:#efd5ad;box-shadow:0 0 10px #bc7d8825}
#treasure-dialog .treasure-new{min-height:52px;font-size:16px;letter-spacing:.05em;border-color:#cda875;background:linear-gradient(135deg,#63344c,#3a2439);box-shadow:inset 0 1px 0 #f5dfcc12}
#treasure-dialog .treasure-new:active{box-shadow:0 0 15px #cda87530,inset 0 0 15px #bc7d8820}
.treasure-count{font-size:12px;color:#c9aa9e;margin:0 0 10px;letter-spacing:.06em}
#treasure-dialog .treasure-card-open{gap:8px}
.treasure-card-photo{position:relative;display:block;width:100%;aspect-ratio:1;overflow:hidden;border-radius:9px;background:linear-gradient(135deg,#362335,#211625);border:1px solid #b8886b30}
.treasure-card .treasure-card-photo img{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:1;object-fit:cover;opacity:0;transition:opacity .2s}
.treasure-card-photo[data-photo-state=ready] img{opacity:1}
.treasure-card-photo .treasure-photo-placeholder{position:absolute;inset:0;display:grid;place-items:center;font-size:30px;color:#b8886b80}
.treasure-card-photo[data-photo-state=ready] .treasure-photo-placeholder{display:none}
.treasure-card-photo[data-photo-state=loading]::after{content:"";position:absolute;inset:0;background:linear-gradient(100deg,transparent,#f5dfcc09,transparent);transform:translateX(-100%);pointer-events:none}
.treasure-card .treasure-photo-heart{position:absolute;right:7px;top:7px;display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#211624b3;color:#d2b5a5;font-size:16px;z-index:1}
.treasure-card .treasure-photo-heart.is-favorite{color:#edc39c;text-shadow:0 0 8px #d69a9d80}
.treasure-card .treasure-photo-error{position:absolute;left:8px;right:8px;bottom:12px;font-size:11px;line-height:1.6;text-align:center;color:#c9aa9e}
.treasure-card .treasure-card-meta{display:flex;flex-wrap:wrap;column-gap:8px;row-gap:3px;font-size:11px;line-height:1.5}
.treasure-card-meta span,.treasure-card-meta time{font-size:11px}
.treasure-card .treasure-tags{min-height:44px;max-height:44px;align-content:flex-start;gap:0 8px}
#treasure-dialog .treasure-card a.treasure-tag{display:block;max-width:calc(50% - 4px);min-height:22px;height:22px;padding:2px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;line-height:18px}
.treasure-card .treasure-tag-more{font-size:11px;color:#c9aa9e;line-height:22px}
.treasure-empty{padding:30px 10px}
.treasure-empty>span{font-size:32px;color:#cda87580}
.treasure-empty p{font-size:14px}
#treasure-dialog .treasure-empty button{font-size:14px}
@media(max-width:340px){.treasure-grid{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:no-preference){
 .treasure-card-photo[data-photo-state=loading]::after{animation:treasure-shimmer 1.8s infinite}
 @keyframes treasure-shimmer{to{transform:translateX(100%)}}
}
@media(hover:hover){#treasure-dialog .treasure-new:hover{box-shadow:0 0 14px #bc7d8830}}

#treasure-dialog [data-close]{font-size:24px}
.treasure-pagination{display:flex;align-items:center;justify-content:center;gap:12px;margin:24px 0 4px}
.treasure-pagination span{font-size:13px;color:#d2b5a5;white-space:nowrap}
#treasure-dialog .treasure-pagination button{min-height:44px;font-size:13px;padding:9px 12px;background:transparent}
.treasure-count{scroll-margin-top:80px}

/* The chest stays behind the viewport; the list ends with room to see it. */
#treasure-dialog{
  min-height:calc(100dvh - max(24px,env(safe-area-inset-top)) - max(24px,env(safe-area-inset-bottom)));
  background-color:#100c16;
  background-image:url('assets/images/backgrounds/treasure-vault.webp');
  background-position:center;
  background-size:cover;
  background-repeat:no-repeat;
  background-attachment:scroll;
}
.treasure-heading{background:#17101eee}
#treasure-dialog article.treasure-card{
  background:linear-gradient(145deg,#291b29ed,#130f1aeb);
  border-color:#b8886b99;
}
.treasure-vault-footer{
  position:static;inset:auto;z-index:auto;transform:none;
  width:100%;margin:26px 0 0;text-align:center;pointer-events:auto;
}
.treasure-vault-footer p{
  margin:0;color:#e6c397;font-size:clamp(11px,3.2vw,14px);
  line-height:1.9;letter-spacing:.04em;text-shadow:0 1px 6px #000;
}
.treasure-vault-scenery{height:clamp(150px,24dvh,240px);pointer-events:none}
@media(min-width:600px){#treasure-dialog{min-height:90dvh}}

/* Quiet reading surface, without dimming the photographs or hiding the frame. */
.treasure-detail-reading{
  background:linear-gradient(145deg,#100c17cc,#100c17b8);
  border:1px solid #b8886b25;border-radius:14px;
  padding:1px 14px 14px;margin-top:14px;
}
.treasure-detail-panel{background:rgba(5,4,9,.88);border:1px solid #b8886b42;border-radius:16px;margin-top:20px;padding:14px 14px 4px}.treasure-detail-panel .treasure-detail-reading{background:transparent;border:0;margin-top:4px;padding-left:0;padding-right:0}
.treasure-detail-reading .treasure-prose{color:#f5dfcc}
.treasure-intro,.treasure-count{
  width:fit-content;max-width:100%;background:#100c1799;
  border-radius:6px;padding:3px 7px;
}
/* Edge-to-edge title bar: no initial inset, so sticky never changes its position. */
#treasure-dialog .treasure-shell{padding-top:0}
#treasure-dialog .treasure-heading{
  position:sticky;top:0;
  display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:0 10px;
  width:calc(100% + 32px);max-width:none;
  margin:0 -16px;
  min-height:78px;
  padding:12px 18px;
  border-radius:19px 19px 0 0;
  background:#1d1224 url('/assets/images/ui/calendar-branch.svg') 8px center/96px auto no-repeat;
  border-bottom:1px solid #b98c65;
  z-index:3;
}
#treasure-dialog .treasure-heading::before{content:none;background:none}
#treasure-dialog .treasure-heading h2{grid-column:2;grid-row:1;align-self:end;margin:0;text-align:center;font:26px/1.5 "Shippori Mincho", 'Yu Mincho',serif;letter-spacing:.18em}
#treasure-dialog .treasure-heading-subtitle{grid-column:2;grid-row:2;margin:0;text-align:center;font:11px/1.5 "Shippori Mincho", serif;letter-spacing:.08em;color:#f2dfc8}
#treasure-dialog .treasure-heading [data-close]{grid-column:3;grid-row:1/3;align-self:center;justify-self:center;display:grid;place-items:center;width:44px;height:44px;margin:0;padding:0;border:1px solid #b8936c;border-radius:50%;background:#382333;font-size:24px;line-height:1}
#treasure-dialog .treasure-heading [data-back]{grid-column:1;grid-row:1/3}
@media(max-width:360px){#treasure-dialog .treasure-heading{padding-left:12px;padding-right:12px;background-size:88px auto}#treasure-dialog .treasure-heading h2{font-size:24px}#treasure-dialog .treasure-heading-subtitle{font-size:10px}}

/* A translucent writing surface and gentle, accessible keepsake controls. */
#treasure-dialog .treasure-form{
  margin-top:16px;padding:16px 12px 12px;
  background:linear-gradient(145deg,#100c17c9,#100c17b8);
  border:1px solid #b8886b25;border-radius:14px;
}
#treasure-dialog .treasure-form .treasure-save{
  background:#1b1120ed;border-radius:0 0 12px 12px;
}
#treasure-dialog .treasure-favorite-toggle{
  position:relative;justify-self:start;min-height:44px;
  border:1px solid #b8886b80;border-radius:24px;
  padding:8px 14px;gap:8px;background:linear-gradient(135deg,#302033,#211624);
  color:#d9b292;cursor:pointer;
}
#treasure-dialog .treasure-favorite-toggle input{
  position:absolute;opacity:0;width:1px;height:1px;margin:0;overflow:hidden;
}
.treasure-favorite-heart::before{content:"♡";font-size:23px;line-height:1}
#treasure-dialog .treasure-favorite-toggle:has(input:checked){
  border-color:#d3ad83;background:linear-gradient(135deg,#593348,#342136);
  color:#efd2af;box-shadow:0 0 12px #bc7d8825;
}
.treasure-favorite-toggle:has(input:checked) .treasure-favorite-heart::before{
  content:"♥";color:#d8a2ac;text-shadow:0 0 8px #bc7d8860;
}
#treasure-dialog .treasure-favorite-toggle:has(input:focus-visible){
  outline:2px solid #f7ce92;outline-offset:3px;
}
#treasure-dialog .treasure-favorite-toggle:has(input:disabled){opacity:.5;cursor:wait}
#treasure-dialog .treasure-carry{background:#24162b88;border-color:#b8886b55}
.treasure-carry legend{padding:0 5px;color:#d9b292}
.treasure-carry label{display:inline-flex;align-items:center;gap:6px;min-height:36px;cursor:pointer}
#treasure-dialog .treasure-carry input[type=checkbox]{
  appearance:none;-webkit-appearance:none;position:relative;flex:none;
  width:20px;height:20px;margin:0;border:1px solid #b8886b;
  border-radius:6px;background:linear-gradient(145deg,#332137,#1b1321);cursor:pointer;
}
#treasure-dialog .treasure-carry input:checked{
  background:linear-gradient(145deg,#b9798c,#74465e);border-color:#dfb898;
}
.treasure-carry input:checked::after{
  content:"";position:absolute;left:6px;top:3px;width:6px;height:10px;
  border:solid #fff0dc;border-width:0 2px 2px 0;transform:rotate(45deg);
}
.treasure-memory-note{font-size:12px}


.treasure-detail-edit{display:flex;justify-content:flex-end;margin:20px 0 8px}

/* Inline native pickers retain the vault's compact controls. */
.treasure-browse .treasure-filter-select{display:flex;align-items:center;gap:6px;flex:1 1 120px;min-width:0;max-width:100%;min-height:40px;padding:6px 10px;border:1px solid #b8886b90;border-radius:24px;background:linear-gradient(135deg,#301c30,#211624);font-size:12px}
.treasure-filter-select>span{flex:none;color:#f5dfcc}
#treasure-dialog .treasure-filter-select select{width:auto;flex:1;min-width:0;max-width:100%;padding:3px 0;border:0;border-radius:0;background:transparent;color:#e4bea0;font:inherit;cursor:pointer}
.treasure-filter-select:has(select[data-active=true]){border-color:#cda875;background:linear-gradient(135deg,#583045,#392538)}
.treasure-filter-select option{background:#211624;color:#f5dfcc}

/* Three controls share one row, even with long category or tag names. */
.treasure-browse{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.treasure-browse .treasure-filter-select{position:relative;width:100%;min-width:0;gap:5px;min-height:42px;padding:7px 8px}
.treasure-filter-icon{flex:none;width:13px;height:13px;fill:none;stroke:#e4bea0;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
#treasure-dialog .treasure-filter-select select{appearance:none;-webkit-appearance:none;width:0;flex:1 1 0;min-width:0;padding:3px 12px 3px 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}
.treasure-filter-select::after{content:"";position:absolute;right:9px;top:calc(50% - 3px);width:4px;height:4px;border-right:1px solid #e4bea0;border-bottom:1px solid #e4bea0;transform:rotate(45deg);pointer-events:none}
#treasure-dialog .treasure-browse [data-favorites]{width:100%;min-width:0;min-height:42px;padding:7px 4px;font-size:11px;text-align:center;white-space:nowrap}
