* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: #f4f6f8;
    color: #222;
    font-family: Arial, sans-serif;
    transition: background-color 0.25s ease, color 0.25s ease;
}

body.theme-night {
    background: #0d1721;
    color: #edf4ff;
}

body.theme-night .messenger-layout {
    background: #101d29;
    box-shadow: 0 0 30px rgba(2, 7, 12, 0.5);
}

body.theme-night .messenger-sidebar,
body.theme-night .conversation,
body.theme-night .workspace-view,
body.theme-night .workspace-header,
body.theme-night .chat-search,
body.theme-night .settings-card,
body.theme-night .subscription-card,
body.theme-night .currency-converter,
body.theme-night .city-weather-form,
body.theme-night .city-weather-card,
body.theme-night .city-weather-card .weather-detail,
body.theme-night .message-form,
body.theme-night .reaction-total-card,
body.theme-night .reaction-breakdown-item,
body.theme-night .chat-list-item,
body.theme-night .message-bubble,
body.theme-night .message-empty {
    background: #182734;
    border-color: #2a3d4d;
    color: #edf4ff;
}

body.theme-night .sidebar-brand,
body.theme-night .sidebar-section-button,
body.theme-night .local-clock,
body.theme-night .conversation-name,
body.theme-night .conversation-person h2,
body.theme-night .chat-list-title-row strong,
body.theme-night .message-text,
body.theme-night .city-weather-heading h2,
body.theme-night .city-temperature,
body.theme-night .weather-detail strong,
body.theme-night .city-currency-rate strong,
body.theme-night .workspace-header h1,
body.theme-night .subscription-card h2,
body.theme-night .converter-intro,
body.theme-night .setting-row strong,
body.theme-night .reaction-breakdown-title,
body.theme-night .reaction-breakdown-item strong,
body.theme-night .reaction-total-card div strong,
body.theme-night .subscription-current strong,
body.theme-night .subscription-card-footer strong,
body.theme-night .utility-note,
body.theme-night .city-weather-form > label,
body.theme-night .city-weather-heading p,
body.theme-night .city-currency-rate span,
body.theme-night .weather-copy strong,
body.theme-night .chat-search input,
body.theme-night .currency-field,
body.theme-night .amount-field,
body.theme-night .message-form input,
body.theme-night .city-search-controls input,
body.theme-night .currency-field select,
body.theme-night .amount-field input {
    color: #edf4ff;
}

body.theme-night .sidebar-brand-mark,
body.theme-night .city-condition-icon,
body.theme-night .empty-chat-icon,
body.theme-night .list-avatar,
body.theme-night .conversation-avatar {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

body.theme-night .chat-search,
body.theme-night .chat-search input,
body.theme-night .city-search-controls input,
body.theme-night .message-form input,
body.theme-night .currency-field select,
body.theme-night .amount-field input,
body.theme-night .setting-select {
    background: #121f2b;
    border-color: #2a3d4d;
}

body.theme-night .chat-list-preview,
body.theme-night .utility-note,
body.theme-night .reaction-total-card div span,
body.theme-night .subscription-current small,
body.theme-night .setting-row small,
body.theme-night .message-time,
body.theme-night .conversation-status,
body.theme-night .city-search-status,
body.theme-night .subscription-card ul,
body.theme-night .weather-copy small,
body.theme-night .workspace-eyebrow,
body.theme-night .chat-list-time,
body.theme-night .reaction-period,
body.theme-night .city-weather-heading p,
body.theme-night .weather-detail span,
body.theme-night .city-currency-rate span,
body.theme-night .currency-field,
body.theme-night .amount-field,
body.theme-night .rate-controls p,
body.theme-night .rate-updated,
body.theme-night .city-search-status,
body.theme-night .city-weather-description {
    color: #aabac7;
}

body.theme-night .message-bubble {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

body.theme-night .message-row.is-outgoing .message-bubble {
    background: linear-gradient(180deg, #1d78b3 0%, #145a93 100%);
}

body.theme-night .message-row:not(.is-outgoing) .message-bubble {
    background: #1d2f3d;
}

body.theme-night .sidebar-section-button:hover,
body.theme-night .sidebar-section-button.is-active {
    background: rgba(22, 138, 205, 0.18);
    color: #a9dcff;
}

body.theme-night .section-icon,
body.theme-night .sidebar-brand,
body.theme-night .weather-widget {
    color: #d9ecff;
}

body.theme-night .local-clock,
body.theme-night .weather-copy strong,
body.theme-night .weather-copy small {
    color: #edf4ff;
}

body.theme-night .chat-search kbd,
body.theme-night .reaction-badge,
body.theme-night .subscription-current {
    background: rgba(22, 138, 205, 0.18);
    color: #d8ecff;
}

.page-header {
    padding: 18px 20px;
    background: #007bff;
    color: #fff;
    text-align: center;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
}

.welcome-container {
    width: min(430px, calc(100% - 32px));
    margin: 48px auto;
    padding: 24px;
    border: 2px solid #323232;
    border-radius: 5px;
    background: #d3d3d3;
    box-shadow: 4px 4px #323232;
    text-align: center;
}

.welcome-container h2 {
    margin: 0 0 14px;
    color: #323232;
    font-size: 22px;
}

.welcome-container p {
    margin: 0 0 12px;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

.welcome-actions {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.oauthButton {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    border: 2px solid #323232;
    border-radius: 5px;
    background: #fff;
    box-shadow: 4px 4px #323232;
    color: #323232;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.oauthButton:hover {
    transform: translate(-1px, -1px);
    background: #212121;
    color: #fff;
}

.oauthButton:focus-visible {
    outline: 3px solid #2d8cf0;
    outline-offset: 3px;
}

@media (max-width: 480px) {
    .welcome-container {
        margin: 32px auto;
        padding: 20px 16px;
    }
}

.visually-hidden {
    width: 1px;
    height: 1px;
    position: absolute;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.messenger-layout {
    width: 100%;
    height: var(--app-viewport-height, 100vh);
    min-height: var(--app-viewport-height, 100vh);
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    margin: 0;
    overflow: hidden;
    background: #fff;
    box-shadow: none;
}

@supports (height: 100dvh) {
    .messenger-layout {
        height: var(--app-viewport-height, 100dvh);
        min-height: var(--app-viewport-height, 100dvh);
    }
}

.messenger-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e1e7ed;
    background: #fff;
}

.sidebar-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 14px;
}

.sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #172c3d;
    font-size: 19px;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-brand-mark {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #168acd;
    color: #fff;
    font-size: 16px;
}

.local-info {
    min-width: 0;
    display: grid;
    justify-items: end;
    gap: 2px;
}

.local-clock {
    color: #263a49;
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.weather-widget {
    max-width: 150px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #788690;
    cursor: pointer;
    text-align: left;
}

.weather-widget-wrap {
    position: relative;
}

.weather-details {
    width: min(290px, calc(100vw - 24px));
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    gap: 11px;
    padding: 15px;
    border: 1px solid #dce5eb;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(30, 49, 63, 0.18);
    color: #263a49;
    text-align: left;
}

.weather-widget-wrap:hover .weather-details:not([hidden]),
.weather-widget-wrap:focus-within .weather-details:not([hidden]) {
    display: grid;
}

.weather-details[hidden] {
    display: none;
}

.weather-details h2 {
    margin: 0;
    color: #263a49;
    font-size: 13px;
}

.weather-details dl {
    display: grid;
    gap: 9px;
    margin: 0;
}

.weather-details dl > div {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
}

.weather-details dt {
    color: #788690;
    font-size: 11px;
}

.weather-details dd {
    margin: 0;
    color: #263a49;
    font-size: 11px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

body.theme-night .weather-details {
    border-color: #2a3d4d;
    background: #182734;
    color: #edf4ff;
}

body.theme-night .weather-details h2,
body.theme-night .weather-details dd {
    color: #edf4ff;
}

body.theme-night .weather-details dt {
    color: #aabac7;
}

.weather-widget:hover:not(:disabled) {
    color: #137eb9;
}

.weather-widget:disabled {
    cursor: wait;
}

.weather-widget:focus-visible {
    outline: 2px solid #168acd;
    outline-offset: 3px;
}

.weather-icon {
    flex: 0 0 auto;
    color: #d39b29;
    font-size: 13px;
}

.weather-copy {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.weather-copy strong,
.weather-copy small {
    overflow: hidden;
    max-width: 120px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weather-copy strong {
    color: #536572;
    font-size: 10px;
    font-weight: 600;
}

.weather-copy small {
    color: #89959e;
    font-size: 9px;
}

.home-link {
    color: #73818d;
    font-size: 12px;
    text-decoration: none;
}

.home-link:hover,
.conversation-home:hover {
    color: #168acd;
}

.chat-search {
    height: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 4px 14px 17px;
    padding: 0 10px;
    border: 1px solid #e2e8ed;
    border-radius: 5px;
    background: #f4f7f9;
    color: #7e8b95;
}

.chat-search > span:first-child {
    font-size: 20px;
    line-height: 1;
}

.chat-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #253847;
    font: inherit;
    font-size: 13px;
}

.chat-search input::placeholder {
    color: #89959e;
}

.chat-search:focus-within {
    border-color: #168acd;
    background: #fff;
}

.user-search-form {
    display: grid;
    gap: 7px;
    margin: -8px 14px 14px;
}

.user-search-controls {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px 0 10px;
    border: 1px solid #e2e8ed;
    border-radius: 5px;
    background: #fff;
    color: #7e8b95;
}

.user-search-controls:focus-within {
    border-color: #168acd;
}

.user-search-controls input {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #253847;
    font: inherit;
    font-size: 12px;
}

.user-search-controls button {
    width: 32px;
    min-width: 32px;
    min-height: 32px;
    border: 0;
    border-radius: 4px;
    background: #eaf4fa;
    color: #137eb9;
    font-size: 19px;
    cursor: pointer;
}

.user-search-controls button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.user-search-status {
    margin: 0 2px;
    color: #788690;
    font-size: 10px;
    line-height: 1.4;
}

.user-search-results {
    max-height: 220px;
    display: grid;
    gap: 4px;
    overflow-y: auto;
}

.user-search-results[hidden] {
    display: none;
}

.user-search-result {
    min-width: 0;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 8px;
    border: 1px solid #e5e9ed;
    border-radius: 5px;
    background: #fff;
}

.user-search-result-details {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.user-search-result-details strong,
.user-search-result-details small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-search-result-details strong {
    color: #263a49;
    font-size: 11px;
}

.user-search-result-details small {
    color: #788690;
    font-size: 10px;
}

.user-search-result-details .user-search-relation {
    color: #137eb9;
}

.user-search-action {
    min-height: 36px;
    flex: 0 0 auto;
    padding: 0 9px;
    border: 1px solid #cde4f0;
    border-radius: 4px;
    background: #eaf4fa;
    color: #137eb9;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.user-search-action:hover {
    border-color: #168acd;
    background: #dff0f8;
}

body.theme-night .user-search-controls,
body.theme-night .user-search-result {
    border-color: #2a3d4d;
    background: #182734;
}

body.theme-night .user-search-controls input,
body.theme-night .user-search-result-details strong {
    color: #edf4ff;
}

body.theme-night .user-search-result-details small,
body.theme-night .user-search-status {
    color: #aabac7;
}

body.theme-night .user-search-result-details .user-search-relation,
body.theme-night .user-search-controls button,
body.theme-night .user-search-action {
    background: rgba(22, 138, 205, 0.18);
    color: #d9ecff;
}

.chat-search kbd {
    flex: 0 0 auto;
    padding: 2px 4px;
    border: 1px solid #dce3e8;
    border-radius: 3px;
    background: #fff;
    color: #89959e;
    font: 10px Arial, sans-serif;
}

.list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px 9px;
    color: #74828d;
    font-size: 12px;
    font-weight: 700;
}

.chat-count {
    color: #96a1a9;
    font-size: 11px;
    font-weight: 400;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.sidebar-account {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-top: 1px solid #e1e7ed;
    color: #536572;
    font-size: 12px;
}

.sidebar-account span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account button {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid #dce4e9;
    border-radius: 4px;
    background: transparent;
    color: #536572;
    font: inherit;
    cursor: pointer;
}

.sidebar-account button:hover {
    border-color: #168acd;
    color: #137eb9;
}

body.theme-night .sidebar-account {
    border-color: #2a3d4d;
    color: #edf4ff;
}

body.theme-night .sidebar-account button {
    border-color: #2a3d4d;
    color: #d9ecff;
}

.chat-list-item {
    width: 100%;
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border: 0;
    border-left: 3px solid transparent;
    background: #fff;
    color: #263a49;
    cursor: pointer;
    text-align: left;
}

.chat-list-item:hover {
    background: #f5f8fa;
}

.chat-list-item.is-active {
    border-left-color: #168acd;
    background: #eaf4fa;
}

.list-avatar,
.conversation-avatar {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
}

.list-avatar {
    width: 46px;
    height: 46px;
}

.avatar-coral {
    background: #f5ddd6;
    color: #a85443;
}

.avatar-yellow {
    background: #f4e9c9;
    color: #886a20;
}

.avatar-green {
    background: #d9eee2;
    color: #35734f;
}

.avatar-blue {
    background: #dceaf6;
    color: #3d7197;
}

.chat-list-details {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 5px;
}

.chat-list-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.chat-list-title-row strong {
    overflow: hidden;
    color: #263a49;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-list-time {
    flex: 0 0 auto;
    color: #89959e;
    font-size: 10px;
}

.chat-list-preview {
    overflow: hidden;
    color: #788690;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-empty {
    padding: 15px 18px;
    color: #788690;
    font-size: 13px;
    text-align: center;
}

.sidebar-note {
    margin: 0;
    padding: 12px 14px;
    border-top: 1px solid #edf0f2;
    color: #89959e;
    font-size: 10px;
    line-height: 1.5;
    text-align: center;
}

.conversation {
    min-width: 0;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #e9eff3;
    background-image: radial-gradient(#d8e2e8 0.7px, transparent 0.7px);
    background-size: 16px 16px;
}

.conversation-active {
    min-height: 0;
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.message-drop-overlay {
    position: absolute;
    z-index: 4;
    inset: 78px 16px 86px;
    display: grid;
    place-items: center;
    border: 2px dashed #168acd;
    border-radius: 10px;
    background: rgba(234, 244, 250, 0.94);
    color: #126fa3;
    font-size: 15px;
    font-weight: 700;
    pointer-events: none;
}

.message-drop-overlay[hidden] {
    display: none;
}

.conversation-active.is-file-dragging .message-list {
    filter: saturate(0.75);
}

body.theme-night .message-drop-overlay {
    border-color: #65c5fa;
    background: rgba(18, 31, 43, 0.96);
    color: #d9ecff;
}

.conversation-header {
    min-height: 66px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    border-bottom: 1px solid #dce4e9;
    background: #fff;
}

.conversation-avatar {
    width: 40px;
    height: 40px;
}

.conversation-person {
    min-width: 0;
    flex: 1;
}

.conversation-person h2 {
    overflow: hidden;
    margin: 0 0 4px;
    color: #263a49;
    font-size: 15px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-person p {
    margin: 0;
    color: #89959e;
    font-size: 11px;
}

.conversation-home {
    color: #788690;
    font-size: 22px;
    text-decoration: none;
}

.mobile-back {
    display: none;
}

.message-list {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding: 22px clamp(16px, 5vw, 68px);
}

.date-divider {
    align-self: center;
    margin: 2px 0 12px;
}

.date-divider span {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    background: rgba(91, 112, 127, 0.64);
    color: #fff;
    font-size: 10px;
}

.message-row {
    display: flex;
    justify-content: flex-start;
}

.message-row.is-outgoing {
    justify-content: flex-end;
}

.message-bubble {
    position: relative;
    max-width: min(76%, 480px);
    padding: 9px 11px 6px;
    border: 1px solid #e5ebef;
    border-radius: 7px 7px 7px 2px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(36, 55, 69, 0.06);
    overflow-wrap: anywhere;
}

.is-outgoing .message-bubble {
    border-color: #c8e5d5;
    border-radius: 7px 7px 2px 7px;
    background: #e1f3e8;
}

.message-text {
    margin: 0;
    color: #293d4c;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.message-time {
    display: block;
    margin-top: 4px;
    color: #89959e;
    font-size: 10px;
    text-align: right;
}

.message-empty {
    align-self: center;
    margin: auto;
    color: #74828d;
    font-size: 13px;
}

.message-form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    border-top: 1px solid #dce4e9;
    background: #fff;
}

.message-form input {
    min-width: 0;
    min-height: 42px;
    flex: 1;
    padding: 0 13px;
    border: 1px solid #e0e6eb;
    border-radius: 5px;
    outline: none;
    background: #f8fafb;
    color: #263a49;
    font: inherit;
    font-size: 13px;
}

.message-form input:focus {
    border-color: #168acd;
    background: #fff;
}

.message-form button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 14px;
    border: 0;
    border-radius: 5px;
    background: #168acd;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.message-form button:hover {
    background: #0d75b3;
}

.message-form button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.message-status {
    flex: 0 0 auto;
    margin: 0;
    padding: 5px 16px;
    background: #fff;
    color: #536572;
    font-size: 11px;
    line-height: 1.4;
}

.message-status[hidden] {
    display: none;
}

.message-attachment-button {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid #dce4e9 !important;
    background: #fff !important;
    color: #536572 !important;
    font-size: 24px !important;
    font-weight: 400 !important;
}

.message-attachment-button:hover:not(:disabled) {
    border-color: #168acd !important;
    color: #137eb9 !important;
}

.message-attachment {
    display: block;
    max-width: 100%;
    margin-top: 7px;
    padding: 9px 11px;
    border: 1px solid #dce5eb;
    border-radius: 5px;
    background: #f7fafc;
    color: #137eb9;
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.message-media {
    display: block;
    width: min(100%, 360px);
    max-height: 340px;
    margin-top: 8px;
    border-radius: 5px;
    background: #edf2f5;
    object-fit: contain;
}

.message-media-image {
    height: auto;
}

.message-audio {
    display: block;
    width: min(100%, 360px);
    max-width: 100%;
    margin-top: 8px;
}

.message-attachment:hover {
    text-decoration: underline;
}

.message-reactions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
}

.message-reaction {
    min-height: 30px;
    padding: 3px 8px;
    border: 1px solid #dbe5eb;
    border-radius: 15px;
    background: #fff;
    color: #425968;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.message-reaction.is-active {
    border-color: #168acd;
    background: #eaf4fa;
    color: #126fa3;
}

.reaction-picker {
    position: relative;
}

.reaction-picker summary {
    width: 34px;
    min-height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid #dbe5eb;
    border-radius: 50%;
    background: #fff;
    color: #536572;
    cursor: pointer;
    list-style: none;
}

.reaction-picker summary::-webkit-details-marker {
    display: none;
}

.reaction-picker-options {
    position: absolute;
    z-index: 5;
    bottom: calc(100% + 6px);
    left: 0;
    display: none;
    gap: 3px;
    padding: 5px;
    border: 1px solid #dce5eb;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(28, 48, 68, 0.14);
}

.reaction-picker[open] .reaction-picker-options {
    display: flex;
}

.reaction-picker-options button {
    width: 38px;
    min-height: 40px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

.reaction-picker-options button:hover {
    background: #eaf4fa;
}

body.theme-night .message-attachment {
    border-color: #2a3d4d;
    background: #121f2b;
    color: #a9dcff;
}

body.theme-night .message-reaction,
body.theme-night .reaction-picker summary,
body.theme-night .reaction-picker-options {
    border-color: #2a3d4d;
    background: #182734;
    color: #d9ecff;
}

body.theme-night .message-reaction.is-active {
    background: rgba(22, 138, 205, 0.24);
    color: #d9ecff;
}

body.theme-night .message-status {
    background: #182734;
    color: #d9ecff;
}

.mobile-back:focus-visible,
.chat-list-item:focus-visible,
.message-form button:focus-visible,
.conversation-home:focus-visible {
    outline: 2px solid #168acd;
    outline-offset: -2px;
}

@media (max-width: 700px) {
    .messenger-layout {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .conversation {
        display: none;
    }

    .messenger-layout.show-conversation .messenger-sidebar {
        display: none;
    }

    .messenger-layout.show-conversation .conversation {
        display: flex;
    }

    .conversation-active {
        height: 100%;
    }

    .message-drop-overlay {
        inset: 72px 10px 76px;
        font-size: 13px;
    }

    .message-form {
        position: relative;
        z-index: 2;
        flex: 0 0 auto;
        gap: 7px;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    }

    .message-form input[type="text"] {
        min-height: 44px;
        font-size: 16px;
    }

    .message-attachment-button {
        width: 42px;
        min-width: 42px;
        flex: 0 0 42px;
    }

    .message-form button[type="submit"] {
        width: 44px;
        min-width: 44px;
        flex: 0 0 44px;
    }

    .mobile-back {
        width: 32px;
        height: 38px;
        display: grid;
        place-items: center;
        padding: 0;
        border: 0;
        background: transparent;
        color: #168acd;
        font-size: 30px;
        cursor: pointer;
    }

    .message-list {
        padding-inline: 16px;
    }
}

@media (max-width: 420px) {
    .sidebar-header {
        min-height: 72px;
        padding-inline: 12px;
    }

    .conversation-header {
        gap: 8px;
        padding-inline: 10px;
    }

    .message-form {
        gap: 6px;
        padding-inline: 8px;
    }
}

.conversation-empty {
    min-height: 0;
    flex: 1;
    display: grid;
    align-content: center;
    justify-items: center;
    padding: 24px;
    text-align: center;
}

.conversation-empty[hidden],
.conversation-active[hidden],
.workspace-view[hidden],
.utility-section[hidden] {
    display: none;
}

.empty-chat-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border: 1px solid #cbd8e0;
    border-radius: 50%;
    background: #fff;
    color: #168acd;
    font-size: 25px;
}

.conversation-empty h1 {
    margin: 18px 0 7px;
    color: #263a49;
    font-size: 20px;
}

.conversation-empty p {
    margin: 0;
    color: #788690;
    font-size: 13px;
}

.sidebar-sections {
    display: grid;
    gap: 3px;
    padding: 0 10px 14px;
}

.sidebar-section-button {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #536572;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}

.sidebar-section-button:hover,
.sidebar-section-button.is-active {
    background: #eaf4fa;
    color: #137eb9;
}

.section-icon {
    width: 22px;
    color: #71818c;
    font-size: 17px;
    text-align: center;
}

.reaction-icon {
    color: #d9656a;
}

.reaction-badge {
    min-width: 22px;
    min-height: 20px;
    display: grid;
    place-items: center;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 10px;
    background: #fbe7e7;
    color: #be5359;
    font-size: 11px;
    font-weight: 700;
}

.workspace-view {
    min-width: 0;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f5f7f9;
}

.workspace-header {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 30px;
    border-bottom: 1px solid #e1e7ed;
    background: #fff;
}

.workspace-eyebrow {
    margin: 0 0 4px;
    color: #89959e;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.workspace-header h1 {
    margin: 0;
    color: #263a49;
    font-size: 18px;
}

.workspace-content {
    width: min(720px, 100%);
    flex: 1;
    overflow-y: auto;
    padding: 28px 30px;
}

.settings-card {
    overflow: hidden;
    border: 1px solid #e0e6eb;
    border-radius: 6px;
    background: #fff;
}

.setting-row {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    cursor: pointer;
}

.setting-row + .setting-row {
    border-top: 1px solid #edf0f2;
}

.setting-row strong,
.setting-row small {
    display: block;
}

.setting-row strong {
    margin-bottom: 5px;
    color: #263a49;
    font-size: 13px;
}

.setting-row small {
    color: #89959e;
    font-size: 11px;
}

.setting-switch {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    accent-color: #168acd;
    cursor: pointer;
}

.setting-select {
    min-height: 36px;
    max-width: 160px;
    padding: 0 9px;
    border: 1px solid #dce4e9;
    border-radius: 4px;
    background: #fff;
    color: #263a49;
    font: inherit;
    font-size: 12px;
}

.utility-note {
    margin: 13px 2px 0;
    color: #89959e;
    font-size: 11px;
    line-height: 1.5;
}

.subscription-current {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 16px;
    padding: 15px 17px;
    border: 1px solid #dfe8ee;
    border-radius: 6px;
    background: #fff;
}

.current-plan-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #96a4ae;
}

.subscription-current.is-plus .current-plan-dot {
    background: #e5a938;
}

.subscription-current strong,
.subscription-current small {
    display: block;
}

.subscription-current strong {
    margin-bottom: 4px;
    color: #263a49;
    font-size: 13px;
}

.subscription-current small {
    color: #89959e;
    font-size: 11px;
}

.subscription-card {
    padding: 22px;
    border: 1px solid #dfe8ee;
    border-radius: 6px;
    background: #fff;
}

.subscription-card-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9a6a16;
}

.subscription-star {
    font-size: 18px;
}

.subscription-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
}

.subscription-card h2 {
    margin: 13px 0 14px;
    color: #263a49;
    font-size: 17px;
}

.subscription-card ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 18px;
    color: #687985;
    font-size: 12px;
}

.subscription-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #edf0f2;
}

.subscription-card-footer p {
    margin: 0;
    color: #89959e;
    font-size: 11px;
}

.currency-converter {
    max-width: 560px;
    padding: 22px;
    border: 1px solid #dfe8ee;
    border-radius: 6px;
    background: #fff;
}

.city-weather-form {
    max-width: 560px;
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid #dfe8ee;
    border-radius: 6px;
    background: #fff;
}

.city-weather-form > label {
    display: block;
    margin-bottom: 9px;
    color: #263a49;
    font-size: 13px;
    font-weight: 700;
}

.city-search-controls {
    display: flex;
    gap: 8px;
}

.city-search-controls input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    flex: 1;
    padding: 0 11px;
    border: 1px solid #dce4e9;
    border-radius: 4px;
    color: #263a49;
    font: inherit;
    font-size: 12px;
}

.city-search-controls input:focus {
    border-color: #168acd;
    outline: 2px solid rgba(22, 138, 205, 0.15);
}

.city-search-controls .primary-action {
    min-height: 40px;
    flex: 0 0 auto;
}

.city-search-status {
    margin: 9px 0 0;
    color: #788690;
    font-size: 11px;
    line-height: 1.45;
}

.city-weather-card {
    max-width: 560px;
    display: grid;
    gap: 15px;
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid #dfe8ee;
    border-radius: 6px;
    background: #fff;
}

.city-weather-card[hidden] {
    display: none;
}

.city-weather-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.city-condition-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fff4d8;
    color: #d39b29;
    font-size: 24px;
}

.city-weather-heading h2 {
    margin: 0 0 4px;
    color: #263a49;
    font-size: 14px;
}

.city-weather-heading p {
    margin: 0;
    color: #788690;
    font-size: 11px;
}

.city-temperature {
    margin-left: auto;
    color: #263a49;
    font-size: 22px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.city-weather-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding-top: 13px;
    border-top: 1px solid #edf0f2;
}

.weather-detail {
    padding: 10px 12px;
    border: 1px solid #edf0f2;
    border-radius: 6px;
    background: #f9fbfc;
}

.weather-detail span {
    display: block;
    color: #7a8a94;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.weather-detail strong {
    display: block;
    margin-top: 5px;
    color: #263a49;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.city-currency-rate {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 13px;
    border-top: 1px solid #edf0f2;
}

.city-currency-rate span {
    color: #788690;
    font-size: 11px;
}

.city-currency-rate strong {
    color: #1c5679;
    font-size: 13px;
    text-align: right;
}

.converter-intro {
    margin: 0 0 20px;
    color: #263a49;
    font-size: 15px;
    font-weight: 700;
}

.amount-field,
.currency-field {
    min-width: 0;
    display: grid;
    gap: 7px;
    color: #71808b;
    font-size: 11px;
}

.amount-field input,
.currency-field select {
    width: 100%;
    min-height: 42px;
    padding: 0 11px;
    border: 1px solid #dce4e9;
    border-radius: 4px;
    background: #fff;
    color: #263a49;
    font: inherit;
    font-size: 13px;
}

.amount-field input:focus,
.currency-field select:focus {
    border-color: #168acd;
    outline: 2px solid rgba(22, 138, 205, 0.15);
}

.currency-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr);
    align-items: end;
    gap: 9px;
    margin-top: 15px;
}

.swap-currencies {
    width: 38px;
    height: 38px;
    border: 1px solid #dce4e9;
    border-radius: 4px;
    background: #f5f8fa;
    color: #536572;
    font-size: 19px;
    cursor: pointer;
}

.swap-currencies:hover {
    border-color: #168acd;
    color: #168acd;
}

.conversion-result {
    display: grid;
    gap: 8px;
    margin-top: 21px;
    padding: 17px;
    border-radius: 5px;
    background: #eaf4fa;
}

.conversion-result > span {
    color: #607584;
    font-size: 12px;
}

.conversion-result > strong {
    overflow-wrap: anywhere;
    color: #1c5679;
    font-size: 25px;
    font-variant-numeric: tabular-nums;
}

.rate-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.rate-controls p {
    margin: 0;
    color: #788690;
    font-size: 11px;
    line-height: 1.4;
}

.refresh-rates {
    min-height: 34px;
    flex: 0 0 auto;
    padding: 0 12px;
    border: 1px solid #dce4e9;
    border-radius: 4px;
    background: #fff;
    color: #536572;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.refresh-rates:hover:not(:disabled) {
    border-color: #168acd;
    color: #137eb9;
}

.refresh-rates:disabled {
    opacity: 0.55;
    cursor: wait;
}

.rate-updated {
    margin: 8px 0 0;
    color: #89959e;
    font-size: 10px;
}

.subscription-card-footer strong {
    color: #263a49;
    font-size: 17px;
}

.primary-action {
    min-height: 38px;
    padding: 0 13px;
    border: 0;
    border-radius: 4px;
    background: #168acd;
    color: #fff;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.primary-action:hover {
    background: #0d75b3;
}

.reaction-total-card {
    min-height: 120px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid #e5e9ed;
    border-radius: 6px;
    background: #fff;
}

.reaction-total-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #fbe8e8;
    color: #d45f65;
    font-size: 26px;
}

.reaction-total-card div {
    display: grid;
    gap: 5px;
}

.reaction-total-card div strong {
    color: #263a49;
    font-size: 25px;
}

.reaction-total-card div span {
    color: #788690;
    font-size: 12px;
}

.reaction-period {
    margin-left: auto;
    color: #89959e;
    font-size: 11px;
}

.reaction-breakdown-title {
    margin: 25px 0 10px;
    color: #536572;
    font-size: 12px;
}

.reaction-breakdown {
    display: grid;
    gap: 7px;
}

.reaction-breakdown-item {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 13px;
    border: 1px solid #e5e9ed;
    border-radius: 5px;
    background: #fff;
    color: #687985;
    font-size: 12px;
}

.reaction-breakdown-icon {
    font-size: 17px;
}

.reaction-breakdown-item strong {
    margin-left: auto;
    color: #263a49;
}

.message-reactions {
    display: flex;
    gap: 4px;
    margin-top: 5px;
}

.message-reaction {
    padding: 2px 5px;
    border: 1px solid #dbe5eb;
    border-radius: 10px;
    background: #fff;
    font-size: 11px;
}

@media (max-width: 700px) {
    .workspace-header {
        min-height: 68px;
        gap: 8px;
        padding-inline: 12px;
    }

    .workspace-content {
        padding: 18px 14px;
    }
}

@media (max-width: 420px) {
    .city-search-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .subscription-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .setting-row {
        padding-inline: 13px;
    }
}