/* Lingvido v3: reusable templates and case exploration. */
#templates,#gallery{scroll-margin-top:20px}
.hero-motion{color:#aaa49b;background:transparent;border:0;font:9px/1.5 var(--mono);letter-spacing:.2px;padding:6px;white-space:nowrap}
.hero-motion:hover{color:var(--accent)}
.floating-art .hero-incoming{position:absolute;left:5px;top:5px;width:calc(100% - 10px);height:auto;opacity:0;transition:opacity .65s ease;z-index:1}
.floating-art .hero-incoming.visible{opacity:1}
.template-section{padding-top:80px;padding-bottom:10px}
.template-heading-row{display:flex;align-items:center;justify-content:space-between;gap:18px;border-top:1px solid var(--line);padding-top:24px}
.template-total{font:8px/1.5 var(--mono);letter-spacing:1px;color:#898580;white-space:nowrap;padding-bottom:17px}
.template-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
.template-card{overflow:hidden;border:1px solid #403a34;border-radius:6px;background:#1b1815;transition:border-color .2s}
.template-card:hover{border-color:#93604a}
.template-cover{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;height:162px;gap:3px;overflow:hidden;padding:6px 6px 0;background:#24201b}
.template-cover img{width:100%;height:100%;object-fit:cover;min-width:0;filter:saturate(.85);border-radius:2px}
.template-card-body{padding:22px}
.template-card-body>.eyebrow{font-size:7px;letter-spacing:1px;color:#b39580;margin:0 0 9px}
.template-card h3{font-size:20px;font-weight:500;margin:0 0 12px;letter-spacing:.5px}
.template-card-body>p:not(.eyebrow){font-size:11px;line-height:1.95;color:#aaa097;margin:0;min-height:44px}
.template-card-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:21px;padding-top:17px;border-top:1px solid #3a332c}
.template-card-actions .small-button{background:#39261d;border-color:#71442f;color:#f0bd9a;font-size:10px;gap:20px}
.template-card-actions .text-button{font-size:10px;color:#b8ada2}
.template-footnote{font-size:10px;line-height:1.9;color:#958b80;margin:21px 0 0}
.gallery-rail{position:sticky;top:0;z-index:10;background:#14120ff2;backdrop-filter:blur(16px);box-shadow:0 12px 16px #14120f80}
.gallery-controls{gap:12px}
.gallery-search{max-width:none;min-width:150px}
.template-filter{background:#1b1815;border:1px solid #4a4139;border-radius:5px;color:#c5b9ae;padding:10px 8px;min-height:39px;font-size:10px;width:178px;max-width:100%}
.gallery-rail .result-bar{padding-bottom:17px}
.prompt-dialog{width:min(1340px,96vw);max-width:calc(100vw - 42px);height:90dvh;max-height:calc(100dvh - 42px);overflow:hidden}
.prompt-dialog .dialog-top{height:56px;min-height:56px}
.prompt-dialog .dialog-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);height:calc(100% - 56px);min-height:0;overflow:hidden}
.dialog-media{display:flex;flex-direction:column;min-height:0;min-width:0;padding:22px;background:#13110f;border-right:1px solid #40382f}
.prompt-dialog .dialog-visual{position:relative;flex:1;min-height:160px;height:auto;border:0;border-radius:4px;background:#201c17;isolation:isolate}
.prompt-dialog .dialog-visual>img{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;object-fit:contain;transition:opacity .25s}
.dialog-visual .dialog-image-thumb{filter:blur(9px);opacity:.8}
.dialog-visual #dialogImage{opacity:0}
.dialog-visual.is-image-ready #dialogImage{opacity:1}
.dialog-visual.is-image-ready .dialog-image-thumb{opacity:0}
.dialog-visual .view-image{z-index:2;background:#13110fc9;backdrop-filter:blur(6px)}
.dialog-visual .visual-note{z-index:2;background:#13110fc9;border-radius:3px;padding:4px 8px;bottom:12px;font-size:8px;left:50%;transform:translateX(-50%);width:max-content;max-width:100%}
.image-notice{position:absolute;z-index:2;bottom:44px;left:12px;right:12px;background:#2e241de8;color:#efcfb4;padding:10px;font-size:11px;line-height:1.6;text-align:center}
.related-heading{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:#b4a797;margin:19px 0 10px;gap:12px}
.related-heading>span:last-child{color:#84776a;font-size:9px}
.related-cases{display:flex;gap:9px;overflow-x:auto;flex-shrink:0;padding-bottom:3px;scrollbar-width:thin}
.related-cases>button{position:relative;flex:0 0 calc((100% - 18px)/3);min-width:90px;max-width:175px;padding:0;overflow:hidden;background:#292118;border:1px solid #5c4734;border-radius:3px;text-align:left}
.related-cases img{width:100%;height:90px;display:block;object-fit:cover;transition:filter .2s}
.related-cases button:hover img{filter:brightness(.75)}
.related-cases button>span{display:block;font-size:9px;color:#d0c2b3;padding:7px 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.prompt-dialog .dialog-content{padding:27px 28px 32px;overflow-y:auto;min-height:0;min-width:0;overscroll-behavior:contain;scrollbar-width:thin}
.detail-kicker{display:flex;align-items:center;gap:12px;justify-content:space-between;flex-wrap:wrap}
.detail-kicker>.eyebrow{margin:0;font-size:8px}
.template-badge{font-size:9px;color:#e1af8d;border:1px solid #754b33;border-radius:4px;background:#38271d;padding:5px 8px}
.prompt-dialog .dialog-content h2{font-size:29px;line-height:1.4;margin:14px 0 12px}
.prompt-dialog .dialog-description{font-size:12px;line-height:1.85;color:#b0a69a}
.prompt-dialog .detail-tabs{display:flex;gap:21px;overflow-x:auto;scrollbar-width:none;flex-shrink:0;white-space:nowrap}
.prompt-dialog .detail-tab{font-size:11px;flex-shrink:0;min-height:39px}
.prompt-dialog .detail-panel{min-height:0}
.prompt-dialog #promptText{min-height:260px;font-size:12px;line-height:1.95}
.template-panel-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:0 0 14px}
.template-panel-head .eyebrow{font-size:7px;color:#be916c;margin:0 0 8px}
.template-panel-head h3{margin:0;font-size:19px;font-weight:500}
.template-panel-head .text-button{font-size:10px;white-space:nowrap;color:#bd9d83}
.template-principle{font-size:11px;line-height:1.9;color:#b5aa9c;padding:12px 14px;background:#252018;border-left:2px solid #ad6b42;border-radius:0 3px 3px 0;margin:0 0 21px}
.template-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px 13px}
.template-field{display:block;min-width:0}
.template-field.wide{grid-column:1/-1}
.template-field>span{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:11px;color:#d1c1b2;margin-bottom:8px}
.template-field small{font-size:8px;color:#84776b;font-weight:400}
.prompt-dialog .template-field textarea{display:block;width:100%;min-height:70px;font-size:12px;line-height:1.75;padding:11px 12px;resize:vertical;border:1px solid #514235;border-radius:4px;background:#171411;color:#d4c7bb}
.prompt-dialog .template-field textarea:focus{outline:1px solid #bf7b50;border-color:#bf7b50}
.template-ratio-label{display:flex;align-items:center;justify-content:space-between;gap:14px;font-size:11px;color:#d1c1b2;margin:18px 0}
.template-ratio-label select{width:125px;padding:8px 12px;font-size:12px;color:#e4ceba;background:#241c16;border:1px solid #66503b;border-radius:4px}
.template-preview-head{display:flex;justify-content:space-between;gap:12px;font-size:10px;color:#c6b8a9;margin:25px 0 10px}
.template-preview-head>span{color:#90806f;font-size:9px}
.prompt-dialog .template-preview{min-height:170px;font-size:11px;line-height:1.9;background:#201b16;color:#cdbfaf;padding:13px}
.template-draft-note,.usage-note{font-size:10px;color:#9c8b79;line-height:1.8;margin:10px 0 0}
.template-error{font-size:11px;line-height:1.7;color:#f3ad88;border:1px solid #935b3c;background:#3a2417;border-radius:4px;padding:10px 13px}
.usage-intro{font-size:12px;line-height:1.8;color:#b9aa99;margin:0 0 18px}
.usage-conversation{display:flex;flex-direction:column;gap:15px;margin-bottom:20px}
.usage-message{max-width:94%;border:1px solid #4a3f32;background:#201b15;border-radius:7px;padding:15px 17px;align-self:flex-start}
.usage-message.user{align-self:flex-end;background:#33241a;border-color:#67452e}
.usage-message>span{font-size:10px;color:#e5b590}
.usage-message small{font-size:8px;color:#98816c;margin-left:7px}
.usage-message p{font-size:12px;line-height:1.95;color:#cabcaa;margin:9px 0 0;overflow-wrap:anywhere}
.usage-note{margin-top:15px}
#copyBrief{font-size:11px;width:100%;justify-content:center}
.prompt-dialog button:disabled{opacity:.45;cursor:not-allowed}
.site-footer>div{flex-wrap:wrap}
@media(max-width:1100px){.site-header nav{gap:8px}.nav-templates .tiny-badge{display:none}.template-total{display:none}.template-card-body{padding:18px}.template-card h3{font-size:18px}.template-cover{height:140px}.template-card-actions{gap:6px}.template-card-actions .small-button{gap:9px}.prompt-dialog .detail-tabs{gap:17px}}
@media(max-width:850px){
 .template-section{padding-top:55px}.template-cards{gap:15px}.template-card-body{padding:16px}.template-card h3{font-size:16px}.template-card-body>p:not(.eyebrow){font-size:10px;min-height:60px}.template-card-actions{flex-wrap:wrap;gap:13px}.template-cover{height:120px}
 .gallery-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px}.view-switch{grid-column:1/-1;justify-self:start;order:0}.gallery-search{grid-column:1/-1;width:100%;order:1;box-sizing:border-box;min-width:0}.template-filter{order:2;width:100%}.sort-select{order:3;width:100%}
 .prompt-dialog{height:94dvh;max-height:calc(100dvh - 24px);max-width:calc(100vw - 24px)}.prompt-dialog .dialog-body{display:block;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.dialog-media{height:490px;border-right:0;border-bottom:1px solid #40382f;padding:20px}.prompt-dialog .dialog-content{overflow:visible;padding:25px;min-height:0}.prompt-dialog .dialog-visual{min-height:0}.related-cases img{height:74px}.related-heading{margin-top:15px}.related-cases>button{max-width:150px}.prompt-dialog .detail-tabs{gap:24px}.prompt-dialog .detail-tab{font-size:12px}
}
@media(max-width:600px){.template-cards{grid-template-columns:1fr}.template-cover{height:165px}.template-card-body{padding:20px}.template-card h3{font-size:20px}.template-card-body>p:not(.eyebrow){font-size:12px;min-height:0}.template-card-actions{flex-wrap:nowrap;margin-top:20px}.template-card-actions .small-button{font-size:12px;padding:9px 14px;gap:25px}.template-card-actions .text-button{font-size:11px}.template-card-body>.eyebrow{font-size:8px}.template-footnote{font-size:11px}.template-heading-row{padding-top:20px}.template-section .category-filters{width:100%;margin-right:0;padding-right:0}.hero-bottom{flex-wrap:wrap;gap:12px 22px}.hero-bottom .hero-motion{font-size:8px}.floating-art .hero-incoming{top:3px;left:3px;width:calc(100% - 6px)}}
@media(max-width:540px){
 .template-section{padding-top:45px}.template-cover{height:150px}.gallery-rail .category-filters{margin-right:0;padding-right:0}.gallery-rail .result-bar{padding-bottom:12px}.gallery-controls{padding-top:12px;padding-bottom:12px;gap:9px}.gallery-controls .view-switch{grid-column:1;grid-row:1}.gallery-controls .sort-select{grid-column:2;grid-row:1;width:95px;justify-self:end;min-height:36px}.gallery-controls .gallery-search{grid-column:1/-1;grid-row:2}.gallery-controls .template-filter{grid-column:1/-1;grid-row:3;min-height:36px;font-size:11px}.gallery-rail .ready-indicator{display:none}
 .prompt-dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);height:calc(100dvh - 20px);max-height:calc(100dvh - 20px)}.prompt-dialog .dialog-top{height:52px;min-height:52px;padding:10px 12px}.prompt-dialog .dialog-body{height:calc(100% - 52px)}.dialog-media{height:430px;padding:14px}.related-cases img{height:67px}.related-cases button>span{font-size:9px;padding:7px}.related-heading{font-size:10px;margin:13px 0 8px}.prompt-dialog .dialog-content{padding:22px 17px 28px}.detail-kicker{gap:9px}.detail-kicker>.eyebrow{font-size:8px}.template-badge{font-size:10px}.prompt-dialog .dialog-content h2{font-size:25px}.prompt-dialog .dialog-description{font-size:12px}.prompt-dialog .detail-tabs{gap:19px;margin-bottom:20px}.prompt-dialog .detail-tab{font-size:12px}.template-panel-head h3{font-size:19px}.template-principle{font-size:12px}.template-fields{gap:15px 12px}.template-field>span{font-size:12px}.prompt-dialog .template-field textarea{font-size:13px;min-height:89px}.template-field small{font-size:9px}.template-ratio-label{font-size:12px}.prompt-dialog .template-preview{font-size:12px}.usage-message p{font-size:13px}.template-draft-note,.usage-note{font-size:11px}.prompt-dialog .dialog-actions .primary-button{font-size:12px}.studio-transfer{font-size:12px;min-height:42px}.template-preview-head{font-size:11px}.site-footer>div{row-gap:16px}.prompt-dialog .dialog-secondary .text-button{font-size:10px}
}
@media(prefers-reduced-motion:reduce){.floating-art .hero-incoming,.dialog-visual>img,.template-card,.related-cases img{transition:none}}
