:root {
    --page-bg: var(--hy-theme-bg, #fbf8ff);
    --card-bg: var(--hy-theme-surface, rgba(255, 255, 255, 0.96));
    --text: var(--hy-theme-text, #282333);
    --muted: var(--hy-theme-muted, #8d879a);
    --line: var(--hy-theme-line, #f0e8fb);
    --primary: var(--hy-theme-primary, #dbc8ff);
    --primary-soft: var(--hy-theme-primary-soft, #f4ebff);
    --primary-deep: var(--hy-theme-primary-deep, #7d57c7);
    --button: var(--hy-theme-button, #7d57c7);
    --danger: var(--hy-theme-danger, #d95d72);
    --shadow: var(--hy-theme-shadow, 0 10px 24px rgba(132, 90, 212, 0.075));
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    display: flex;
    justify-content: center;
    background: #111;
    color: var(--text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
}

button:focus,
input:focus {
    outline: none;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid rgba(125, 87, 199, 0.32);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.agency-center {
    position: relative;
    width: 100%;
    max-width: 430px;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.82),
            rgba(250, 246, 255, 0) 42%
        ),
        var(--page-bg);
}

.hero-bg {
    position: absolute;
    inset: 0 0 auto;
    height: 215px;
    background: var(
        --hy-theme-hero,
        linear-gradient(
            151deg,
            #f0e6ff 0%,
            #fffbff 58%,
            rgba(251, 248, 255, 0.88) 100%
        )
    );
    clip-path: polygon(0 0, 100% 0, 100% 76%, 70% 47%, 40% 58%, 0 78%);
}

.title-bar,
.content,
.home-indicator {
    position: relative;
    z-index: 1;
}

.title-bar {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    align-items: center;
    z-index: 3;
    height: 60px;
    padding: 0 14px;
    direction: ltr;
}

.title-bar h1 {
    margin: 0;
    color: var(--text);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.back-button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 44px;
    height: 44px;
}

.back-button svg {
    width: 28px;
    height: 28px;
}

.back-button path {
    fill: none;
    stroke: var(--text);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.language-switcher {
    position: relative;
    justify-self: end;
}

.language-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 30px;
    border: 1px solid rgba(35, 40, 46, 0.12);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(43, 118, 107, 0.08);
}

.language-menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 7px);
    right: 0;
    display: grid;
    gap: 2px;
    min-width: 72px;
    padding: 5px;
    border: 1px solid rgba(35, 40, 46, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 26px rgba(36, 46, 60, 0.14);
}

.language-menu button {
    min-height: 34px;
    border-radius: 6px;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
}

.language-menu button.is-active {
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 8px 14px 90px;
}

.card {
    width: 100%;
    border-radius: 8px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
}

.profile-card {
    display: flex;
    align-items: center;
    min-height: 103px;
    padding: 16px 18px 16px 24px;
}

.avatar-shell {
    position: relative;
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
}

.avatar-image,
.avatar-fallback {
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.avatar-image {
    display: block;
    object-fit: cover;
}

.avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: var(--primary-deep);
    font-size: 24px;
    font-weight: 950;
}

.profile-copy {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 20px;
}

.name {
    overflow: hidden;
    color: var(--text);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta {
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta {
    margin-top: 6px;
}

.bd-row {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin-top: 7px;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.bd-label {
    flex: 0 0 auto;
    margin-right: 5px;
}

.bd-avatar-shell {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-right: 5px;
}

.bd-avatar-image,
.bd-avatar-fallback {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.bd-avatar-image {
    display: block;
    object-fit: cover;
}

.bd-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 10px;
    font-weight: 950;
}

.bd-short-id {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    margin-left: auto;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.message-button svg {
    width: 25px;
    height: 25px;
}

.message-button path {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.message-unread-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 9px;
    height: 9px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #ff3b30;
}

.salary-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 113px;
    padding: 18px 24px;
}

.salary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.salary-title {
    display: flex;
    align-items: center;
    min-width: 0;
    color: var(--text);
    font-size: 17px;
    font-weight: 900;
}

.salary-title svg {
    width: 17px;
    height: 17px;
    margin-left: 7px;
}

.salary-title circle,
.salary-title path {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2;
}

.salary-link {
    flex: 0 0 auto;
    color: var(--primary-deep);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.salary-value {
    display: flex;
    align-items: center;
    max-width: 100%;
    margin-top: 14px;
    color: #23272d;
    font-size: 34px;
    font-weight: 950;
    line-height: 1.05;
}

.salary-currency {
    flex: 0 0 auto;
    margin-right: 6px;
    color: #f2ad2c;
    font-size: 28px;
    font-weight: 950;
    line-height: 1;
}

.salary-value #currentSalary.skeleton-line {
    width: 160px;
    height: 40px;
    border-radius: 10px;
}

.chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    color: var(--muted);
    font-size: 24px;
    font-weight: 500;
    line-height: 0.8;
}

.menu-card {
    display: grid;
    padding: 0 16px;
}

.menu-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto 24px;
    gap: 12px;
    align-items: center;
    min-height: 64px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

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

.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-deep);
}

.menu-icon svg {
    width: 20px;
    height: 20px;
}

.menu-icon path {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.menu-label {
    min-width: 0;
    overflow: hidden;
    color: #464951;
    font-size: 16px;
    font-weight: 850;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-count {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.menu-count.skeleton-line {
    width: 28px;
    height: 16px;
    border-radius: 7px;
}

.sheet-modal,
.message-modal,
.confirm-modal {
    position: fixed;
    z-index: 24;
    inset: 0;
    display: flex;
    justify-content: center;
}

.sheet-modal {
    align-items: flex-end;
    padding: 0 0 env(safe-area-inset-bottom);
}

.message-modal,
.confirm-modal {
    align-items: center;
    padding: 18px;
}

.confirm-modal {
    z-index: 30;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 21, 28, 0.38);
}

.bottom-sheet {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(430px, 100%);
    max-height: 80vh;
    max-height: 80dvh;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: #fff;
    box-shadow: 0 -14px 34px rgba(23, 31, 42, 0.16);
}

.message-dialog,
.confirm-dialog {
    position: relative;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 18px 44px rgba(23, 31, 42, 0.2);
}

.message-dialog {
    display: flex;
    flex-direction: column;
    width: min(394px, 100%);
    max-height: 78vh;
    max-height: 78dvh;
    border-radius: 14px;
}

.confirm-dialog {
    display: grid;
    gap: 14px;
    width: min(342px, 100%);
    padding: 20px 18px 18px;
    border-radius: 14px;
}

.confirm-dialog h2,
.confirm-dialog p {
    margin: 0;
    text-align: center;
}

.confirm-dialog h2 {
    color: var(--text);
    font-size: 18px;
    font-weight: 950;
    line-height: 1.2;
}

.confirm-dialog p {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.confirm-cancel,
.confirm-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 900;
}

.confirm-cancel {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
}

.confirm-submit {
    background: var(--button);
    color: #fff;
    box-shadow: var(
        --hy-theme-button-shadow,
        0 8px 18px rgba(125, 87, 199, 0.18)
    );
}

.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 950;
    line-height: 1.2;
}

.sheet-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 25px;
    font-weight: 500;
    line-height: 1;
}

.host-list,
.message-list,
.invite-steps {
    display: grid;
    gap: 10px;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 18px max(18px, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
}

.host-row,
.message-card,
.invite-step {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfc;
}

.host-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 10px;
    padding: 14px 18px 0;
}

.host-search input {
    min-width: 0;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    padding: 0 12px;
    font-size: 14px;
    font-weight: 800;
}

.host-search input::placeholder {
    color: #b7b3bf;
}

.host-search button,
.remove-host-button,
.message-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 950;
    white-space: nowrap;
}

.host-search button {
    min-height: 42px;
    background: var(--button);
    color: #fff;
    box-shadow: var(
        --hy-theme-button-shadow,
        0 8px 18px rgba(125, 87, 199, 0.18)
    );
}

.host-search button:disabled {
    background: var(--hy-theme-button-disabled, #c5a6f6);
    box-shadow: none;
}

.invite-status {
    margin: 12px 18px 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 12px;
    font-weight: 850;
    line-height: 1.35;
}

.invite-status.is-error {
    background: #fff0f0;
    color: #c43f3f;
}

.invite-status.is-success {
    background: #ebfbf2;
    color: #128946;
}

.host-row,
.message-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
}

.host-row.is-skeleton {
    pointer-events: none;
}

.host-row.is-skeleton .small-avatar {
    background: transparent;
}

.host-row.is-skeleton .host-name.skeleton-line {
    width: min(148px, 100%);
    height: 18px;
    border-radius: 7px;
}

.host-row.is-skeleton .host-meta.skeleton-line {
    width: min(190px, 100%);
    height: 14px;
    border-radius: 7px;
}

.host-side-skeleton.skeleton-line {
    width: 58px;
    height: 32px;
    border-radius: 8px;
}

.host-user,
.message-user {
    display: flex;
    align-items: center;
    min-width: 0;
}

.small-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-deep);
    font-size: 18px;
    font-weight: 950;
}

.small-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.host-copy,
.message-copy {
    min-width: 0;
    margin-left: 12px;
}

.host-name,
.message-name {
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    font-weight: 950;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.host-meta,
.message-id {
    margin-top: 5px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remove-host-button {
    min-width: 58px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid rgba(217, 93, 114, 0.28);
    color: var(--danger);
}

.message-actions {
    display: flex;
    gap: 6px;
}

.message-action {
    min-width: 54px;
    padding: 0 10px;
}

.message-action:disabled {
    opacity: 0.58;
}

.message-action.agree {
    background: var(--button);
    color: #fff;
}

.message-action.refuse {
    background: #f1edf8;
    color: var(--text);
}

.invite-step {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 13px 12px;
    color: #3d4148;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.42;
}

.invite-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-deep);
    font-size: 14px;
    font-weight: 950;
    line-height: 1;
}

.invite-step p {
    margin: 0;
}

.sheet-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 112px;
    margin: 14px 18px max(18px, env(safe-area-inset-bottom));
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 850;
    text-align: center;
}

.policy-sheet-body {
    min-height: 180px;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

.policy-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border-radius: 8px;
    background: var(--primary-soft);
}

.policy-summary strong {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 17px;
    font-weight: 950;
    line-height: 1.25;
}

.policy-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
}

.policy-empty {
    padding: 22px 10px;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.45;
}

.policy-level-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.policy-level-row {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.policy-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.policy-level {
    color: var(--text);
    font-size: 16px;
    font-weight: 950;
    line-height: 1.25;
}

.policy-effective {
    color: var(--muted);
    text-align: right;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
}

.policy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.policy-cell {
    min-width: 0;
}

.policy-cell-label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}

.policy-cell-value {
    display: block;
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: #292d33;
    font-size: 14px;
    font-weight: 950;
    line-height: 1.25;
}

.modal-open {
    overflow: hidden;
}

.home-indicator {
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 154px;
    height: 5px;
    border-radius: 999px;
    background: #050506;
    transform: translateX(-50%);
}

[dir='rtl'] .content,
[dir='rtl'] .bottom-sheet,
[dir='rtl'] .message-dialog,
[dir='rtl'] .confirm-dialog {
    direction: rtl;
}

[dir='rtl'] .profile-copy {
    margin-right: 20px;
    margin-left: 0;
    text-align: right;
}

[dir='rtl'] .bd-row {
    direction: ltr;
}

[dir='rtl'] .message-button {
    margin-right: auto;
    margin-left: 0;
}

[dir='rtl'] .menu-row {
    text-align: right;
}

[dir='rtl'] .chevron {
    transform: rotate(180deg);
}

[dir='rtl'] .host-copy,
[dir='rtl'] .message-copy {
    margin-right: 12px;
    margin-left: 0;
    text-align: right;
}

@media (max-width: 360px) {
    .content {
        padding-right: 12px;
        padding-left: 12px;
    }

    .profile-card,
    .salary-card {
        padding-right: 18px;
        padding-left: 18px;
    }

    .profile-copy {
        margin-left: 14px;
    }

    .policy-grid {
        grid-template-columns: 1fr;
    }

    .salary-value {
        font-size: 29px;
    }
}
