* {
    box-sizing: border-box;
}

:root {
    --rz-icon-weight: 300;
}

.rz-data-grid,
.rz-datatable,
.rz-pivot-data-grid {
    --rz-grid-border-radius: var(--rz-border-radius);
}

.rz-dialog-mask {
    opacity: 0.05;
}

.app-menu-delete {
    --rz-menu-item-color: var(--rz-danger);
    --rz-menu-item-hover-color: var(--rz-danger-dark);
    --rz-menu-item-icon-color: var(--rz-danger);
    --rz-menu-item-icon-hover-color: var(--rz-danger-dark);
    --rz-menu-top-item-color: var(--rz-danger);
    --rz-menu-top-item-hover-color: var(--rz-danger-dark);
    --rz-menu-top-item-icon-color: var(--rz-danger);
    --rz-menu-top-item-icon-hover-color: var(--rz-danger-dark);
}

html {
    height: 100%;
    font-size: var(--rz-root-font-size);
}

body {
    margin: 0;
    height: 100%;
    color: var(--rz-text-color);
    background-color: var(--rz-body-background-color);
    font-family: var(--rz-text-font-family);
    font-size: var(--rz-body-font-size);
    line-height: var(--rz-body-line-height);
}

.shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-bottom: var(--rz-border-normal);
}

.topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.brand-home {
    display: inline-flex;
    align-items: center;
}

.brand-app {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-logo {
    display: block;
    height: 2rem;
    width: auto;
}

.brand-mark {
    font-size: 1.1rem;
}

.brand-mark.big {
    font-size: 3rem;
    opacity: 0.35;
}

.brand-name {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-tag {
    color: var(--rz-text-secondary-color);
    font-size: 0.8rem;
}

.columns {
    flex: 1;
    min-height: 0;
}

.chat-pane,
.preview-pane {
    display: flex;
    flex-direction: column;
}

.agent-chat {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    min-width: 0;
}

.builder-nav {
    top: 0 !important;
    bottom: 0 !important;
    z-index: 1001;
    background-color: var(--rz-body-background-color);
    border-right: var(--rz-border-normal);
    box-shadow: var(--rz-shadow-3);
}

.builder-nav.rz-sidebar-expanded {
    width: var(--rz-sidebar-width) !important;
}

.builder-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.3);
}

.agent-chat > .rz-chat {
    flex: 1;
    min-height: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.chat .rz-chat-messages {
    padding: 1rem;
}

.chat .rz-chat-message {
    max-width: 100%;
}

.chat .rz-chat-message-assistant {
    flex-direction: column;
}

.chat .rz-chat-message-text {
    font-size: 0.9rem;
    line-height: 1.5;
}

.hero {
    margin: auto 0;
    padding: 1rem 0.5rem;
}

.hero-sub {
    color: var(--rz-text-secondary-color);
}

.plan-inner h3 {
    margin: 0 0 0.3rem;
    font-size: 1rem;
}

.plan-inner p {
    margin: 0 0 0.5rem;
    color: var(--rz-text-secondary-color);
}

.plan-kind {
    color: var(--rz-text-secondary-color);
    font-size: 0.8rem;
    text-transform: capitalize;
}

.plan-entity {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    padding: 0.15rem 0;
}

.plan-pages {
    margin-top: 0.5rem;
    color: var(--rz-text-secondary-color);
    font-size: 0.82rem;
}

.status {
    color: var(--rz-text-secondary-color);
    font-size: 0.8rem;
    padding-left: 0.3rem;
}

.working {
    padding: 0.2rem 0.3rem;
}

.changed {
    margin-top: 0.3rem;
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-version {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.2rem;
}

.version-changes {
    display: grid;
    grid-template-columns: minmax(12rem, 16rem) 1fr;
    gap: 0.75rem;
    height: 70vh;
}

.version-files {
    height: 100%;
    font-size: 0.8rem;
}

.version-file-kind {
    display: inline-block;
    width: 1.2em;
    font-weight: 600;
    text-transform: uppercase;
}

.version-file-kind.added {
    color: var(--rz-success);
}

.version-file-kind.deleted {
    color: var(--rz-danger);
}

.version-file-kind.modified {
    color: var(--rz-warning);
}

.version-diff {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.version-diff-host {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.image-versions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.2rem 0 0.6rem;
}

.image-version img {
    height: 80px;
    width: auto;
    max-width: 144px;
    object-fit: contain;
    padding: 0.25rem;
    border: var(--rz-border-normal);
    border-radius: var(--rz-border-radius);
}

.chat-switcher {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
}

.chat-switcher .chat-picker {
    flex: 1;
    min-width: 0;
}

.chat .rz-chat-input {
    border-top: var(--rz-border-normal);
}

.chat .rz-chat-input-inner {
    grid-template-columns: 1fr;
}

.chat .rz-chat-input-actions {
    justify-content: flex-end;
}

.chat-actions {
    margin-bottom: 0.5rem;
}

.run-progress {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
    color: var(--rz-text-secondary-color);
    font-size: 0.8rem;
}

.run-elapsed {
    font-variant-numeric: tabular-nums;
}

.run-activity {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queued .rz-chat-message-text {
    opacity: 0.6;
}

.chat-usage {
    text-align: right;
    font-size: 0.72rem;
}

.chat .rz-chat-textarea {
    min-height: 4.5rem;
    overflow-y: auto;
}

.chat.drop-target {
    outline: 2px dashed var(--rz-primary);
    outline-offset: -4px;
}

.attachment-notice {
    color: var(--rz-danger);
    margin-bottom: 0.4rem;
}

.preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.preview iframe {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: none;
}

.preview.phone {
    background: var(--bg);
}

.preview.code-view {
    background: var(--panel);
}

.preview.phone iframe {
    width: 390px;
    max-width: 100%;
    align-self: center;
}

.preview.tablet iframe {
    width: 820px;
    max-width: 100%;
    align-self: center;
}

.preview-bar.rz-stack {
    padding: 0.25rem 0.5rem;
    border-bottom: var(--rz-border-normal);
}

.preview-address {
    flex: 1;
    min-width: 0;
}

.preview-address .rz-textbox {
    width: 100%;
}

.preview-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-empty-inner {
    text-align: center;
    color: var(--rz-text-secondary-color);
}

.sample.rz-button {
    white-space: normal;
    text-align: left;
    justify-content: flex-start;
    line-height: 1.4;
}

.plan.rz-card {
    font-size: 0.88rem;
}

.connect-tables {
    height: 260px;
    overflow-y: auto;
    border: var(--rz-border-normal);
    border-radius: var(--rz-border-radius);
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.connect-table-row {
    display: flex;
    align-items: center;
}

.publish-log {
    margin: 0;
    max-height: 16rem;
    overflow: auto;
    padding: 0.75rem;
    border-radius: var(--rz-border-radius);
    background: var(--rz-base-200);
    color: var(--rz-text-color);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.publish-output {
    position: relative;
}

.publish-output .publish-copy-log {
    position: absolute;
    top: 0.25rem;
    right: 0.75rem;
}

.admin {
    padding: 1rem 1.25rem;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

.admin-stat {
    border: var(--rz-border-normal);
    border-radius: var(--rz-border-radius);
    padding: 0.75rem 1rem;
}

.admin-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.7;
}

.admin-stat-value {
    font-size: 1.6rem;
    font-weight: 600;
}

.admin-stat-note {
    font-size: 0.8rem;
    opacity: 0.7;
}

.hub-popup {
    display: none;
    position: absolute;
    min-width: 220px;
    padding: 0.35rem;
    border: var(--rz-menu-border);
    border-radius: var(--rz-menu-border-radius);
    background-color: var(--rz-menu-background-color);
    box-shadow: var(--rz-context-menu-box-shadow);
}

.hub-popup .hub-popup-item {
    width: 100%;
    text-align: left;
}

.hub-popup .hub-theme {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
}

.hub-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}









.data-view {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.data-view-inner {
    max-width: 760px;
    padding: 1.25rem;
}

.settings-view {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.25rem;
}

.settings-section {
    max-width: 760px;
}
