* { margin: 0; padding: 0; box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f3f3f3;
}

.welcome {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 24px 56px;
    background-image: url('../assets/welcome-bg.png');
    background-size: cover;
    background-position: center;
    position: relative;
}
.welcome::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,.12), rgba(0,0,0,.5));
}
.welcome-content { position: relative; z-index: 1; text-align: center; }
.welcome-title { color: #fff; font-size: 52px; font-weight: 700; margin-bottom: 12px; }
.welcome-subtitle { color: rgba(255,255,255,.88); font-size: 16px; margin-bottom: 42px; }
.welcome-buttons { display: flex; flex-direction: column; gap: 12px; }

.btn {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 28px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
}
.btn-patient { background: #d4e87a; color: #111; }
.btn-doctor, .btn-black { background: #111; color: #fff; }

.screen {
    min-height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    padding: 12px 16px 28px;
    display: flex;
    flex-direction: column;
    background: #f3f3f3;
}
.back-btn {
    align-self: flex-start;
    background: none;
    border: none;
    font-size: 16px;
    padding: 8px 0 16px;
    cursor: pointer;
}
.screen-title { text-align: center; font-size: 22px; font-weight: 600; margin-bottom: 18px; }
.card { background: #fff; border-radius: 22px; padding: 16px; margin-bottom: 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #6b7280; margin-bottom: 6px; }
.field input {
    width: 100%;
    height: 48px;
    border: 1px solid #ececec;
    border-radius: 24px;
    padding: 0 16px;
    font-size: 16px;
    outline: none;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gender { display: flex; background: #f4f4f4; border-radius: 24px; padding: 4px; }
.gender button {
    flex: 1; height: 40px; border: none; border-radius: 20px;
    background: transparent; font-size: 16px; cursor: pointer;
}
.gender button.active { background: #d4e87a; font-weight: 600; }
.phone-row { display: flex; gap: 8px; }
.phone-prefix {
    height: 48px; min-width: 56px; border-radius: 24px;
    border: 1px solid #ececec; display: flex; align-items: center;
    justify-content: center; background: #fff;
}
.phone-row input { flex: 1; height: 48px; border: 1px solid #ececec; border-radius: 24px; padding: 0 16px; font-size: 16px; }
.error { color: #dc2626; font-size: 13px; margin: 4px 0 10px; }
.link-row { text-align: center; margin-top: 18px; font-size: 14px; color: #6b7280; }
.link-row button { background: none; border: none; font-weight: 700; cursor: pointer; }
.btn-black { margin-top: auto; }
.stub h2 { margin-bottom: 8px; }
.stub p { color: #6b7280; margin-bottom: 20px; }

.home {
    min-height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    padding: 8px 16px 32px;
    background: #f3f3f3;
}

.p-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 52px;
    margin-bottom: 12px;
}
.p-header-title { font-size: 20px; font-weight: 600; }
.p-header-menu { position: absolute; right: 0; }
.p-avatar {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}
.p-dropdown {
    position: absolute;
    right: 0;
    top: 40px;
    width: 200px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    padding: 12px;
    z-index: 10;
}
.p-dropdown-name { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.p-dropdown-exit {
    width: 100%;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: #111;
    color: #fff;
    cursor: pointer;
}

.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}
.home-tile {
    height: 120px;
    border: none;
    border-radius: 24px;
    padding: 16px;
    text-align: left;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}
.tile-pink { background: linear-gradient(180deg, #f7c1d8, #f3b7c8); }
.tile-blue { background: linear-gradient(180deg, #c9e4ff, #b7d6fb); }

.about-row {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 26px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 0 8px;
    margin-bottom: 12px;
    font-size: 16px;
    cursor: pointer;
}
.about-q {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #d4e87a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.about-arrow { margin-left: auto; font-size: 22px; color: #999; padding-right: 8px; }

.about-you h3 { margin-bottom: 10px; font-size: 16px; }
.about-line { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; font-size: 14px; }

.home-cta { margin: 8px 0 22px; }

.history h2 { font-size: 22px; margin-bottom: 12px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
    border: none;
    height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
}
.tab.active { background: #111; color: #fff; }

.empty-box {
    background: #fff;
    border-radius: 18px;
    padding: 18px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.4;
}

.lesion-card { margin-bottom: 16px; }
.lesion-photo-wrap { position: relative; border-radius: 22px; overflow: hidden; }
.lesion-photo { width: 100%; height: 220px; object-fit: cover; display: block; background: #e8d7c8; }
.lesion-placeholder { display: flex; align-items: center; justify-content: center; color: #9a7f6a; }
.lesion-meta {
    position: absolute;
    left: 12px;
    top: 12px;
    color: #fff;
    font-size: 13px;
    text-shadow: 0 1px 4px rgba(0,0,0,.4);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.result-box {
    margin-top: 10px;
    background: #dceeff;
    border-radius: 18px;
    padding: 14px;
}
.result-title { font-weight: 700; margin-bottom: 6px; }
.result-box p, .note-box p { font-size: 14px; line-height: 1.35; }
.note-box {
    margin-top: 10px;
    background: #fff;
    border-radius: 18px;
    padding: 14px;
}
.note-title { font-weight: 700; margin-bottom: 6px; display: flex; justify-content: space-between; }

.quiz {
    min-height: 100dvh;
    max-width: 430px;
    margin: 0 auto;
    padding: 8px 16px 28px;
    background: #f3f3f3;
    display: flex;
    flex-direction: column;
}
.quiz-header {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    align-items: center;
    height: 52px;
}
.quiz-back {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    font-size: 28px;
    cursor: pointer;
}
.quiz-title { text-align: center; font-size: 18px; font-weight: 600; }
.quiz-header .p-header { height: auto; margin: 0; }
.quiz-header .p-header-title { display: none; }

.quiz-progress {
    display: flex;
    gap: 6px;
    margin: 8px 0 16px;
}
.quiz-progress .dot {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: #e5e5e5;
}
.quiz-progress .dot.active { background: #9ad0ff; }

.quiz-body { display: flex; flex-direction: column; flex: 1; }
.quiz-body .card { margin-bottom: 12px; }
.quiz-body h3, .quiz-q {
    font-size: 16px;
    line-height: 1.35;
    margin-bottom: 12px;
}

.radio-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.3;
}

.tan-scale {
    display: flex;
    gap: 6px;
    margin: 8px 0 12px;
}
.tan-seg {
    flex: 1;
    height: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.55;
}
.tan-seg.selected { opacity: 1; outline: 2px solid #111; }
.tan-0 { background: #2f6b3a; }
.tan-1 { background: #c9e87a; }
.tan-2 { background: #8ec8ff; }
.tan-3 { background: #f5b6d0; }
.tan-4 { background: #ff4fa0; }
.tan-label {
    background: #d4e87a;
    border-radius: 14px;
    padding: 12px;
    text-align: center;
    font-size: 14px;
}

.skin-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 14px;
}
.skin-card {
    min-width: 140px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.skin-photo {
    height: 170px;
    border-radius: 18px;
    background: #ddd center/cover no-repeat;
    position: relative;
    border: 3px solid transparent;
}
.skin-card.selected .skin-photo { border-color: #d4e87a; }
.skin-num {
    position: absolute;
    left: 8px;
    bottom: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #d4e87a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}
.skin-desc {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    border: none;
    background: #111;
    color: #fff;
    border-radius: 18px;
    height: 36px;
    padding: 0 12px;
    cursor: pointer;
    font-size: 14px;
}
.chip.active { background: #d4e87a; color: #111; }

.hint {
    font-size: 13px;
    color: #9aa0a6;
    margin: -6px 0 12px;
    line-height: 1.3;
}
.toggle {
    display: inline-flex;
    background: #f4f4f4;
    border-radius: 24px;
    padding: 4px;
}
.toggle-btn {
    min-width: 64px;
    height: 40px;
    border: none;
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
}
.toggle-btn.active {
    background: #d4e87a;
    font-weight: 600;
}

.zone-row {
    width: 100%;
    min-height: 72px;
    margin-bottom: 8px;
    border: none;
    border-bottom: 1px solid #ececec;
    background: transparent;
    text-align: left;
    padding: 0 16px;
    font-size: 14px;
    letter-spacing: 0.04em;
    cursor: pointer;
}
.zone-row.selected {
    background: #eaf7a8;
    border-radius: 16px;
    border-bottom: none;
}
.zone-caption {
    text-align: center;
    margin: 6px 0 12px;
    font-size: 15px;
}
.plus-box {
    height: 120px;
    border: none;
    border-radius: 22px;
    background: #eaf7a8;
    font-size: 36px;
    margin-bottom: 12px;
    cursor: pointer;
}
.preview-wrap { position: relative; margin-bottom: 12px; }
.preview-photo {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 22px;
    display: block;
}
.preview-x {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    cursor: pointer;
    font-size: 18px;
}
.note-input {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 16px;
    background: #eef6ff;
    padding: 0 12px;
    font-size: 14px;
}
.btn-disabled {
    background: #cfcfcf;
    color: #fff;
}

.search-row { display: flex; gap: 10px; margin-bottom: 12px; }
.search-input {
    flex: 1; height: 48px; border: none; border-radius: 24px;
    padding: 0 16px; font-size: 16px; background: #fff;
}
.plus-round {
    width: 48px; height: 48px; border: none; border-radius: 50%;
    background: #111; color: #fff; font-size: 28px; cursor: pointer;
}
.filter-row {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 8px;
}
.fchip {
    flex: 0 0 auto; height: 32px; padding: 0 12px; border-radius: 16px;
    border: none; background: #fff; cursor: pointer; font-size: 13px;
}
.fchip.on { background: #d4e87a; }
.doc-card { background: #fff; border-radius: 22px; padding: 14px; margin-bottom: 10px; }
.doc-card-top {
    width: 100%; display: flex; gap: 10px; align-items: flex-start;
    border: none; background: transparent; text-align: left; cursor: pointer;
}
.risk-dot { color: #d4e87a; font-size: 18px; padding-top: 2px; }
.risk-Intermediate { color: #f5c15b; }
.risk-High { color: #f07167; }
.doc-name { font-weight: 700; margin-bottom: 2px; }
.doc-meta { font-size: 13px; color: #6b7280; }
.chev { margin-left: auto; color: #9aa0a6; font-size: 18px; }
.doc-card-more { margin-top: 12px; }
.doc-diag { font-size: 14px; margin-bottom: 10px; }
.exam-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.exam-tag { border-radius: 12px; padding: 4px 8px; background: #e8f1ff; }
.exam-tag.green { background: #eaf7a8; }

.filter-fields {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.filter-input {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: none;
    border-radius: 18px;
    padding: 0 12px;
    font-size: 13px;
    background: #fff;
}

.skin-radio {
    display: block;
    width: 16px;
    height: 16px;
    margin: 8px auto 0;
    border: 2px solid #cfcfcf;
    border-radius: 50%;
    background: #fff;
}
.skin-radio.on {
    border-color: #111;
    box-shadow: inset 0 0 0 4px #111;
}

.patient-head-row { display: flex; gap: 10px; align-items: flex-start; }
.icon-btn { margin-left: auto; border: none; background: none; font-size: 18px; cursor: pointer; }
.diag-preview { margin-top: 10px; font-size: 14px; color: #4b5563; line-height: 1.35; }
.block-title { font-size: 22px; margin: 8px 0 10px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.compare-item img, .compare-item .lesion-placeholder, .compare-item .plus-box {
    width: 100%; height: 140px; object-fit: cover; border-radius: 16px;
}
.compare-date { font-size: 12px; color: #6b7280; margin: 6px 0; }
.open-link { border: none; background: none; text-decoration: underline; cursor: pointer; }
.text-delete {
    display: block; width: 100%; margin-top: 12px;
    border: none; background: none; text-align: center;
    text-decoration: underline; cursor: pointer; font-size: 16px;
}

.quiz-body {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 170px);
    padding-bottom: 12px;
}

.zone-board {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: auto;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    margin-bottom: 12px;
}

.zone-board-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    pointer-events: none;
    z-index: 0;
    transform: scale(1.15);
}

.quiz-body > .btn {
    margin-top: auto;
}

.zone-board .zone-row:nth-of-type(1) { flex: 36 0 0; }
.zone-board .zone-row:nth-of-type(2) { flex: 36 0 0; }
.zone-board .zone-row:nth-of-type(3) { flex: 28 0 0; border-bottom: none; }

.modal-back {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 20px;
}

.modal-card {
    width: 100%;
    max-width: 340px;
    background: #fff;
    border-radius: 20px;
    padding: 20px 18px 16px;
    text-align: center;
}

.modal-card p {
    margin: 0 0 16px;
    font-size: 16px;
    line-height: 1.35;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-actions .btn {
    flex: 1;
    margin: 0;
}

.btn-light {
    background: #eee;
    color: #111;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.modal-card {
    position: relative;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: #e8e8e8;
}

#root {
    min-height: 100vh;
}

.screen,
.home,
.quiz {
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    margin: 0 auto;
    background: #f3f3f3;
    display: flex;
    flex-direction: column;
}

.date-pill {
    position: relative;
    width: 166px;
    height: 52px;
    padding: 11px 20px;
    border: 1px solid #141415;
    border-radius: 30px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    font-size: 16px;
    color: #141415;
}

.date-pill .date-placeholder {
    color: #b3b3b3;
}

.date-pill .date-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.date-pill .date-native {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    border: 0;
}

.date-wrap { position: relative; }

.cal-pop {
    position: absolute;
    z-index: 20;
    top: 60px;
    left: 0;
    width: 296px;
    min-height: 274px;
    padding: 16px 16px 12px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

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

.cal-month, .cal-year {
    border: 0;
    background: none;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.cal-nav {
    border: 0;
    background: none;
    font-size: 22px;
    cursor: pointer;
    width: 28px;
}

.cal-week, .cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 4px 0;
}

.cal-week span {
    color: #c4c4c4;
    font-size: 12px;
    padding: 4px 0;
}

.cal-day {
    width: 36px;
    height: 36px;
    margin: 0 auto;
    border: 0;
    background: none;
    border-radius: 50%;
    cursor: pointer;
}

.cal-day.on {
    background: #141415;
    color: #fff;
}

.cal-years {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: 210px;
    overflow: auto;
}

.cal-year-cell {
    border: 0;
    background: #f3f3f3;
    border-radius: 12px;
    height: 36px;
    cursor: pointer;
}

.cal-year-cell.on {
    background: #141415;
    color: #fff;
}

.gender-toggle {
    width: 117px;
    height: 55px;
    padding: 5px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    border: 1px solid #141415;
    border-radius: 30px;
    background: #fff;
    gap: 0;
}

.gender-toggle button {
    flex: 1;
    height: 45px;
    border: 0;
    background: transparent;
    border-radius: 50%;
    font-size: 16px;
    color: #141415;
    cursor: pointer;
}

.gender-toggle button.active {
    background: #eaf7a8;
}

.app-head {
    width: 100%;
    min-height: 68px;
    padding: 18px 18px 10px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.app-head .head-back,
.app-head .head-side {
    width: 32px;
    height: 32px;
    border: 0;
    background: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.app-head .head-title {
    flex: 1;
    margin: 0;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

.app-head .head-title {
    flex: 1;
    margin: 0;
    text-align: center;
    font-family: Onest, system-ui, sans-serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 1;
    letter-spacing: 0;
    color: #141415;
}

.screen {
    padding: 0;
}

.screen .app-head {
    margin: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
}

.screen form {
    padding: 16px;
}
.eye-btn {
    border: 0;
    background: none;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.password-wrap {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e5e5e5;
    border-radius: 30px;
    background: #fff;
    padding: 0 12px 0 20px;
    min-height: 52px;
}

.password-wrap input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 16px;
}

.eye-btn {
    flex-shrink: 0;
    border: 0;
    background: none;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}