:root { --gif-ink: #242321; --gif-paper: #fffdf9; --gif-line: #d8d1c6; --gif-muted: #777067; --gif-lime: #b8f04a; --gif-purple: #7048d8; --gif-coral: #ff6b4a; }
.gif-main { min-height: 100vh; padding: 18px max(24px, calc((100vw - 1320px) / 2)) 96px; }
.gif-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 48px; align-items: center; padding: 54px 0 46px; }
.gif-hero h1 { max-width: 820px; margin: 12px 0 18px; color: var(--gif-ink); font-size: clamp(48px, 7vw, 86px); line-height: .94; letter-spacing: -.065em; }
.gif-hero h1 em { color: var(--gif-purple); font-family: Georgia, serif; font-weight: 500; }
.gif-hero p { max-width: 720px; margin: 0; color: var(--gif-muted); font-size: 16px; line-height: 1.75; }
.gif-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.gif-tags span { padding: 7px 10px; border: 1px solid #d4cdc2; border-radius: 999px; background: rgba(255,255,255,.58); color: #625c54; font-size: 10px; font-weight: 760; }
.gif-hero-art { min-height: 245px; position: relative; overflow: hidden; border: 1px solid #181713; border-radius: 30px; background: #242321; box-shadow: 0 20px 52px rgba(46,39,31,.16); }
.gif-hero-art::before, .gif-hero-art::after { content: ''; position: absolute; width: 150px; height: 150px; left: 50%; top: 50%; border-radius: 30px; transform: translate(-50%,-50%) rotate(-8deg); background: var(--gif-coral); box-shadow: -46px 20px 0 var(--gif-lime), 47px -18px 0 var(--gif-purple); animation: gif-stack 3.2s steps(1,end) infinite; }
.gif-hero-art::after { width: 58px; height: 58px; z-index: 2; border-radius: 50%; background: #fffdf9; box-shadow: none; animation: gif-dot 1.2s steps(4,end) infinite; }
.gif-hero-art b { position: absolute; left: 25px; top: 22px; z-index: 3; color: #fff; font: 750 11px ui-monospace, monospace; letter-spacing: .12em; }
@keyframes gif-stack { 0%,24% { transform: translate(-50%,-50%) rotate(-8deg); } 25%,49% { transform: translate(-50%,-50%) rotate(4deg); } 50%,74% { transform: translate(-50%,-50%) rotate(10deg); } 75%,100% { transform: translate(-50%,-50%) rotate(-2deg); } }
@keyframes gif-dot { 0% { transform: translate(-95%,-80%); } 25% { transform: translate(10%,-85%); } 50% { transform: translate(10%,5%); } 75%,100% { transform: translate(-95%,5%); } }
@media (prefers-reduced-motion: reduce) { .gif-hero-art::before, .gif-hero-art::after { animation: none; } }

.gif-workbench { overflow: hidden; border: 1px solid #d4cdc2; border-radius: 28px; background: var(--gif-paper); box-shadow: 0 24px 70px rgba(47,39,29,.1); }
.gif-workbench-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 22px 27px; border-bottom: 1px solid #e2dcd2; }
.gif-kicker { color: var(--gif-purple); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.gif-workbench-heading h2 { margin: 4px 0 0; font-size: 24px; letter-spacing: -.035em; }
.gif-local-note { color: #676158; font-size: 11px; }
.gif-local-note i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #69a88e; box-shadow: 0 0 0 4px rgba(105,168,142,.12); }
.gif-layout { display: grid; grid-template-columns: minmax(280px, 330px) minmax(400px, 1fr) minmax(270px, 310px); min-height: 720px; }
.gif-frames { padding: 20px; border-right: 1px solid #e1dbd0; background: #f7f3eb; }
.gif-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.gif-panel-heading div { display: flex; align-items: center; gap: 8px; }
.gif-panel-heading span { color: #9c4839; font: 800 10px ui-monospace, monospace; }
.gif-panel-heading h3 { margin: 0; font-size: 15px; }
.gif-panel-heading output { display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 999px; background: #262421; color: #fff; font-size: 10px; font-weight: 800; }
.gif-dropzone { display: grid; place-items: center; min-height: 110px; border: 1px dashed #bcb3a6; border-radius: 15px; padding: 14px; text-align: center; background: rgba(255,255,255,.55); transition: .2s ease; }
.gif-dropzone.dragging { border-color: var(--gif-purple); background: #f0ebff; transform: translateY(-2px); }
.gif-dropzone button, .gif-delay-presets button, .gif-settings button, .gif-preview-controls button { border: 1px solid #cec6ba; border-radius: 9px; padding: 8px 10px; background: #fffdf9; color: #4f4a43; font-family: inherit; font-size: 10px; font-weight: 750; line-height: 1; cursor: pointer; }
.gif-dropzone p { margin: 9px 0 0; color: #81796f; font-size: 10px; line-height: 1.5; }
.gif-frame-list { display: grid; gap: 8px; max-height: 490px; overflow: auto; margin: 14px 0 0; padding: 0; list-style: none; }
.gif-frame-list li { display: grid; grid-template-columns: 74px minmax(0,1fr) auto; align-items: center; gap: 9px; border: 1px solid #d9d2c7; border-radius: 12px; padding: 7px; background: rgba(255,255,255,.65); }
.gif-frame-list li.selected { border-color: var(--gif-purple); box-shadow: inset 0 0 0 1px var(--gif-purple); }
.gif-frame-list img { width: 74px; height: 50px; border-radius: 8px; object-fit: cover; background: #e5dfd5; }
.gif-frame-select { min-width: 0; border: 0; padding: 0; text-align: left; background: none; cursor: pointer; }
.gif-frame-select strong, .gif-frame-select small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gif-frame-select strong { color: #37332e; font-size: 10px; }
.gif-frame-select small { margin-top: 4px; color: #8b8379; font-size: 9px; }
.gif-frame-actions { display: grid; gap: 3px; }
.gif-frame-actions button { width: 24px; height: 22px; border: 0; border-radius: 6px; color: #655f57; background: #eee8df; cursor: pointer; }
.gif-frame-actions button:disabled { opacity: .3; cursor: default; }
.gif-empty { margin: 18px 0 0; padding: 24px 14px; border-radius: 14px; color: #827a71; background: #eee9e0; text-align: center; }
.gif-empty strong { display: block; color: #4b4640; font-size: 12px; }
.gif-empty p { margin: 7px 0 0; font-size: 10px; line-height: 1.55; }

.gif-preview { min-width: 0; display: flex; flex-direction: column; padding: 22px; background: #e9e3d9; }
.gif-canvas-shell { flex: 1; min-height: 430px; display: grid; place-items: center; overflow: hidden; border: 1px solid #d1c9bd; border-radius: 19px; padding: 20px; background-image: linear-gradient(45deg,#d8d1c6 25%,transparent 25%),linear-gradient(-45deg,#d8d1c6 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#d8d1c6 75%),linear-gradient(-45deg,transparent 75%,#d8d1c6 75%); background-position: 0 0,0 10px,10px -10px,-10px 0; background-size: 20px 20px; background-color: #eee8de; }
#gifCanvas { display: block; max-width: 100%; max-height: 540px; width: auto; height: auto; border-radius: 5px; box-shadow: 0 13px 40px rgba(43,36,28,.18); }
.gif-preview-controls { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; margin-top: 13px; }
.gif-preview-controls button { min-height: 42px; }
.gif-result a { display: grid; place-items: center; min-height: 36px; margin-top: 8px; border-radius: 8px; color: #fff; background: #262421; font-size: 10px; font-weight: 800; text-decoration: none; }
#gifPlay { color: #fff; background: #262421; border-color: #262421; }

.gif-settings { padding: 20px; background: #fffdf9; }
.gif-settings-group + .gif-settings-group { margin-top: 20px; padding-top: 20px; border-top: 1px solid #e1dbd1; }
.gif-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gif-fields label { display: grid; gap: 6px; color: #655f57; font-size: 10px; font-weight: 750; }
.gif-fields label.wide { grid-column: 1/-1; }
.gif-fields input, .gif-fields select { width: 100%; min-width: 0; height: 40px; border: 1px solid #cbc3b7; border-radius: 9px; padding: 0 10px; background: #fff; color: #2d2a26; font: inherit; }
.gif-range-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.gif-range-row input { padding: 0; }
.gif-range-row output { min-width: 58px; color: #4c4741; font-size: 10px; font-weight: 750; text-align: right; }
.gif-delay-presets { display: flex; gap: 5px; margin-top: 8px; }
.gif-loop-label { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-top: 10px; padding: 8px 10px; border: 1px solid #d9d2c7; border-radius: 10px; color: #554f48; background: #faf7f1; font-size: 10px; font-weight: 750; }
.gif-loop-label input { width: 17px; height: 17px; accent-color: var(--gif-purple); }
.gif-action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.gif-error { margin: 12px 0 0; padding: 9px 10px; border: 1px solid #e5b2a6; border-radius: 9px; color: #963b29; background: #fff0ec; font-size: 10px; line-height: 1.5; }
#gifExport { width: 100%; min-height: 50px; margin-top: 13px; border: 0; border-radius: 12px; color: #fff; background: var(--gif-purple); font-size: 12px; font-weight: 850; cursor: pointer; box-shadow: 0 10px 25px rgba(112,72,216,.2); }
#gifExport:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
#gifProgress { display: block; margin-top: 9px; color: #817a71; font-size: 9px; line-height: 1.5; }
.gif-result { margin-top: 12px; border: 1px solid #d6cec2; border-radius: 12px; padding: 9px; background: #f3eee6; }
.gif-result img { display: block; width: 100%; max-height: 170px; border-radius: 8px; object-fit: contain; background: #fff; }
.gif-result small { display: block; margin-top: 7px; color: #6e675e; font-size: 9px; }
.gif-benefits { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 18px; }
.gif-benefits article { min-height: 170px; border: 1px solid #d7d0c5; border-radius: 18px; padding: 22px; background: rgba(255,255,255,.5); }
.gif-benefits span { color: var(--gif-purple); font: italic 15px Georgia,serif; }
.gif-benefits strong { display: block; margin: 23px 0 8px; font-size: 15px; }
.gif-benefits p { margin: 0; color: var(--gif-muted); font-size: 11px; line-height: 1.7; }

@media (max-width: 1080px) { .gif-layout { grid-template-columns: 290px minmax(0,1fr); } .gif-settings { grid-column: 1/-1; border-top: 1px solid #e1dbd0; } .gif-settings-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; } .gif-settings-group + .gif-settings-group { margin: 0; padding: 0; border: 0; } }
@media (max-width: 760px) { .gif-hero { grid-template-columns: 1fr; gap: 28px; padding-top: 34px; } .gif-hero h1 { font-size: 50px; } .gif-hero-art { min-height: 200px; } .gif-layout { grid-template-columns: 1fr; } .gif-frames { border-right: 0; border-bottom: 1px solid #e1dbd0; } .gif-preview { min-height: 520px; } .gif-settings { grid-column: auto; } .gif-settings-inner { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .gif-main { padding-inline: 14px; } .gif-workbench-heading { align-items: flex-start; flex-direction: column; } .gif-frames, .gif-preview, .gif-settings { padding: 16px; } .gif-canvas-shell { min-height: 330px; padding: 10px; } .gif-benefits { grid-template-columns: 1fr; } .gif-frame-list { max-height: 430px; } }
