/* ==========================================================================
   Hentai Generator — Free Online Image Editor
   Design identity matched to the main site / upscaler page.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;900&family=Comfortaa:wght@400;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --navPadding: 16px;
    --navFontSize: 100%;
    --mainColor: #ff49e1;
    --secondaryColor: #8d00b57a;
    --terciaryColor: #302;

    --bg:          #000;
    --panel:       #140a16;
    --panel-2:     #1d0f21;
    --panel-3:     #2a1630;
    --line:        #ff49e133;
    --line-strong: #ff49e1;
    --text:        #dbceff;
    --text-bright: #fff;
    --muted:       #a894c0;
    --radius:      10px;

    --rail-w:  74px;
    --side-w:  308px;
    --top-h:   50px;
}

html { overflow-x: hidden; scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400' viewBox='0 0 800 800'%3E%3Cg fill='none' stroke='dark-grey' stroke-width='0'%3E%3Cpath d='M769 229L1037 260.9M927 880L731 737 520 660 309 538 40 599 295 764 126.5 879.5 40 599-197 493 102 382-31 229 126.5 79.5-69-63'/%3E%3Cpath d='M-31 229L237 261 390 382 603 493 308.5 537.5 101.5 381.5M370 905L295 764'/%3E%3Cpath d='M520 660L578 842 731 737 840 599 603 493 520 660 295 764 309 538 390 382 539 269 769 229 577.5 41.5 370 105 295 -36 126.5 79.5 237 261 102 382 40 599 -69 737 127 880'/%3E%3Cpath d='M520-140L578.5 42.5 731-63M603 493L539 269 237 261 370 105M902 382L539 269M390 382L102 382'/%3E%3Cpath d='M-222 42L126.5 79.5 370 105 539 269 577.5 41.5 927 80 769 229 902 382 603 493 731 737M295-36L577.5 41.5M578 842L295 764M40-201L127 80M102 382L-261 269'/%3E%3C/g%3E%3Cg fill='%230044cc'%3E%3Ccircle cx='769' cy='229' r='5'/%3E%3Ccircle cx='539' cy='269' r='5'/%3E%3Ccircle cx='603' cy='493' r='5'/%3E%3Ccircle cx='731' cy='737' r='5'/%3E%3Ccircle cx='520' cy='660' r='5'/%3E%3Ccircle cx='309' cy='538' r='5'/%3E%3Ccircle cx='295' cy='764' r='5'/%3E%3Ccircle cx='40' cy='599' r='5'/%3E%3Ccircle cx='102' cy='382' r='5'/%3E%3Ccircle cx='127' cy='80' r='5'/%3E%3Ccircle cx='370' cy='105' r='5'/%3E%3Ccircle cx='578' cy='42' r='5'/%3E%3Ccircle cx='237' cy='261' r='5'/%3E%3Ccircle cx='390' cy='382' r='5'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 200px 200px;
    color: var(--text);
    font-family: "Comfortaa", sans-serif;
    padding: 10px;
    -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; }
iframe { max-width: 100%; }

/* ===== Navigation (same identity as the main page) ===== */
nav { display: flex; justify-content: center; align-items: center; font-size: 15px; margin-top: 10px; }
nav ul { list-style: none; display: flex; gap: 1px; flex-wrap: wrap; justify-content: center; }
nav ul li a {
    padding: var(--navPadding);
    font-size: var(--navFontSize);
    color: #fff;
    text-decoration: none;
    font-family: "Kanit";
    background-color: var(--mainColor);
    transition: background-color .3s ease-in;
    border-radius: var(--radius);
    border: 1px solid #000;
    cursor: pointer;
    white-space: nowrap;
    display: block;
}
nav ul li a:hover { background-color: #220b23; box-shadow: 1px 1px 30px rgb(255,255,255); }
nav ul li a:active { background-color: rgb(255,0,0); }
nav ul li a[aria-current="page"] { background-color: #220b23; }

/* ===== Brand ===== */
.brand-row { position: relative; display: flex; justify-content: center; align-items: center; margin: 20px 0 15px; }
.site-name {
    position: relative; display: flex; justify-content: center; align-items: center;
    font-family: "Kanit"; font-size: 230%; color: #fff; transition: all 1s ease-in-out;
}
.site-name:hover { transition: all .2s ease-in-out; text-shadow: 0 0 15px #f00; }
.site-name-link { color: inherit; text-decoration: none; }
.site-name img { position: relative; left: 20%; max-height: 120px; max-width: 120px; height: 120px; width: 120px; }

/* ===== Narrow content column (SEO copy, FAQ, footer) ===== */
.page-intro, .page-content, footer { max-width: 700px; margin-left: auto; margin-right: auto; }

.page-intro { text-align: center; margin-bottom: 14px; }
h1 { color: #fff; font-size: 25px; margin-bottom: 10px; font-family: "Comfortaa"; }
h2 { color: #fff; font-size: 20px; margin-bottom: 12px; font-family: "Comfortaa"; }
h3 { color: #fff; font-size: 16px; margin-bottom: 8px; font-family: "Comfortaa"; }
.lede { font-size: 14px; margin-bottom: 12px; line-height: 1.7; }
.checklist { list-style: none; padding: 0; font-size: 13px; margin: 0 0 10px; }
.checklist li { margin: 3px 0; }
.center { text-align: center; }
.accent { color: #ffeb3b; text-decoration: none; }
.accent:hover { text-decoration: underline; }

/* ===== Ads ===== */
.ad-wrap { display: flex; justify-content: center; margin: 18px auto; width: 100%; max-width: 728px; height: 90px; overflow: hidden; }
.ad-wrap iframe { width: 728px; height: 90px; border: 0; }

/* ==========================================================================
   START SCREEN
   ========================================================================== */
.hge-app { max-width: 1600px; margin: 0 auto; }

.hge-start {
    background: rgba(255,255,255,.08);
    border: 2px solid var(--mainColor);
    border-radius: 12px;
    box-shadow: 0 0 20px #ff49e155;
    padding: 20px;
    margin: 15px auto;
    max-width: 700px;
    text-align: center;
}
.local-badge {
    display: inline-block; background: #ff49e12b; border: 1px solid var(--mainColor);
    border-radius: 6px; padding: 4px 9px; font-size: 11px; margin-bottom: 14px; color: #fff;
}
.hge-drop {
    border: 2px dashed #ff49e199; border-radius: var(--radius);
    padding: 34px 14px; cursor: pointer; transition: all .25s; color: #fff; outline: none;
}
.hge-drop:hover, .hge-drop.dragover, .hge-drop:focus-visible { background: #ff49e122; border-color: var(--mainColor); }
.hge-drop-icon { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.hge-drop-main { font-size: 15px; margin-bottom: 4px; }
.hge-drop-sub { font-size: 13px; opacity: .85; }
.hge-drop-formats { font-size: 11px; opacity: .6; margin-top: 10px; letter-spacing: .5px; }

.hge-start-or { font-size: 12px; opacity: .6; margin: 14px 0 10px; }
.hge-blank-size { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 10px; font-size: 12px; flex-wrap: wrap; }
.hge-blank-size input[type=number] { width: 74px; }
.hge-check { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }

.hge-receiving { margin-top: 18px; font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff; }
.hge-spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid #ff49e155; border-top-color: var(--mainColor);
    animation: hge-spin .8s linear infinite; flex: none;
}
@keyframes hge-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   SHARED CONTROLS
   ========================================================================== */
.hge-btn {
    background-color: var(--terciaryColor); border: 2px solid #000; border-radius: var(--radius);
    color: #fff; font-family: "Comfortaa"; font-size: 13px; font-weight: 700;
    padding: 9px 14px; cursor: pointer; transition: all .25s; text-shadow: 0 0 6px #fff8;
}
.hge-btn:hover:not(:disabled) { background-color: var(--mainColor); box-shadow: 0 0 12px #fff8; }
.hge-btn:disabled { opacity: .4; cursor: not-allowed; }
.hge-btn.sm { font-size: 11.5px; padding: 6px 9px; border-width: 1px; }
.hge-btn-primary { background-color: var(--mainColor); }
.hge-btn-primary:hover:not(:disabled) { background-color: #ff7bea; }
.hge-btn-block { display: block; width: 100%; }

.hge-icon-btn {
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
    color: #fff; font-size: 16px; line-height: 1; width: 34px; height: 34px;
    cursor: pointer; transition: all .2s; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.hge-icon-btn:hover:not(:disabled) { background: var(--mainColor); border-color: var(--mainColor); }
.hge-icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.hge-icon-btn.sm { width: 27px; height: 27px; font-size: 12px; }
.hge-icon-btn.active { background: var(--mainColor); border-color: #fff; }

input[type=number], input[type=text], select {
    background: var(--panel-3); border: 1px solid var(--line); border-radius: 6px;
    color: #fff; font-family: "Comfortaa"; font-size: 12px; padding: 5px 7px; outline: none; min-width: 0;
}
input[type=number]:focus, input[type=text]:focus, select:focus { border-color: var(--mainColor); }
select { cursor: pointer; }
select option { background: var(--panel-2); }

input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; height: 18px; cursor: pointer; min-width: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: #ffffff26; }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: #ffffff26; }
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 14px; height: 14px; border-radius: 50%;
    background: var(--mainColor); border: 2px solid #fff; margin-top: -5px; box-shadow: 0 0 6px #ff49e1aa;
}
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--mainColor); border: 2px solid #fff; }

input[type=color] {
    -webkit-appearance: none; appearance: none; border: 1px solid var(--line); border-radius: 6px;
    width: 100%; height: 30px; padding: 2px; background: var(--panel-3); cursor: pointer;
}
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: none; border-radius: 4px; }

input[type=checkbox] { accent-color: var(--mainColor); width: 15px; height: 15px; cursor: pointer; flex: none; }

/* ==========================================================================
   EDITOR CHROME
   ========================================================================== */
.hge-editor {
    background: var(--panel);
    border: 2px solid var(--mainColor);
    border-radius: 12px;
    box-shadow: 0 0 24px #ff49e144;
    overflow: hidden;
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    height: min(calc(100vh - 40px), 900px);
    min-height: 520px;
}
.hge-editor[hidden] { display: none; }

.hge-topbar {
    height: var(--top-h); flex: none; display: flex; align-items: center; gap: 8px;
    padding: 0 10px; background: var(--panel-2); border-bottom: 1px solid var(--line);
}
.hge-topbar-group { display: flex; align-items: center; gap: 6px; }
.hge-topbar-right { margin-left: auto; }
.hge-zoom-group { margin-left: 10px; }
.hge-zoom-label {
    background: var(--panel-3); border: 1px solid var(--line); border-radius: 8px; color: #fff;
    font-family: "Comfortaa"; font-size: 12px; padding: 7px 8px; min-width: 60px; cursor: pointer; transition: all .2s;
}
.hge-zoom-label:hover { border-color: var(--mainColor); }
.hge-doc-size { font-size: 11px; color: var(--muted); white-space: nowrap; }

.hge-body { flex: 1; display: flex; min-height: 0; }

/* ---- Left tool rail ---- */
.hge-tools {
    width: var(--rail-w); flex: none; background: var(--panel-2); border-right: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 2px; padding: 6px 4px; overflow-y: auto; overscroll-behavior: contain;
}
.hge-tool {
    background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--text);
    cursor: pointer; padding: 7px 2px; display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-family: "Comfortaa"; transition: all .18s; flex: none;
}
.hge-tool span { font-size: 19px; line-height: 1; }
.hge-tool em { font-style: normal; font-size: 9.5px; letter-spacing: .2px; }
.hge-tool:hover { background: #ff49e11f; border-color: var(--line); }
.hge-tool.active { background: var(--mainColor); border-color: #fff; color: #fff; box-shadow: 0 0 10px #ff49e199; }

/* ---- Center stage ---- */
.hge-stage {
    flex: 1; min-width: 0; position: relative; overflow: hidden;
    background:
        linear-gradient(45deg, #1a1020 25%, transparent 25%, transparent 75%, #1a1020 75%),
        linear-gradient(45deg, #1a1020 25%, #120a16 25%, #120a16 75%, #1a1020 75%);
    background-size: 24px 24px; background-position: 0 0, 12px 12px;
    display: flex; align-items: center; justify-content: center; touch-action: none;
}
.hge-canvas-holder { position: relative; line-height: 0; box-shadow: 0 0 0 1px #ff49e155, 0 8px 40px #000a; }
.hge-canvas-holder .canvas-container { background-image:
        linear-gradient(45deg, #808080 25%, transparent 25%, transparent 75%, #808080 75%),
        linear-gradient(45deg, #808080 25%, #bbb 25%, #bbb 75%, #808080 75%);
    background-size: 16px 16px; background-position: 0 0, 8px 8px; }

.hge-hint {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
    background: #000000cc; border: 1px solid var(--line); border-radius: 20px;
    padding: 5px 13px; font-size: 11.5px; color: #fff; pointer-events: none;
    opacity: 0; transition: opacity .25s; max-width: 92%; text-align: center; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.hge-hint.show { opacity: 1; }

/* ---- Crop overlay ---- */
.hge-crop-overlay { position: absolute; inset: 0; z-index: 30; cursor: crosshair; }
.hge-crop-box { position: absolute; border: 1px solid #fff; box-shadow: 0 0 0 9999px #000000a6; cursor: move; }
.hge-crop-box::before, .hge-crop-box::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(to right, transparent 33.33%, #ffffff55 33.33%, #ffffff55 33.53%, transparent 33.53%,
                        transparent 66.66%, #ffffff55 66.66%, #ffffff55 66.86%, transparent 66.86%);
}
.hge-crop-box::after {
    background:
        linear-gradient(to bottom, transparent 33.33%, #ffffff55 33.33%, #ffffff55 33.53%, transparent 33.53%,
                        transparent 66.66%, #ffffff55 66.66%, #ffffff55 66.86%, transparent 66.86%);
}
.hge-crop-box i {
    position: absolute; width: 13px; height: 13px; background: #fff; border: 1px solid var(--mainColor);
    border-radius: 2px; z-index: 2;
}
.hge-crop-box i[data-h=nw]{ left:-7px; top:-7px; cursor: nwse-resize; }
.hge-crop-box i[data-h=ne]{ right:-7px; top:-7px; cursor: nesw-resize; }
.hge-crop-box i[data-h=sw]{ left:-7px; bottom:-7px; cursor: nesw-resize; }
.hge-crop-box i[data-h=se]{ right:-7px; bottom:-7px; cursor: nwse-resize; }
.hge-crop-box i[data-h=n] { left:50%; top:-7px; margin-left:-6px; cursor: ns-resize; }
.hge-crop-box i[data-h=s] { left:50%; bottom:-7px; margin-left:-6px; cursor: ns-resize; }
.hge-crop-box i[data-h=w] { left:-7px; top:50%; margin-top:-6px; cursor: ew-resize; }
.hge-crop-box i[data-h=e] { right:-7px; top:50%; margin-top:-6px; cursor: ew-resize; }

/* ---- Right side panel ---- */
.hge-side {
    width: var(--side-w); flex: none; background: var(--panel-2); border-left: 1px solid var(--line);
    display: flex; flex-direction: column; min-height: 0;
}
.hge-side-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 10px; min-height: 0; }
.hge-panel-title {
    font-family: "Kanit"; font-size: 14px; color: #fff; letter-spacing: .4px;
    padding-bottom: 7px; margin-bottom: 10px; border-bottom: 1px solid var(--line);
}

/* Panel building blocks */
.hge-group { margin-bottom: 14px; }
.hge-group-label {
    font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted);
    margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.hge-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 12px; }
.hge-row > span:first-child { flex: none; width: 68px; color: var(--text); }
.hge-row > input[type=range] { flex: 1; }
.hge-row > b { flex: none; width: 34px; text-align: right; font-weight: 400; font-size: 11px; color: #fff; font-variant-numeric: tabular-nums; }
.hge-row > select, .hge-row > input[type=text], .hge-row > input[type=number] { flex: 1; }
.hge-row.stack { flex-direction: column; align-items: stretch; gap: 4px; }
.hge-row.stack > span:first-child { width: auto; }

.hge-grid { display: grid; gap: 5px; }
.hge-grid.c2 { grid-template-columns: repeat(2, 1fr); }
.hge-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.hge-grid.c4 { grid-template-columns: repeat(4, 1fr); }
.hge-grid.c5 { grid-template-columns: repeat(5, 1fr); }

.hge-chip {
    background: var(--panel-3); border: 1px solid var(--line); border-radius: 8px; color: #fff;
    font-family: "Comfortaa"; font-size: 10.5px; padding: 8px 4px; cursor: pointer; transition: all .18s;
    display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; line-height: 1.25; overflow: hidden;
}
.hge-chip big { font-size: 17px; line-height: 1; }
.hge-chip:hover { background: var(--mainColor); border-color: #fff; }
.hge-chip.active { background: var(--mainColor); border-color: #fff; box-shadow: 0 0 8px #ff49e1aa; }
.hge-chip svg { width: 100%; height: 34px; display: block; }
.hge-chip.thumb { padding: 4px; background: #fff; }
.hge-chip.thumb:hover { background: #ffd9f7; }
.hge-chip.thumb span { font-size: 9px; color: #333; }

.hge-swatches { display: flex; flex-wrap: wrap; gap: 4px; }
.hge-swatch { width: 22px; height: 22px; border-radius: 5px; border: 1px solid #ffffff44; cursor: pointer; transition: transform .15s; }
.hge-swatch:hover { transform: scale(1.15); border-color: #fff; }

.hge-note { font-size: 11px; color: var(--muted); line-height: 1.55; margin-top: 6px; }
.hge-note.warn { color: #ffb56b; }
.hge-divider { height: 1px; background: var(--line); margin: 12px 0; }

.hge-brush-preview {
    height: 46px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
    margin-bottom: 8px; overflow: hidden;
}
.hge-brush-preview canvas { display: block; width: 100%; height: 100%; }

/* ---- Layers ---- */
.hge-layers { flex: none; border-top: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; max-height: 46%; }
.hge-layers-head {
    display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 9px;
    font-family: "Kanit"; font-size: 12.5px; color: #fff; border-bottom: 1px solid var(--line);
}
.hge-layers-head-btns { display: flex; gap: 3px; }
.hge-layer-list { overflow-y: auto; overscroll-behavior: contain; padding: 5px; min-height: 62px; flex: 1; }

.hge-layer {
    display: flex; align-items: center; gap: 6px; padding: 4px 5px; border-radius: 7px;
    border: 1px solid transparent; cursor: pointer; margin-bottom: 3px; transition: background .15s;
}
.hge-layer:hover { background: #ff49e114; }
.hge-layer.active { background: #ff49e12e; border-color: var(--mainColor); }
.hge-layer-thumb {
    width: 30px; height: 30px; flex: none; border-radius: 4px; border: 1px solid #ffffff33;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%),
        linear-gradient(45deg, #ccc 25%, #fff 25%, #fff 75%, #ccc 75%);
    background-size: 10px 10px; background-position: 0 0, 5px 5px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.hge-layer-thumb img { width: 100%; height: 100%; object-fit: contain; }
.hge-layer-name {
    flex: 1; font-size: 11.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: transparent; border: none; font-family: "Comfortaa"; padding: 2px; border-radius: 4px; min-width: 0;
}
.hge-layer-name:focus { background: var(--panel-3); outline: 1px solid var(--mainColor); }
.hge-layer-btn {
    background: transparent; border: none; color: var(--text); font-size: 12px; cursor: pointer;
    width: 21px; height: 21px; border-radius: 4px; flex: none; transition: all .15s; line-height: 1;
}
.hge-layer-btn:hover { background: #ffffff1f; color: #fff; }
.hge-layer-btn.off { opacity: .32; }

.hge-layer-props { flex: none; padding: 8px 9px; border-top: 1px solid var(--line); }
.hge-layer-props .hge-row { margin-bottom: 6px; }
.hge-layer-props .hge-row > span:first-child { width: 50px; font-size: 11px; }
.hge-layer-order { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }

/* ---- Toast ---- */
.hge-toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
    background: var(--panel-2); border: 1px solid var(--mainColor); border-radius: 22px;
    padding: 9px 18px; font-size: 12.5px; color: #fff; z-index: 9000;
    box-shadow: 0 6px 26px #000b; animation: hge-toast-in .22s ease-out; max-width: 90vw; text-align: center;
}
@keyframes hge-toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---- Modal (used by resize / export confirm) ---- */
.hge-modal-back {
    position: fixed; inset: 0; background: #000000cc; z-index: 9500;
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.hge-modal {
    background: var(--panel); border: 2px solid var(--mainColor); border-radius: 12px;
    box-shadow: 0 0 30px #ff49e155; padding: 18px; width: 100%; max-width: 340px; max-height: 90vh; overflow-y: auto;
}
.hge-modal h4 { font-family: "Kanit"; font-size: 15px; color: #fff; margin-bottom: 12px; }
.hge-modal-btns { display: flex; gap: 8px; margin-top: 14px; }
.hge-modal-btns .hge-btn { flex: 1; }

/* ---- SEO content blocks ---- */
.section { margin: 25px 0; text-align: center; font-size: 14px; line-height: 1.7; }
.section p { margin-bottom: 8px; }
.section.how p { margin: 6px 0; }
.support-box {
    background: rgba(255,255,255,.1); padding: 25px; border-radius: var(--radius);
    margin: 25px auto; max-width: 700px; text-align: center;
}
.support-box .big-btn {
    display: inline-block; background: #ffeb3b; color: #000; padding: 12px 25px; border-radius: 25px;
    text-decoration: none; font-weight: bold; font-size: 16px; transition: all .3s; margin-top: 12px;
}
.support-box .big-btn:hover { transform: scale(1.05); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 14px; text-align: left; }
.feature {
    background: rgba(255,255,255,.07); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px; font-size: 12.5px; line-height: 1.6;
}
.feature b { color: var(--mainColor); display: block; margin-bottom: 4px; font-size: 13.5px; }
.feature span { color: var(--text); }

.faq { text-align: left; }
.faq h3 { color: #fff; font-size: 15px; margin: 16px 0 4px; }
.faq p { font-size: 13px; opacity: .95; }

footer { text-align: center; font-size: 12px; opacity: .8; margin: 30px auto 15px; line-height: 2; }
footer a { color: #ffeb3b; text-decoration: none; margin: 0 6px; }

/* Visibility helpers */
.hge-only-mobile { display: none !important; }
body.editing .page-intro { display: none; }

/* ==========================================================================
   TABLET
   ========================================================================== */
@media (max-width: 1100px) {
    :root { --side-w: 268px; --rail-w: 66px; }
    .hge-tool span { font-size: 17px; }
    .hge-tool em { font-size: 9px; }
}

/* ==========================================================================
   MOBILE  —  bottom tool bar + slide-up sheet
   ========================================================================== */
@media (max-width: 820px) {
    body { padding: 6px; }
    nav ul { gap: 4px; }
    nav ul li a { padding: 6px 10px; font-size: .82rem; }
    .site-name { font-size: 150%; }
    .site-name img { max-height: 80px; max-width: 80px; height: 80px; width: 80px; }
    h1 { font-size: 21px; }
    h2 { font-size: 18px; }
    .brand-row { margin: 12px 0 10px; }
    .hge-start { padding: 15px; }

    .hge-only-mobile { display: inline-flex !important; }
    .hge-hide-mobile { display: none !important; }

    .hge-editor {
        height: calc(100dvh - 12px); max-height: none; min-height: 0;
        margin: 10px 0; border-radius: 12px;
    }
    .hge-body { flex-direction: column; }

    /* stage first, full width */
    .hge-stage { order: 1; flex: 1; min-height: 0; }

    /* tool rail becomes a horizontal scroller pinned to the bottom */
    .hge-tools {
        order: 3; width: 100%; flex-direction: row; border-right: none; border-top: 1px solid var(--line);
        overflow-x: auto; overflow-y: hidden; padding: 5px 4px; gap: 3px;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
        padding-bottom: max(5px, env(safe-area-inset-bottom));
    }
    .hge-tools::-webkit-scrollbar { display: none; }
    .hge-tool { min-width: 58px; padding: 6px 4px; }
    .hge-tool span { font-size: 18px; }

    /* side panel becomes a bottom sheet above the tool bar */
    .hge-side {
        order: 2; width: 100%; border-left: none; border-top: 1px solid var(--line);
        max-height: 47vh; transition: max-height .25s ease;
    }
    .hge-side.collapsed { max-height: 0; border-top-width: 0; overflow: hidden; }
    .hge-side-scroll { padding: 9px 10px; -webkit-overflow-scrolling: touch; }
    .hge-panel-title { position: sticky; top: -9px; background: var(--panel-2); z-index: 3; padding-top: 3px; margin-top: -3px; }

    /* layers become an overlay sheet, toggled from the top bar */
    .hge-layers {
        position: absolute; left: 0; right: 0; bottom: 0; z-index: 60; max-height: 62%;
        border-top: 2px solid var(--mainColor); border-radius: 14px 14px 0 0;
        box-shadow: 0 -8px 30px #000c; transform: translateY(102%); transition: transform .25s ease; background: var(--panel);
    }
    .hge-layers.open { transform: translateY(0); }
    .hge-layer-list { max-height: 40vh; }
    .hge-layer, .hge-layer-btn { min-height: 34px; }
    .hge-layer-btn { width: 30px; height: 30px; font-size: 14px; }
    .hge-sheet-backdrop { position: absolute; inset: 0; background: #0009; z-index: 55; }

    .hge-topbar { height: 46px; padding: 0 7px; gap: 5px; }
    .hge-zoom-group { margin-left: 4px; }
    .hge-zoom-label { min-width: 50px; font-size: 11px; padding: 6px 5px; }
    .hge-doc-size { display: none; }
    .hge-icon-btn { width: 32px; height: 32px; }
    .hge-btn { padding: 8px 11px; font-size: 12px; }

    /* touch-friendly targets */
    .hge-chip { padding: 10px 4px; font-size: 10px; }
    .hge-chip big { font-size: 19px; }
    input[type=range] { height: 26px; }
    input[type=range]::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -7px; }
    input[type=range]::-moz-range-thumb { width: 18px; height: 18px; }
    .hge-row > span:first-child { width: 60px; font-size: 11.5px; }

    .ad-wrap { height: auto; max-width: 100%; }
    .ad-wrap iframe { max-width: 100%; }
    .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .hge-tool em { display: none; }
    .hge-tool { min-width: 46px; }
    .hge-tool span { font-size: 20px; }
    .site-name { font-size: 125%; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Print: never print the app chrome */
@media print { .hge-app, nav, .ad-wrap { display: none !important; } }
