:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-muted: #f5f5f5;
    --surface-soft: #fafafa;
    --border: #e7e7e7;
    --border-strong: #d4d4d4;
    --text: #111111;
    --text-muted: #6a6a6a;
    --accent: #111111;
    --accent-contrast: #ffffff;
    --danger: #c73939;
    --success: #18794e;
    --warning: #a05b00;
    --header-height: 72px;
    --nav-height: 86px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --app-height: 100dvh;
    --keyboard-inset: 0px;
    --chat-composer-height: 88px;
    --radius: 22px;
    --shadow-soft: 0 8px 24px rgba(17, 17, 17, 0.05);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hidden {
    display: none !important;
}

.app-shell {
    min-height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfb 100%);
}

.topbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 20;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}

.topbar__inner {
    height: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
}

.topbar__title-wrap {
    grid-column: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.topbar__eyebrow {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.1;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__title-wrap h1 {
    margin: 2px 0 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.1;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__placeholder,
.topbar__action {
    grid-column: 3;
    width: 48px;
    height: 48px;
}

.main-stage {
    height: var(--app-height);
    min-height: 100vh;
    padding-top: var(--header-height);
}

.screen {
    height: calc(var(--app-height) - var(--header-height));
    min-height: calc(100vh - var(--header-height));
}

#screen-auth {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.screen-app {
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
}

.page {
    height: 100%;
}

.page.hidden {
    display: none;
}

.page-body {
    max-width: 900px;
    margin: 0 auto;
    height: 100%;
    padding: 18px 16px calc(16px + var(--safe-bottom));
}

.page-body--home {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    align-items: flex-start;
    padding-bottom: calc(var(--nav-height) + 14px + var(--safe-bottom));
}

.page-body--profile,
.page-body--placeholder {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--nav-height) + 14px + var(--safe-bottom));
}

.page-body--chat {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    min-height: 0;
    position: relative;
    padding-bottom: calc(8px + var(--safe-bottom));
}

.auth-screen {
    max-width: 900px;
    margin: 0 auto;
    min-height: 100%;
    padding: 12px 16px 24px;
    display: grid;
    gap: 12px;
    align-content: start;
}

.auth-hero {
    padding: 2px 4px 0;
}

.step-pill,
.pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 0.82rem;
}

.auth-hero p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.45;
    font-size: 0.96rem;
}

.auth-card,
.placeholder-card,
.subsection-card,
.soft-card,
.info-card,
.service-card,
.accordion-item,
.profile-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.auth-card {
    padding: 14px;
}

.segmented-control {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 6px;
    border-radius: 999px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
}

.segmented-control--small {
    margin-bottom: 6px;
}

.segmented-control__item {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    padding: 10px 14px;
    border-radius: 999px;
    font-weight: 600;
}

.segmented-control__item.is-active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
}

.auth-panel {
    margin-top: 14px;
}

.auth-panel__head h3 {
    margin: 0 0 6px;
    font-size: 1.25rem;
}

.auth-panel__head p {
    margin: 0 0 16px;
    color: var(--text-muted);
    line-height: 1.5;
}

.stack-form {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-size: 0.92rem;
    font-weight: 600;
}

.field input,
.field textarea,
.field select,
.chat-composer__field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-soft);
    color: var(--text);
    padding: 14px 16px;
    resize: none;
    transition: border-color 160ms ease, background 160ms ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.chat-composer__field textarea:focus {
    outline: none;
    border-color: var(--border-strong);
    background: #ffffff;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.checkbox-field input {
    width: 18px;
    height: 18px;
}

.primary-button,
.ghost-button {
    min-height: 52px;
    border-radius: 18px;
    padding: 0 18px;
    border: 1px solid var(--border);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.primary-button {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent);
}

.ghost-button {
    background: var(--surface);
    color: var(--text);
}

.danger-button {
    color: var(--danger);
    border-color: rgba(199, 57, 57, 0.18);
}

.button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.button-row--left {
    grid-template-columns: 1fr;
}

.feedback {
    border-radius: 18px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text-muted);
    line-height: 1.45;
    font-size: 0.92rem;
}

.feedback.is-error {
    border-color: rgba(199, 57, 57, 0.2);
    color: var(--danger);
    background: rgba(199, 57, 57, 0.06);
}

.feedback.is-success {
    border-color: rgba(24, 121, 78, 0.2);
    color: var(--success);
    background: rgba(24, 121, 78, 0.06);
}

.feedback.is-info {
    color: var(--text);
}

.feedback--compact {
    margin-top: 10px;
}

.service-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-content: start;
}

.service-card {
    min-height: 160px;
    padding: 18px;
    display: grid;
    gap: 12px;
    text-align: left;
    align-content: start;
}

.service-card--wide {
    grid-column: 1 / span 1;
}

.service-card__icon,
.icon-button {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
}

.service-card__icon svg,
.icon-button svg,
.bottom-nav__item svg,
.message-action svg {
    width: 22px;
    height: 22px;
}

.service-card__title {
    font-size: 1.12rem;
    font-weight: 700;
}

.service-card__text {
    color: var(--text-muted);
    line-height: 1.5;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--chat-composer-height) + var(--nav-height) + 12px + var(--safe-bottom));
}

.chat-message {
    display: flex;
}

.chat-message--user {
    justify-content: flex-end;
}

.chat-message__bubble {
    max-width: min(100%, 290px);
    padding: 14px 16px;
    border-radius: 20px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    line-height: 1.55;
    word-break: break-word;
}

.chat-message__content {
    min-width: 0;
}

.chat-message--assistant .chat-message__bubble {
    border-bottom-left-radius: 10px;
}

.chat-message--user .chat-message__bubble {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: var(--accent);
    border-bottom-right-radius: 10px;
}

.chat-message--system .chat-message__bubble {
    margin: 0 auto;
    color: var(--warning);
    background: rgba(160, 91, 0, 0.06);
    border-color: rgba(160, 91, 0, 0.15);
}

.chat-markdown p,
.chat-markdown ul,
.chat-markdown ol {
    margin: 0;
}

.chat-markdown p + p,
.chat-markdown p + ul,
.chat-markdown p + ol,
.chat-markdown ul + p,
.chat-markdown ol + p,
.chat-markdown__heading + p,
.chat-markdown__heading + ul,
.chat-markdown__heading + ol {
    margin-top: 10px;
}

.chat-markdown__heading {
    font-weight: 700;
    line-height: 1.35;
}

.chat-markdown__heading--1,
.chat-markdown__heading--2 {
    font-size: 1.02rem;
}

.chat-markdown__heading--3,
.chat-markdown__heading--4 {
    font-size: 0.96rem;
}

.chat-markdown__list {
    padding-left: 20px;
}

.chat-markdown li + li {
    margin-top: 6px;
}

.chat-markdown code {
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(17, 17, 17, 0.08);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.92em;
}

.chat-markdown a {
    color: inherit;
    text-decoration: underline;
}

.chat-message__actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.message-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.message-action--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
}

.chat-composer {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    gap: 10px;
    padding-top: 12px;
    padding-bottom: calc(6px + var(--safe-bottom));
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(var(--nav-height) + 8px + var(--safe-bottom));
    margin-top: 0;
    flex-shrink: 0;
    z-index: 18;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.96) 28%, rgba(255, 255, 255, 1) 100%);
}

.chat-composer__field {
    display: block;
}

.chat-composer__field textarea {
    min-height: 52px;
    max-height: 140px;
}

.icon-button {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.icon-button--filled {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-contrast);
}

.icon-button.is-recording {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.profile-hero {
    padding: 22px 18px;
    display: grid;
    justify-items: center;
    gap: 12px;
}

.avatar-button {
    width: 112px;
    height: 112px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
}

.avatar-button__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-button__fallback {
    font-size: 2rem;
    font-weight: 700;
}

.profile-hero h2 {
    margin: 0;
    font-size: 1.4rem;
    text-align: center;
}

.profile-hero p {
    margin: 0;
    color: var(--text-muted);
    text-align: center;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.pill--muted {
    color: var(--text-muted);
}

.accordion-list {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.accordion-item {
    overflow: hidden;
}

.accordion-trigger {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 18px;
    display: grid;
    gap: 4px;
    text-align: left;
    position: relative;
}

.accordion-trigger::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 24px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 180ms ease;
}

.accordion-item.is-open .accordion-trigger::after {
    transform: rotate(-135deg);
    top: 28px;
}

.accordion-trigger__label {
    font-weight: 700;
    font-size: 1rem;
}

.accordion-trigger__hint {
    color: var(--text-muted);
    font-size: 0.88rem;
    padding-right: 28px;
}

.accordion-panel {
    padding: 0 18px 18px;
}

.info-card-grid,
.entity-list {
    display: grid;
    gap: 10px;
}

.info-card {
    padding: 14px 16px;
}

.info-card__label {
    display: block;
    color: var(--text-muted);
    font-size: 0.84rem;
    margin-bottom: 8px;
}

.soft-card,
.subsection-card {
    padding: 16px;
}

.soft-card p,
.placeholder-card p,
.subsection-card p {
    margin: 8px 0 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.subsection-card + .subsection-card {
    margin-top: 12px;
}

.subsection-card h3,
.placeholder-card h2 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.entity-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px 16px;
    background: var(--surface-soft);
    display: grid;
    gap: 12px;
}

.entity-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.entity-card__title {
    font-weight: 700;
}

.entity-card__text {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.entity-card__actions {
    display: flex;
    gap: 8px;
}

.entity-card__button {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.placeholder-card {
    padding: 24px;
}

.page-body--europrotocol {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--nav-height) + 14px + var(--safe-bottom));
}

.europrotocol-shell {
    padding: 22px 18px 28px;
    display: grid;
    gap: 24px;
}

.europrotocol-shell__hero h2 {
    margin: 14px 0 10px;
    font-size: 1.35rem;
}

.europrotocol-shell__hero p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.europrotocol-progress {
    display: grid;
    gap: 10px;
}

.europrotocol-progress__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.europrotocol-progress__bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--surface-muted);
    overflow: hidden;
    border: 1px solid var(--border);
}

.europrotocol-progress__fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #111111 0%, #3d3d3d 100%);
    border-radius: inherit;
    transition: width 180ms ease;
}

.europrotocol-content {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.euro-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-soft);
    padding: 18px;
    display: grid;
    gap: 18px;
}

.euro-card__title {
    margin: 0;
    font-size: 1.08rem;
}

.euro-card__text {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.euro-grid {
    display: grid;
    gap: 12px;
}

.euro-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.euro-field {
    display: grid;
    gap: 6px;
}

.euro-field label,
.euro-field__label {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.euro-field input,
.euro-field select,
.euro-field textarea {
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 12px 14px;
    background: var(--surface);
}

.euro-field textarea {
    min-height: 100px;
    resize: vertical;
}

.euro-field__hint {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.euro-summary {
    display: grid;
    gap: 10px;
}

.euro-summary__item {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    padding: 14px;
    display: grid;
    gap: 6px;
}

.euro-summary__item strong {
    font-size: 0.92rem;
}

.euro-summary__item span {
    color: var(--text-muted);
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.euro-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.euro-note {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.euro-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.euro-inline--muted {
    color: var(--text-muted);
}

.euro-map-card {
    display: grid;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    padding: 14px;
    overflow: hidden;
}

.euro-map-card__header {
    display: grid;
    gap: 4px;
}

.euro-map-card__header strong {
    font-size: 0.95rem;
}

.euro-map-card__header span {
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.45;
}

.euro-map {
    width: 100%;
    min-height: 260px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #eef3f7;
}

.euro-map .leaflet-control-attribution {
    font-size: 0.62rem;
}

.euro-map .leaflet-control-zoom a {
    color: var(--text);
}

.euro-file-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    padding: 18px;
    display: grid;
    gap: 16px;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

.euro-card--hero {
    background:
        radial-gradient(circle at top right, rgba(17, 17, 17, 0.06), transparent 35%),
        linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%);
}

.euro-hero-card {
    display: grid;
    gap: 12px;
}

.euro-checklist {
    display: grid;
    gap: 14px;
}

.euro-checklist__item {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    align-items: start;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    padding: 16px;
}

.euro-checklist__item strong {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    background: #111111;
    color: #ffffff;
    font-size: 0.92rem;
}

.euro-checklist__item span {
    line-height: 1.45;
}

.euro-section {
    display: grid;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    padding: 16px;
}

.euro-section__header {
    display: grid;
    gap: 4px;
}

.euro-section__header h4 {
    margin: 0;
    font-size: 0.96rem;
}

.euro-section__header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.euro-section__body {
    display: grid;
    gap: 14px;
}

.euro-summary-block {
    display: grid;
    gap: 14px;
}

.euro-summary-block__header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-top: 2px;
}

.euro-summary-block__header h4 {
    margin: 0;
    font-size: 0.96rem;
}

.ghost-button--small {
    min-height: 40px;
    padding: 10px 14px;
}

.euro-inline--muted {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.euro-document-preview {
    display: grid;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fffdf9;
    padding: 16px;
}

.euro-document-preview__header {
    display: grid;
    gap: 4px;
}

.euro-document-preview__header span {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.euro-document-preview__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.euro-document-preview__section {
    display: grid;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    padding: 14px;
}

.euro-document-preview__section h4 {
    margin: 0;
    font-size: 0.95rem;
}

.euro-document-preview__row {
    display: grid;
    gap: 4px;
}

.euro-document-preview__row span {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.euro-document-preview__row strong {
    font-size: 0.92rem;
    line-height: 1.45;
}

.info-card-grid--estimate {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.estimate-result {
    display: grid;
    gap: 16px;
}

.estimate-result-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.estimate-save-pdf-btn {
    min-height: 44px;
    padding: 0 16px;
}

.estimate-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.estimate-file-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
}

.estimate-file-trigger {
    min-height: 46px;
    padding: 0 16px;
}

.estimate-file-caption {
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.4;
}

.feedback--estimate {
    line-height: 1.6;
    font-size: 0.98rem;
}

.estimate-summary {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 22px;
    background: linear-gradient(135deg, #fffaf2 0%, #ffffff 55%, #f7f8fb 100%);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.06);
}

.estimate-summary__eyebrow {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.estimate-summary__title {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
}

.estimate-summary__lead {
    margin: 0;
    font-size: 1rem;
    color: var(--text-muted);
}

.estimate-summary__lead strong {
    color: var(--text);
    font-size: 1.28rem;
}

.estimate-photo {
    display: grid;
    gap: 12px;
}

.estimate-photo__head {
    display: grid;
    gap: 4px;
}

.estimate-photo__head h4 {
    margin: 0;
    font-size: 1rem;
}

.estimate-photo__head span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.estimate-photo__image {
    width: 100%;
    display: block;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: #f4f4f4;
    object-fit: cover;
    max-height: 320px;
}

.info-card--accent {
    background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
}

.estimate-breakdown {
    display: grid;
    gap: 14px;
}

.estimate-breakdown__head {
    display: grid;
    gap: 4px;
}

.estimate-breakdown__head h4 {
    margin: 0;
    font-size: 1rem;
}

.estimate-breakdown__head p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.estimate-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.estimate-meta__item {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@media (max-width: 640px) {
    .euro-grid--2 {
        grid-template-columns: 1fr;
    }

    .euro-document-preview__grid {
        grid-template-columns: 1fr;
    }

    .info-card-grid--estimate {
        grid-template-columns: 1fr;
    }

    .estimate-summary__title {
        font-size: 1.18rem;
    }

    .estimate-summary__lead strong {
        display: inline-block;
        margin-top: 2px;
        font-size: 1.16rem;
    }

    .estimate-result-card__head {
        align-items: stretch;
    }

    .europrotocol-progress__meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

.bottom-nav {
    position: fixed;
    inset: auto 0 0 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    z-index: 30;
}

body.keyboard-open .bottom-nav {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.editable-focus .bottom-nav {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.keyboard-open .screen-app {
    padding-bottom: calc(8px + var(--safe-bottom));
}

body.keyboard-open .page-body--home,
body.keyboard-open .page-body--profile,
body.keyboard-open .page-body--placeholder,
body.keyboard-open .page-body--europrotocol {
    padding-bottom: calc(18px + var(--safe-bottom));
}

body.editable-focus .page-body--home,
body.editable-focus .page-body--profile,
body.editable-focus .page-body--placeholder,
body.editable-focus .page-body--europrotocol {
    padding-bottom: calc(18px + var(--safe-bottom));
}

body.keyboard-open .page-body--chat {
    padding-bottom: calc(8px + var(--safe-bottom));
}

body.keyboard-open .chat-composer {
    bottom: calc(var(--keyboard-inset) + 8px);
}

body.keyboard-open .chat-thread {
    padding-bottom: calc(var(--chat-composer-height) + var(--keyboard-inset) + 12px + var(--safe-bottom));
}

@media (min-width: 768px) {
    .chat-composer {
        left: calc(50% - 434px);
        right: calc(50% - 434px);
    }
}

.bottom-nav__item {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 6px;
}

.bottom-nav__item span {
    font-size: 0.76rem;
}

.bottom-nav__item.is-active {
    color: var(--text);
}

@media (min-width: 768px) {
    body {
        background: #f3f3f3;
    }

    .app-shell {
        max-width: 980px;
        margin: 0 auto;
        background: var(--bg);
        box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.04), 0 24px 80px rgba(17, 17, 17, 0.08);
    }

    .auth-screen {
        grid-template-columns: 1.1fr 0.9fr;
        align-items: center;
        gap: 24px;
        padding-top: 28px;
    }

    .service-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .service-card--wide {
        grid-column: auto;
    }

    .info-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .button-row--left {
        grid-template-columns: repeat(2, max-content);
        justify-content: flex-start;
    }
}
