:root {
    --bg: #f5faf5;
    --bg-soft: #edf5ed;
    --card: #ffffff;
    --line: #e3ebe0;
    --text: #191f18;
    --muted: #7f8a7d;
    --green: #2e7d32;
    --green-dark: #185e20;
    --green-soft: #ecf8e8;
    --green-pale: #f4fbf2;
    --yellow-soft: #fff9e9;
    --yellow-line: #f4df9c;
    --danger: #c62828;
    --shadow-soft: 0 18px 48px rgba(49, 90, 40, 0.08);
    --shadow-card: 0 12px 28px rgba(27, 80, 33, 0.08);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --phone-width: 430px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 8% 10%, rgba(90, 170, 84, 0.08), transparent 22%),
        radial-gradient(circle at 92% 12%, rgba(46, 125, 50, 0.05), transparent 18%),
        linear-gradient(180deg, #f9fcf8 0%, var(--bg) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

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

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

.app-shell,
.auth-shell {
    width: min(100%, 1240px);
    margin: 0 auto;
    padding: 18px 14px 118px;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding-bottom: 24px;
}

.page-section {
    margin-bottom: 18px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

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

.card-soft {
    background: linear-gradient(180deg, #fcfffc, #f5fbf4);
}

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

.eyebrow {
    margin: 0 0 4px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--green);
    text-transform: uppercase;
}

.flash-stack {
    position: sticky;
    top: 10px;
    z-index: 30;
    display: grid;
    gap: 10px;
    width: min(100%, var(--phone-width));
    margin: 0 auto 14px;
}

.flash {
    padding: 14px 16px;
    border-radius: 18px;
    box-shadow: var(--shadow-card);
    border: 1px solid transparent;
    font-size: 0.92rem;
}

.flash-success {
    background: #eef9ee;
    border-color: #d5ecd2;
    color: var(--green-dark);
}

.flash-error {
    background: #fff1f1;
    border-color: #f1d2d2;
    color: #9d2424;
}

.btn,
.btn-secondary,
.btn-ghost,
.btn-danger,
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover,
.btn-secondary:hover,
.btn-ghost:hover,
.btn-danger:hover,
.btn-icon:hover {
    transform: translateY(-1px);
}

.btn {
    min-height: 56px;
    padding: 14px 18px;
    background: linear-gradient(180deg, #2f9835, #2a842f);
    color: #fff;
    box-shadow: 0 14px 24px rgba(46, 125, 50, 0.2);
}

.btn-secondary {
    min-height: 44px;
    padding: 10px 14px;
    background: var(--green-soft);
    color: var(--green-dark);
}

.btn-ghost {
    min-height: 42px;
    padding: 10px 14px;
    background: #fff;
    color: var(--green-dark);
    border: 1px solid var(--line);
}

.btn-danger {
    min-height: 42px;
    padding: 10px 14px;
    background: #fff2f2;
    color: var(--danger);
    border: 1px solid #f3d5d5;
}

.btn-icon {
    width: 42px;
    height: 42px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--green-dark);
}

.btn-block {
    width: 100%;
}

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

.label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.94rem;
    font-weight: 700;
}

.input,
.textarea,
.select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px 16px;
    background: #fff;
    color: var(--text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input[readonly] {
    background: #f5f7f4;
    color: #4f564c;
}

.textarea {
    min-height: 140px;
    resize: none;
}

.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: rgba(46, 125, 50, 0.48);
    box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.11);
}

.field-hint,
.char-counter {
    margin-top: 8px;
    font-size: 0.84rem;
    color: var(--muted);
}

.char-counter {
    text-align: right;
}

.char-counter.is-limit {
    color: #ae6f12;
}

.hidden {
    display: none !important;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 6px 6px 0;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-lockup__logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.brand-lockup h1 {
    margin: 0;
    font-size: 1.36rem;
    line-height: 1.1;
}

.brand-lockup--brand h1 {
    font-size: 1.16rem;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.avatar {
    width: 62px;
    height: 62px;
    border-radius: 999px;
    object-fit: cover;
    background: #eff6ef;
    border: 3px solid #fff;
    box-shadow: 0 8px 20px rgba(27, 94, 32, 0.1);
}

.avatar-sm {
    width: 42px;
    height: 42px;
}

.avatar-link {
    display: inline-flex;
}

.meta {
    color: var(--muted);
    font-size: 0.88rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: #f1f8ef;
    color: var(--green-dark);
    font-size: 0.8rem;
    font-weight: 800;
}

.stack-sm {
    display: grid;
    gap: 6px;
}

.inline-actions,
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 0.88rem;
    font-weight: 800;
}

.list {
    display: grid;
    gap: 12px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
}

.list-item__main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.empty-state {
    padding: 24px 18px;
    text-align: center;
    color: var(--muted);
}

.badge-toast {
    position: fixed;
    right: 16px;
    bottom: 96px;
    z-index: 40;
    display: grid;
    gap: 4px;
    min-width: 210px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #fff7d7, #fff0b6);
    border: 1px solid #f1dea1;
    border-radius: 18px;
    color: #5e4d11;
    box-shadow: 0 16px 30px rgba(177, 132, 25, 0.18);
}

.pwa-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 18px;
}

.pwa-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(19, 34, 19, 0.38);
    backdrop-filter: blur(8px);
}

.pwa-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(calc(100vw - 28px), 390px);
    padding: 22px 18px 18px;
    border-radius: 30px;
    background: linear-gradient(180deg, #ffffff, #fbfdfb);
    border: 1px solid #e4ebe1;
    box-shadow: 0 24px 52px rgba(28, 88, 34, 0.2);
}

.pwa-modal__content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.pwa-modal__icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: #eef8eb;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px #dcebd6;
}

.pwa-modal__icon img {
    width: 44px;
    height: 44px;
}

.pwa-modal__text strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.02rem;
    line-height: 1.25;
    color: var(--green-dark);
}

.pwa-modal__text p {
    margin: 0;
    color: #667164;
    font-size: 0.9rem;
    line-height: 1.5;
}

.pwa-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.pwa-modal__button {
    flex: 1 1 0;
    min-height: 48px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    width: min(calc(100% - 18px), 450px);
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(225, 233, 223, 0.9);
    box-shadow: 0 22px 40px rgba(40, 95, 48, 0.12);
    backdrop-filter: blur(14px);
    z-index: 35;
}

.bottom-nav a {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 5px;
    min-height: 62px;
    padding: 8px 4px;
    border-radius: 18px;
    color: #535e51;
    font-size: 0.8rem;
    font-weight: 700;
}

.bottom-nav__icon {
    display: block;
    font-size: 1.18rem;
    line-height: 1;
}

.bottom-nav a.is-active {
    color: var(--green-dark);
}

.bottom-nav a.is-active .bottom-nav__label {
    color: var(--green-dark);
}

.nav-badge {
    position: absolute;
    top: 6px;
    right: 10px;
    min-width: 18px;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--green-dark);
    color: #fff;
    font-size: 0.7rem;
}

.auth-mobile {
    background: linear-gradient(180deg, #fbfdf9 0%, #eef5ee 100%);
}

.mobile-scene {
    width: 100%;
    min-height: calc(100vh - 48px);
    display: grid;
    place-items: center;
    padding: 24px 0;
}

.phone-card {
    position: relative;
    width: min(calc(100vw - 28px), var(--phone-width));
    min-height: 740px;
    border-radius: 38px;
    background: linear-gradient(180deg, #ffffff, #fbfdfb);
    border: 1px solid rgba(232, 239, 230, 0.85);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.phone-card--tight {
    min-height: 700px;
}

.phone-card__inner {
    position: relative;
    z-index: 2;
    padding: 26px 24px 30px;
    min-height: inherit;
    display: flex;
    flex-direction: column;
}

.phone-card__center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.phone-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
    font-size: 0.92rem;
}

.back-link__arrow {
    font-size: 1.9rem;
    line-height: 1;
    margin-top: -2px;
}

.step-title {
    margin: 0 auto;
    color: #8e958a;
    font-size: 1rem;
    font-weight: 700;
}

.portal-screen {
    text-align: center;
}

.portal-screen__logo {
    width: min(100%, 100%);
    max-width: 100%;
    height: auto;
    margin: 0 auto 26px;
}

.portal-screen__subtitle {
    margin-bottom: 24px;
    font-size: 1.06rem;
    color: #404a3d;
}

.brand-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 999px;
    background: linear-gradient(180deg, #2d9433, #24782a);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 10px 18px rgba(46, 125, 50, 0.18);
}

.leaf-spark,
.leaf-spark::before,
.leaf-spark::after {
    position: absolute;
    border-radius: 999px 999px 999px 0;
    background: linear-gradient(180deg, #8bd86f, #5faf42);
    content: "";
}

.leaf-spark {
    width: 18px;
    height: 18px;
    bottom: 158px;
    left: 58px;
    transform: rotate(-28deg);
}

.leaf-spark::before {
    width: 12px;
    height: 12px;
    bottom: 16px;
    left: 20px;
}

.leaf-spark::after {
    width: 14px;
    height: 14px;
    bottom: 4px;
    left: 36px;
}

.leaf-spark--right {
    right: 66px;
    left: auto;
    bottom: 174px;
    transform: rotate(18deg);
}

.leaf-spark--right::before {
    left: -20px;
}

.leaf-spark--right::after {
    left: -42px;
}

.droplet-buddy {
    position: relative;
    width: 138px;
    height: 172px;
    margin: 48px auto 0;
}

.droplet-buddy__body {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 118px;
    height: 150px;
    background: linear-gradient(180deg, #a0de61, #74c540);
    border-radius: 60% 60% 52% 52% / 64% 64% 40% 40%;
    transform: rotate(3deg);
}

.droplet-buddy__body::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 28px;
    width: 62px;
    height: 62px;
    background: inherit;
    transform: rotate(45deg);
    border-radius: 18px;
}

.droplet-buddy__face {
    position: absolute;
    left: 50%;
    bottom: 42px;
    transform: translateX(-50%);
    width: 80px;
    height: 58px;
}

.droplet-buddy__eye {
    position: absolute;
    top: 8px;
    width: 16px;
    height: 22px;
    border-radius: 999px;
    background: #0f2110;
}

.droplet-buddy__eye::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #fff;
}

.droplet-buddy__eye--left {
    left: 14px;
}

.droplet-buddy__eye--right {
    right: 14px;
}

.droplet-buddy__mouth {
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 34px;
    height: 22px;
    transform: translateX(-50%);
    border-radius: 0 0 999px 999px;
    background: #0d1d0e;
}

.droplet-buddy__mouth::after {
    content: "";
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 3px;
    height: 9px;
    border-radius: 999px 999px 7px 7px;
    background: #ff9d98;
}

.droplet-buddy__blush {
    position: absolute;
    bottom: 20px;
    width: 14px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 136, 106, 0.54);
}

.droplet-buddy__blush--left {
    left: 6px;
}

.droplet-buddy__blush--right {
    right: 6px;
}

.droplet-buddy__arm {
    position: absolute;
    bottom: 48px;
    width: 44px;
    height: 18px;
    border-radius: 999px;
    background: #5aa730;
}

.droplet-buddy__arm--left {
    left: -8px;
    transform: rotate(34deg);
}

.droplet-buddy__arm--right {
    right: -8px;
    transform: rotate(-34deg);
}

.droplet-buddy__leg {
    position: absolute;
    bottom: 4px;
    width: 18px;
    height: 34px;
    border-radius: 999px;
    background: #2f7e24;
}

.droplet-buddy__leg--left {
    left: 44px;
}

.droplet-buddy__leg--right {
    right: 44px;
}

.droplet-buddy__shadow {
    position: absolute;
    left: 50%;
    bottom: -2px;
    width: 92px;
    height: 12px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(27, 94, 32, 0.08);
}

.login-panel {
    text-align: center;
}

.login-panel h1,
.login-panel h2,
.onboard-panel h1,
.welcome-panel h1 {
    margin-bottom: 8px;
    font-size: 2.15rem;
    line-height: 1.12;
}

.login-panel h2,
.onboard-panel h1,
.welcome-panel h1 {
    font-size: 1.85rem;
}

.login-panel__hint {
    margin-bottom: 24px;
    font-size: 1rem;
    color: #525c50;
}

.qr-panel {
    position: relative;
    width: 216px;
    height: 216px;
    margin: 0 auto 26px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    background: #fff;
    overflow: hidden;
}

.qr-panel::before,
.qr-panel::after,
.qr-panel__corner::before,
.qr-panel__corner::after {
    content: "";
    position: absolute;
    width: 34px;
    height: 34px;
    border: 5px solid #3bb33d;
    border-radius: 10px;
    z-index: 3;
}

.qr-panel::before {
    top: 0;
    left: 0;
    border-right: 0;
    border-bottom: 0;
}

.qr-panel::after {
    top: 0;
    right: 0;
    border-left: 0;
    border-bottom: 0;
}

.qr-panel__corner::before {
    bottom: 0;
    left: 0;
    border-right: 0;
    border-top: 0;
}

.qr-panel__corner::after {
    right: 0;
    bottom: 0;
    border-left: 0;
    border-top: 0;
}

.qr-panel__code {
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: grid;
    place-items: center;
    border-radius: 28px;
    overflow: hidden;
    background: #fff;
}

#qr-reader {
    border: 0 !important;
}

#qr-reader > div {
    border: 0 !important;
}

#qr-reader__scan_region {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
}

#qr-reader__scan_region video,
#qr-reader__scan_region img,
#qr-reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: 28px;
}

#qr-reader__dashboard {
    display: none !important;
}

.scan-feedback {
    margin: 14px auto 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f7fbf6;
    border: 1px solid #e3ece0;
    color: #5d675a;
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: left;
}

.scan-feedback--error {
    background: #fff3f3;
    border-color: #f0d1d1;
    color: #9f2a2a;
}

.scan-feedback--success {
    background: #eef9ee;
    border-color: #d7ebd2;
    color: var(--green-dark);
}

.input-shell {
    text-align: left;
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

.password-field {
    position: relative;
}

.password-field .input {
    padding-right: 54px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #80897d;
    font-size: 1rem;
    cursor: pointer;
}

.mini-link {
    display: inline-flex;
    justify-content: center;
    margin: 6px auto 0;
    font-size: 0.92rem;
    color: #63a15f;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.subtle-footer-link {
    display: inline-flex;
    justify-content: center;
    margin-top: 18px;
    font-size: 0.9rem;
    color: #7d8b7a;
}

.onboard-panel {
    text-align: center;
}

.onboard-panel__subtitle {
    margin-bottom: 26px;
    font-size: 1.02rem;
    color: #4d574a;
}

.avatar-upload {
    position: relative;
    width: 224px;
    margin: 0 auto 18px;
}

.avatar-upload__preview {
    width: 224px;
    height: 224px;
    border-radius: 999px;
    object-fit: cover;
    background: #f6f6f6;
    border: 1px solid #edf0ed;
    box-shadow: inset 0 0 0 10px #fafafa;
}

.avatar-upload__trigger {
    position: absolute;
    right: 22px;
    bottom: 14px;
    width: 64px;
    height: 64px;
    border-radius: 999px;
    background: linear-gradient(180deg, #24912b, #196c20);
    color: #fff;
    display: grid;
    place-items: center;
    border: 6px solid #f9fcf8;
    box-shadow: 0 10px 20px rgba(38, 125, 50, 0.24);
    font-size: 1.45rem;
    cursor: pointer;
}

.helper-text {
    font-size: 0.96rem;
    color: #7a8478;
}

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.onboarding-dots span {
    display: block;
    width: 18px;
    height: 10px;
    border-radius: 999px;
    background: #d9e7d7;
}

.onboarding-dots span.is-active {
    width: 32px;
    background: linear-gradient(90deg, #4bb446, #2b892f);
}

.motto-box {
    position: relative;
}

.motto-box .textarea {
    min-height: 210px;
    padding: 22px 18px 34px;
    font-size: 1rem;
    line-height: 1.5;
}

.password-rules {
    display: grid;
    gap: 10px;
    margin: 4px 0 8px;
    text-align: left;
}

.password-rules__item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4d574a;
    font-size: 0.95rem;
}

.password-rules__check {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #2d9733;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.86rem;
    font-weight: 800;
}

.welcome-panel {
    position: relative;
    text-align: center;
}

.confetti-dots {
    position: absolute;
    inset: 10px 0 auto;
    height: 190px;
    pointer-events: none;
}

.confetti-dots span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    opacity: 0.95;
}

.badge-medal {
    width: 154px;
    height: 154px;
    margin: 34px auto 18px;
    position: relative;
}

.badge-medal__star {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 128px;
    height: 128px;
    background: linear-gradient(180deg, #ffd87b, #f4b848);
    clip-path: polygon(50% 0%, 61% 14%, 78% 8%, 82% 26%, 98% 32%, 89% 47%, 100% 62%, 83% 68%, 78% 88%, 60% 82%, 50% 100%, 39% 82%, 20% 88%, 17% 68%, 0% 62%, 12% 47%, 2% 32%, 17% 26%, 22% 8%, 39% 14%);
    display: grid;
    place-items: center;
    box-shadow: 0 16px 26px rgba(222, 162, 34, 0.24);
}

.badge-medal__core {
    width: 78px;
    height: 78px;
    border-radius: 999px;
    background: linear-gradient(180deg, #2ea634, #17631d);
    display: grid;
    place-items: center;
}

.badge-medal__core img {
    width: 44px;
    height: 44px;
}

.badge-medal__ribbon {
    position: absolute;
    bottom: 2px;
    width: 34px;
    height: 54px;
    background: linear-gradient(180deg, #1d7523, #105218);
}

.badge-medal__ribbon--left {
    left: 40px;
    clip-path: polygon(0 0, 100% 0, 78% 100%, 0 76%);
}

.badge-medal__ribbon--right {
    right: 40px;
    clip-path: polygon(0 0, 100% 0, 100% 76%, 22% 100%);
}

.badge-highlight {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f0faeb, #ecf7e9);
    border: 1px solid #d9ecd2;
    font-size: 1.06rem;
    font-weight: 900;
    text-align: left;
}

.badge-highlight__icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffe082, #f0b53f);
    display: grid;
    place-items: center;
    color: #5c4709;
}

.app-mobile {
    width: min(100%, 430px);
    margin: 0 auto;
}

.app-panel {
    position: relative;
    background: linear-gradient(180deg, #ffffff, #fbfdfb);
    border-radius: 34px;
    border: 1px solid #e6ede3;
    box-shadow: var(--shadow-soft);
    padding: 12px 12px 94px;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px 12px;
}

.app-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header__brand img {
    width: 34px;
    height: 34px;
}

.app-header__brand strong {
    font-size: 1.02rem;
    font-weight: 900;
}

.bell-button,
.square-button {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    border: 1px solid #e8eee6;
    background: #fff;
    display: grid;
    place-items: center;
    color: var(--green-dark);
    font-size: 1.08rem;
    box-shadow: 0 8px 18px rgba(28, 88, 34, 0.05);
}

.app-header__action-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 7px 10px 7px 9px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e8eee6;
    box-shadow: 0 8px 18px rgba(28, 88, 34, 0.05);
}

.app-header__action-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef8eb;
    color: var(--green-dark);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.app-header__action-text {
    display: grid;
    line-height: 1.05;
}

.app-header__action-text strong {
    font-size: 0.78rem;
    font-weight: 900;
    color: var(--green-dark);
}

.app-header__action-text small {
    font-size: 0.62rem;
    color: #7d8679;
}

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

.notice-card,
.prompt-card,
.status-card,
.timeline-card,
.friend-action-card {
    border-radius: 24px;
    border: 1px solid #e9eee6;
    background: #fff;
    box-shadow: 0 10px 24px rgba(30, 86, 35, 0.05);
    padding: 16px;
}

.notice-card {
    background: linear-gradient(180deg, #edf9e7, #e9f7e2);
    border-color: #d6eacd;
}

.prompt-card {
    background: linear-gradient(180deg, #fffdf4, #fff9ea);
    border-color: #f4e5b5;
}

.status-card__textarea {
    min-height: 116px;
    padding-bottom: 52px;
}

.status-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: -44px;
    position: relative;
    z-index: 2;
}

.post-inline-btn {
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 0.92rem;
}

.section-title {
    margin: 2px 0 0;
    font-size: 0.98rem;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.timeline-list {
    display: grid;
    gap: 12px;
}

.timeline-card {
    padding: 14px;
}

.timeline-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.timeline-card__profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.reaction-pill {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid #e4ebe2;
    background: #fff;
    color: var(--green-dark);
    font-size: 0.84rem;
    font-weight: 700;
}

.reaction-pill.active {
    background: #ecf8e8;
    border-color: #d7ebd2;
}

.friend-actions {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.friend-action-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.friend-action-card__icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: #eef8eb;
    color: var(--green);
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    font-weight: 900;
}

.underline-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 14px;
    border-bottom: 1px solid #edf1eb;
}

.underline-tabs a {
    padding: 10px 4px 12px;
    text-align: center;
    font-size: 0.84rem;
    font-weight: 800;
    color: #7b8478;
    border-bottom: 3px solid transparent;
}

.underline-tabs a.is-active {
    color: var(--green-dark);
    border-bottom-color: var(--green);
}

.friend-request-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 4px;
}

.friend-request-row + .friend-request-row {
    border-top: 1px solid #eef2ec;
}

.friend-request-row__profile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.friend-request-row__school {
    color: #80897d;
    font-size: 0.84rem;
}

.small-btn {
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 14px;
    font-size: 0.9rem;
}

.qr-box {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 24px;
    border: 1px dashed #cde2c7;
    background: #fbfefb;
}

.qr-canvas {
    width: 210px;
    min-height: 210px;
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: 24px;
    border: 1px solid #e5ece2;
    background: #fff;
}

.scanner {
    min-height: 220px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
}

.notification-item.is-unread {
    background: linear-gradient(180deg, #f4fbf4, #fff);
    border-color: #d9ead5;
}

.icon-dot {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--green-soft);
    color: var(--green-dark);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.badge-card {
    padding: 16px 14px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff, #fbfefb);
    text-align: center;
    display: grid;
    gap: 10px;
}

.badge-card.locked {
    opacity: 0.75;
    background: #f8faf8;
}

.badge-card.is-highlighted {
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.16), 0 18px 28px rgba(27, 94, 32, 0.12);
    transform: translateY(-2px);
}

.badge-card--legendary {
    position: relative;
    border-color: rgba(229, 184, 61, 0.9);
    background:
        radial-gradient(circle at top, rgba(255, 236, 171, 0.62), transparent 45%),
        linear-gradient(180deg, #fffdf5, #fff3cc);
    box-shadow: 0 18px 34px rgba(192, 146, 31, 0.18);
}

.badge-card--epic {
    position: relative;
    border-color: rgba(163, 120, 220, 0.72);
    background:
        radial-gradient(circle at top, rgba(225, 212, 247, 0.68), transparent 44%),
        linear-gradient(180deg, #fcfaff, #f4effd);
    box-shadow: 0 18px 34px rgba(123, 86, 180, 0.14);
}

.badge-card--epic::after {
    content: "Langka";
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #d8c2ff, #bf98ff);
    color: #5d3f8f;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.badge-card--legendary::after {
    content: "Prestisius";
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f8d873, #e2aa2e);
    color: #6b4b0f;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.01em;
}

.badge-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    border-radius: 20px;
    background: linear-gradient(180deg, #fff7dc, #f8e5a0);
}

.badge-icon--legendary {
    width: 72px;
    height: 72px;
    font-size: 2.1rem;
    background: linear-gradient(180deg, #ffe89e, #e8b23c);
    color: #6a4a0c;
    box-shadow: 0 12px 24px rgba(210, 157, 34, 0.28);
}

.badge-icon--epic {
    width: 68px;
    height: 68px;
    font-size: 1.95rem;
    background: linear-gradient(180deg, #eadcff, #cfb1ff);
    color: #5f3d8f;
    box-shadow: 0 12px 24px rgba(122, 88, 178, 0.22);
}

.pill--epic {
    background: linear-gradient(180deg, #efe5ff, #dcc7ff);
    color: #5b3d88;
}

.pill--legendary {
    background: linear-gradient(180deg, #fff0bd, #ffe08a);
    color: #77520d;
}

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

.progress-bar {
    height: 12px;
    border-radius: 999px;
    background: #e6efe4;
    overflow: hidden;
}

.progress-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #62ba66, var(--green));
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-hero .avatar {
    width: 88px;
    height: 88px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-box {
    padding: 14px;
    border-radius: 16px;
    background: #f8fcf8;
    border: 1px solid var(--line);
    text-align: center;
}

.stat-box strong {
    display: block;
    color: var(--green-dark);
    font-size: 1.24rem;
}

.profile-stats-trigger {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid #dcebd6;
    border-radius: 18px;
    background: linear-gradient(180deg, #f3fbee, #edf8e8);
    text-align: left;
}

.profile-stats-trigger strong,
.profile-stats-trigger small {
    display: block;
}

.profile-stats-trigger strong {
    color: var(--green-dark);
    font-size: 1rem;
}

.profile-stats-trigger small {
    margin-top: 4px;
    color: #748072;
    font-size: 0.82rem;
    font-weight: 600;
}

.profile-stats-trigger__icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #fff;
    color: var(--green-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(28, 88, 34, 0.08);
}

.profile-accordion-list {
    display: grid;
    gap: 14px;
}

.profile-accordion {
    padding: 0;
    overflow: hidden;
}

.profile-accordion__toggle {
    width: 100%;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.profile-accordion__toggle small {
    display: block;
    margin-bottom: 6px;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.profile-accordion__toggle strong {
    font-size: 1.02rem;
}

.profile-accordion__chevron {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #e4ece2;
    background: #f7fbf7;
    color: var(--green-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
    flex-shrink: 0;
}

.profile-accordion.is-open .profile-accordion__chevron {
    background: #ecf8e8;
    border-color: #d7ebd2;
}

.profile-accordion__content {
    padding: 0 18px 18px;
    border-top: 1px solid #edf2eb;
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: grid;
    place-items: center;
    padding: 16px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(21, 40, 22, 0.28);
    backdrop-filter: blur(6px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(calc(100vw - 28px), 408px);
    border-radius: 32px;
    border: 1px solid #e5ece2;
    background: linear-gradient(180deg, #ffffff, #fbfdfb);
    box-shadow: 0 24px 48px rgba(28, 88, 34, 0.16);
    padding: 22px 18px 18px;
}

.modal-card--social {
    padding-top: 14px;
}

.badge-unlock-modal {
    z-index: 58;
}

.badge-unlock-card {
    overflow: hidden;
    text-align: center;
    padding-top: 26px;
    animation: badgeCardPop 0.42s ease;
}

.badge-unlock-card--legendary {
    background:
        radial-gradient(circle at top, rgba(255, 224, 136, 0.44), transparent 45%),
        linear-gradient(180deg, #fffdf8, #fff6de);
    border-color: rgba(234, 192, 78, 0.92);
    box-shadow: 0 26px 56px rgba(191, 145, 28, 0.24);
}

.badge-unlock-card--epic {
    background:
        radial-gradient(circle at top, rgba(219, 198, 255, 0.42), transparent 45%),
        linear-gradient(180deg, #fffefe, #f5efff);
    border-color: rgba(171, 130, 226, 0.84);
    box-shadow: 0 24px 52px rgba(120, 86, 178, 0.18);
}

.badge-unlock-card__glow {
    position: absolute;
    top: -24px;
    left: 50%;
    width: 180px;
    height: 180px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: radial-gradient(circle, rgba(121, 214, 106, 0.28) 0%, rgba(121, 214, 106, 0) 70%);
    pointer-events: none;
}

.badge-unlock-card--legendary .badge-unlock-card__glow {
    background: radial-gradient(circle, rgba(255, 213, 84, 0.34) 0%, rgba(255, 213, 84, 0) 72%);
}

.badge-unlock-card--epic .badge-unlock-card__glow {
    background: radial-gradient(circle, rgba(186, 145, 255, 0.32) 0%, rgba(186, 145, 255, 0) 72%);
}

.badge-unlock-card__confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.badge-unlock-card__confetti span {
    position: absolute;
    width: 8px;
    height: 14px;
    border-radius: 999px;
    opacity: 0.9;
    animation: badgeConfettiFloat 2.1s ease forwards;
}

.badge-unlock-card__confetti span:nth-child(1) { top: 18px; left: 32px; background: #5dc163; }
.badge-unlock-card__confetti span:nth-child(2) { top: 38px; right: 44px; background: #ffd45f; animation-delay: 0.08s; }
.badge-unlock-card__confetti span:nth-child(3) { top: 76px; left: 20px; background: #8cd28a; animation-delay: 0.14s; }
.badge-unlock-card__confetti span:nth-child(4) { top: 84px; right: 26px; background: #eab443; animation-delay: 0.18s; }
.badge-unlock-card__confetti span:nth-child(5) { top: 118px; left: 58px; background: #b9df78; animation-delay: 0.24s; }
.badge-unlock-card__confetti span:nth-child(6) { top: 124px; right: 62px; background: #4aa74c; animation-delay: 0.3s; }

.badge-unlock-card--legendary .badge-unlock-card__confetti span:nth-child(1),
.badge-unlock-card--legendary .badge-unlock-card__confetti span:nth-child(2),
.badge-unlock-card--legendary .badge-unlock-card__confetti span:nth-child(3),
.badge-unlock-card--legendary .badge-unlock-card__confetti span:nth-child(4),
.badge-unlock-card--legendary .badge-unlock-card__confetti span:nth-child(5),
.badge-unlock-card--legendary .badge-unlock-card__confetti span:nth-child(6) {
    background: linear-gradient(180deg, #ffe389, #dba12c);
}

.badge-unlock-card--epic .badge-unlock-card__confetti span:nth-child(1),
.badge-unlock-card--epic .badge-unlock-card__confetti span:nth-child(2),
.badge-unlock-card--epic .badge-unlock-card__confetti span:nth-child(3),
.badge-unlock-card--epic .badge-unlock-card__confetti span:nth-child(4),
.badge-unlock-card--epic .badge-unlock-card__confetti span:nth-child(5),
.badge-unlock-card--epic .badge-unlock-card__confetti span:nth-child(6) {
    background: linear-gradient(180deg, #dec7ff, #b58bff);
}

.badge-unlock-card__icon {
    position: relative;
    z-index: 1;
    width: 88px;
    height: 88px;
    margin: 6px auto 14px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    background: linear-gradient(180deg, #f1ffe8, #d9f5c9);
    color: var(--green-dark);
    box-shadow: 0 16px 28px rgba(46, 125, 50, 0.16);
    animation: badgeIconPulse 1.9s ease;
}

.badge-unlock-card__icon--epic {
    width: 92px;
    height: 92px;
    font-size: 2.85rem;
    background: linear-gradient(180deg, #efe3ff, #cfafff);
    color: #5b378f;
    box-shadow: 0 18px 32px rgba(129, 91, 192, 0.22);
}

.badge-unlock-card__icon--legendary {
    width: 98px;
    height: 98px;
    font-size: 3rem;
    background: linear-gradient(180deg, #ffe69b, #ebb53d);
    color: #6e4d0f;
    box-shadow: 0 18px 32px rgba(207, 152, 29, 0.28);
}

.badge-unlock-card h2 {
    margin-bottom: 10px;
    font-size: 1.85rem;
    line-height: 1.1;
}

.badge-unlock-card__message {
    margin: 0 auto;
    max-width: 300px;
    color: #556052;
    font-size: 0.98rem;
    line-height: 1.6;
}

.badge-unlock-card__actions {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.modal-card__header,
.social-page-header {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.modal-card__header h2,
.social-page-header h1 {
    margin: 0;
    text-align: center;
    font-size: 1.5rem;
    line-height: 1.18;
}

.modal-card__spacer {
    width: 42px;
    height: 42px;
}

.modal-back-button {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 0;
    background: transparent;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.social-stats-card {
    padding: 18px;
}

.social-stats-list {
    display: grid;
    gap: 10px;
}

.social-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 12px 10px;
    border-radius: 18px;
    background: #fff;
}

.social-stats-row__main {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    font-weight: 700;
}

.social-stats-row__icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #edf8e8;
    color: var(--green-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.02rem;
    flex-shrink: 0;
}

.social-stats-row strong {
    color: var(--text);
    font-size: 1.28rem;
}

.social-stats-note {
    margin: 14px 0 18px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #f7fbf6;
    border: 1px solid #e5eee2;
    color: #667164;
    font-size: 0.9rem;
    line-height: 1.55;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

th {
    font-size: 0.82rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.small {
    font-size: 0.86rem;
}

.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

@keyframes badgeCardPop {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(16px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes badgeIconPulse {
    0% {
        transform: scale(0.82);
    }
    44% {
        transform: scale(1.06);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes badgeConfettiFloat {
    0% {
        transform: translateY(-8px) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 0.95;
    }
    100% {
        transform: translateY(46px) rotate(24deg);
        opacity: 0;
    }
}

@media (max-width: 640px) {
    .app-shell,
    .auth-shell {
        padding-left: 10px;
        padding-right: 10px;
    }

    .phone-card {
        width: min(calc(100vw - 18px), 420px);
        min-height: 712px;
    }

    .phone-card__inner {
        padding-left: 20px;
        padding-right: 20px;
    }

    .list-item {
        flex-direction: column;
        align-items: stretch;
    }

    .friend-request-row {
        flex-direction: column;
        align-items: stretch;
    }

    .friend-request-row .inline-actions {
        justify-content: flex-end;
    }

    .pwa-modal__actions {
        flex-direction: column;
    }
}
