* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: #bcbcbc;
    color: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 412px;
    height: 100vh;
    max-height: 892px;
    background-color: #dddddd;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border: 2px solid #555555;
    border-radius: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    margin: 20px auto;
}

.app-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 90px;
    padding: 36px 24px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 11;
    background: transparent;
}

.app-title {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #bcbcbc;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
}

.fade-overlay-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 105px;
    background: linear-gradient(to bottom, #dddddd 60%, rgba(221, 221, 221, 0) 100%);
    z-index: 10;
    pointer-events: none;
}

.fade-overlay-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 115px;
    background: linear-gradient(to top, #dddddd 60%, rgba(221, 221, 221, 0) 100%);
    z-index: 10;
    pointer-events: none;
}

.content-area {
    width: 100%;
    flex-grow: 1; 
    overflow-y: auto;
    padding: 95px 24px 105px 24px; 
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: none;
    position: relative;
    z-index: 1;
}

.content-area::-webkit-scrollbar {
    display: none;
}

.tr-card {
    background-color: #ffffff;
    border: 1px solid #bcbcbc;
    border-radius: 24px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: box-shadow 0.2s ease;
}

#smart-card {
    cursor: default;
}

.tr-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.card-label {
    font-size: 12px;
    font-weight: 500;
    color: #888888;
    margin-bottom: 12px;
}

.total-amount {
    font-size: 42px;
    font-weight: 500;
    color: #4a9e61;
    letter-spacing: -1px;
}

.goals-list, .income-list, .expense-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.goal-item, .income-item, .expense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
}

.goal-values {
    display: flex;
    align-items: center;
    gap: 12px;
}

.goal-amount {
    min-width: 65px;
    text-align: right;
    font-weight: 500;
}

.price-orange {
    color: #ff6b00;
    font-weight: 600;
    font-size: 14px;
    min-width: 42px;
    text-align: right;
    display: inline-block;
}

.price-green { color: #4a9e61; }
.price-red { color: #d94141; }

.smart-content { display: flex; flex-direction: column; gap: 12px; }
.smart-text { font-size: 16px; line-height: 1.4; }

.card-divider {
    height: 1px;
    background-color: #bcbcbc;
    margin: 12px 0;
    width: 100%;
}

.app-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 96px;
    padding: 0 24px 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: transparent;
    z-index: 11;
}

.input-bar-container {
    background-color: #ffffff;
    border: 1px solid #bcbcbc;
    border-radius: 26px;
    display: flex;
    align-items: flex-end;
    padding: 12px 18px;
    gap: 12px;
    max-height: 150px;
    transition: none;
    width: 100%;
}

.input-bar-container:focus-within {
    transform: none;
    box-shadow: none;
}

.input-bar-container textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 15px;
    color: inherit;
    resize: none;
    font-family: inherit;
    line-height: 1.4;
    padding: 2px 0;
    min-height: 22px;
    max-height: 120px;
    overflow-y: auto;
}

.input-bar-container textarea::placeholder { color: #888888; }

.icon-btn {
    background: transparent;
    border: none;
    color: currentColor;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-btn {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

#send-btn.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    background-color: #ffffff;
    width: 100%;
    height: 85%;
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    touch-action: none;
}

.modal-overlay.active .bottom-sheet {
    transform: translateY(0);
}

.drag-handle-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 16px 0 8px 0;
    cursor: pointer;
}

.drag-handle {
    width: 40px;
    height: 5px;
    background-color: #bbbbbb;
    border-radius: 3px;
}

.sheet-header {
    height: 60px;
    padding: 12px 24px 0 24px;
    display: flex;
    align-items: center;
}

.sheet-content {
    flex: 1;
    padding: 12px 24px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.balance-section {
    margin-top: 12px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}

.big-green { font-size: 42px; }

.options-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-item {
    background: transparent;
    border: none;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 4px;
    cursor: pointer;
}

.option-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.option-text {
    font-size: 16px;
    font-weight: 500;
    color: #000000;
}

.sheet-slider {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.sheet-slides {
    display: flex;
    width: 300%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.sheet-slide {
    width: 33.333%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sheet-slider:not(.profile-tree-slider)[data-active-slide="0"] .sheet-slides { transform: translateX(0%); }
.sheet-slider:not(.profile-tree-slider)[data-active-slide="1"] .sheet-slides { transform: translateX(-33.333%); }
.sheet-slider:not(.profile-tree-slider)[data-active-slide="2"] .sheet-slides { transform: translateX(-66.666%); }

.profile-tree-slider .sheet-slides {
    width: 200%;
}

.profile-tree-slider .main-settings-slide {
    width: 50%;
}

.profile-tree-slider .branch-slides-container {
    width: 50%;
    position: relative;
    height: 100%;
}

.profile-tree-slider .branch-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

.profile-tree-slider.show-branch-1 .appearance-branch-slide { opacity: 1; pointer-events: auto; }
.profile-tree-slider.show-branch-2 .editprofile-branch-slide { opacity: 1; pointer-events: auto; }
.profile-tree-slider.show-branch-3 .apikey-branch-slide { opacity: 1; pointer-events: auto; }
.profile-tree-slider.show-branch-4 .reset-branch-slide { opacity: 1; pointer-events: auto; }

.profile-tree-slider[data-active-slide="0"] .sheet-slides {
    transform: translateX(0%);
}

.profile-tree-slider[data-active-slide="1"] .sheet-slides {
    transform: translateX(-50%);
}

.edit-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #bcbcbc;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    background-color: #ffffff;
    margin-top: 8px;
    transition: border-color 0.2s ease;
}

.edit-input.input-invalid {
    border-color: #d94141 !important;
    border-width: 2px;
}

.error-msg {
    color: #d94141;
    font-size: 13px;
    font-weight: 500;
    margin-top: 6px;
    display: none;
}

.error-msg.visible {
    display: block;
}

.btn-primary {
    background-color: #000000 !important;
    border-radius: 12px;
    margin: 8px 0;
}

.btn-danger {
    background-color: #d94141 !important;
    border-radius: 12px;
    margin: 8px 0;
}

.btn-danger .option-text {
    color: #ffffff !important;
}

.btn-danger .arrow {
    color: #ffffff !important;
}

.icon-btn-edit, .icon-btn-delete {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.icon-btn-edit:hover, .icon-btn-delete:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.icon-btn-edit svg {
    stroke: #888888;
}

.icon-btn-delete svg {
    stroke: #d94141;
}

body.dark-mode .icon-btn-edit svg {
    stroke: #aaaaaa;
}

body.dark-mode .icon-btn-edit:hover, body.dark-mode .icon-btn-delete:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.checkmark { display: none; font-weight: bold; }
body.light-mode #check-light { display: block; }
body:not(.dark-mode) #check-light { display: block; }
body.dark-mode #check-dark { display: block; }
body.dark-mode .checkmark { color: #ffffff; }

.arrow { color: #888888; font-size: 20px; }

body.dark-mode {
    background-color: #1a1a1a;
    color: #ffffff;
}

body.dark-mode .app-container {
    background-color: #222222;
    border-color: #444444;
}

body.dark-mode .tr-card,
body.dark-mode .bottom-sheet,
body.dark-mode .input-bar-container,
body.dark-mode .edit-input {
    background-color: #2c2c2c;
    border-color: #444444;
    color: #ffffff;
}

body.dark-mode .card-label,
body.dark-mode .input-bar-container textarea::placeholder {
    color: #aaaaaa;
}

body.dark-mode .total-amount {
    color: #ffffff;
}

body.dark-mode .total-amount.price-green {
    color: #4a9e61;
}

body.dark-mode .total-amount.price-red {
    color: #d94141;
}

body.dark-mode .option-text,
body.dark-mode .app-title,
body.dark-mode .smart-text,
body.dark-mode .input-bar-container textarea {
    color: #ffffff;
}

body.dark-mode .card-divider {
    background-color: #444444;
}

body.dark-mode .profile-avatar {
    background-color: #333333;
    color: #ffffff;
    border-color: #555555;
}

body.dark-mode .fade-overlay-top {
    background: linear-gradient(to bottom, #222222 60%, rgba(34, 34, 34, 0) 100%);
}

body.dark-mode .fade-overlay-bottom {
    background: linear-gradient(to top, #222222 60%, rgba(34, 34, 34, 0) 100%);
}

body.dark-mode .btn-primary {
    background-color: #ffffff !important;
}

body.dark-mode .btn-primary .option-text {
    color: #000000 !important;
}

body.dark-mode .btn-danger {
    background-color: #d94141 !important;
}

body.dark-mode .btn-danger .option-text,
body.dark-mode .btn-danger .arrow {
    color: #ffffff !important;
}

body.dark-mode [style*="color: #000000"],
body.dark-mode #total-goal-amount {
    color: #ffffff !important;
}

body.dark-mode #send-btn svg {
    stroke: #ffffff !important;
}

.empty-state {
    color: #888888;
    font-size: 14px;
    font-style: italic;
    padding: 4px 0;
    display: block;
}

body.dark-mode .empty-state {
    color: #aaaaaa;
}