* {
    box-sizing: border-box;
}

:root {
    --bg-gradient: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 30%, #f8fafc 100%);
    --surface: #ffffff;
    --surface-muted: #f1f5f9;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --accent: #008080;
    --accent-hover: #00a3a3;
    --accent-soft: rgba(0, 128, 128, 0.12);
    --border: rgba(0, 128, 128, 0.08);
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    --panel-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --radius-pill: 9999px;
    --font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    --app-bg: rgba(255, 255, 255, 0.92);
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --sidebar-bg: rgba(255, 255, 255, 0.98);
    --product-card-bg: rgba(255, 255, 255, 0.95);
    --product-card-alt-bg: linear-gradient(135deg, rgba(0, 128, 128, 0.03) 0%, rgba(255, 255, 255, 0.95) 100%);
    --footer-bg: rgba(248, 250, 252, 0.6);
    --toggle-bg: rgba(255, 255, 255, 0.95);
    --toggle-shadow: rgba(15, 23, 42, 0.1);
    --transition-base: all 0.2s ease;
    --backdrop-blur: blur(22px);
    --hover-lift: translateY(-1px);
    --hover-lift-lg: translateY(-2px);
    --color-white: #ffffff;
}

.dark-mode {
    --bg-gradient: #000000;
    --surface: #000000;
    --surface-muted: #0a0a0a;
    --text-primary: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #008080;
    --accent-hover: #00a3a3;
    --accent-soft: rgba(0, 128, 128, 0.15);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    --panel-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
    --app-bg: #000000;
    --navbar-bg: #000000;
    --sidebar-bg: #000000;
    --product-card-bg: #000000;
    --product-card-alt-bg: linear-gradient(135deg, rgba(0, 128, 128, 0.06) 0%, #000000 100%);
    --footer-bg: #000000;
    --toggle-bg: #000000;
    --toggle-shadow: rgba(0, 0, 0, 0.5);
}

.dark-mode .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

html {
    height: 100%;
    margin: 0;
    background: var(--bg-gradient);
    font-family: var(--font-stack);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    height: 100%;
    margin: 0;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    background: transparent;
    overflow: hidden;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.chat-app {
    width: min(920px, 100%);
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2vw, 1.5rem);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: var(--backdrop-blur);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-home {
    border-radius: 12px;
    padding: 0.65rem 1.25rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: inherit;
}

.chat-home:hover {
    background: rgba(15, 23, 42, 0.1);
    border-color: rgba(15, 23, 42, 0.14);
    transform: var(--hover-lift);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.12);
}

.chat-home:active {
    transform: translateY(0);
}

.chat-home:focus-visible {
    outline: 3px solid rgba(0, 128, 128, 0.35);
    outline-offset: 3px;
}

.chat-avatar {
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    padding: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    font-family: inherit;
}

.chat-avatar:hover {
    transform: var(--hover-lift);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 10px 18px rgba(0, 128, 128, 0.18);
    background: rgba(0, 128, 128, 0.16);
}

.chat-avatar:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.chat-avatar:focus-visible {
    outline: 3px solid rgba(0, 128, 128, 0.55);
    outline-offset: 4px;
}

.quick-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem clamp(0.75rem, 2vw, 1.25rem);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(0, 128, 128, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    min-height: 64px;
}

.quick-links__rail {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 128, 128, 0.4) transparent;
    padding-bottom: 0.25rem;
}

.quick-links__rail::-webkit-scrollbar {
    height: 6px;
}

.quick-links__rail::-webkit-scrollbar-thumb {
    background: rgba(0, 128, 128, 0.4);
    border-radius: var(--radius-pill);
}

.quick-links__rail::-webkit-scrollbar-track {
    background: transparent;
}

.quick-link {
    flex: 0 0 auto;
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(0, 128, 128, 0.35);
    background: rgba(0, 128, 128, 0.18);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: var(--transition-base);
}

.quick-link:hover {
    background: rgba(0, 128, 128, 0.28);
    border-color: rgba(0, 128, 128, 0.5);
    transform: var(--hover-lift);
    box-shadow: 0 10px 20px rgba(0, 128, 128, 0.15);
}

.quick-link:active {
    transform: translateY(0);
}

.quick-link--active {
    background: var(--accent);
    border-color: transparent;
    color: var(--color-white);
    box-shadow: 0 14px 26px rgba(0, 128, 128, 0.3);
}

.quick-link--active:hover {
    background: var(--accent);
    transform: var(--hover-lift);
}

.quick-link--active:focus-visible {
    outline-color: rgba(241, 244, 255, 0.65);
}

.quick-link:focus-visible {
    outline: 3px solid rgba(0, 128, 128, 0.35);
    outline-offset: 3px;
}

.pros-cons-board {
    display: grid;
    gap: 1.25rem;
}

.pros-cons-card {
    background: rgba(248, 250, 252, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
}

.pros-cons-card header {
    margin-bottom: 1rem;
}

.pros-cons-card h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pros-cons-summary {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.pros-cons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.pros-cons-list {
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.pros-cons-list h4 {
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pros-cons-list.pros h4 {
    color: #15803d;
}

.pros-cons-list.cons h4 {
    color: #b91c1c;
}

.pros-cons-list ul {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.5rem;
    color: var(--text-primary);
}

.pros-cons-list li {
    line-height: 1.5;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-title {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.chat-status {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.chat-window {
    position: relative;
    min-height: clamp(360px, 60vh, 620px);
    max-height: 70vh;
    overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: clamp(1.25rem, 2.5vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    font-size: 1rem;
    line-height: 1.7;
    transition: var(--transition-base);
}

.chat-window:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 128, 128, 0.12);
}

.chat-window::-webkit-scrollbar {
    width: 6px;
}

.chat-window::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.4);
    border-radius: var(--radius-pill);
}

.chat-window::-webkit-scrollbar-track {
    background: transparent;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.chat-message.incoming .chat-bubble {
    background: var(--accent-soft);
    border: 1px solid rgba(0, 128, 128, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    color: var(--text-primary);
}

.chat-bubble {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    width: 100%;
}

.chat-bubble p {
    margin: 0 0 0.75rem;
}

.chat-bubble p:last-child {
    margin-bottom: 0;
}

.chat-highlight {
    color: var(--accent);
    font-weight: 600;
}

.chat-signoff {
    font-style: italic;
    color: var(--text-muted);
}

.chat-cursor-anchor {
    min-height: 24px;
}

.chat-cursor-anchor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    opacity: 0.85;
    font-style: italic;
    pointer-events: none;
}

.display_none,
.display-none {
    display: none !important;
}

.steadtra_panel {
    position: fixed;
    right: clamp(1rem, 4vw, 2.5rem);
    bottom: clamp(1rem, 4vw, 2.5rem);
    width: clamp(280px, 28vw, 360px);
    max-width: calc(100% - 2rem);
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: var(--panel-shadow);
    padding: 1.75rem 1.5rem 1.5rem;
    backdrop-filter: blur(18px);
}

.steadtra_panel h2 {
    margin: 0 0 1.25rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.steadtra_panel table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.steadtra_panel th,
.steadtra_panel td {
    padding: 0.65rem 0;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.steadtra_panel th:last-child,
.steadtra_panel td:last-child {
    text-align: right;
}

.steadtra_panel table button {
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-pill);
    background: rgba(248, 250, 252, 0.12);
    color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.35);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: var(--transition-base);
}

.steadtra_panel table button:hover {
    background: rgba(248, 250, 252, 0.22);
    border-color: rgba(248, 250, 252, 0.4);
    transform: var(--hover-lift);
}

.steadtra_panel table button:active {
    transform: translateY(0);
}

.steadtra_panel tbody tr:last-child th,
.steadtra_panel tbody tr:last-child td {
    border-bottom: none;
}

.steadtra-panel__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(248, 250, 252, 0.35);
    background: rgba(248, 250, 252, 0.12);
    color: #f8fafc;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: var(--transition-base);
}

.steadtra-panel__close:hover {
    background: rgba(248, 250, 252, 0.22);
    border-color: rgba(248, 250, 252, 0.45);
    transform: translateY(-1px) scale(1.02);
}

.steadtra-panel__close:active {
    transform: translateY(0) scale(0.98);
}

.steadtra-panel__close:focus-visible {
    outline: 3px solid rgba(0, 128, 128, 0.55);
    outline-offset: 3px;
}

/* React App Styles */
#root {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.app {
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    background: var(--app-bg);
    backdrop-filter: var(--backdrop-blur);
    border-radius: 0;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem clamp(2rem, 4vw, 3rem);
    background: var(--navbar-bg);
    backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--border);
    margin-top: -clamp(2rem, 4vw, 3rem);
    margin-left: -clamp(2rem, 4vw, 3rem);
    margin-right: -clamp(2rem, 4vw, 3rem);
    padding-top: 1.5rem;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.navbar-logo-img {
    height: 88px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.navbar-logo-dark,
.chatbot-logo-dark {
    display: none;
}

.dark-mode .navbar-logo-light,
.dark-mode .chatbot-logo-light {
    display: none;
}

.dark-mode .navbar-logo-dark,
.dark-mode .chatbot-logo-dark {
    display: block;
}

.dark-mode .navbar-title,
.dark-mode .chatbot-logo-link {
    color: var(--accent);
}

.navbar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
    font-size: 1.125rem;
    padding: 0;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.theme-toggle:hover {
    background: rgba(15, 23, 42, 0.08);
    transform: var(--hover-lift);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.theme-toggle:active {
    transform: translateY(0);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.navbar-title {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.navbar-title-white,
.dark-mode .navbar-title-white {
    color: #ffffff !important;
}

.navbar-subtitle {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: flex-end;
    margin-right: 2rem;
}

.navbar-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: var(--transition-base);
    white-space: nowrap;
}

.navbar-link:hover {
    color: var(--accent);
}

.navbar-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 2px;
}

.navbar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.btn-nav {
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: inherit;
    min-width: 120px;
    text-align: center;
}

.btn-nav-primary {
    background: var(--accent);
    color: var(--color-white);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 128, 128, 0.3);
}

.btn-nav-primary:hover {
    background: var(--accent-hover);
    transform: var(--hover-lift-lg);
    box-shadow: 0 6px 16px rgba(0, 128, 128, 0.4);
}

.btn-nav-primary:active {
    transform: translateY(0);
}

.btn-nav-secondary {
    background: var(--surface-muted);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-nav-secondary:hover {
    background: rgba(15, 23, 42, 0.08);
    transform: var(--hover-lift-lg);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-nav-secondary:active {
    transform: translateY(0);
}

.btn-nav:focus-visible {
    outline: 3px solid rgba(0, 128, 128, 0.35);
    outline-offset: 3px;
}

.app-header {
    text-align: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.app-header h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.app-header p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.app.app-drawing {
    gap: 0;
    height: 100vh; /* fallback for older browsers */
    height: 100dvh;
    min-height: -webkit-fill-available;
}

.drawing-stage {
    flex: 1;
    min-height: 0;
    position: relative;
}

.drawing-canvas-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.drawing-canvas-wrap canvas {
    display: block;
}

.drawing-stage.mode-object .drawing-canvas-wrap,
.drawing-stage.mode-object .canvas-container {
    cursor: grab;
}

.drawing-stage.mode-object .drawing-canvas-wrap:active,
.drawing-stage.mode-object .canvas-container:active {
    cursor: grabbing;
}

.drawing-stage.mode-pan .drawing-canvas-wrap,
.drawing-stage.mode-pan .canvas-container {
    cursor: grab;
}

.drawing-stage.mode-pan .drawing-canvas-wrap:active,
.drawing-stage.mode-pan .canvas-container:active {
    cursor: grabbing;
}

.drawing-stage.canvas-pointer-events-none .drawing-canvas-wrap,
.drawing-stage.canvas-pointer-events-none .canvas-container {
    pointer-events: none;
}

.drawing-overlays {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.overlay-module {
    pointer-events: none;
    background: var(--product-card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow);
}

/* Ensure clicks on overlay pass through to canvas; only interactive elements capture */
.overlay-module a,
.overlay-module button,
.overlay-module input,
.overlay-module select,
.overlay-module [role="button"] {
    pointer-events: auto;
}

.logo-module {
    position: absolute;
    top: calc(0.35rem + env(safe-area-inset-top, 0px));
    left: calc(0.35rem + env(safe-area-inset-left, 0px));
    padding: 0.25rem 0.4rem;
    background: transparent;
    border: none;
    box-shadow: none;
}

.logo-module-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    line-height: 1;
}

.logo-module-img {
    height: 44px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-module-text {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.dark-mode .logo-module-text {
    color: #ffffff;
}

.logo-module-draw {
    color: var(--accent);
}

.logo-module .logo-img-dark {
    display: none;
}

.dark-mode .logo-module .logo-img-light {
    display: none;
}

.dark-mode .logo-module .logo-img-dark {
    display: block;
}

.cta-module {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.cta-module .cta-banner-text {
    white-space: nowrap;
}

.bottom-row-module {
    position: absolute;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 clamp(1rem, 4vw, 1.5rem);
    box-sizing: border-box;
}

.bottom-row-module .mode-buttons-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    flex-shrink: 0;
}

.bottom-row-module .mode-buttons {
    display: flex;
    gap: 0.35rem;
    width: 100%;
    flex-shrink: 0;
}

.bottom-row-module .mode-buttons-row-2 .mode-btn {
    flex: 1;
}

.bottom-row-module .mode-btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.4rem 0.5rem;
}

.bottom-row-module .mode-btn-active {
    background: var(--accent);
    color: var(--color-white);
    border-color: var(--accent);
}

.bottom-row-module .mode-btn-active:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.bottom-row-module .mode-btn-delete {
    flex: 0;
    min-width: fit-content;
    background: rgba(185, 28, 28, 0.15);
    border-color: rgba(185, 28, 28, 0.4);
    color: #b91c1c;
}

.bottom-row-module .mode-btn-delete:hover {
    background: rgba(185, 28, 28, 0.25);
    border-color: rgba(185, 28, 28, 0.5);
    color: #991b1b;
}

.bottom-row-module .prompt-input-wrap {
    width: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.prompt-input {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: var(--transition-base);
}

.prompt-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.prompt-input::placeholder {
    color: var(--text-muted);
}

.prompt-submit-btn {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-row-module .toolbar-module {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 0.15rem;
}

.bottom-row-module .toolbar-module::-webkit-scrollbar {
    height: 4px;
}

.bottom-row-module .toolbar-module::-webkit-scrollbar-thumb {
    background: rgba(0, 128, 128, 0.3);
    border-radius: 2px;
}

.bottom-row-module .toolbar-module .drawing-tool-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.bottom-row-module .swipe-up-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    width: auto;
    flex-shrink: 0;
}

.bottom-row-module .swipe-up-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
}

/* Draw controls: responsive layout for all screen sizes */
@media (max-width: 480px) {
    .app.app-drawing .bottom-row-module {
        max-width: 100%;
    }

    .app.app-drawing .bottom-row-module .mode-buttons {
        gap: 0.25rem;
    }

    .app.app-drawing .bottom-row-module .mode-btn {
        font-size: 0.7rem;
        padding: 0.5rem 0.4rem;
        min-height: 44px; /* touch target */
    }

    .app.app-drawing .bottom-row-module .swipe-up-hint {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        min-height: 44px;
    }
}

@media (max-height: 500px) {
    /* Landscape or short screens: compact controls */
    .app.app-drawing .bottom-row-module {
        bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
        gap: 0.25rem;
    }

    .app.app-drawing .bottom-row-module .mode-btn {
        padding: 0.3rem 0.4rem;
    }

    .app.app-drawing .bottom-row-module .swipe-up-hint {
        padding: 0.3rem 0.75rem;
    }
}

/* Apple Watch / tiny screens: scale down draw controls */
@media (max-width: 340px) {
    .app.app-drawing .bottom-row-module {
        bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
        padding: 0 0.4rem;
        gap: 0.2rem;
    }

    .app.app-drawing .bottom-row-module .mode-buttons {
        gap: 0.15rem;
    }

    .app.app-drawing .bottom-row-module .mode-btn {
        font-size: 0.6rem;
        padding: 0.35rem 0.25rem;
        min-height: 32px;
    }

    .app.app-drawing .bottom-row-module .swipe-up-hint {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
        min-height: 32px;
    }

    .app.app-drawing .bottom-row-module .swipe-up-icon {
        font-size: 1rem;
    }

    .app.app-drawing .logo-module .logo-module-img {
        height: 28px;
    }

    .app.app-drawing .logo-module .logo-module-text {
        font-size: 0.85rem;
    }
}

.toolbar-module {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.cta-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--border);
}

.cta-banner-text {
    font-size: clamp(0.75rem, 2vw, 0.95rem);
    color: var(--text-primary);
    white-space: nowrap;
}

.cta-banner-link {
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.cta-banner-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
}

.app-main-drawing {
    padding: 1.5rem clamp(1.5rem, 4vw, 2rem);
}

.drawing-toolbar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.drawing-tool-btn {
    font-size: 0.9rem;
}


.head-statement {
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 600;
    color: var(--accent);
    letter-spacing: -0.02em;
    line-height: 1.4;
    margin: 0 auto;
    max-width: 800px;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

.product-card {
    background: var(--product-card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: clamp(2.5rem, 5vw, 4rem);
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.product-card-alt {
    background: var(--product-card-alt-bg);
    border-color: var(--border);
}

.dark-mode .product-card-alt {
    border-color: rgba(0, 128, 128, 0.3);
}

.product-card-title {
    margin: 0 0 1.5rem;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.2;
}

.product-card-description {
    margin: 0 0 2.5rem;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 700px;
    position: relative;
}

.product-card-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.product-feature {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-feature-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-feature-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.info-term {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0 0.25rem;
}

.info-term .info-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    z-index: 10;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: rgba(0, 128, 128, 0.1);
    color: var(--accent);
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-base);
    flex-shrink: 0;
    font-family: inherit;
    line-height: 1;
}

.info-icon:hover {
    background: rgba(0, 128, 128, 0.2);
    transform: scale(1.1);
}

.info-icon:active {
    transform: scale(0.95);
}

.info-icon:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.info-tooltip {
    display: block;
    margin-top: 0.75rem;
    padding: 1rem;
    background: rgba(0, 128, 128, 0.08);
    border: 1px solid rgba(0, 128, 128, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card-email-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 2rem 0 1.5rem;
    flex-wrap: wrap;
}

.product-card-email-input {
    flex: 1;
    min-width: 240px;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-primary);
    transition: var(--transition-base);
}

.product-card-email-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.product-card-email-input::placeholder {
    color: var(--text-muted);
}

/* Login page */
.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.login-card {
    max-width: 420px;
}

.login-title {
    margin-bottom: 0.5rem;
}

.login-subtitle {
    margin-bottom: 2rem !important;
    font-size: 1rem !important;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.login-input {
    width: 100%;
    min-width: unset;
}

.login-submit {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.875rem 2rem;
}

.product-card-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.product-card-cta {
    font-size: 1rem;
    padding: 0.875rem 2rem;
    margin-left: 0;
    display: inline-block;
    width: auto;
}

.counter-card,
.info-card {
    background: rgba(248, 250, 252, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
}

.counter-card h2,
.info-card h3 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.counter-display {
    text-align: center;
    margin: 1.5rem 0;
}

.counter-value {
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent);
    display: inline-block;
    min-width: 120px;
}

.counter-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: inherit;
}

.btn-primary {
    background: var(--accent);
    color: var(--color-white);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 128, 128, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: var(--hover-lift-lg);
    box-shadow: 0 6px 16px rgba(0, 128, 128, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--surface-muted);
    color: var(--text-primary);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.08);
    transform: var(--hover-lift-lg);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn:focus-visible {
    outline: 3px solid rgba(0, 128, 128, 0.35);
    outline-offset: 3px;
}

.info-card ul {
    margin: 0;
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: var(--text-primary);
}

.info-card li {
    line-height: 1.6;
}

.info-card code {
    background: rgba(0, 128, 128, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--accent);
}

/* Footer Styles */
.footer {
    margin-top: auto;
    padding: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem);
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: clamp(2rem, 4vw, 3rem);
    margin-bottom: 2.5rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-heading {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition-base);
    display: inline-block;
}

.footer-link:hover {
    color: var(--accent);
}

.footer-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-text {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Chatbot Styles */
.app:has(.chatbot-main) {
    overflow: hidden;
    gap: 0;
}

.app:has(.chatbot-main) .chatbot-main {
    min-height: 100vh;
}

.app:has(.chatbot-main) .navbar-brand-text {
    flex-direction: row;
    align-items: baseline;
    gap: 0.5rem;
}

.chatbot-main {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    position: relative;
}

.chatbot-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: var(--backdrop-blur);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 50;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.1);
}

.chatbot-sidebar-open {
    transform: translateX(0);
}

.chatbot-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.chatbot-sidebar-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition-base);
}

.chatbot-sidebar-close:hover {
    background: var(--surface-muted);
    color: var(--text-primary);
}

.chatbot-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.chatbot-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.chatbot-sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 3px;
}

.chatbot-sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-sidebar-section {
    margin-bottom: 2rem;
}

.chatbot-sidebar-section:last-child {
    margin-bottom: 0;
}

.chatbot-new-chat-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--accent);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition-base);
    margin-bottom: 1.5rem;
}

.chatbot-sidebar-header .chatbot-new-chat-btn {
    width: auto;
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.chatbot-new-chat-btn:hover {
    background: var(--accent-hover);
    transform: var(--hover-lift);
}

.chatbot-sidebar-section-title {
    margin: 0 0 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0 0.5rem;
}

.chatbot-chat-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chatbot-chat-item {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
}

.chatbot-chat-item:hover {
    background: var(--surface-muted);
}

.chatbot-chat-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.chatbot-chat-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chatbot-documents-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chatbot-document-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-base);
}

.chatbot-document-item:hover {
    background: var(--surface-muted);
}

.chatbot-document-link {
    text-decoration: none;
    color: inherit;
}

.chatbot-document-icon {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
    flex-shrink: 0;
}

.dark-mode .chatbot-document-icon {
    filter: invert(1);
}

.chatbot-document-info {
    flex: 1;
    min-width: 0;
}

.chatbot-document-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-document-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chatbot-empty-documents {
    padding: 1rem 0.75rem;
    text-align: center;
}

.chatbot-empty-documents p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.chatbot-header-fixed {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 0 0 1rem;
}

.chatbot-logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

.chatbot-logo-img {
    height: 44px;
    width: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.chatbot-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.chatbot-sidebar-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--toggle-bg);
    backdrop-filter: var(--backdrop-blur);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition-base);
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--toggle-shadow);
}

.chatbot-sidebar-toggle:hover {
    background: var(--surface);
    transform: var(--hover-lift);
    box-shadow: 0 6px 16px var(--toggle-shadow);
}

.chatbot-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    height: 100vh;
    min-height: 0;
    transition: margin-left 0.3s ease;
    padding-top: 0;
    overflow: hidden;
    position: relative;
}

.chatbot-container-with-sidebar {
    margin-left: 280px;
}

.chatbot-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chatbot-chat-title {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    align-self: center;
    width: 100%;
    max-width: 85%;
}

.chatbot-chat-title h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-message {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    max-width: 85%;
}

.chatbot-message-user {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.chatbot-message-assistant {
    align-self: flex-start;
}

.chatbot-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: var(--surface-muted);
}

.chatbot-message-user .chatbot-message-avatar {
    background: var(--accent-soft);
}

.chatbot-message-content {
    flex: 1;
}

.chatbot-message-text {
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius-md);
    line-height: 1.6;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.chatbot-message-user .chatbot-message-text {
    background: var(--accent);
    color: var(--color-white);
}

.chatbot-message-assistant .chatbot-message-text {
    background: var(--surface-muted);
    color: var(--text-primary);
}

.chatbot-input-container {
    padding: 1.5rem 2rem;
    backdrop-filter: var(--backdrop-blur);
}

.chatbot-welcome-message {
    position: absolute;
    top: calc(50% - 120px);
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 1200px;
    text-align: center;
    padding: 0 2rem;
}

.chatbot-welcome-message p {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.chatbot-input-container-centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 4rem);
    max-width: 1200px;
    margin: 0;
}

.chatbot-input-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9999px;
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.chatbot-upload-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: transparent;
    transition: var(--transition-base);
    cursor: pointer;
}

.chatbot-upload-wrapper:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.chatbot-upload-wrapper:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.chatbot-upload-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
    font-weight: 500;
    margin: 0;
}

.chatbot-upload-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    pointer-events: none;
}

.chatbot-upload-wrapper:hover .chatbot-upload-button {
    color: var(--accent);
}

.chatbot-input {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 1.125rem;
    line-height: 1.5;
    color: var(--text-primary);
    background: transparent;
    max-height: 200px;
    overflow-y: auto;
}

.chatbot-input::placeholder {
    color: var(--text-muted);
}

.chatbot-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chatbot-send-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-base);
    flex-shrink: 0;
}

.chatbot-send-button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: var(--hover-lift);
}

.chatbot-send-button:active:not(:disabled) {
    transform: translateY(0);
}

.chatbot-send-button:disabled {
    background: var(--surface-muted);
    color: var(--text-muted);
    opacity: 1;
    cursor: not-allowed;
}

.chatbot-typing-indicator {
    display: flex;
    gap: 0.5rem;
    padding: 0.875rem 1.125rem;
}

.chatbot-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite;
}

.chatbot-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.chatbot-streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 1px;
    vertical-align: text-bottom;
    background: currentColor;
    animation: streaming-cursor 1s step-end infinite;
}

@keyframes streaming-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.options-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    animation: options-sheet-fade 0.25s ease;
}

@keyframes options-sheet-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.options-sheet {
    width: 100%;
    max-width: 480px;
    max-height: 75vh;
    background: var(--surface);
    border-radius: 0;
    padding: 1rem 1.25rem 2rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.25);
    border: 1px solid var(--border);
    border-bottom: none;
    animation: options-sheet-slide 0.3s ease;
    overflow-y: auto;
}

@keyframes options-sheet-slide {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.options-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 2px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.options-sheet-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.options-sheet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.options-grid-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    font-family: inherit;
}

.options-grid-btn:hover {
    background: var(--accent-soft);
    border-color: rgba(0, 128, 128, 0.3);
}

.options-grid-icon {
    font-size: 1.5rem;
    line-height: 1;
    color: var(--accent);
}

.options-grid-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.options-sheet-close {
    width: 100%;
}

.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

.confirm-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    min-width: 280px;
    max-width: 90vw;
    box-shadow: var(--panel-shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.confirm-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.confirm-modal-message {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.confirm-modal-dont-ask {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.confirm-modal-dont-ask input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
}

.confirm-modal-login-prompt {
    padding: 0.75rem;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.confirm-modal-login-prompt p {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.confirm-modal-login-actions {
    display: flex;
    gap: 0.5rem;
}

.confirm-modal-login-actions a {
    text-decoration: none;
}

.confirm-modal-saved-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--accent);
}

.confirm-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Right-click context menu on canvas - grid of icon buttons */
.context-menu {
    position: fixed;
    z-index: 1000;
    padding: 0.5rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--panel-shadow);
    border: 1px solid var(--border);
}

.context-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
}

.context-menu-grid > button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s ease;
}

.context-menu-grid > button:hover {
    background: var(--accent-soft);
}

.context-menu-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: invert(0);
    pointer-events: none;
}

.dark-mode .context-menu-icon {
    filter: invert(1);
}

.chatbot-upload-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}

.chatbot-upload-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-width: 280px;
    max-width: 90vw;
    box-shadow: var(--panel-shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.chatbot-upload-modal-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: upload-spin 0.8s linear infinite;
}

.chatbot-upload-modal-success-icon {
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes upload-spin {
    to { transform: rotate(360deg); }
}

.chatbot-upload-modal-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.chatbot-upload-modal-progress {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.chatbot-upload-modal-filename {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .chatbot-message {
        max-width: 95%;
    }
    
    .chatbot-messages {
        padding: 1rem;
    }
    
    .chatbot-input-container {
        padding: 1rem;
    }
    
    .chatbot-sidebar {
        width: 100%;
        max-width: 320px;
    }
    
    .chatbot-container-with-sidebar {
        margin-left: 0;
    }
    
    .chatbot-header-fixed {
        padding: 1rem 0 0 0.5rem;
    }
}

/* Index page cards */
.index-cards {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.index-cards-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.index-card {
    display: block;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 128, 128, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    width: 100%;
    max-width: 200px;
    min-width: 0;
    box-sizing: border-box;
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}
.index-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    transform: var(--hover-lift);
}
.index-card-title {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}
.index-card-desc {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-muted);
}