:root {
    --bg: #f8f7f5;
    --accent: #f07d10;
    --dark: #0e182b;
    --card: #ffffff;
    --text: #0e182b;
    --muted: #6d7485;
    --line: #dedbd6;
    --soft-accent: #ffffff;
    --shadow: 0 14px 34px #dedbd6;
}

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: -webkit-fill-available;
    min-height: var(--app-vh-safe, 100dvh);
    height: var(--app-vh-safe, 100dvh);
    margin: 0;
    padding: 0;
    background: #0b1526;
    overflow-x: hidden;
}

body {
    width: 100%;
    min-height: -webkit-fill-available;
    min-height: var(--app-vh-safe, 100dvh);
    height: var(--app-vh-safe, 100dvh);
    margin: 0;
    padding: 0;
    font-family: "Manrope", Arial, sans-serif;
    background: #0b1526;
    color: var(--text);
    overflow-x: hidden;
}

body.is-scroll-locked {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

/* ─── Toast-уведомления ─────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: 1.5px solid #e6f4ec;
    border-left: 4px solid #2ecc71;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #0e182b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
    min-width: 220px;
    max-width: 300px;
    pointer-events: auto;
    transform: translateX(calc(100% + 24px));
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.toast.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-hiding {
    transform: translateX(calc(100% + 24px));
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.toast.toast-error {
    border-color: #fcebeb;
    border-left-color: #e74c3c;
}

.toast.toast-error .toast-icon {
    background: #fdf2f2;
}

.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: #e9f9f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 480px) {
    .toast-container {
        left: 16px;
        right: 16px;
        top: 16px;
    }
    .toast {
        min-width: 0;
        max-width: none;
        width: 100%;
        transform: translateY(-40px);
        box-sizing: border-box;
    }
    .toast.toast-visible {
        transform: translateY(0);
    }
    .toast.toast-hiding {
        transform: translateY(-40px);
    }
}
/* ─────────────────────────────────────────────────────────── */

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-app {
    position: relative;
    width: 100%;
    max-width: 430px;
    min-height: -webkit-fill-available;
    min-height: var(--app-vh-safe, 100dvh);
    height: var(--app-vh-safe, 100dvh);
    margin: 0 auto;
    padding: 0 18px 108px;
    background: var(--bg);
    overflow-x: hidden;
    box-shadow: none;
}

.screen {
    display: none;
    padding-bottom: 18px;
}

.screen.is-active {
    display: block;
}

.app-header {
    margin: 0 -18px;
    padding: 42px 18px 22px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}

.app-header.compact {
    padding-bottom: 18px;
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    flex-direction: column;
    gap: 0;
    text-decoration: none;
}

.brand-title {
    color: var(--accent);
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
}

.brand-subtitle {
    margin-top: 4px;
    color: var(--dark);
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
}

.icon-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 9px;
    background: transparent;
    color: var(--dark);
}

.icon-button span {
    width: 20px;
    height: 2px;
    display: block;
    margin-left: auto;
    border-radius: 999px;
    background: currentColor;
}

.icon-button span:nth-child(2) {
    width: 14px;
}

.brand-row > .icon-button {
    display: none;
}

.hero-copy {
    margin-top: 28px;
}

.hero-copy h1 {
    margin: 0;
    color: var(--text);
    font-size: 24px;
    line-height: 1.16;
    font-weight: 800;
}

.hero-copy p {
    max-width: 330px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
    font-weight: 500;
}

.progress-panel {
    padding: 22px 0 18px;
}

.progress-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: start;
    padding: 0 2px;
}

.progress-track::before,
.progress-track::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    border-radius: 999px;
    background: #dedbd6;
}

.progress-track::after {
    right: 90%;
    background: var(--accent);
    transition: right .22s ease;
}

.progress-track[data-current="2"]::after {
    right: 70%;
}

.progress-track[data-current="3"]::after {
    right: 50%;
}

.progress-track[data-current="4"]::after {
    right: 30%;
}

.progress-track[data-current="5"]::after {
    right: 10%;
}

.progress-step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 9px;
    min-width: 0;
    padding: 0;
    color: var(--muted);
    user-select: none;
}

.progress-step.is-active,
.progress-step.is-complete {
    color: var(--dark);
}

.progress-step.is-active .step-dot,
.progress-step.is-complete .step-dot {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: none;
}

.step-dot {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid #dedbd6;
    border-radius: 999px;
    background: var(--bg);
    color: var(--dark);
    font-size: 17px;
    font-weight: 800;
}

.step-label {
    min-height: 34px;
    color: currentColor;
    font-size: 10px;
    line-height: 1.25;
    font-weight: 800;
    text-align: center;
}

.card,
.accordion-item {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.card {
    padding: 18px 14px;
}

.card h2 {
    margin: 0 0 18px;
    color: var(--text);
    font-size: 18px;
    line-height: 1.3;
    font-weight: 800;
}

.service-options {
    display: grid;
    gap: 10px;
}

.service-option {
    width: 100%;
    min-height: 130px;
    position: relative;
    display: grid;
    grid-template-columns: 76px 1fr 30px;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    text-align: left;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.service-option.is-selected {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
    box-shadow: var(--shadow);
}

.service-option.is-selected .service-title {
    color: #fff;
}

.service-option.is-selected .service-description {
    color: #dedbd6;
}

.service-image {
    width: 76px;
    height: 92px;
    overflow: hidden;
    display: block;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-image-simple img {
    object-position: 46% center;
}

.service-copy {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.service-title {
    color: var(--text);
    font-size: 17px;
    line-height: 1.2;
    font-weight: 800;
}

.service-description {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.38;
    font-weight: 500;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.service-price {
    color: var(--accent);
    font-size: 18px;
    line-height: 1.1;
    font-weight: 800;
}

.check-circle {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    align-self: start;
    margin-top: 8px;
    border: 2px solid #ded9d4;
    border-radius: 50%;
    color: transparent;
    background: #fff;
}

.check-circle svg {
    width: 17px;
    height: 17px;
    stroke-width: 3;
}

.service-option.is-selected .check-circle {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

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

.accordion-item {
    overflow: hidden;
}

.accordion-head {
    width: 100%;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px;
    background: #fff;
    color: var(--text);
    text-align: left;
}

.accordion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 800;
}

.line-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    color: var(--dark);
}

.accordion-meta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.accordion-item.is-open .chevron,
.breakdown-toggle[aria-expanded="true"] .chevron {
    transform: rotate(225deg);
}

.accordion-body {
    display: none;
    padding: 0 14px 16px;
    background: #fff;
}

.accordion-item.is-open .accordion-body {
    display: block;
}

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

.choice-chip {
    min-height: 42px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.choice-chip.is-selected {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
}

.check-row {
    min-height: 48px;
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.check-row:last-child {
    border-bottom: 0;
}

.check-row input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.check-row strong {
    color: var(--accent);
    font-size: 13px;
    white-space: nowrap;
}

.input-grid,
.settings-grid {
    display: grid;
    gap: 10px;
}

.field-line {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
    font-weight: 800;
}

.field-line.is-hidden {
    display: none;
}

.field-line input,
.field-line select {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
    outline: none;
}

.field-line select {
    appearance: none;
}

.field-line input:focus,
.field-line select:focus {
    border-color: var(--dark);
    background: #fff;
    box-shadow: none;
}

.mini-label {
    margin: 14px 0 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.hint-button {
    width: 100%;
    min-height: 42px;
    margin-top: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--accent);
    font-size: 13px;
    font-weight: 800;
}

.hint-button:disabled {
    color: var(--muted);
    background: #fff;
    cursor: default;
}

.hint-button[hidden] {
    display: none;
}

.mix-card {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.mix-card[hidden] {
    display: none;
}

.mix-head,
.mix-result,
.regularity-result,
.markup-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mix-head strong {
    color: var(--text);
    font-size: 14px;
}

.mix-head span,
.mix-result span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.mix-grid {
    margin-top: 10px;
}

.mix-result {
    margin-top: 12px;
}

.mix-apply {
    width: auto;
    min-height: 38px;
    margin-top: 0;
    padding: 0 12px;
}

.total-card {
    overflow: hidden;
    margin-top: 18px;
    border-radius: 18px;
    background: var(--dark);
    color: #fff;
    box-shadow: none;
}

.total-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 16px 18px;
}

.markup-control {
    margin: 0 16px 14px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #3f4756;
    background: var(--dark);
    color: #dedbd6;
}

.markup-control label {
    display: grid;
    gap: 5px;
    width: 86px;
    font-size: 11px;
    font-weight: 800;
}

.markup-control input {
    width: 100%;
    min-height: 34px;
    border: 1px solid #3f4756;
    border-radius: 10px;
    padding: 0 8px;
    background: var(--dark);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    outline: none;
}

.markup-control div {
    display: grid;
    gap: 4px;
}

.markup-control span {
    font-size: 11px;
    font-weight: 700;
}

.markup-control strong {
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
}

.total-head p {
    margin: 0 0 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.total-head strong {
    display: block;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    font-weight: 800;
}

.calc-icon {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--accent);
    color: #fff;
    box-shadow: none;
}

.calc-icon svg {
    width: 30px;
    height: 30px;
    stroke-width: 1.7;
}

.breakdown-toggle {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-top: 1px solid #3f4756;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    text-align: left;
}

.breakdown {
    display: none;
    padding: 0 16px 16px;
}

.breakdown.is-open {
    display: grid;
    gap: 9px;
}

.breakdown-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: #dedbd6;
    font-size: 13px;
    font-weight: 600;
}

.breakdown-row-note {
    align-items: flex-start;
}

.breakdown-row-note > span {
    display: grid;
    gap: 3px;
}

.breakdown-row-note small {
    color: #dedbd6;
    font-size: 11px;
    line-height: 1.35;
    font-weight: 600;
}

.breakdown strong {
    color: #fff;
    white-space: nowrap;
}

.breakdown [data-breakdown="selectedService"] {
    max-width: 170px;
    white-space: normal;
    text-align: right;
    line-height: 1.25;
}

.breakdown-total {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #3f4756;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

.action-stack {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.primary-action,
.secondary-action {
    width: 100%;
    min-height: 58px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
}

.primary-action {
    background: var(--accent);
    color: #fff;
    box-shadow: none;
}

.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    border: 1px solid var(--dark);
    background: #fff;
    color: var(--dark);
}

.secondary-action svg {
    width: 20px;
    height: 20px;
}

.settings-screen,
.simple-screen {
    padding-top: 0;
}

.settings-card,
.empty-card,
.regularity-card {
    margin-top: 14px;
}

.settings-tabs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 14px;
}

.settings-tab {
    width: 100%;
    min-height: 48px;
    display: grid;
    place-items: center;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    line-height: 1;
    font-weight: 800;
}

.settings-tab.is-active {
    border-color: var(--accent);
    color: var(--accent);
}

.settings-panel-topbar {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.settings-panel-topbar h2 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
    line-height: 1.1;
    font-weight: 800;
}

.settings-back-tab {
    min-width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--dark);
    font-size: 13px;
    font-weight: 800;
}

.settings-back-tab svg {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    stroke-width: 2.2;
}

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.is-active {
    display: block;
}

.settings-tab-intro {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
}

.settings-export-actions {
    padding-bottom: 18px;
}

.settings-card h2,
.empty-card h2,
.regularity-card h2 {
    margin-bottom: 14px;
}

.regularity-card p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
}

.regularity-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--dark);
    font-size: 13px;
    font-weight: 800;
}

.regularity-result strong {
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 18px;
}

.material-setting {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.material-setting > strong {
    color: var(--text);
    font-size: 14px;
}

.material-setting > span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.material-setting > span strong {
    color: var(--accent);
}

.empty-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
    font-weight: 600;
}

.history-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.history-entry:first-of-type {
    border-top: 0;
}

.history-entry span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.history-entry strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
}

.history-screen {
    padding-top: 24px;
    padding-bottom: 112px;
}

.history-topbar {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}

.history-topbar h1 {
    margin: 0;
    color: var(--text);
    font-size: 25px;
    line-height: 1;
    font-weight: 800;
    text-align: center;
}

.history-icon-btn {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: transparent;
    color: var(--dark);
}

.history-icon-btn svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.history-search {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    border: 1px solid #dedbd6;
    border-radius: 16px;
    background: #fff;
    color: var(--muted);
    box-shadow: none;
}

.history-search svg {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    stroke-width: 2;
}

.history-search input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    outline: none;
}

.history-search input::placeholder {
    color: #878d9a;
}

.history-chips {
    display: flex;
    gap: 10px;
    margin: 22px -18px 22px;
    padding: 0 18px 2px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-padding: 18px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.history-chips::-webkit-scrollbar {
    display: none;
}

.history-chip {
    min-height: 46px;
    flex: 0 0 auto;
    padding: 0 18px;
    border: 1px solid #dedbd6;
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.history-chip.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: none;
}

.history-stats-card {
    min-height: 126px;
    display: grid;
    grid-template-columns: 74px 1fr 1fr;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    padding: 20px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
}

.history-stat-icon {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--accent);
}

.history-stat-icon svg {
    width: 36px;
    height: 36px;
    stroke-width: 1.9;
}

.history-stats-card h2 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 18px;
    font-weight: 800;
}

.history-stats-card strong {
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    font-weight: 800;
}

.history-stat-total {
    padding-left: 16px;
    border-left: 1px solid var(--line);
}

.history-stat-total span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.history-stat-total strong {
    color: var(--accent);
    white-space: nowrap;
}

.history-list {
    display: grid;
    gap: 10px;
    padding-bottom: 26px;
}

.history-card {
    width: 100%;
    min-height: 76px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto 28px;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    text-align: left;
    box-shadow: var(--shadow);
}

.history-avatar {
    width: 58px;
    height: 58px;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
}

.history-avatar img {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.history-avatar svg {
    width: 34px;
    height: 34px;
    color: var(--dark);
    stroke-width: 1.8;
}

.history-main {
    min-width: 0;
}

.history-main h3 {
    margin: 0 0 3px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.12;
    font-weight: 800;
}

.history-main p {
    margin: 0 0 5px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.18;
    font-weight: 800;
}

.history-meta,
.history-params {
    display: block;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.28;
    font-weight: 700;
}

.client-type-badge {
    display: inline-flex;
    width: fit-content;
    margin-top: 5px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--dark);
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
}

.history-side {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.history-price {
    color: var(--text);
    font-size: 17px;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
}

.status-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 5px 8px;
    border-radius: 9px;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
}

.status-saved {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--dark);
}

.status-done {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--dark);
}

.status-draft {
    border: 1px solid var(--accent);
    background: #fff;
    color: var(--accent);
}

.status-completed {
    opacity: 0.55;
}

/* Overdue appointments styling */
.appointment-card.is-overdue {
    border-color: #f97316 !important;
    box-shadow: 0 0 0 1px #f97316, 0 4px 12px rgba(249, 115, 22, 0.08);
}

.overdue-tooltip {
    position: absolute;
    z-index: 99999;
    padding: 8px 12px;
    background: #221910;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(34, 25, 16, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: none;
    animation: fadeIn 0.15s ease;
}

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

.history-arrow {
    position: relative;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
}

.history-arrow::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 8px;
    width: 7px;
    height: 7px;
    border-top: 2px solid var(--dark);
    border-right: 2px solid var(--dark);
    transform: rotate(45deg);
}

.history-empty {
    padding: 28px 18px;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
    text-align: center;
}

.history-empty h2 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 20px;
}

.history-empty p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.clients-screen {
    padding-top: 24px;
    padding-bottom: 112px;
}

.appointments-screen {
    padding-top: 24px;
    padding-bottom: 112px;
}

.clients-topbar {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}

.clients-topbar h1 {
    margin: 0;
    color: var(--text);
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
    text-align: center;
}

.clients-icon-btn,
.clients-add-btn {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--dark);
}

.clients-back-btn svg,
.clients-add-btn svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.4;
}

.clients-back-btn svg {
    color: var(--dark);
}

.clients-add-btn svg {
    color: var(--accent);
}

.clients-search {
    margin-bottom: 0;
}

.clients-chips {
    margin-top: 22px;
}

.clients-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.client-stat-card {
    min-height: 86px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 5px;
    padding: 10px 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
    text-align: center;
}

.client-stat-card svg {
    width: 19px;
    height: 19px;
    color: var(--accent);
    stroke-width: 1.9;
}

.client-stat-card strong {
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    font-weight: 800;
}

.client-stat-card span {
    color: var(--muted);
    font-size: 9px;
    line-height: 1.2;
    font-weight: 800;
}

.clients-list {
    display: grid;
    gap: 10px;
    padding-bottom: 26px;
}

.client-card {
    width: 100%;
    min-height: 82px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto 26px;
    align-items: center;
    gap: 9px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    text-align: left;
    box-shadow: var(--shadow);
}

.client-avatar {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--accent);
    font-size: 18px;
    font-weight: 800;
}

.client-main {
    min-width: 0;
}

.client-main h3 {
    margin: 0 0 4px;
    color: var(--text);
    font-size: 16px;
    line-height: 1.12;
    font-weight: 800;
}

.client-phone,
.client-meta {
    display: block;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
    font-weight: 700;
}

.client-meta {
    margin-top: 4px;
}

.client-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.client-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--dark);
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
}

.client-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
}

.client-badge-vip {
    color: var(--accent);
}

.client-badge-vip::before {
    background: var(--accent);
}

.client-badge-archive {
    color: var(--muted);
}

.client-side {
    display: grid;
    justify-items: end;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.client-side strong {
    color: var(--accent);
    font-size: 13px;
}

.client-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.client-analytics-grid span {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.client-analytics-grid strong {
    color: var(--text);
    font-size: 16px;
    line-height: 1.1;
}

.client-analytics-grid small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.client-arrow {
    position: relative;
    width: 26px;
    height: 26px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
}

.client-arrow::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 8px;
    width: 7px;
    height: 7px;
    border-top: 2px solid var(--dark);
    border-right: 2px solid var(--dark);
    transform: rotate(45deg);
}

.clients-empty {
    margin-top: 18px;
}

.history-overlay {
    position: fixed;
    inset: 0;
    z-index: 45;
    overflow: hidden;
    background: rgba(14, 24, 43, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 300ms cubic-bezier(0.2, 0.9, 0.2, 1.05);
    will-change: opacity;
}

.history-overlay.is-visible {
    opacity: 1;
}

.history-overlay.is-closing {
    opacity: 0;
    transition: opacity 250ms cubic-bezier(0.32, 0, 0.67, 0);
}

.history-sheet {
    box-sizing: border-box;
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    width: min(100%, 430px);
    max-width: 100vw;
    max-height: 86vh;
    margin: 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 10px 18px 24px;
    border: 1px solid var(--line);
    border-radius: 24px 24px 0 0;
    background: #fff;
    box-shadow: none;
    touch-action: pan-y;
    transform: translate3d(0, 105%, 0);
    transition: transform 320ms cubic-bezier(0.2, 0.9, 0.2, 1.05);
    will-change: transform;
}

.history-sheet.is-open {
    transform: translate3d(0, 0, 0);
}

.history-sheet.is-dragging {
    transition: none;
}

.history-sheet.is-closing {
    transform: translate3d(0, 105%, 0);
    transition: transform 260ms cubic-bezier(0.32, 0, 0.67, 0);
    pointer-events: none;
}

.sheet-handle {
    width: 46px;
    height: 5px;
    margin: 0 auto 16px;
    border-radius: 999px;
    background: #dedbd6;
}

.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.sheet-head h2,
.confirm-sheet h2 {
    margin: 0;
    color: var(--text);
    font-size: 21px;
    font-weight: 800;
}

.detail-content,
.filter-grid {
    display: grid;
    gap: 12px;
}

.detail-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.detail-row strong {
    color: var(--text);
    text-align: right;
}

.appointment-complete-action {
    border-color: #16833b;
    background: #16833b;
    box-shadow: 0 10px 24px rgba(22, 131, 59, .22);
}

.appointment-final-price {
    margin-top: 16px;
}

.appointment-final-price input {
    font-size: 20px;
    font-weight: 800;
}

.detail-actions,
.confirm-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.history-sheet > .primary-action {
    margin-top: 18px;
}

.history-sheet .history-icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.history-sheet .history-icon-btn svg {
    width: 22px;
    height: 22px;
}

.history-sheet .field-line {
    gap: 8px;
}

.history-sheet .field-line input,
.history-sheet .field-line select,
.history-sheet .field-line textarea {
    min-height: 48px;
    border-radius: 13px;
    background: #fff;
}

.history-sheet .field-line textarea {
    min-height: 96px;
}

.secondary-action.compact,
.danger-action {
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
}

.danger-action {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--dark);
}

.filter-grid .full {
    grid-column: 1 / -1;
}

#manualAppointmentSheet .filter-grid {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

#manualAppointmentSheet .field-line,
#manualAppointmentSheet .full {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.additional-services-picker {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    max-height: 238px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8f6f3;
}

.additional-service-option {
    box-sizing: border-box;
    position: relative;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease;
}

.additional-service-option:has(input:checked) {
    border-color: var(--accent);
    background: #fff8f1;
}

.additional-service-option.is-disabled {
    display: none;
}

.additional-service-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.additional-service-check {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border: 1.5px solid #c9c1b8;
    border-radius: 6px;
    background: #fff;
}

.additional-service-option input:checked + .additional-service-check {
    border-color: var(--accent);
    background: var(--accent);
}

.additional-service-option input:checked + .additional-service-check::after {
    content: "";
    width: 8px;
    height: 4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translateY(-1px) rotate(-45deg);
}

.additional-service-name {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 800;
}

.additional-service-duration {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.manual-duration-hint {
    box-sizing: border-box;
    width: 100%;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    margin: 0;
    padding: 12px 13px;
    border: 1px solid #f5c48f;
    border-radius: 14px;
    background: #fff8f1;
    color: var(--text);
}

.manual-duration-hint[hidden] {
    display: none;
}

.manual-duration-hint-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
}

.manual-duration-hint strong,
.manual-duration-hint small {
    display: block;
}

.manual-duration-hint strong {
    font-size: 13px;
    line-height: 1.25;
}

.manual-duration-hint small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
    font-weight: 700;
}

.field-line textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    resize: vertical;
    outline: none;
}

.confirm-sheet p {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 500px) {
    .clients-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .client-stat-card {
        min-height: 78px;
    }

    .client-card {
        grid-template-columns: 44px minmax(0, 1fr) auto 24px;
        min-height: 78px;
        gap: 8px;
        padding: 9px;
    }

    .client-avatar {
        width: 44px;
        height: 44px;
    }

    .client-main h3 {
        font-size: 15px;
    }

    .client-side {
        font-size: 11px;
    }

    .history-card {
        grid-template-columns: 54px minmax(0, 1fr) auto 24px;
        align-items: center;
        gap: 8px;
        padding: 9px;
    }

    .history-avatar {
        width: 54px;
        height: 54px;
        border-radius: 15px;
    }

    .history-side {
        grid-column: auto;
        grid-row: auto;
        justify-items: end;
        display: grid;
        gap: 5px;
    }

    .history-arrow {
        display: block;
        width: 24px;
        height: 24px;
    }

    .history-arrow::before {
        top: 7px;
        left: 7px;
    }

    .history-price {
        font-size: 15px;
    }

    .status-badge {
        padding: 5px 6px;
        font-size: 8px;
    }
}

.bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    padding: 9px 10px 12px;
    border-top: 1px solid var(--line);
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
}

.nav-item {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    padding: 5px 2px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
}

.nav-item span {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.8;
}

.nav-item.is-active {
    color: var(--accent);
}

/* Strict production palette cleanup */
.app-header {
    background: var(--bg);
}

.mobile-app,
.header-island,
.desktop-nav,
.bottom-nav {
    box-shadow: none;
}

.card,
.accordion-item,
.service-option,
.history-card,
.history-stats-card,
.history-empty,
.regularity-card,
.settings-card,
.empty-card {
    border-color: var(--line);
    background: var(--card);
    box-shadow: 0 12px 28px #dedbd6;
}

.service-option {
    background: var(--card);
    border-color: var(--line);
}

.service-option.is-selected {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 12px 28px #dedbd6;
}

.service-option.is-selected::before {
    content: none;
}

.service-image,
.history-avatar {
    display: grid;
    place-items: center;
    background: var(--card);
    border: 1px solid var(--line);
}

.service-image img,
.history-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-avatar img {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.history-avatar svg {
    width: 34px;
    height: 34px;
    color: var(--dark);
    stroke-width: 1.8;
}

.service-image::before,
.history-avatar::before {
    content: none;
}

.progress-step.is-active .step-dot,
.progress-step.is-complete .step-dot,
.history-chip.is-active {
    box-shadow: none;
}

.choice-chip.is-selected,
.hint-button,
.regularity-result,
.mix-card,
.material-setting,
.history-stat-icon,
.client-type-badge {
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--dark);
}

.choice-chip.is-selected {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
}

.hint-button {
    color: var(--accent);
}

.hint-button:disabled {
    background: var(--card);
    color: var(--muted);
}

.primary-action {
    box-shadow: none;
}

.secondary-action {
    background: var(--card);
}

.total-card {
    background: var(--dark);
    box-shadow: none;
}

.markup-control {
    background: var(--dark);
    border: 1px solid #3f4756;
}

.markup-control input {
    background: var(--dark);
    border-color: #3f4756;
}

.calc-icon {
    box-shadow: none;
}

.history-search {
    background: var(--card);
    box-shadow: none;
}

.history-stats-card {
    border-color: var(--line);
}

.history-stat-total {
    border-left-color: var(--line);
}

.status-badge {
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--dark);
}

.status-draft {
    border-color: var(--accent);
    color: var(--accent);
}

.history-overlay {
    background: #0e182b;
}

.history-sheet {
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: none;
}

.danger-action {
    border-color: var(--line);
    color: var(--dark);
}

.field-line input,
.field-line select,
.field-line textarea {
    background: var(--card);
}

.field-line input:focus,
.field-line select:focus,
.field-line textarea:focus {
    border-color: var(--dark);
    box-shadow: none;
}

@media (max-width: 410px) {
    .service-option {
        grid-template-columns: 70px 1fr 28px;
        gap: 9px;
        padding: 12px 10px;
    }

    .service-image {
        width: 70px;
        height: 86px;
    }

    .service-title {
        font-size: 16px;
    }

    .service-description {
        font-size: 12px;
    }
}

@media (max-width: 370px) {
    .mobile-app {
        padding-right: 12px;
        padding-left: 12px;
    }

    .app-header {
        margin-right: -12px;
        margin-left: -12px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .service-image {
        width: 66px;
        height: 82px;
    }

    .service-title,
    .accordion-title {
        font-size: 15px;
    }

    .accordion-meta {
        font-size: 12px;
    }

    .total-head strong {
        font-size: 29px;
    }
}

#exportExcelButton {
    background: #107c41 !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    transition: background-color 0.2s ease !important;
}

#exportExcelButton:hover {
    background: #0b592e !important;
}

#exportExcelButton::before {
    content: "";
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M2.859 2.877l12.57-1.795a.5.5 0 0 1 .571.495v20.846a.5.5 0 0 1-.57.495L2.858 21.123a1 1 0 0 1-.859-.99V3.867a1 1 0 0 1 .859-.99zM17 11h3v2h-3v-2zm0-4h3v2h-3V7zm0 8h3v2h-3v-2zm3-10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-3V5h3zm-8.462 8.782c.08-.227.172-.452.274-.678l1.452-3.104H11.5l-.89 2.193-.896-2.193H7.952l1.523 3.235c-.097.23-.2.46-.307.691L7.548 16h1.764l1.012-2.45L11.36 16h1.764l-1.586-3.218z'/%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
}


/* ─── Online Appointments Screen Styles ──────────────────────── */
.appointments-schedule-widget {
    margin: 10px 0 18px;
    padding: 12px;
    border: 1px solid #dfe4ec;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.08);
}

.appointments-schedule-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
    margin-bottom: 10px;
}

.appointments-schedule-kicker {
    display: block;
    color: var(--accent);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.appointments-schedule-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 23px;
    line-height: 1;
    letter-spacing: -0.02em;
}

.appointments-schedule-next {
    min-width: 136px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #151f30;
    color: #fff;
    text-align: left;
    box-shadow: inset 3px 0 0 var(--accent);
}

.appointments-schedule-next span {
    display: block;
    color: #b9c1cf;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.appointments-schedule-next strong {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.15;
}

.appointments-schedule-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(212px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding: 1px 1px 4px;
    scrollbar-width: thin;
}

.appointments-day-column {
    min-width: 212px;
    border: 1px solid #dfe4ec;
    border-radius: 16px;
    background: #f7f9fc;
    overflow: hidden;
}

.appointments-day-column header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 8px;
    align-items: start;
    padding: 11px 12px 10px;
    border-bottom: 1px solid #dfe4ec;
    background: #fff;
}

.appointments-day-column header span {
    grid-column: 1;
    color: var(--text);
    font-size: 15px;
    font-weight: 950;
}

.appointments-day-column header strong,
.appointments-day-column header small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
}

.appointments-day-column header strong {
    grid-column: 1;
}

.appointments-day-column header small {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    padding: 5px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: #536070;
    white-space: nowrap;
}

.appointments-time-grid {
    display: grid;
    gap: 6px;
    padding: 8px;
}

.appointment-slot {
    min-height: 50px;
    border-radius: 13px;
    border: 1px solid #dfe4ec;
    overflow: hidden;
}

.appointment-slot.is-free {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    color: #8c97a6;
    background: #ffffff;
}

.appointment-slot-time {
    font-size: 12px;
    font-weight: 950;
    color: var(--text);
    white-space: nowrap;
}

.appointment-slot-empty {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.appointment-slot.is-booked {
    background: #fff4e8;
    border-color: #f0a252;
    box-shadow: 0 7px 18px rgba(236, 127, 19, 0.12);
}

.appointment-slot-main {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3px 8px;
    padding: 10px 11px 8px;
    border: 0;
    background: #fff4e8;
    color: var(--text);
    text-align: left;
}

.appointment-slot-main strong,
.appointment-slot-main small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.appointment-slot-main strong {
    font-size: 13px;
    font-weight: 950;
}

.appointment-slot-main small {
    grid-column: 2;
    color: #657184;
    font-size: 10px;
    font-weight: 900;
}

.appointment-slot-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid #f0c99f;
}

.appointment-slot-actions button,
.appointment-slot-actions span {
    min-height: 34px;
    border: 0;
    background: #ffffff;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.appointment-slot-actions span {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d63b30;
}

.appointment-slot-actions button + button {
    border-left: 1px solid #f0c99f;
    background: #fff8f6;
    color: #d63b30;
}

.appointment-slot-actions span + button {
    border-left: 1px solid #f0c99f;
    background: #fff8f6;
    color: #d63b30;
}

.appointment-slot-actions button:hover {
    background: #f4f7fb;
}

.appointment-slot-actions button + button:hover,
.appointment-slot-actions span + button:hover {
    background: #ffe9e5;
}

.appointments-day-group {
    display: grid;
    gap: 8px;
}

.appointments-day-group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.appointments-day-group-head span {
    color: var(--text);
}

.appointments-day-group-list {
    display: grid;
    gap: 10px;
}

.client-calculation-card {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8f9fa;
    color: var(--text);
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.client-calculation-card:hover {
    border-color: rgba(236, 127, 19, 0.45);
    background: #fff7ef;
    transform: translateY(-1px);
}

.client-calculation-card:active {
    transform: translateY(0);
}

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

@media (max-width: 500px) {
    .appointments-schedule-widget {
        padding: 10px;
        border-radius: 16px;
    }

    .appointments-schedule-head {
        grid-template-columns: 1fr;
    }

    .appointments-schedule-next {
        width: 100%;
        text-align: left;
    }

    .appointments-schedule-grid {
        grid-template-columns: repeat(3, 86%);
        scroll-snap-type: x mandatory;
    }

    .appointments-day-column {
        min-width: 0;
        scroll-snap-align: start;
    }

    .appointments-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .appointments-stats .client-stat-card {
        padding: 8px 4px;
    }
    .appointments-stats .client-stat-card strong {
        font-size: 16px;
    }
    .appointments-stats .client-stat-card span {
        font-size: 9px;
    }
}

.appointments-list {
    display: grid;
    gap: 10px;
    padding-bottom: 26px;
}

.appointment-card {
    width: 100%;
    min-height: 100px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto 28px;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    text-align: left;
    box-shadow: var(--shadow);
}

.appointment-card .history-main {
    padding-left: 4px;
}

.appointment-card:hover {
    background: #fafafa;
}

@media (max-width: 500px) {
    .appointment-card {
        grid-template-columns: 54px minmax(0, 1fr) auto 20px;
        gap: 8px;
        padding: 8px;
    }
}

.phone-link {
    transition: opacity 0.2s ease;
}
.phone-link:hover {
    opacity: 0.8;
}

/* Custom Styles for the new "Ближайшие слоты" layout */
.appointments-schedule-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 12px !important;
    padding: 2px 2px 12px !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
}

.appointments-day-card {
    flex: 0 0 85% !important;
    min-width: 0 !important;
    scroll-snap-align: start !important;
    background: #ffffff;
    border: 1px solid #dfe4ec;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.03);
}

@media (min-width: 768px) {
    .appointments-day-card {
        flex: 0 0 300px !important;
    }
}

.day-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f2f5fa;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.day-card-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-card-label {
    font-size: 13px;
    font-weight: 850;
    color: var(--text);
}

.day-card-date {
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
}

.day-card-badge {
    font-size: 10px;
    font-weight: 850;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f0f4f8;
    color: #4a5568;
}

.day-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slots-free-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
}

.slots-free-label {
    font-size: 10px;
    font-weight: 900;
    color: #8c97a6;
    text-transform: uppercase;
    margin-top: 5px;
    min-width: 68px;
    letter-spacing: 0.03em;
}

.slots-free-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1;
}

.slot-pill-free {
    font-size: 11px;
    font-weight: 850;
    padding: 3px 6px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.slot-row-booked {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    background: #fffaf0;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(237, 137, 54, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.slot-row-booked:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(237, 137, 54, 0.07);
}

.slot-row-booked.status-new {
    border-color: #cbd5e1;
    background: #f8fafc;
    box-shadow: none;
}
.slot-row-booked.status-new:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.slot-row-booked.status-confirmed {
    border-color: #bbf7d0;
    background: #f0fdf4;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.04);
}
.slot-row-booked.status-confirmed:hover {
    box-shadow: 0 6px 14px rgba(34, 197, 94, 0.07);
}

.slot-booked-main {
    width: 100%;
    min-width: 0;
    border: 0;
    padding: 8px 10px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.slot-booked-time {
    font-size: 10px;
    font-weight: 850;
    color: var(--text);
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 3px 6px;
    border-radius: 6px;
    white-space: nowrap;
}

.slot-booked-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.slot-booked-client {
    font-size: 13px;
    font-weight: 850;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot-booked-service {
    font-size: 10px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slot-booked-status {
    font-size: 9px;
    font-weight: 850;
    padding: 1px 5px;
    border-radius: 4px;
    width: fit-content;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-top: 1px;
}

.slot-booked-status.status-saved {
    background: #e2e8f0;
    color: #475569;
}
.slot-booked-status.status-done {
    background: #dcfce7;
    color: #166534;
}
.slot-booked-status.status-draft {
    background: #fee2e2;
    color: #991b1b;
}

.slot-booked-actions {
    display: flex;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    background: #ffffff;
}

.slot-booked-actions button,
.slot-booked-actions span {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    border: 0;
    background: transparent;
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    font-family: inherit;
}

.btn-action-cancel {
    color: var(--muted);
    border-right: 1px solid rgba(0, 0, 0, 0.04);
}

.btn-action-delete {
    color: #ef4444;
}

.status-cancelled-text {
    color: #94a3b8;
    border-right: 1px solid rgba(0, 0, 0, 0.04);
}

.slot-row-break {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    padding: 8px 10px;
    color: #64748b;
}

.slot-break-time {
    font-size: 10px;
    font-weight: 850;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 3px 6px;
    border-radius: 6px;
    white-space: nowrap;
    color: #334155;
}

.slot-break-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.slot-break-details strong {
    font-size: 11px;
    font-weight: 850;
    color: #334155;
}

.slot-break-details span {
    font-size: 10px;
    color: #64748b;
}

.slots-day-closed {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    color: #64748b;
    text-align: center;
}

.closed-icon {
    width: 20px;
    height: 20px;
    margin-bottom: 6px;
    color: #94a3b8;
}

.slots-day-closed span {
    font-size: 12px;
    font-weight: 850;
}

.slots-no-free {
    font-size: 12px;
    font-weight: 850;
    color: #64748b;
    padding: 8px 0;
    text-align: center;
    border: 1px dashed #e2e8f0;
    border-radius: 10px;
    background: #fafafa;
}

/* --- Notification Badge & Wrapper for Bottom Nav --- */
.nav-icon-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nav-badge {
    position: absolute;
    top: -5px;
    right: -7px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background-color: #ef4444; /* Telegram Red */
    color: #ffffff;
    font-size: 9px;
    font-weight: 900;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.4);
    pointer-events: none;
    display: inline-block;
    z-index: 10;
}

.nav-badge[hidden] {
    display: none !important;
}

/* --- New Appointment Layout Highlights --- */
.appointment-card.status-new {
    border-left: 4px solid #f59e0b !important; /* Premium Amber Left Border */
    border: 1px solid #fde68a !important; /* Elegant Soft Amber Border Outline */
    background: #fffdf9 !important; /* Subtle Warm Background */
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.06) !important; /* Subtle Amber Glow */
    position: relative;
}

/* Breathing indicator dot for new bookings */
.new-badge-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background-color: #f59e0b;
    border-radius: 50%;
    margin-left: 6px;
    position: relative;
    top: -1px;
}

.new-badge-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f59e0b;
    border-radius: 50%;
    animation: pulse-dot 1.8s infinite ease-in-out;
    opacity: 0.6;
}

@keyframes pulse-dot {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(2.8);
        opacity: 0;
    }
}

/* Styled status badge for pending new appointments */
.status-badge.status-pending-new {
    background: #fff7ed !important;
    color: #c2410c !important;
    border: 1px solid #ffedd5 !important;
}

/* Booking slots status in widget for new appointments */
.slot-booked-status.status-pending-new {
    background: #ffedd5 !important;
    color: #c2410c !important;
}

.slot-row-booked.status-new {
    border-left: 3px solid #f59e0b !important;
    background: #fffdf9 !important;
}

/* --- Editable total value styling in Calculator Tab --- */
.total-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.total-value-input {
    display: inline-block;
    width: 140px;
    background: transparent;
    border: none;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.4);
    color: #fff;
    font-family: inherit;
    font-size: 32px;
    line-height: 1;
    font-weight: 800;
    padding: 0;
    margin: 0;
    outline: none;
    transition: border-color 0.2s ease;
    text-align: left;
    -moz-appearance: textfield;
}

.total-value-input::-webkit-outer-spin-button,
.total-value-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.total-value-input:focus {
    border-bottom-color: #fff;
}

.total-value-currency {
    color: #fff;
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
}

/* ─────────────────────────────────────────────────────────── */
/* Fix date/time inputs overflow inside Выходные и перерывы form */
.add-break-form {
    box-sizing: border-box;
    width: 100% !important;
}

.add-break-form .field-line {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.add-break-form input[type="date"],
.add-break-form input[type="time"],
.add-break-form select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    display: block !important;
}

#breakSingleDateBlock,
#breakDateRangeBlock,
#breakTimeRangeBlock {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

#breakDateRangeBlock .field-line,
#breakTimeRangeBlock .field-line {
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Global date input styles safety in .field-line */
.field-line input[type="date"],
.field-line input[type="time"] {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.service-enabled-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-weight: 700;
}

.service-enabled-toggle input {
    flex: 0 0 auto;
}

.service-enabled-toggle span {
    overflow-wrap: anywhere;
}

.schedule-conflicts-panel {
    display: grid;
    gap: 10px;
    margin: 16px 0;
    padding: 12px;
    border: 1px solid rgba(255, 171, 64, 0.42);
    border-radius: 8px;
    background: rgba(255, 171, 64, 0.08);
}

.schedule-conflicts-panel[hidden] {
    display: none;
}

.schedule-conflicts-title {
    color: #ffd59a;
    font-weight: 800;
    font-size: 13px;
}

.schedule-conflicts-list {
    display: grid;
    gap: 8px;
}

.schedule-conflict-item {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    text-align: left;
    font: inherit;
}

.schedule-conflict-item strong,
.schedule-conflict-item span,
.schedule-conflict-item small {
    overflow-wrap: anywhere;
}

.schedule-conflict-item small {
    color: var(--muted);
}

/* Autocomplete container and input group rules */
.autocomplete-container {
    position: relative;
    width: 100%;
    margin-bottom: 12px;
}

.autocomplete-container .sheet-input-group {
    margin-bottom: 0 !important;
}

/* Autocomplete Suggestions for Booking Name Input */
.autocomplete-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(30, 30, 35, 0.75) !important;
    backdrop-filter: blur(25px) saturate(120%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(120%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 16px;
    margin-top: 6px;
    max-height: 180px;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.autocomplete-suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: var(--text, #ffffff) !important;
    transition: background-color 0.2s ease;
}

.autocomplete-suggestion-item:last-child {
    border-bottom: none !important;
}

.autocomplete-suggestion-item:hover,
.autocomplete-suggestion-item.is-active {
    background-color: rgba(255, 255, 255, 0.12) !important;
}

.autocomplete-suggestion-item strong {
    font-weight: 700;
    font-size: 14.5px;
    color: #ffffff !important;
}

.autocomplete-suggestion-item span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6) !important;
    font-weight: 500;
}

#manualAppointmentSheet {
    display: flex !important;
    flex-direction: column !important;
    max-height: 88vh !important;
}

/* Офлайн-плашка */
.offline-badge-container {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    display: none;
    justify-content: center;
    align-items: center;
    width: calc(100% - 32px);
    max-width: 450px;
    background: rgba(20, 24, 33, 0.88);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border: 1.5px solid rgba(240, 125, 16, 0.4);
    border-radius: 16px;
    padding: 10px 16px;
    color: #fcefe3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: slideDownBadge 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideDownBadge {
    from {
        transform: translate(-50%, -60px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.offline-badge-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.offline-badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f07d10;
}

.offline-badge-time {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 500;
    color: #f09848;
}

/* Liquid Glass offline state */
.offline-badge-container {
    top: calc(10px + env(safe-area-inset-top, 0px));
    width: calc(100% - 36px);
    max-width: 520px;
    padding: 1px;
    border: 0;
    border-radius: 26px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08) 44%, rgba(255, 159, 67, 0.24));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(24px) saturate(155%);
    -webkit-backdrop-filter: blur(24px) saturate(155%);
    overflow: hidden;
    text-shadow: none;
}

.offline-badge-container::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 25px;
    background: linear-gradient(135deg, rgba(18, 22, 31, 0.58), rgba(18, 22, 31, 0.34));
    pointer-events: none;
}

.offline-badge-container::after {
    content: "";
    position: absolute;
    top: -48%;
    left: 14%;
    width: 72%;
    height: 90%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.24), transparent 62%);
    opacity: 0.68;
    pointer-events: none;
}

.offline-badge-container {
    touch-action: pan-x pan-y;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out;
}

.offline-badge-container.is-swiping {
    transition: none !important;
}

.offline-badge-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 30px;
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 2px;
    align-items: center;
    justify-content: stretch;
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    text-align: left;
}

.offline-badge-close {
    grid-column: 3;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    outline: none;
}

.offline-badge-close:hover,
.offline-badge-close:active {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transform: scale(1.08);
}

.card-tag.is-offline-pending-tag {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
}

.card-tag.is-offline-conflict-tag {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
}

.offline-badge-icon {
    grid-row: 1 / 3;
    width: 38px;
    height: 38px;
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(255, 177, 94, 0.34), rgba(255, 122, 69, 0.14));
    border: 1px solid rgba(255, 210, 150, 0.32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 20px rgba(255, 122, 69, 0.18);
    color: #ffd9ad;
}

.offline-badge-icon svg {
    width: 18px !important;
    height: 18px !important;
}

.offline-badge-text {
    min-width: 0;
    color: rgba(255, 255, 255, 0.96);
    font-size: 14px;
    font-weight: 760;
    line-height: 1.2;
}

.offline-badge-time {
    min-width: 0;
    color: rgba(255, 218, 178, 0.86);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.25;
    opacity: 1;
}

/* === New & Past Appointments Toggles highlighting === */
.toggle-new-btn {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.12) !important; /* Легкий янтарный фон (Amber) */
    border: 1px solid rgba(245, 158, 11, 0.3) !important; /* Тонкая янтарная рамка */
    border-radius: 12px;
    color: #f59e0b !important; /* Насыщенный янтарный текст */
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
    margin-bottom: 12px;
}

.toggle-new-btn:hover, .toggle-new-btn:active {
    background: rgba(245, 158, 11, 0.18) !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.2);
    transform: translateY(-1px);
}

.toggle-new-btn .toggle-past-arrow {
    width: 18px;
    height: 18px;
    stroke: #f59e0b !important;
    transition: transform 0.3s ease;
}

.toggle-new-btn.is-expanded .toggle-past-arrow {
    transform: rotate(180deg);
}

.toggle-past-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
}

.toggle-past-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.toggle-past-btn .toggle-past-arrow {
    width: 18px;
    height: 18px;
    stroke: rgba(255, 255, 255, 0.75);
    transition: transform 0.3s ease;
}

.toggle-past-btn.is-expanded .toggle-past-arrow {
    transform: rotate(180deg);
}

.new-appointments-wrapper {
    margin-top: 8px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    width: 100%;
}
