/* v42 cinematic story frames, editable mood controls and phrase library. */
.app-header .brand-logo{width:70px!important;height:26px!important;flex:0 0 70px!important}
.app-header .brand-group{gap:10px!important}

.story-tone-control{margin:12px 0 14px;padding:12px;border:1px solid #dde1e4;border-radius:13px;background:linear-gradient(145deg,#fafafa,#f5f5f3)}
.story-tone-control .label-row{margin-bottom:9px}
.story-tone-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.story-tone-buttons button{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;min-height:42px;padding:7px 8px;border:1px solid #d8dde1;border-radius:10px;background:#fff;color:#30353a;font:650 11px/1.2 Inter,'Noto Sans KR',sans-serif;cursor:pointer}
.story-tone-buttons button:hover{border-color:#9da4aa}
.story-tone-buttons button.active{border-color:#202327;background:#202327;color:#fff;box-shadow:0 5px 14px rgba(20,23,27,.14)}
.tone-swatch{width:18px;height:18px;flex:0 0 18px;border:1px solid rgba(20,23,27,.16);border-radius:50%}
.tone-original{background:linear-gradient(135deg,#d5a67d 0 34%,#7c9da7 34% 66%,#65764f 66%)}
.tone-mono{background:linear-gradient(135deg,#f2f2f2 0 48%,#222 52%)}
.tone-muted{background:linear-gradient(135deg,#c6b8a4,#7c7f79)}

.text-template-grid{display:block!important}
.text-template-group+.text-template-group{margin-top:16px;padding-top:15px;border-top:1px solid #e3e6e8}
.text-template-group-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:8px}
.text-template-group-heading b{font:700 12px/1.25 Inter,'Noto Sans KR',sans-serif;color:#202428}
.text-template-group-heading small{color:#747d85;font:500 9.5px/1.35 Inter,'Noto Sans KR',sans-serif;text-align:right}
.story-template-rail{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.story-template-button{display:block!important;min-height:0!important;padding:5px!important;border:1px solid #d9dde1!important;border-radius:12px!important;background:#fff!important;overflow:hidden;text-align:left!important;box-shadow:0 2px 7px rgba(24,27,31,.04)}
.story-template-button:hover{border-color:#8f969c!important;transform:translateY(-1px)}
.story-template-button.active{border-color:#202327!important;box-shadow:0 0 0 1px #202327,0 8px 18px rgba(24,27,31,.12)}
.story-template-art{position:relative;display:grid;place-items:center;width:100%;height:112px;border-radius:8px;background:#111316;overflow:hidden}
.story-template-art canvas{display:block;width:auto!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain;box-shadow:0 0 0 1px rgba(255,255,255,.08)}
.story-template-art em{position:absolute;right:6px;bottom:6px;padding:3px 5px;border:1px solid rgba(255,255,255,.22);border-radius:999px;background:rgba(7,8,10,.56);backdrop-filter:blur(5px);color:#fff;font:700 7px/1 Inter,'Noto Sans KR',sans-serif;font-style:normal;letter-spacing:.04em}
.story-template-copy{display:flex;align-items:center;justify-content:space-between;gap:7px;padding:8px 4px 4px}
.story-template-copy b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#202327;font:650 10.5px/1.2 Inter,sans-serif;letter-spacing:.025em}
.story-template-copy small{flex:0 0 auto;color:#8a4e3a;font:700 7px/1.2 Inter,sans-serif;letter-spacing:.08em}
.quick-template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.quick-template-grid .text-template-button{min-height:64px}
.quick-template-grid .text-template-button.active{border-color:#202327;box-shadow:0 0 0 1px #202327}

.phrase-library{background:#f8f8f6!important}
.phrase-library[open]>summary span{transform:rotate(45deg)}
.phrase-library>summary span{transition:transform .18s ease}
.phrase-mood-chips{display:flex;gap:6px;padding:0 12px 10px;overflow-x:auto;scrollbar-width:none}
.phrase-mood-chips::-webkit-scrollbar{display:none}
.phrase-mood-chips button{flex:0 0 auto;min-height:30px;padding:0 11px;border:1px solid #d7dce0;border-radius:999px;background:#fff;color:#596169;font:650 10px/1 Inter,'Noto Sans KR',sans-serif;cursor:pointer}
.phrase-mood-chips button.active{border-color:#9e382f;background:#9e382f;color:#fff}
#phraseSuggestions{grid-template-columns:repeat(2,minmax(0,1fr))}
#phraseSuggestions button{display:flex;flex-direction:column;gap:4px;min-width:0;font-family:'Noto Serif KR','Newsreader',Georgia,serif!important}
#phraseSuggestions button small{color:#a4433a;font:700 8px/1 Inter,'Noto Sans KR',sans-serif;letter-spacing:.08em;text-transform:uppercase}
#phraseSuggestions button span{font:400 13px/1.55 'Noto Serif KR','Newsreader',Georgia,serif;word-break:keep-all}

@media(max-width:900px){
  body.has-media .text-template-grid{display:block!important;overflow:visible!important;padding-bottom:0!important}
  body.has-media .story-template-rail{display:flex;gap:8px;overflow-x:auto;overscroll-behavior-inline:contain;touch-action:pan-x pan-y;padding:1px 1px 7px;scroll-snap-type:x proximity;scrollbar-width:none}
  body.has-media .story-template-rail::-webkit-scrollbar{display:none}
  body.has-media .story-template-button{flex:0 0 210px!important;scroll-snap-align:start}
  body.has-media .quick-template-grid{display:grid;grid-auto-flow:column;grid-auto-columns:142px;grid-template-columns:none;gap:7px;overflow-x:auto;padding-bottom:5px;scroll-snap-type:x proximity;scrollbar-width:none}
  body.has-media .quick-template-grid::-webkit-scrollbar{display:none}
  body.has-media .quick-template-grid .text-template-button{width:auto;min-width:0;scroll-snap-align:start}
  .story-template-art{height:116px}
  #phraseSuggestions{grid-template-columns:1fr}
}

@media(max-width:720px){
  .app-header .brand-logo{width:60px!important;height:22px!important;flex-basis:60px!important}
  .story-tone-control{padding:10px}
  .story-tone-buttons button{min-height:40px;padding:6px;font-size:9.5px}
  .tone-swatch{width:15px;height:15px;flex-basis:15px}
  .text-template-group-heading{align-items:flex-start;flex-direction:column;gap:2px}
  .text-template-group-heading small{text-align:left}
}

@media(max-width:420px){
  .app-header .brand-logo{width:55px!important;height:20px!important;flex-basis:55px!important}
  .story-tone-buttons button{gap:4px;font-size:9px}
  body.has-media .story-template-button{flex-basis:190px!important}
}
