.directory-controls{display:flex;align-items:center;gap:10px}.directory-controls [hidden]{display:none}.category-editor{width:min(860px,calc(100vw - 28px))}.category-edit{border:1px solid #ffffff20;border-left:5px solid var(--category-color);border-radius:14px;padding:18px;margin-bottom:18px}.category-edit-top{display:grid;grid-template-columns:minmax(0,1fr) 66px minmax(160px,1fr);gap:12px}.category-editor label{margin:0}.category-editor input,.category-editor select{margin-top:7px;min-height:44px}.category-editor input[type=color]{padding:4px;height:47px;cursor:pointer}.category-editor select{box-sizing:border-box;max-width:100%;border:1px solid #ffffff30;border-radius:10px;padding:10px;background:#101510;color:#fff;font:inherit;font-size:13px}.category-edit-top select{width:100%}.category-order{display:flex;gap:8px;justify-content:flex-end;padding:12px 0}.category-shortcut{display:grid;grid-template-columns:minmax(100px,1fr) minmax(120px,1fr) 44px 44px;align-items:center;gap:8px;padding:9px 0;border-top:1px solid #ffffff12}.category-shortcut select{margin:0}.shortcut-name{font-size:14px;overflow-wrap:anywhere}.category-shortcut button,.category-order button{min-height:44px;min-width:44px;padding:9px}.category-footer{position:sticky;bottom:-28px;background:#191e19;display:flex;gap:8px;flex-wrap:wrap;padding:18px 0 12px;border-top:1px solid #ffffff20}.category-footer .jt-primary{margin-left:auto}.category-editor button:disabled{cursor:default}#directory-error{color:#ffb8aa;font-size:14px}@media(max-width:600px){.category-edit{padding:12px}.category-edit-top{grid-template-columns:minmax(0,1fr) 60px}.category-edit-top label:last-child{grid-column:1/-1}.category-shortcut{grid-template-columns:minmax(0,1fr) 44px 44px}.category-shortcut .shortcut-name{grid-column:1/-1}.category-shortcut select{grid-column:1}.category-footer{bottom:-22px}.directory-controls{justify-content:flex-end;flex-wrap:wrap}.directory-controls .jt-action{padding:10px;font-size:12px}.category-title{font-size:17px}}

/* Keep every category and tile on the same phone-width track. */
@media(max-width:740px){
  #directory,#directory .grid{width:100%;min-width:0;max-width:100%}
  #directory .grid{grid-template-columns:minmax(0,1fr)}
  #directory .category-tile{grid-column:1/-1;grid-row:auto;width:100%;min-width:0;max-width:100%;justify-self:stretch;box-sizing:border-box}
}

.hero-image{position:absolute;max-width:55%;height:80%;object-fit:contain;transform:rotate(-12deg);filter:drop-shadow(0 12px 15px #0006)}

/* Neutral homepage: category color is an accent, never the tile surface. */
body{background:#111413}
main{max-width:1120px;padding:60px 40px 44px}
header{margin-bottom:40px}
#directory .grid{gap:20px}
#directory .category-tile{background:linear-gradient(145deg,#202523,#1c201f);color:#f2f1eb;border:1px solid #ffffff12;border-top:2px solid color-mix(in srgb,var(--tile-color) 65%,#65746c);border-radius:14px;box-shadow:0 2px 5px #0001;transition:transform .18s,border-color .18s,background .18s}
#directory .category-tile:hover{transform:translateY(-2px);background:linear-gradient(145deg,#252b28,#202523);border-left-color:#ffffff26;border-right-color:#ffffff26;border-bottom-color:#ffffff26;filter:none;box-shadow:0 6px 18px #0002}
#directory .category-tile .arrow{color:#939e97;font-size:19px}
#directory .small{gap:16px;padding:18px 20px}
#directory .small h2{font-size:16px;line-height:1.35;letter-spacing:-.25px;font-weight:550}
#directory .icon{width:42px;height:42px;border-radius:10px;font-size:26px;background:color-mix(in srgb,var(--tile-color) 12%,#242b27)}
#directory .icon img{width:28px;height:32px;object-fit:contain}
#directory .featured{padding:24px;aspect-ratio:auto}
#directory .featured .art{display:flex;align-items:center;justify-content:flex-start;min-height:0;margin:0 0 18px}
#directory .featured .hero-emoji{font-size:52px;transform:rotate(-8deg);filter:drop-shadow(0 5px 8px #0002)}
#directory .featured .hero-image{position:static;height:60px;width:44px;object-fit:contain;transform:rotate(-8deg)}
#directory .featured .hero-image.is-square{height:92px;width:92px;max-width:none;transform:none;filter:drop-shadow(0 10px 14px #0007)}
#directory .featured h2{font-size:27px;line-height:1.2;letter-spacing:-.7px;font-weight:600}
@media(min-width:741px){#directory .grid{grid-auto-rows:100px}}
@media(max-width:740px){main{padding:30px 22px 36px}header{margin-bottom:30px}#directory .grid{gap:16px;grid-auto-rows:88px}#directory .small{min-height:0}#directory .featured{grid-row:span 2;min-height:0;padding:24px}#directory .small h2{font-size:16px}}
@media(prefers-reduced-motion:reduce){#directory .category-tile{transition:none}#directory .category-tile:hover{transform:none}}

/* All big tiles inherit the illustrated glow treatment from their category color. */
#directory .big-hero{background:radial-gradient(ellipse at var(--hero-origin),var(--hero-glow),transparent 72%),var(--hero-base);border-color:color-mix(in srgb,var(--hero-accent) 18%,transparent);border-top-color:var(--hero-accent)}
#directory .big-hero:hover{background:radial-gradient(ellipse at var(--hero-origin),var(--hero-hover),transparent 72%),var(--hero-hover-base)}
#directory .big-hero .art{display:grid;place-items:center;justify-content:center;margin:0 0 10px}
#directory .big-hero .hero-emoji{font-size:76px;transform:rotate(-12deg);filter:drop-shadow(0 12px 12px #0005)}
#directory .big-hero .orbit{width:110px;height:110px;border-color:#e9b77a26}
#directory .big-hero .spark{top:3px;right:14%;font-size:22px;color:#e8c996}
#directory .big-hero .mini-card{bottom:0;right:15%;width:36px;height:50px;font-size:27px}
#directory .big-hero h2{font-size:40px;letter-spacing:-1.5px;font-weight:650}
#directory .big-hero .arrow{color:var(--hero-ink);font-size:24px}
@media(max-width:740px){#directory .big-hero{padding:20px 24px}#directory .big-hero .hero-emoji{font-size:64px}#directory .big-hero .orbit{width:90px;height:90px}#directory .big-hero h2{font-size:34px}#directory .big-hero .mini-card{right:20%;height:43px;width:31px;font-size:23px}}

#directory-unlock{position:relative;display:grid;place-items:center;width:46px;height:46px;min-width:46px;padding:0;border-radius:14px;font-size:28px;line-height:1;font-weight:400}
#directory-unlock[hidden]{display:none}
#directory-unlock::after{content:attr(data-tooltip);position:absolute;z-index:10;right:0;top:calc(100% + 10px);width:max-content;max-width:min(230px,calc(100vw - 44px));padding:10px 13px;border:1px solid #ffffff26;border-radius:10px;background:#28302b;color:#f2f1eb;box-shadow:0 6px 22px #0005;font:13px/1.4 Inter,system-ui,sans-serif;pointer-events:none;opacity:0;transform:translateY(-3px);transition:opacity .15s,transform .15s}
#directory-unlock:focus-visible:not([data-dismissed])::after{opacity:1;transform:none}
@media(hover:hover){#directory-unlock:hover:not([data-dismissed])::after{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){#directory-unlock::after{transition:none}}

#directory-unlock svg{display:block;width:20px;height:20px;pointer-events:none}

/* Minis is independent of desktop main-grid centering. */
:root{--main-width:990px;--mini-gap:18px;--mini-left-gap:40px}
.mini-shortcuts{display:grid;grid-template-columns:repeat(2,56px);gap:var(--mini-gap);align-content:start}
.mini-shortcut{display:grid;place-items:center;width:56px;height:56px;border:1px solid #ffffff1c;border-top:2px solid var(--tile-color);border-radius:13px;background:#202523;text-decoration:none;color:#f2f1eb;font-size:27px;line-height:1;transition:background .15s,transform .15s}
.mini-shortcut .mini-image{display:block;width:28px;height:28px;object-fit:contain}
.mini-shortcut:hover{background:#2b342e;transform:translateY(-2px)}
.mini-shortcut:focus-visible{outline:2px solid #d6e8b8;outline-offset:3px}
.mini-tooltip{position:fixed;z-index:1000;width:max-content;max-width:calc(100vw - 16px);padding:9px 13px;border:1px solid #ffffff26;border-radius:9px;background:#28302b;color:#f2f1eb;box-shadow:0 6px 22px #0006;font:13px/1.4 Inter,system-ui,sans-serif;overflow-wrap:anywhere;pointer-events:none}
.mini-tooltip[hidden]{display:none}
@media(min-width:741px){
  :root{scrollbar-gutter:stable both-edges}
  main{max-width:none;padding-left:32px;padding-right:32px;container-type:normal}
  main>header{width:min(var(--main-width),100%);margin-left:auto;margin-right:auto}
  #directory{position:relative;--rail-reserve:calc(112px + var(--mini-gap) + var(--mini-left-gap));--effective-main-width:min(var(--main-width),calc(100% - var(--rail-reserve) - var(--rail-reserve)))}
  #directory>.grid{width:min(var(--main-width),100%);margin:0 auto}
  #directory.has-minis>.grid{width:var(--effective-main-width)}
  #directory>.mini-shortcuts{position:absolute;left:calc(50% + var(--effective-main-width)/2 + var(--mini-left-gap));top:0}
  #directory .big-hero h2{font-size:32px}
}
@media(min-width:741px) and (max-width:1100px){#directory>.grid{grid-template-columns:repeat(4,minmax(0,1fr))}#directory .big-hero h2{font-size:28px}}
@media(max-width:740px){
  main{padding-left:16px;padding-right:16px}
  #directory.has-minis{display:block}
  .mini-shortcuts{position:static;grid-template-columns:repeat(2,44px);width:max-content;margin:24px 0 0 auto}
  .mini-shortcut{width:44px;height:44px;font-size:23px;border-radius:10px}.mini-shortcut .mini-image{width:23px;height:23px}
}
@media(prefers-reduced-motion:reduce){.mini-shortcut{transition:none}.mini-shortcut:hover{transform:none}}

/* Category manager: scan categories first, then open only the one being edited. */
.category-editor{width:min(760px,calc(100vw - 24px));padding:20px}
.category-editor .jt-head{margin-bottom:12px}
.category-edit{margin:0 0 7px;padding:0;border-left-width:3px;border-radius:10px}
.category-summary{display:flex;align-items:center;gap:10px;min-height:48px;padding:0 14px;cursor:pointer;list-style:none}
.category-summary::-webkit-details-marker{display:none}
.category-summary::before{content:'›';color:#b7c4b4;font-size:22px;line-height:1;transition:transform .15s}
.category-edit[open] .category-summary::before{transform:rotate(90deg)}
.category-summary-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:600}
.category-summary-count{display:grid;place-items:center;min-width:25px;height:25px;padding:0 5px;border-radius:7px;background:#ffffff10;color:#b7c4b4;font-size:12px}
.category-edit-body{padding:0 14px 10px}
.category-edit-top{grid-template-columns:minmax(130px,1fr) 160px 90px 50px;gap:8px;align-items:end}
.category-editor label{margin:0;font-size:12px;color:#b7c4b4}
.category-editor input,.category-editor select{margin-top:4px;min-height:38px}
.category-editor input{padding:8px 10px}
.category-editor input[type=color]{height:38px;padding:3px}
.category-editor select{width:100%;padding:7px 28px 7px 8px;font-size:12px}
.category-order{padding:8px 0;justify-content:flex-start}
.category-shortcut{grid-template-columns:minmax(0,1fr) minmax(115px,160px) 38px 38px;gap:6px;padding:5px 0}
.category-shortcut select{margin:0}
.category-shortcut button,.category-order button{min-width:38px;min-height:38px;padding:6px}
.category-shortcut .shortcut-name{min-width:0;width:100%;margin:0;font-size:13px}
.category-footer{bottom:-20px;padding:12px 0 3px}
@media(max-width:600px){
  .category-editor{padding:16px}
  .category-edit-body{padding:0 10px 10px}
  .category-edit-top{grid-template-columns:minmax(0,1fr) 50px}
  .category-edit-top label:nth-child(2){grid-column:1}
  .category-edit-top label:nth-child(3){grid-column:1}
  .category-edit-top label:nth-child(4){grid-column:2;grid-row:1}
  .category-shortcut{grid-template-columns:minmax(0,1fr) 38px 38px}
  .category-shortcut .shortcut-name{grid-column:1/-1}
  .category-shortcut select{grid-column:1;max-width:180px}
  .category-footer{bottom:-16px}
}

.jt-layout{padding-top:18px}
.jt-layout label{display:flex;justify-content:space-between;gap:12px}
.jt-layout output{white-space:nowrap;color:#c9dda9}
.jt-dialog .jt-layout input[type=range]{padding:0;min-height:36px;accent-color:#c9dda9}
.jt-dialog .jt-layout button{width:auto;margin-top:4px;padding:8px 12px}

.brand-group{display:flex;align-items:center;gap:16px;min-width:0}
.liam-frame{flex:none;width:var(--portraitSize,54px);height:auto;aspect-ratio:9/10;padding:3px;border:1px solid #bcaa7d77;border-radius:7px;background:#292b24;box-shadow:0 3px 12px #0004}
.liam-crop{display:block;width:100%;height:100%;overflow:hidden;border-radius:3px}.liam-frame img{display:block;width:100%;height:100%;object-fit:cover;object-position:var(--portraitX,50%) var(--portraitY,50%);transform:scale(var(--portraitZoom,1));transform-origin:var(--portraitX,50%) var(--portraitY,50%)}
@media(max-width:740px){main>header{flex-wrap:wrap;gap:14px}.brand-group{gap:12px}.brand{font-size:23px}.direction{font-size:12px}.brand-group .liam-frame{width:min(var(--portraitSize,54px),calc(100vw - 226px))}.directory-controls{margin-left:auto}}

.jt-portrait-preview{display:flex;align-items:center;justify-content:center;min-height:190px;margin:16px 0;background:#101510;border:1px solid #ffffff18;border-radius:12px;padding:8px}.jt-portrait-preview .liam-frame{box-sizing:border-box}

.portrait-hidden .brand-group .liam-frame{display:none}
.jt-dialog .jt-checkbox{display:flex;align-items:center;justify-content:flex-start;gap:10px;margin:16px 0}
.jt-dialog .jt-checkbox input{width:18px;height:18px;min-height:0;margin:0;padding:0;accent-color:#c9dda9}
.jt-dialog.jt-wide{width:min(1320px,calc(100vw - 28px));padding:22px;overflow:hidden}
/* The row must shrink to the max-height, otherwise both panels grow past the clipped dialog and cannot scroll. */
.jt-wide>#jt-body{display:grid;grid-template-columns:minmax(320px,0.8fr) minmax(0,1.3fr);grid-template-rows:minmax(0,1fr);gap:24px;max-height:calc(100svh - 160px)}
#jt-settings,#jt-categories-panel{min-width:0;overflow:auto;padding-right:8px;overscroll-behavior:contain}
#jt-categories-panel{border-left:1px solid #ffffff20;padding-left:24px}
.category-editor.category-embedded{width:100%;max-width:none;padding:0}
.category-embedded .category-footer{bottom:0;flex-wrap:wrap;z-index:1}
@media(max-width:1050px){
 .jt-dialog.jt-wide{overflow:auto}
 .jt-wide>#jt-body{display:block;max-height:none}
 #jt-settings,#jt-categories-panel{overflow:visible;padding-right:0}
 #jt-categories-panel{border-left:0;border-top:1px solid #ffffff20;padding:20px 0 0;margin-top:20px}
}

.category-embedded .category-edit{margin:0 0 7px}
