:root {
    --nae-bg: #F4EBDD;
    --nae-text: #17202a;
    --nae-muted: rgba(23, 32, 42, .56);
    --nae-line: rgba(23, 32, 42, .18);
    --nae-soft: rgba(255, 255, 255, .28);
    --nae-shadow: 0 20px 60px rgba(16, 24, 40, .12);
    --nae-radius: 999px;
    --nae-font: "Noto Sans Georgian", "Helvetica Neue", Arial, sans-serif;
}

html[data-nae-theme="night"] {
    --nae-bg: #071A2C;
    --nae-text: #F4EBDD;
    --nae-muted: rgba(244, 235, 221, .58);
    --nae-line: rgba(244, 235, 221, .18);
    --nae-soft: rgba(255, 255, 255, .04);
    --nae-shadow: 0 20px 60px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.nae-app {
    background: var(--nae-bg);
    color: var(--nae-text);
    font-family: var(--nae-font);
    font-weight: 300;
    transition: background-color .25s ease, color .25s ease;
}
button, textarea { font: inherit; }
button { color: inherit; }
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.nae-shell {
    min-height: 100svh;
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 22px clamp(18px, 4vw, 58px) 20px;
    display: grid;
    grid-template-rows: auto 1fr;
}

.nae-header {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.nae-brand { color: inherit; text-decoration: none; display: inline-flex; align-items: center; min-width: 54px; }
.nae-brand .custom-logo { max-height: 34px; width: auto; display: block; }
.nae-wordmark { font-size: clamp(24px, 3vw, 34px); font-weight: 300; letter-spacing: .04em; }

.nae-actions { display: flex; gap: 9px; }
.nae-icon-button {
    width: 42px; height: 42px;
    border-radius: var(--nae-radius);
    border: 1px solid var(--nae-line);
    background: transparent;
    display: grid; place-items: center;
    cursor: pointer;
    transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}
.nae-icon-button:hover { transform: translateY(-1px); background: var(--nae-soft); }
.nae-icon-button:focus-visible, .nae-send:focus-visible, .nae-panel-close:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.nae-icon { font-size: 18px; line-height: 1; font-weight: 300; }

.nae-chat {
    min-height: 0;
    display: grid;
    grid-template-rows: 1fr auto;
    padding-top: clamp(26px, 6vh, 74px);
}

.nae-conversation {
    width: min(100%, 860px);
    margin: 0 auto;
    padding: 0 6px 36px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.nae-message { display: flex; margin: 0 0 24px; }
.nae-message p {
    margin: 0;
    max-width: min(82%, 650px);
    font-size: clamp(19px, 2.1vw, 27px);
    line-height: 1.55;
    font-weight: 300;
    letter-spacing: .01em;
}
.nae-message-nae { justify-content: flex-end; text-align: right; }
.nae-message-user { justify-content: flex-start; }

.nae-composer {
    width: min(100%, 980px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 12px;
    border-top: 1px solid var(--nae-line);
    padding-top: 14px;
}
.nae-composer textarea {
    width: 100%;
    min-height: 48px;
    max-height: 160px;
    resize: none;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--nae-text);
    padding: 12px 2px;
    font-size: 18px;
    font-weight: 300;
}
.nae-composer textarea::placeholder { color: var(--nae-muted); }
.nae-send {
    width: 44px; height: 44px;
    border: 0;
    background: transparent;
    border-radius: var(--nae-radius);
    cursor: pointer;
    font-size: 34px;
    line-height: 1;
    transition: transform .18s ease, background-color .18s ease;
}
.nae-send:hover { transform: translateX(2px); background: var(--nae-soft); }

.nae-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-columns: 1fr min(92vw, 440px); }
.nae-overlay[hidden] { display: none; }
.nae-overlay-backdrop { border: 0; background: rgba(0, 0, 0, .28); cursor: default; }
.nae-panel {
    background: var(--nae-bg);
    color: var(--nae-text);
    box-shadow: var(--nae-shadow);
    padding: 24px;
    overflow-y: auto;
}
.nae-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nae-panel-header h2 { margin: 0; font-size: 27px; font-weight: 300; }
.nae-panel-close { width: 40px; height: 40px; border: 1px solid var(--nae-line); border-radius: 50%; background: transparent; font-size: 24px; cursor: pointer; }
.nae-panel-content { padding-top: 28px; color: var(--nae-muted); line-height: 1.7; }
.nae-panel-list { display: grid; gap: 12px; }
.nae-panel-card { border: 1px solid var(--nae-line); border-radius: 18px; padding: 16px; }
.nae-panel-card strong { color: var(--nae-text); font-weight: 400; display: block; margin-bottom: 5px; }

@media (max-width: 640px) {
    .nae-shell { padding: 14px 14px 12px; }
    .nae-header { min-height: 50px; }
    .nae-actions { gap: 6px; }
    .nae-icon-button { width: 38px; height: 38px; }
    .nae-brand .custom-logo { max-height: 29px; }
    .nae-wordmark { font-size: 25px; }
    .nae-chat { padding-top: 28px; }
    .nae-message { margin-bottom: 19px; }
    .nae-message p { max-width: 88%; font-size: 19px; line-height: 1.5; }
    .nae-composer { gap: 6px; padding-top: 10px; }
    .nae-composer textarea { font-size: 17px; min-height: 44px; }
    .nae-send { width: 40px; height: 40px; }
    .nae-overlay { grid-template-columns: 1fr; }
    .nae-overlay-backdrop { display: none; }
    .nae-panel { width: 100%; }
}

/* Dual responsive Nae logos */
.nae-brand {
    margin-right: auto;
    justify-content: flex-start;
    width: clamp(72px, 10vw, 126px);
    height: 52px;
    overflow: hidden;
}
.nae-logo {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}
.nae-logo-night { display: none; }
html[data-nae-theme="night"] .nae-logo-day { display: none; }
html[data-nae-theme="night"] .nae-logo-night { display: block; }

@media (max-width: 640px) {
    .nae-brand { width: 72px; height: 44px; }
}

/* v0.3: fixed app frame and real WordPress pages */
html { min-height: 100%; }
body.nae-app { min-height: 100dvh; }
.nae-shell { height: 100dvh; min-height: 0; overflow: hidden; }
.nae-chat-shell { grid-template-rows: auto minmax(0, 1fr); }
.nae-header { flex: 0 0 auto; }
.nae-chat { min-height: 0; overflow: hidden; }
.nae-conversation { min-height: 0; height: 100%; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.nae-composer { flex: 0 0 auto; padding-bottom: max(0px, env(safe-area-inset-bottom)); }
.nae-icon-button { text-decoration: none; }

.nae-page-shell { grid-template-rows: auto minmax(0, 1fr); }
.nae-page-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: clamp(28px, 6vh, 76px) 0 60px; }
.nae-page { width: min(100%, 900px); margin: 0 auto; }
.nae-back-link { display: inline-block; margin-bottom: 34px; color: var(--nae-muted); text-decoration: none; font-size: 15px; }
.nae-page h1 { margin: 0 0 34px; font-size: clamp(40px, 6vw, 74px); line-height: 1.08; font-weight: 200; letter-spacing: -.02em; }
.nae-page-content { font-size: clamp(18px, 2vw, 22px); line-height: 1.75; font-weight: 300; }
.nae-page-content h2, .nae-page-content h3 { font-weight: 300; line-height: 1.25; }
.nae-page-content a { color: inherit; text-underline-offset: 4px; }
.nae-page-content p { margin: 0 0 1.35em; }

.nae-panel-links { display: grid; border-top: 1px solid var(--nae-line); }
.nae-panel-link { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 2px; border-bottom: 1px solid var(--nae-line); color: var(--nae-text); text-decoration: none; font-size: 20px; font-weight: 300; }
.nae-panel-link:hover { padding-left: 7px; }

.nae-conversation-archive { display: grid; gap: 14px; margin-top: 32px; }
.nae-archive-card { border: 1px solid var(--nae-line); border-radius: 22px; padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nae-archive-card strong { display: block; font-size: 19px; font-weight: 400; margin-bottom: 5px; }
.nae-archive-card span { color: var(--nae-muted); font-size: 15px; }
.nae-card-actions { display: flex; gap: 8px; }
.nae-card-actions button { border: 1px solid var(--nae-line); border-radius: 999px; background: transparent; color: var(--nae-muted); padding: 8px 13px; }

.nae-pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 35px; }
.nae-plan { border: 1px solid var(--nae-line); border-radius: 26px; padding: 28px; }
.nae-plan h2 { margin-top: 0; }
.nae-plan strong { display: block; margin-top: 28px; font-size: 30px; font-weight: 300; }
.nae-plan-featured { background: var(--nae-soft); }

/* WooCommerce inherits Nae instead of looking like a separate website. */
.woocommerce .woocommerce-MyAccount-navigation ul { list-style: none; margin: 0 0 30px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.woocommerce .woocommerce-MyAccount-navigation a,
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button { border: 1px solid var(--nae-line) !important; border-radius: 999px !important; background: transparent !important; color: var(--nae-text) !important; font-weight: 300 !important; }
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce select { background: transparent; color: var(--nae-text); border: 1px solid var(--nae-line); border-radius: 14px; padding: 12px; }
.woocommerce table.shop_table { border-color: var(--nae-line); border-radius: 18px; }

@media (max-width: 640px) {
    .nae-shell { height: 100dvh; }
    .nae-page-scroll { padding-top: 34px; }
    .nae-page h1 { font-size: 40px; margin-bottom: 26px; }
    .nae-page-content { font-size: 17px; }
    .nae-pricing-grid { grid-template-columns: 1fr; }
    .nae-archive-card { align-items: flex-start; flex-direction: column; }
}

/* v0.3.1 icon consistency and Georgian controls */
.nae-icon-button,
.nae-icon-button:link,
.nae-icon-button:visited,
.nae-icon-button:hover,
.nae-icon-button:focus,
.nae-icon-button:active {
    color: var(--nae-text) !important;
    text-decoration: none !important;
    -webkit-text-fill-color: var(--nae-text);
}
.nae-icon-cloud { font-size: 20px; transform: translateY(-1px); }
.nae-icon-theme { font-size: 21px; }


/* v0.3.2: unclipped logo and WordPress-managed About menu */
.nae-brand {
    width: clamp(118px, 12vw, 180px);
    height: 64px;
    overflow: visible;
    flex: 0 0 auto;
}
.nae-logo {
    object-fit: contain;
    object-position: left center;
}
.nae-panel-links {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nae-panel-links > li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--nae-line);
}
.nae-panel-links > li:first-child {
    border-top: 1px solid var(--nae-line);
}
.nae-panel-links > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 2px;
    color: var(--nae-text) !important;
    text-decoration: none !important;
    font-size: 20px;
    font-weight: 300;
    transition: padding-left .18s ease;
}
.nae-panel-links > li > a::after {
    content: "›";
    font-size: 24px;
    line-height: 1;
}
.nae-panel-links > li > a:hover {
    padding-left: 7px;
}
.nae-menu-empty {
    border-top: 1px solid var(--nae-line);
    border-bottom: 1px solid var(--nae-line);
    padding: 20px 2px;
}
.nae-menu-empty p { margin: 0 0 10px; }
.nae-menu-empty a { color: var(--nae-text); text-underline-offset: 4px; }
@media (max-width: 640px) {
    .nae-brand { width: 102px; height: 52px; }
}
