@charset "UTF-8";
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa2JL7SUc.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa0ZL7SUc.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa2ZL7SUc.woff2) format("woff2");
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1pL7SUc.woff2) format("woff2");
  unicode-range: U+0370-03FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa2pL7SUc.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa25L7SUc.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v13/UcC73FwrK3iLTeHuS_fvQtMwCp50KnMa1ZL7.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lobster";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/lobster/v30/neILzCirqoswsqX9zo-mM5Ez.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Lobster";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/lobster/v30/neILzCirqoswsqX9zoamM5Ez.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Lobster";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/lobster/v30/neILzCirqoswsqX9zo2mM5Ez.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Lobster";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/lobster/v30/neILzCirqoswsqX9zoymM5Ez.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lobster";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/lobster/v30/neILzCirqoswsqX9zoKmMw.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/manrope/v15/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FN_P-bnBeA.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/manrope/v15/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FN_G-bnBeA.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/manrope/v15/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FN_B-bnBeA.woff2) format("woff2");
  unicode-range: U+0370-03FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/manrope/v15/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FN_N-bnBeA.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/manrope/v15/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FN_M-bnBeA.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/manrope/v15/xn7_YHE41ni1AdIRqAuZuw1Bx9mbZk79FN_C-bk.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu72xKOzY.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu5mxKOzY.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7mxKOzY.woff2) format("woff2");
  unicode-range: U+1F00-1FFF;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4WxKOzY.woff2) format("woff2");
  unicode-range: U+0370-03FF;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7WxKOzY.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu7GxKOzY.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/roboto/v30/KFOmCnqEu92Fr1Mu4mxK.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadeInFromNone {
  0% {
    display: none;
    opacity: 0;
  }
  1% {
    display: flex;
    opacity: 0;
  }
  100% {
    display: flex;
    opacity: 1;
  }
}
.portfolio-app {
  --pf-bg-primary: #e8ebf2;
  --pf-bg-secondary: #f4f6fa;
  --pf-bg-tertiary: #dee3ec;
  --pf-text-primary: #07070B;
  --pf-text-secondary: #5D5D5D;
  --pf-text-muted: #5D5D5D;
  --pf-border-color: #d0d6e0;
  --pf-border-light: #e2e6ef;
  --pf-accent: #2C5282;
  --pf-accent-hover: #1E3A5F;
  --pf-accent-light: #4A90D9;
  --pf-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --pf-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
  --pf-positive: #059669;
  --pf-positive-bg: #ecfdf5;
  --pf-negative: #dc2626;
  --pf-negative-bg: #fef2f2;
  --pf-warning: #d97706;
  --pf-warning-bg: #fffbeb;
  --pf-info: #2563eb;
  --pf-info-bg: #eff6ff;
  --pf-sidebar-bg: var(--pf-bg-secondary);
  --pf-sidebar-border: #C7C7C7;
  --pf-input-bg: var(--pf-bg-secondary);
  --pf-input-border: #d1d5db;
  --pf-table-hover: #dce1eb;
  --pf-table-stripe: #e4e8f0;
  --pf-selection-bg: #d4e4f7;
}
.portfolio-app.darkmode {
  --pf-bg-primary: #11131B;
  --pf-bg-secondary: #2A2C38;
  --pf-bg-tertiary: #1e2028;
  --pf-text-primary: #FFF;
  --pf-text-secondary: #C7C7C7;
  --pf-text-muted: #909090;
  --pf-border-color: #3C3C43;
  --pf-border-light: #2a2d38;
  --pf-accent: #4A90D9;
  --pf-accent-hover: #5BA3E8;
  --pf-accent-light: rgba(74, 144, 217, 0.15);
  --pf-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --pf-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.4);
  --pf-positive: #10b981;
  --pf-positive-bg: rgba(16, 185, 129, 0.1);
  --pf-negative: #ef4444;
  --pf-negative-bg: rgba(239, 68, 68, 0.1);
  --pf-warning: #f59e0b;
  --pf-warning-bg: rgba(245, 158, 11, 0.1);
  --pf-info: #3b82f6;
  --pf-info-bg: rgba(59, 130, 246, 0.1);
  --pf-sidebar-bg: #2A2C38;
  --pf-sidebar-border: #3C3C43;
  --pf-input-bg: #2A2C38;
  --pf-input-border: #3C3C43;
  --pf-table-stripe: color-mix(in srgb, var(--pf-bg-secondary) 96%, white);
  --pf-table-hover: color-mix(in srgb, var(--pf-bg-secondary) 94%, white);
  --pf-selection-bg: color-mix(in srgb, var(--pf-info) 22%, var(--pf-bg-secondary));
}

html {
  height: 100%;
}

.portfolio-app {
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: clip;
  display: flex;
  flex-direction: column;
  background: var(--pf-bg-primary);
  color: var(--pf-text-primary);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
@media (min-width: 768px) {
  .portfolio-app {
    font-size: 16px;
  }
}

.portfolio-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
}
@media (min-width: 850px) {
  .portfolio-wrapper {
    flex-direction: row;
    align-items: flex-start;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2%;
    gap: 12px;
  }
}

.portfolio-sidebar {
  display: none;
}
@media (min-width: 850px) {
  .portfolio-sidebar {
    display: flex;
    flex-direction: column;
    width: 220px;
    height: fit-content;
    flex-shrink: 0;
    background: var(--pf-sidebar-bg);
    border: 1px solid var(--pf-border-color);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 24px;
    margin-top: 24px;
    margin-bottom: 24px;
    z-index: 100;
    transition: transform 0.3s ease;
  }
  .portfolio-app.darkmode .portfolio-sidebar {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  }
}

.sidebar-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
@media (min-width: 850px) {
  .sidebar-header {
    padding: 24px;
  }
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--pf-accent);
  font-weight: 600;
  font-size: 18px;
  transition: color 0.2s ease;
}
.sidebar-logo .logo-icon {
  flex-shrink: 0;
  width: auto;
  height: 22px;
}
.sidebar-logo svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}
.sidebar-logo:hover {
  color: var(--pf-accent-hover);
}

.sidebar-close {
  display: block;
  background: none;
  border: none;
  color: var(--pf-text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s;
  min-width: 44px;
  min-height: 44px;
}
.sidebar-close:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}
@media (min-width: 850px) {
  .sidebar-close {
    display: none;
  }
}

.portfolio-selector {
  padding: 0 16px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (min-width: 850px) {
  .portfolio-selector {
    padding: 0 16px 16px;
  }
}
.portfolio-selector label {
  display: none;
}
.portfolio-selector select {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
  padding-right: 24px;
  height: 40px;
  line-height: 38px;
  background: var(--pf-bg-primary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  color: var(--pf-text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px;
}
@media (min-width: 850px) {
  .portfolio-selector select {
    height: 36px;
    line-height: 34px;
    background-color: var(--pf-bg-tertiary);
    border-color: var(--pf-border-light);
  }
}
.portfolio-selector select:hover {
  border-color: var(--pf-text-muted);
}
.portfolio-selector select:focus {
  outline: none;
  border-color: var(--pf-accent);
}
.portfolio-selector select option {
  background: var(--pf-bg-secondary);
  color: var(--pf-text-primary);
}
.portfolio-app.darkmode .portfolio-selector select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
}
.portfolio-selector .btn-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--pf-bg-primary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  color: var(--pf-text-muted);
}
@media (min-width: 850px) {
  .portfolio-selector .btn-icon {
    width: 36px;
    height: 36px;
    background: var(--pf-bg-tertiary);
    border-color: var(--pf-border-light);
  }
}
.portfolio-selector .btn-icon svg {
  width: 16px;
  height: 16px;
}
.portfolio-selector .btn-icon:hover {
  border-color: var(--pf-accent);
  color: var(--pf-accent);
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
  border-top: 1px solid var(--pf-border-color);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  color: var(--pf-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
  border-left: 3px solid transparent;
}
.nav-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}
.nav-item:hover:not(.disabled) {
  color: var(--pf-text-primary);
  background: rgba(0, 0, 0, 0.03);
}
.nav-item:hover:not(.disabled) svg {
  opacity: 0.7;
}
.portfolio-app.darkmode .nav-item:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.04);
}
.nav-item.active {
  color: var(--pf-accent);
  background: rgba(44, 82, 130, 0.08);
  border-left-color: var(--pf-accent);
}
.nav-item.active svg {
  opacity: 1;
}
.portfolio-app.darkmode .nav-item.active {
  background: rgba(74, 144, 217, 0.12);
}
.nav-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.nav-item.disabled:hover {
  background: transparent;
  color: var(--pf-text-secondary);
}

.sidebar-footer {
  display: none;
}
@media (min-width: 850px) {
  .sidebar-footer {
    display: block;
    padding: 16px;
    border-top: 1px solid var(--pf-border-color);
  }
}

.sidebar-actions {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 4px;
  background: var(--pf-bg-primary);
  border-radius: 10px;
  border: 1px solid var(--pf-border-light);
}

.sidebar-overlay {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}
@media (min-width: 850px) {
  .sidebar-overlay {
    display: none;
  }
}

.bottom-tab-bar {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--pf-bg-secondary);
  border-top: 1px solid var(--pf-border-color);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (min-width: 850px) {
  .bottom-tab-bar {
    display: none;
  }
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  color: var(--pf-text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  min-width: 44px;
  min-height: 44px;
}
.tab-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s ease;
}
.tab-item span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tab-item:active {
  background: var(--pf-bg-tertiary);
}
.tab-item:active svg {
  transform: scale(0.95);
}
.tab-item.active {
  color: var(--pf-accent);
}
.tab-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  background: var(--pf-accent);
  border-radius: 0 0 3px 3px;
}
.tab-item.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.mobile-portfolio-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
@media (min-width: 850px) {
  .mobile-portfolio-selector {
    display: none;
    flex: 0;
  }
}
.mobile-portfolio-selector select {
  padding: 0 24px 0 8px;
  height: 40px;
  background: var(--pf-bg-primary);
  border: 1px solid var(--pf-border-color);
  border-radius: 6px;
  color: var(--pf-text-primary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  max-width: 140px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px;
}
.mobile-portfolio-selector select:focus {
  outline: none;
  border-color: var(--pf-accent);
}
.mobile-portfolio-selector select option {
  background: var(--pf-bg-secondary);
  color: var(--pf-text-primary);
}
.portfolio-app.darkmode .mobile-portfolio-selector select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
}
.mobile-portfolio-selector .btn-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.portfolio-main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portfolio-header {
  padding: 8px 16px;
  background: linear-gradient(to right, var(--pf-bg-secondary), var(--pf-bg-tertiary));
  border-bottom: 1px solid var(--pf-border-color);
  display: flex;
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
@media (min-width: 850px) {
  .portfolio-header {
    display: none;
  }
}
.portfolio-app.darkmode .portfolio-header {
  background: linear-gradient(to right, var(--pf-bg-secondary), rgba(255, 255, 255, 0.02));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--pf-text-primary);
  cursor: pointer;
  padding: 4px;
}

.page-title-wrapper {
  flex: 1;
  display: none;
  align-items: center;
  gap: 8px;
}
@media (min-width: 768px) {
  .page-title-wrapper {
    display: flex;
  }
}

.page-title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--pf-accent-light), rgba(74, 144, 217, 0.1));
  border-radius: 8px;
  color: var(--pf-accent);
  flex-shrink: 0;
}
.page-title-icon svg {
  width: 16px;
  height: 16px;
}
.page-title-icon:empty {
  display: none;
}
@media (min-width: 480px) {
  .page-title-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .page-title-icon svg {
    width: 18px;
    height: 18px;
  }
}
@media (min-width: 768px) {
  .page-title-icon {
    width: 40px;
    height: 40px;
  }
  .page-title-icon svg {
    width: 20px;
    height: 20px;
  }
}

.page-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--pf-text-primary) 0%, var(--pf-text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
@supports not (background-clip: text) {
  .page-title {
    background: none;
    -webkit-text-fill-color: var(--pf-text-primary);
    color: var(--pf-text-primary);
  }
}
@media (min-width: 480px) {
  .page-title {
    font-size: 18px;
  }
}
@media (min-width: 768px) {
  .page-title {
    font-size: 24px;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--pf-bg-primary);
  border-radius: 12px;
  border: 1px solid var(--pf-border-light);
}

.language-selector {
  position: relative;
}
.language-selector .btn-icon span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  box-shadow: var(--pf-shadow-lg);
  min-width: 150px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
  z-index: 100;
}
.language-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.language-dropdown form {
  display: contents;
}

.lang-option {
  display: block;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  text-align: left;
  color: var(--pf-text-primary);
  cursor: pointer;
  font-size: 14px;
}
.lang-option:hover {
  background: var(--pf-bg-tertiary);
}
.lang-option.active {
  color: var(--pf-accent);
  font-weight: 500;
}

.user-menu {
  position: relative;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: linear-gradient(135deg, var(--pf-accent), var(--pf-accent-hover)) padding-box, linear-gradient(135deg, var(--pf-accent), var(--pf-accent-hover)) border-box;
  transition: all 0.2s ease;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.user-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(44, 82, 130, 0.3);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  box-shadow: var(--pf-shadow-lg);
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s;
  z-index: 100;
}
.user-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-info {
  padding: 16px;
  border-bottom: 1px solid var(--pf-border-color);
}
.user-info strong {
  display: block;
  font-size: 14px;
}

.portfolio-content {
  flex: 1;
  padding: 8px;
  padding-bottom: calc(8px + 64px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 480px) {
  .portfolio-content {
    padding: 16px;
    padding-bottom: calc(16px + 64px + env(safe-area-inset-bottom, 0px));
  }
}
@media (min-width: 850px) {
  .portfolio-content {
    padding: 24px;
    padding-top: 24px;
    padding-bottom: 24px;
  }
}

.feedback-fab {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--pf-accent);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  z-index: 90;
}
.feedback-fab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.feedback-fab .feedback-fab-label {
  display: none;
}
@media (min-width: 850px) {
  .feedback-fab {
    bottom: 20px;
    right: 20px;
  }
}
.feedback-fab:hover {
  background: var(--pf-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.feedback-fab:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.workspace-container {
  flex: 1;
  min-height: 0;
  height: auto;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--pf-bg-primary);
  --iconbar-container-width: 60px;
  --content-width: 800px;
  --chat-width: 400px;
}
.workspace-container.is-resizing {
  user-select: none;
}
.workspace-container.is-resizing .workspace-content,
.workspace-container.is-resizing .workspace-chat {
  pointer-events: none;
}

.workspace-layout {
  display: flex;
  flex: 1;
  height: 100%;
  overflow: hidden;
  position: relative;
}
@media (min-width: 768px) {
  .workspace-layout {
    justify-content: flex-start;
    align-items: stretch;
    position: static;
    gap: 0;
  }
}

.workspace-panel {
  display: flex;
  flex-direction: column;
  background: var(--pf-bg-primary);
  overflow: hidden;
  position: absolute;
  inset: 0;
  bottom: calc(46px + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.workspace-panel.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}
@media (min-width: 768px) {
  .workspace-panel {
    position: static;
    opacity: 1;
    visibility: visible;
  }
}
@media (max-width: 767px) {
  .workspace-container.keyboard-open .workspace-panel {
    bottom: var(--keyboard-height, 0px);
  }
}

.workspace-iconbar-container {
  display: none;
}
@media (min-width: 768px) {
  .workspace-iconbar-container {
    display: flex;
    flex-direction: column;
    position: static;
    width: var(--iconbar-container-width);
    flex-shrink: 0;
    height: 100%;
    opacity: 1;
    visibility: visible;
    background: transparent;
    padding-top: 24px;
    align-items: flex-end;
    overflow: visible;
  }
}
@media (min-width: 850px) {
  .workspace-iconbar-container {
    padding-top: 32px;
  }
}

.workspace-iconbar {
  width: 100%;
  flex: 1;
  border-right: none;
  flex-shrink: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}
.workspace-iconbar .iconbar-label {
  opacity: 1;
  width: auto;
  margin-left: 12px;
}
.workspace-iconbar .iconbar-chevron {
  opacity: 1;
}
@media (min-width: 768px) {
  .workspace-iconbar {
    width: 60px;
    height: fit-content;
    flex: none;
    background: transparent;
    border-right: none;
    border-radius: 8px;
    overflow: visible;
  }
  .workspace-iconbar .iconbar-label {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    padding: 6px 12px;
    background: var(--pf-bg-secondary);
    border: 1px solid var(--pf-border-color);
    border-radius: 8px;
    box-shadow: var(--pf-shadow-md);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 100;
    width: auto;
  }
  .workspace-iconbar .iconbar-chevron {
    opacity: 0;
  }
}

.iconbar-header {
  padding: 16px;
  border-bottom: 1px solid var(--pf-border-color);
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .iconbar-header {
    border-bottom: none;
    padding: 8px;
  }
}

.iconbar-portfolio {
  position: relative;
}

.iconbar-portfolio-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px;
  background: var(--pf-bg-tertiary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--pf-text-primary);
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.iconbar-portfolio-btn .iconbar-label {
  color: var(--pf-text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.iconbar-portfolio-btn .iconbar-chevron {
  color: var(--pf-text-secondary);
  flex-shrink: 0;
  margin-left: auto;
}
.iconbar-portfolio-btn:hover {
  border-color: var(--pf-accent);
  background: var(--pf-bg-primary);
}
.iconbar-portfolio-btn:hover .iconbar-chevron {
  color: var(--pf-text-primary);
}

.iconbar-portfolio-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--pf-accent), var(--pf-accent-hover));
  color: white;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  border-radius: 4px;
  flex-shrink: 0;
}

.iconbar-chevron {
  opacity: 0;
  transition: opacity 0.2s ease;
  color: var(--pf-text-muted);
  flex-shrink: 0;
}

.iconbar-portfolio-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: auto;
  min-width: 200px;
  margin-top: 4px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  box-shadow: var(--pf-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
}
.iconbar-portfolio-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.iconbar-portfolio-option {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--pf-text-primary);
  font-size: 14px;
  transition: background 0.15s ease;
  gap: 8px;
}
.iconbar-portfolio-option:hover {
  background: var(--pf-bg-tertiary);
}
.iconbar-portfolio-option.active {
  color: var(--pf-accent);
  font-weight: 500;
}
.iconbar-portfolio-option .option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--pf-bg-tertiary);
  border-radius: 4px;
  font-weight: 500;
  font-size: 11px;
  flex-shrink: 0;
}
.iconbar-portfolio-option.active .option-letter {
  background: var(--pf-accent);
  color: white;
}

.iconbar-portfolio-divider {
  height: 1px;
  background: var(--pf-border-color);
  margin: 4px 0;
}

.iconbar-portfolio-add {
  color: var(--pf-accent);
}
.iconbar-portfolio-add svg {
  width: 16px;
  height: 16px;
}

.iconbar-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  overflow-y: auto;
}

.iconbar-item {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  color: var(--pf-text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
  min-height: 44px;
  border-left: 3px solid transparent;
  position: relative;
}
.iconbar-item:hover:not(.disabled) {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}
.iconbar-item:hover:not(.disabled) .iconbar-icon {
  opacity: 1;
}
@media (min-width: 768px) {
  .iconbar-item:hover:not(.disabled) .iconbar-label {
    opacity: 1;
    visibility: visible;
  }
}
.iconbar-item.active {
  color: var(--pf-accent);
  background: rgba(44, 82, 130, 0.08);
  border-left-color: var(--pf-accent);
}
.iconbar-item.active .iconbar-icon {
  opacity: 1;
}
.portfolio-app.darkmode .iconbar-item.active {
  background: rgba(74, 144, 217, 0.12);
}
.iconbar-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.iconbar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.iconbar-icon.iconbar-portfolio-letter {
  width: 28px;
  height: 28px;
  opacity: 1;
}
.iconbar-icon.iconbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 1;
}
.iconbar-icon.iconbar-lang-code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iconbar-label {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  width: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, width 0.2s ease, margin 0.2s ease;
}

.iconbar-footer {
  padding: 16px;
  border-top: 1px solid var(--pf-border-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .iconbar-footer {
    border-top: none;
    padding: 8px;
  }
}

.iconbar-control-wrapper {
  position: relative;
}

.iconbar-control {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  color: var(--pf-text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
  min-height: 44px;
  text-decoration: none;
  position: relative;
}
.iconbar-control:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}
@media (min-width: 768px) {
  .iconbar-control:hover .iconbar-label {
    opacity: 1;
    visibility: visible;
  }
}

.iconbar-lang-dropdown,
.iconbar-user-dropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: auto;
  min-width: 180px;
  margin-bottom: 4px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  box-shadow: var(--pf-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
  z-index: 100;
}
.iconbar-lang-dropdown.visible,
.iconbar-user-dropdown.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.iconbar-lang-option {
  display: block;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  text-align: left;
  color: var(--pf-text-primary);
  cursor: pointer;
  font-size: 14px;
}
.iconbar-lang-option:hover {
  background: var(--pf-bg-tertiary);
}
.iconbar-lang-option.active {
  color: var(--pf-accent);
  font-weight: 500;
}

.iconbar-user-info {
  padding: 16px;
  border-bottom: 1px solid var(--pf-border-color);
}
.iconbar-user-info strong {
  display: block;
  font-size: 14px;
}

.iconbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--pf-text-primary);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.15s ease;
}
.iconbar-dropdown-item svg {
  opacity: 0.5;
}
.iconbar-dropdown-item:hover {
  background: var(--pf-bg-tertiary);
}

.iconbar-dropdown-divider {
  height: 1px;
  background: var(--pf-border-color);
  margin: 4px 0;
}

.iconbar-logout-form {
  margin: 0;
  padding: 0;
  display: block;
}
.iconbar-logout-form .iconbar-dropdown-item {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: inherit;
  font-weight: 400;
  appearance: none;
  -webkit-appearance: none;
}

.workspace-content,
.workspace-chat,
.chat-messages,
.iconbar-body {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.workspace-content::-webkit-scrollbar,
.workspace-chat::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.iconbar-body::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

.workspace-content {
  flex-shrink: 0;
  background: var(--pf-bg-primary);
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  container-type: inline-size;
}
.workspace-container[data-content-visible=false] .workspace-content {
  display: none;
}
@media (min-width: 768px) {
  .workspace-content {
    width: var(--content-width);
  }
}

.workspace-content-inner {
  padding: 16px 0;
}
@media (min-width: 768px) {
  .workspace-content-inner {
    padding: 24px 0;
  }
}
@media (min-width: 850px) {
  .workspace-content-inner {
    padding: 32px 0;
  }
}

.workspace-chat {
  background: var(--pf-bg-primary);
  display: flex;
  flex-direction: column;
  width: 100%;
  padding-top: 16px;
  container-type: inline-size;
  display: none;
}
.workspace-container[data-chat-visible=true] .workspace-chat {
  display: flex;
}
@media (max-width: 767px) {
  .workspace-chat.active {
    display: flex;
  }
}
@media (min-width: 768px) {
  .workspace-chat {
    flex: 1;
    min-width: 300px;
    padding-top: 24px;
  }
}
@media (min-width: 850px) {
  .workspace-chat {
    padding-top: 32px;
  }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) {
  .chat-messages {
    padding: 0 24px 32px;
  }
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 48px;
  margin-top: 24px;
  width: 100%;
}

.chat-empty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}
.chat-empty-content h4 {
  margin: 16px 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: var(--pf-text-primary);
}
.chat-empty-content p {
  margin: 0;
  color: var(--pf-text-muted);
  font-size: 14px;
  max-width: 320px;
  line-height: 1.5;
}

.chat-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.12), rgba(74, 144, 217, 0.04));
  border-radius: 20px;
  color: var(--pf-accent);
  margin-bottom: 16px;
}
.chat-empty-icon svg {
  width: 32px;
  height: 32px;
}

.chat-starters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 560px;
}
@container (max-width: 500px) {
  .chat-starters {
    grid-template-columns: repeat(2, 1fr);
  }
}
@container (max-width: 380px) {
  .chat-starters {
    grid-template-columns: 1fr;
  }
}

.chat-starter-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 12px;
  color: var(--pf-text-secondary);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.chat-starter-card:hover {
  border-color: var(--pf-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.chat-starter-card svg {
  flex-shrink: 0;
  color: var(--pf-accent);
  opacity: 0.7;
}
.chat-starter-card span {
  flex: 1;
  line-height: 1.4;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 16px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}
.chat-message-user {
  align-self: flex-start;
  text-align: left;
}
.chat-message-user .chat-message-content {
  background: var(--pf-bg-secondary);
  color: var(--pf-text-primary);
  border: 1px solid var(--pf-border-color);
  border-radius: 12px;
  padding: 8px 16px;
  display: inline-block;
  max-width: 100%;
}
.chat-message-user .chat-message-time {
  align-self: flex-start;
}
.chat-message-assistant {
  align-self: flex-start;
  max-width: 100%;
}
.chat-message-assistant .chat-message-content {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  padding-bottom: 16px;
  overflow-x: auto;
  word-wrap: break-word;
}
.chat-message-assistant .chat-message-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}
.chat-message-assistant .chat-message-content pre {
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-message-assistant .chat-message-header {
  display: none;
}

.chat-message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.chat-message-header .chat-message-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.12), rgba(74, 144, 217, 0.04));
  border-radius: 4px;
  color: var(--pf-accent);
  flex-shrink: 0;
}
.chat-message-header .chat-message-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--pf-text-primary);
}
.chat-message-header .chat-message-time {
  font-size: 0.6875rem;
  color: var(--pf-text-muted);
  margin-left: auto;
}

.chat-message-content {
  padding: 16px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--pf-text-primary);
}
.chat-message-content strong {
  font-weight: 600;
  color: var(--pf-accent);
}

.chat-message-time {
  font-size: 0.6875rem;
  color: var(--pf-text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.chat-message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.chat-attachment-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--pf-text-secondary);
}
.chat-attachment-chip .chat-file-icon {
  flex-shrink: 0;
  color: var(--pf-accent);
}
.chat-attachment-chip .chat-attachment-name {
  color: var(--pf-text-primary);
  font-weight: 500;
}
.chat-attachment-chip .chat-attachment-size {
  color: var(--pf-text-muted);
  font-size: 0.6875rem;
}

.chat-thinking-phase {
  margin-bottom: 8px;
  border: 1px solid var(--pf-border-color);
  border-radius: 4px;
  overflow: hidden;
}
.chat-thinking-phase summary {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--pf-bg-secondary);
  cursor: pointer;
  font-size: 14px;
  color: var(--pf-text-secondary);
  user-select: none;
}
.chat-thinking-phase summary::-webkit-details-marker {
  display: none;
}
.chat-thinking-phase summary:hover {
  background: var(--pf-bg-hover);
}
.chat-thinking-phase summary .chat-thinking-icon {
  flex-shrink: 0;
  color: var(--pf-accent);
}
.chat-thinking-phase .chat-thinking-content {
  padding: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--pf-text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
  border-top: 1px solid var(--pf-border-color);
  background: var(--pf-bg-primary);
}

.chat-header-wrapper {
  position: relative;
}

.chat-header {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: var(--pf-bg-tertiary);
  border-bottom: 1px solid var(--pf-border-color);
  overflow: visible;
}

.chat-tabs-container {
  display: flex;
  align-items: stretch;
  flex: 1;
  min-width: 0;
  min-height: 40px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chat-tabs-container::-webkit-scrollbar {
  display: none;
}

.chat-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  margin: 0;
  max-width: 220px;
  min-height: 40px;
  background: transparent;
  border: none;
  border-radius: 0;
  border-right: 1px solid var(--pf-border-color);
  box-shadow: none;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--pf-text-muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
  position: relative;
  flex-shrink: 0;
}
.chat-tab:last-of-type {
  border-right: none;
}
.chat-tab:hover {
  color: var(--pf-text-primary);
  background: var(--pf-table-hover);
}
.chat-tab:focus-visible {
  outline: 2px solid var(--pf-accent);
  outline-offset: -2px;
  z-index: 1;
}
.chat-tab.active {
  color: var(--pf-text-primary);
  background: var(--pf-bg-secondary);
  box-shadow: inset 0 1px 0 var(--pf-border-light);
}
.chat-tab .chat-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--pf-text-muted);
  opacity: 0.85;
  transition: color 0.12s ease, opacity 0.12s ease;
}
.chat-tab .chat-tab-icon svg {
  display: block;
}
.chat-tab:hover .chat-tab-icon, .chat-tab.active .chat-tab-icon {
  color: var(--pf-text-secondary);
  opacity: 1;
}
.chat-tab.active .chat-tab-icon {
  color: var(--pf-accent);
}
.chat-tab .chat-tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  text-align: left;
}
.chat-tab .chat-tab-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-right: -4px;
  background: transparent;
  border: none;
  color: var(--pf-text-muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.chat-tab .chat-tab-close:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}
.chat-tab .chat-tab-close svg {
  width: 12px;
  height: 12px;
}
.chat-tab:hover .chat-tab-close, .chat-tab.active .chat-tab-close {
  display: flex;
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 0 8px 0 4px;
  border-left: 1px solid var(--pf-border-color);
  background: var(--pf-bg-tertiary);
  align-self: stretch;
}

.chat-new-btn,
.chat-history-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 4px;
  color: var(--pf-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.chat-new-btn:hover,
.chat-history-btn:hover {
  color: var(--pf-text-primary);
  background: var(--pf-bg-secondary);
}
.chat-new-btn:focus,
.chat-history-btn:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}
.chat-new-btn svg,
.chat-history-btn svg {
  width: 18px;
  height: 18px;
}

.chat-usage-circle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: help;
  flex-shrink: 0;
}
.chat-usage-circle:hover .chat-usage-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chat-usage-ring {
  position: absolute;
  width: 32px;
  height: 32px;
  transform: rotate(-90deg);
}

.chat-usage-ring-bg {
  fill: none;
  stroke: var(--pf-border-color);
  stroke-width: 2;
}

.chat-usage-ring-progress {
  fill: none;
  stroke: var(--pf-accent);
  stroke-width: 2;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s ease;
}

.chat-usage-percentage {
  font-size: 10px;
  font-weight: 600;
  color: var(--pf-text-primary);
  z-index: 1;
}

.chat-usage-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 11px;
  color: var(--pf-text-secondary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 100;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: all 0.2s ease;
  pointer-events: none;
}
.chat-usage-tooltip .chat-usage-detail {
  display: flex;
  justify-content: space-between;
  gap: 32px;
}
.chat-usage-tooltip .chat-usage-detail + .chat-usage-detail {
  margin-top: 6px;
}
.chat-usage-tooltip .chat-usage-detail .label {
  color: var(--pf-text-muted);
}
.chat-usage-tooltip .chat-usage-detail .value {
  font-weight: 600;
  color: var(--pf-text-primary);
}

.chat-conversations-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 16px;
  right: 16px;
  background: var(--pf-bg-primary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  max-height: 400px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 20;
  display: none;
}
.chat-conversations-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) {
  .chat-conversations-panel {
    left: 24px;
    right: 24px;
  }
}

.chat-conversations-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

.chat-conversation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
  width: 100%;
  text-align: left;
}
.chat-conversation-item:hover {
  background: var(--pf-bg-secondary);
}
.chat-conversation-item:hover .chat-conversation-delete {
  opacity: 1;
  visibility: visible;
}
.chat-conversation-item.active {
  background: var(--pf-bg-tertiary);
  border: 1px solid var(--pf-accent);
}

.chat-conversation-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.chat-conversation-content span {
  font-size: 14px;
  color: var(--pf-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-conversation-content time {
  font-size: 0.6875rem;
  color: var(--pf-text-muted);
}

.chat-conversation-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--pf-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  opacity: 0;
  visibility: hidden;
}
.chat-conversation-delete:hover {
  color: var(--pf-red, #e53e3e);
  background: rgba(229, 62, 62, 0.08);
}
.chat-conversation-delete svg {
  width: 14px;
  height: 14px;
}

.chat-show-archived {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--pf-border-color);
  font-size: 14px;
  color: var(--pf-text-secondary);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.chat-show-archived:hover {
  background: var(--pf-bg-secondary);
  color: var(--pf-text-primary);
}

.chat-pinned-user-message {
  position: sticky;
  top: 0;
  background: var(--pf-bg-tertiary);
  padding: 4px 16px;
  border-bottom: 1px solid var(--pf-border-color);
  font-size: 14px;
  color: var(--pf-text-secondary);
  z-index: 10;
  display: none;
  margin: 0;
}
.chat-pinned-user-message.visible {
  display: block;
}

.chat-message-plan {
  max-width: 100%;
  align-self: stretch;
}
.chat-message-plan .chat-message-content {
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.08), rgba(74, 144, 217, 0.02));
  border-color: var(--pf-accent);
  border-width: 2px;
  padding: 24px;
}
.portfolio-app.darkmode .chat-message-plan .chat-message-content {
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.15), rgba(74, 144, 217, 0.05));
}

.chat-plan-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.chat-plan-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--pf-accent);
  border-radius: 8px;
  color: white;
  flex-shrink: 0;
}

.chat-plan-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.chat-plan-title strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--pf-text-primary);
}

.chat-plan-status {
  font-size: 0.6875rem;
  color: var(--pf-text-muted);
}

.chat-plan-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  padding: 16px;
  background: var(--pf-bg-primary);
  border-radius: 8px;
}

.chat-plan-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--pf-text-secondary);
  padding: 4px 0;
}
.chat-plan-step svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.5;
}
.chat-plan-step span {
  flex: 1;
  line-height: 1.5;
}
.chat-plan-step.completed {
  color: var(--pf-green);
}
.chat-plan-step.completed svg {
  opacity: 1;
  color: var(--pf-green);
}
.chat-plan-step.in-progress {
  color: var(--pf-accent);
}
.chat-plan-step.in-progress svg {
  opacity: 1;
  color: var(--pf-accent);
  animation: spin 1s linear infinite;
}
.chat-plan-step.pending {
  opacity: 0.5;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.chat-plan-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}

.chat-input-wrapper {
  flex-shrink: 0;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
  background: var(--pf-bg-primary);
}
@media (max-width: 767px) {
  .workspace-container.keyboard-open .chat-input-wrapper {
    padding-bottom: 16px;
  }
}
@media (min-width: 768px) {
  .chat-input-wrapper {
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  }
}

.chat-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 20px;
  transition: all 0.15s ease;
}
.chat-input:focus-within {
  border-color: var(--pf-accent);
  box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.08);
}
.chat-input textarea {
  flex: 1;
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--pf-text-primary);
  font-size: 14px;
  font-family: "Inter", sans-serif;
  line-height: 1.5;
  resize: none;
  max-height: 200px;
  overflow-y: auto;
}
.chat-input textarea:focus {
  outline: none;
}
.chat-input textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.chat-input textarea::placeholder {
  color: var(--pf-text-muted);
}
.chat-input .chat-input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.chat-input .chat-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--pf-accent);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.chat-input .chat-send-btn svg {
  width: 16px;
  height: 16px;
}
.chat-input .chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.chat-input .chat-send-btn:not(:disabled):hover {
  background: var(--pf-accent-hover);
  transform: scale(1.05);
}
.chat-input .chat-send-btn:not(:disabled):active {
  transform: scale(0.95);
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 16px 8px;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .chat-panel-header {
    padding: 0 24px 8px;
  }
}

.chat-new-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid var(--pf-border-color);
  border-radius: 4px;
  color: var(--pf-text-muted);
  font-size: 12px;
  font-family: "Inter", sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat-new-btn svg {
  width: 14px;
  height: 14px;
}
.chat-new-btn:hover {
  color: var(--pf-text-primary);
  border-color: var(--pf-text-muted);
}

.chat-stop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--pf-red, #e53e3e);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.chat-stop-btn svg {
  width: 16px;
  height: 16px;
}
.chat-stop-btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
}
.chat-stop-btn:active {
  transform: scale(0.95);
}

.chat-tool-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--pf-text-muted);
  border-radius: 4px;
  background: var(--pf-bg-tertiary, var(--pf-bg-secondary));
}
.chat-tool-status.completed {
  color: var(--pf-green, #38a169);
}

.chat-tool-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--pf-border-color);
  border-top-color: var(--pf-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.chat-tool-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chat-tool-label svg {
  flex-shrink: 0;
}

.chat-typing-indicator {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}
.chat-typing-indicator span {
  width: 6px;
  height: 6px;
  background: var(--pf-text-muted);
  border-radius: 50%;
  animation: chatTypingBounce 1.4s ease-in-out infinite;
}
.chat-typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}
.chat-typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes chatTypingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
.chat-loading-indicator {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}
.chat-loading-indicator span {
  width: 6px;
  height: 6px;
  background: var(--pf-accent-primary, #2C5282);
  border-radius: 50%;
  animation: chatLoadingPulse 1.2s ease-in-out infinite;
}
.chat-loading-indicator span:nth-child(2) {
  animation-delay: 0.15s;
}
.chat-loading-indicator span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatLoadingPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}
.chat-file-error {
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #ef4444;
  font-size: 14px;
  animation: slideInDown 0.2s ease;
}
.darkmode .chat-file-error, .portfolio-app.darkmode .chat-file-error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.chat-action-card {
  margin-top: 8px;
  padding: 16px;
  border: 1px solid var(--pf-accent);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.08), rgba(74, 144, 217, 0.02));
}
.portfolio-app.darkmode .chat-action-card {
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.15), rgba(74, 144, 217, 0.05));
}
.chat-action-card.chat-action-success {
  border-color: var(--pf-green, #38a169);
  background: linear-gradient(135deg, rgba(56, 161, 105, 0.08), rgba(56, 161, 105, 0.02));
}
.chat-action-card.chat-action-error {
  border-color: var(--pf-red, #e53e3e);
  background: linear-gradient(135deg, rgba(229, 62, 62, 0.08), rgba(229, 62, 62, 0.02));
}
.chat-action-card.chat-action-cancelled {
  border-color: var(--pf-border-color);
  opacity: 0.6;
  background: var(--pf-bg-secondary);
}

.chat-action-header {
  font-weight: 600;
  font-size: 14px;
  color: var(--pf-text-primary);
  margin-bottom: 8px;
}

.chat-action-details {
  font-size: 12px;
  color: var(--pf-text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}
.chat-action-details strong {
  color: var(--pf-text-primary);
  font-weight: 500;
}

.chat-action-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.chat-action-btn {
  padding: 4px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--pf-border-color);
  background: var(--pf-bg-secondary);
  color: var(--pf-text-primary);
}
.chat-action-btn:hover {
  border-color: var(--pf-text-muted);
}
.chat-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-action-confirm {
  background: var(--pf-accent);
  border-color: var(--pf-accent);
  color: white;
}
.chat-action-confirm:hover {
  background: var(--pf-accent-hover);
  border-color: var(--pf-accent-hover);
}

.chat-action-result {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-top: 8px;
  color: var(--pf-green, #38a169);
}
.chat-action-result svg {
  flex-shrink: 0;
}
.chat-action-result.error {
  color: var(--pf-red, #e53e3e);
}
.chat-action-result.cancelled {
  color: var(--pf-text-muted);
}

.chat-error {
  color: var(--pf-red, #e53e3e);
  font-size: 14px;
  padding: 8px;
  background: rgba(229, 62, 62, 0.08);
  border-radius: 4px;
}

.chat-message-assistant .chat-message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
}
.chat-message-assistant .chat-message-content th, .chat-message-assistant .chat-message-content td {
  padding: 4px 8px;
  text-align: left;
  border-bottom: 1px solid var(--pf-border-color);
  white-space: nowrap;
}
.chat-message-assistant .chat-message-content th {
  font-weight: 600;
  color: var(--pf-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.chat-message-assistant .chat-message-content ul, .chat-message-assistant .chat-message-content ol {
  margin: 8px 0;
  padding-left: 24px;
}
.chat-message-assistant .chat-message-content li {
  margin-bottom: 2px;
}
.chat-message-assistant .chat-message-content code {
  background: var(--pf-bg-tertiary, var(--pf-bg-secondary));
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 12px;
}
.chat-message-assistant .chat-message-content p {
  margin: 4px 0;
}
.chat-message-assistant .chat-message-content p:first-child {
  margin-top: 0;
}
.chat-message-assistant .chat-message-content p:last-child {
  margin-bottom: 0;
}
.chat-message-assistant .chat-message-content table strong {
  color: inherit;
}

.resize-handle {
  position: relative;
  width: 16px;
  cursor: col-resize;
  background: transparent;
  flex-shrink: 0;
  z-index: 5;
  display: none !important;
}
@media (min-width: 768px) {
  .resize-handle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
}
.resize-handle::after {
  content: "";
  width: 4px;
  height: 24px;
  background-image: radial-gradient(circle, var(--pf-text-muted) 1.5px, transparent 1.5px);
  background-size: 4px 6px;
  background-repeat: repeat-y;
  background-position: center;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}
.resize-handle:hover::after {
  opacity: 1;
}
.workspace-container.is-resizing .resize-handle::after {
  opacity: 1;
}

.workspace-toggles {
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  padding: 0 8px;
  margin-bottom: 8px;
}
@media (min-width: 768px) {
  .workspace-toggles {
    display: flex;
  }
}

.workspace-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--pf-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.workspace-toggle-btn svg {
  width: 20px;
  height: 20px;
}
.workspace-toggle-btn:hover {
  color: var(--pf-text-primary);
}
.workspace-toggle-btn.active {
  color: var(--pf-accent);
}
.workspace-toggle-btn.active:hover {
  color: var(--pf-accent-hover);
}

.workspace-tabs {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(46px + env(safe-area-inset-bottom, 0));
  z-index: 100;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 0.5px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.06), 0 -2px 8px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
@supports not (backdrop-filter: blur(24px)) {
  .workspace-tabs {
    background: var(--pf-bg-secondary);
    border-top: 1px solid var(--pf-border-color);
  }
}
@media (min-width: 768px) {
  .workspace-tabs {
    display: none;
  }
}
.darkmode .workspace-tabs {
  background: rgba(30, 32, 40, 0.75);
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2), 0 -2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
@supports not (backdrop-filter: blur(24px)) {
  .darkmode .workspace-tabs {
    background: var(--pf-bg-secondary);
  }
}

.workspace-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 6px;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--pf-text-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s ease;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.workspace-tab svg {
  width: 20px;
  height: 20px;
  transition: transform 0.15s ease;
}
.workspace-tab span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-tab:active {
  transform: scale(0.95);
}
.workspace-tab:active svg {
  transform: scale(0.92);
}
.workspace-tab.active {
  color: var(--pf-accent);
}
.workspace-tab.active::before {
  content: "";
  position: absolute;
  inset: 2px 6px;
  background: rgba(74, 144, 217, 0.1);
  border-radius: 8px;
  z-index: -1;
}
.darkmode .workspace-tab.active::before {
  background: rgba(74, 144, 217, 0.15);
}

.workspace-content .messages-container {
  padding: 16px;
  padding-bottom: 0;
}
@media (min-width: 768px) {
  .workspace-content .messages-container {
    padding: 24px;
    padding-bottom: 0;
  }
}

.chat-attach-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--pf-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.chat-attach-btn svg {
  width: 18px;
  height: 18px;
}
.chat-attach-btn:hover {
  color: var(--pf-text-primary);
  background: var(--pf-bg-tertiary);
}

.chat-file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 16px;
  margin-bottom: 4px;
}
@media (min-width: 768px) {
  .chat-file-preview {
    padding: 4px 24px;
  }
}

.chat-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  font-size: 12px;
  color: var(--pf-text-primary);
  max-width: 200px;
}
.chat-file-chip .chat-file-icon {
  flex-shrink: 0;
  color: var(--pf-accent);
}
.chat-file-chip .chat-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.chat-file-chip .chat-file-size {
  color: var(--pf-text-muted);
  font-size: 11px;
  flex-shrink: 0;
}
.chat-file-chip .chat-file-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: transparent;
  border: none;
  border-radius: 2px;
  color: var(--pf-text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.chat-file-chip .chat-file-remove:hover {
  color: var(--pf-red, #e53e3e);
  background: rgba(229, 62, 62, 0.08);
}

.chat-input-wrapper.drag-over .chat-input {
  border-color: var(--pf-accent);
  background: linear-gradient(135deg, rgba(74, 144, 217, 0.08), rgba(74, 144, 217, 0.02));
}

.chat-ephemeral-block {
  margin-bottom: 8px;
  border-radius: 4px;
  background: var(--pf-bg-tertiary, var(--pf-bg-secondary));
  border: 1px solid var(--pf-border-color);
  overflow: hidden;
  transition: all 0.2s ease;
}
.chat-ephemeral-block.completed {
  opacity: 0.9;
}
.chat-ephemeral-block.chat-ephemeral-thinking {
  border-left: 3px solid #4A90D9;
}
.chat-ephemeral-block.chat-ephemeral-exploring {
  border-left: 3px solid #38a169;
}

.chat-ephemeral-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
}
.chat-ephemeral-header:hover {
  background: var(--pf-bg-hover, rgba(0, 0, 0, 0.02));
}
.portfolio-app.darkmode .chat-ephemeral-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.chat-ephemeral-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.chat-ephemeral-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--pf-text-secondary);
  flex-shrink: 0;
}

.chat-ephemeral-duration {
  font-size: 11px;
  color: var(--pf-text-muted);
  margin-left: auto;
  font-family: "SF Mono", "Monaco", "Menlo", monospace;
}

.chat-ephemeral-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--pf-text-muted);
  cursor: pointer;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.chat-ephemeral-toggle.expanded {
  transform: rotate(180deg);
}
.chat-ephemeral-toggle svg {
  width: 12px;
  height: 12px;
}

.chat-ephemeral-content {
  border-top: 1px solid var(--pf-border-color);
}
.chat-ephemeral-content[hidden] {
  display: none;
}

.chat-ephemeral-steps {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-ephemeral-step {
  font-size: 12px;
  color: var(--pf-text-secondary);
  padding: 4px 8px;
  background: var(--pf-bg-primary, #fff);
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.portfolio-app.darkmode .chat-ephemeral-step {
  background: var(--pf-bg-secondary, #1a1a1a);
}
.chat-ephemeral-step:before {
  content: "→ ";
  color: var(--pf-text-muted);
  margin-right: 4px;
}

.chat-ephemeral-step {
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.chat-thinking-container {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-thinking-phase {
  border-left: 3px solid #4A90D9;
  background: rgba(74, 144, 217, 0.05);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}
.portfolio-app.darkmode .chat-thinking-phase {
  background: rgba(74, 144, 217, 0.1);
}
.chat-thinking-phase.collapsed .chat-thinking-phase-content {
  display: none;
}
.chat-thinking-phase.collapsed .chat-thinking-phase-toggle svg {
  transform: rotate(-90deg);
}
.chat-thinking-phase.complete {
  border-left-color: #22c55e;
}
.chat-thinking-phase.complete .chat-thinking-phase-header span::after {
  content: " ✓";
  color: #22c55e;
  font-weight: bold;
}
.chat-thinking-phase {
  animation: phaseSlideIn 0.3s ease-out;
}

@keyframes phaseSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.chat-thinking-phase-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  color: #2c5282;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}
.portfolio-app.darkmode .chat-thinking-phase-header {
  color: #63b3ed;
}
.chat-thinking-phase-header svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.chat-thinking-phase-header span {
  flex: 1;
}
.chat-thinking-phase-header:hover {
  background: rgba(74, 144, 217, 0.05);
}
.portfolio-app.darkmode .chat-thinking-phase-header:hover {
  background: rgba(74, 144, 217, 0.15);
}

.chat-thinking-phase-toggle {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: inherit;
  display: flex;
  align-items: center;
  border-radius: 4px;
}
.chat-thinking-phase-toggle svg {
  transition: transform 0.2s ease;
}
.chat-thinking-phase-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}
.portfolio-app.darkmode .chat-thinking-phase-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.chat-thinking-phase-content {
  padding: 8px 16px 16px;
  font-size: 14px;
  color: var(--pf-text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  transition: opacity 0.1s ease;
  min-height: 1.6em;
}

.chat-thinking-container.all-complete {
  opacity: 0.95;
}

.chat-tool-container {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-tool-call {
  border-left: 3px solid #8b5cf6;
  background: rgba(139, 92, 246, 0.05);
  border-radius: 8px;
  padding: 8px 16px;
  animation: phaseSlideIn 0.2s ease-out;
}
.portfolio-app.darkmode .chat-tool-call {
  background: rgba(139, 92, 246, 0.1);
}
.chat-tool-call.complete {
  border-left-color: #22c55e;
  opacity: 0.8;
}

.chat-tool-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #6d28d9;
}
.portfolio-app.darkmode .chat-tool-header {
  color: #a78bfa;
}
.chat-tool-header svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.chat-tool-header strong {
  font-weight: 600;
}

.chat-mermaid {
  margin: 16px 0;
  padding: 16px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  overflow-x: auto;
}
.chat-mermaid svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.chat-mermaid.error {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.3);
}
.portfolio-app.darkmode .chat-mermaid.error {
  background: rgba(239, 68, 68, 0.1);
}
.chat-mermaid .chat-diagram-error {
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: var(--pf-text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SF Mono", "Monaco", "Menlo", monospace;
}

.chat-chart {
  margin: 16px 0;
  padding: 16px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  max-width: 100%;
}
.chat-chart canvas {
  max-height: 300px;
  width: 100% !important;
  height: auto !important;
}
.chat-chart.error {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.3);
}
.portfolio-app.darkmode .chat-chart.error {
  background: rgba(239, 68, 68, 0.1);
}
.chat-chart .chat-diagram-error {
  margin: 0;
  padding: 0;
  font-size: 12px;
  color: var(--pf-text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SF Mono", "Monaco", "Menlo", monospace;
}

.bottom-sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(46px + env(safe-area-inset-bottom, 0));
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 200;
}
.bottom-sheet-overlay.visible {
  opacity: 1;
  visibility: visible;
}
@media (min-width: 768px) {
  .bottom-sheet-overlay {
    display: none;
  }
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(46px + env(safe-area-inset-bottom, 0));
  height: auto;
  max-height: calc(85vh - 46px);
  background: var(--pf-bg-secondary);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  transform: translateY(calc(100% + 46px + env(safe-area-inset-bottom, 0)));
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 201;
  display: flex;
  flex-direction: column;
  overflow: visible;
}
.bottom-sheet.visible {
  transform: translateY(0);
}
.darkmode .bottom-sheet {
  background: var(--pf-bg-secondary);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}
@media (min-width: 768px) {
  .bottom-sheet {
    display: none;
  }
}

.bottom-sheet-header {
  display: flex;
  justify-content: center;
  padding: 8px 16px 4px;
  flex-shrink: 0;
}

.bottom-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--pf-text-muted);
  border-radius: 2px;
  opacity: 0.3;
}

.bottom-sheet-content {
  overflow: visible;
  overscroll-behavior: contain;
}
.bottom-sheet-content .workspace-panel {
  position: static;
  opacity: 1;
  visibility: visible;
  inset: auto;
  bottom: auto;
  flex: none;
}
.bottom-sheet-content .workspace-iconbar {
  width: 100%;
  height: auto !important;
  flex: none;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible !important;
}
.bottom-sheet-content .workspace-iconbar .iconbar-label {
  opacity: 1;
  width: auto;
  margin-left: 12px;
  position: static;
  transform: none;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  visibility: visible;
  pointer-events: auto;
}
.bottom-sheet-content .workspace-iconbar .iconbar-chevron {
  opacity: 1;
}
.bottom-sheet-content .iconbar-header {
  padding: 4px 16px;
  border-bottom: none;
}
.bottom-sheet-content .iconbar-body {
  padding: 0 4px;
}
.bottom-sheet-content .iconbar-item {
  padding: 4px 16px;
  min-height: 40px;
  border-radius: 8px;
  margin: 1px 4px;
  border-left: none;
}
.bottom-sheet-content .iconbar-item.active {
  background: rgba(44, 82, 130, 0.1);
  border-left: none;
}
.portfolio-app.darkmode .bottom-sheet-content .iconbar-item.active {
  background: rgba(74, 144, 217, 0.15);
}
.bottom-sheet-content .iconbar-item:hover:not(.disabled) {
  background: var(--pf-bg-tertiary);
}
.bottom-sheet-content .iconbar-footer {
  padding: 4px 16px;
  border-top: 1px solid var(--pf-border-color);
  gap: 4px;
}
.bottom-sheet-content .iconbar-control {
  padding: 4px 8px;
  min-height: 36px;
  border-radius: 8px;
}
.bottom-sheet-content .iconbar-control:hover {
  background: var(--pf-bg-tertiary);
}
.bottom-sheet-content .iconbar-portfolio-dropdown,
.bottom-sheet-content .iconbar-lang-dropdown,
.bottom-sheet-content .iconbar-user-dropdown {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 100%;
  top: auto;
  margin-bottom: 4px;
  max-height: 200px;
  overflow-y: auto;
}
.bottom-sheet-content .iconbar-portfolio-dropdown {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: auto;
  top: 100%;
  margin-top: 4px;
  margin-bottom: 0;
}

.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown .dropdown-toggle {
  background: transparent;
  border: none;
  padding: 4px;
  border-radius: 4px;
  color: var(--pf-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.dropdown .dropdown-toggle:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}
.dropdown .dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 9999;
  min-width: 180px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  box-shadow: var(--pf-shadow-lg);
  padding: 4px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease-out, visibility 0.15s ease-out, transform 0.15s ease-out;
}
.dropdown.open .dropdown-menu,
.dropdown .dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pos-dropdown-portal {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 9999;
  min-width: 180px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  box-shadow: var(--pf-shadow-lg);
  padding: 4px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease-out, visibility 0.15s ease-out, transform 0.15s ease-out;
}
.pos-dropdown-portal.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.darkmode .pos-dropdown-portal {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--pf-text-primary);
  text-decoration: none;
  font-size: 14px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}
.dropdown-item svg {
  color: var(--pf-text-muted);
  flex-shrink: 0;
}
.dropdown-item:hover {
  background: var(--pf-bg-tertiary);
}
.dropdown-item-danger {
  color: var(--pf-negative);
}
.dropdown-item-danger svg {
  color: var(--pf-negative);
}
.dropdown-item-danger:hover {
  background: var(--pf-negative-bg);
}
.dropdown-item-warning {
  color: #f59e0b;
}
.dropdown-item-warning svg {
  color: #f59e0b;
}
.dropdown-item-warning:hover {
  background: rgba(245, 158, 11, 0.1);
}

.dropdown-divider {
  height: 1px;
  background: var(--pf-border-color);
  margin: 4px 0;
}

.messages-container {
  padding: 16px 24px 0;
}

.alert {
  padding: 16px 24px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  transition: opacity 0.3s;
}
.alert-success {
  background: var(--pf-positive-bg);
  color: var(--pf-positive);
  border: 1px solid var(--pf-positive);
}
.alert-error, .alert-danger {
  background: var(--pf-negative-bg);
  color: var(--pf-negative);
  border: 1px solid var(--pf-negative);
}
.alert-warning {
  background: var(--pf-warning-bg);
  color: var(--pf-warning);
  border: 1px solid var(--pf-warning);
}
.alert-info {
  background: var(--pf-info-bg);
  color: var(--pf-info);
  border: 1px solid var(--pf-info);
}
.alert-compact {
  padding: 8px 16px;
}
.alert code {
  font-size: 0.75rem;
  color: var(--pf-text-muted);
}

.alert-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}
.alert-close:hover {
  opacity: 1;
}

.error-list,
.warning-list {
  margin: 0.5rem 0 0 1rem;
  font-size: 0.85rem;
  max-height: 200px;
  overflow-y: auto;
}
.error-list li,
.warning-list li {
  margin-bottom: 0.25rem;
}

.position-mismatch-alert {
  margin: 0 0 16px;
  padding: 16px 24px;
}
.position-mismatch-alert .alert-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}
.position-mismatch-alert .alert-icon {
  flex-shrink: 0;
  margin-top: 2px;
}
.position-mismatch-alert .alert-body {
  flex: 1;
  min-width: 0;
}
.position-mismatch-alert .alert-body p {
  margin: 4px 0 8px;
  opacity: 0.9;
}
.position-mismatch-alert .alert-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  padding: 4px;
  margin: -4px;
}
.position-mismatch-alert .alert-dismiss:hover {
  opacity: 1;
}

.position-mismatch-list {
  margin: 0;
  padding-left: 24px;
  font-size: 14px;
}
.position-mismatch-list li {
  margin-bottom: 4px;
}
.position-mismatch-list li:last-child {
  margin-bottom: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge-premium {
  background: linear-gradient(135deg, var(--pf-accent), var(--pf-accent-hover));
  color: #FFF;
}
.badge-stock {
  background: var(--pf-info-bg);
  color: var(--pf-info);
}
.badge-etf {
  background: var(--pf-accent-light);
  color: var(--pf-accent);
}
.badge-cash {
  background: var(--pf-positive-bg);
  color: var(--pf-positive);
}
.badge-bond {
  background: var(--pf-warning-bg);
  color: var(--pf-warning);
}
.badge-custom {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-secondary);
}
.badge-duplicate {
  background: var(--pf-negative-bg);
  color: var(--pf-negative);
}
.badge-closed {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-muted);
  border: 1px solid var(--pf-border-color);
}

.import-cat {
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.closed-position {
  opacity: 0.6;
}
.closed-position td {
  color: var(--pf-text-muted);
}
.closed-position .ticker-link {
  text-decoration: line-through;
  opacity: 0.8;
}

.pf-card {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  box-shadow: var(--pf-shadow);
}
.pf-card-header {
  padding: 8px 16px;
  border-bottom: 1px solid var(--pf-border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  overflow: visible;
}
@media (min-width: 768px) {
  .pf-card-header {
    padding: 16px 24px;
    gap: 16px;
    flex-wrap: nowrap;
  }
}
.pf-card-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
@media (min-width: 768px) {
  .pf-card-title {
    font-size: 16px;
  }
}
.pf-card-body {
  padding: 16px;
}
@media (min-width: 768px) {
  .pf-card-body {
    padding: 24px;
  }
}
.pf-card-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--pf-border-color);
  background: var(--pf-bg-tertiary);
}
@media (min-width: 768px) {
  .pf-card-footer {
    padding: 16px 24px;
  }
}
.pf-card-narrow {
  max-width: 500px;
  margin: 0 auto;
}
.pf-card-xs {
  max-width: 400px;
  margin: 0 auto;
}
.pf-card-sm {
  max-width: 420px;
  margin: 0 auto;
}
.pf-card-md {
  max-width: 600px;
  margin: 0 auto;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
@media (min-width: 480px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}
@media (min-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 24px;
  }
}
@media (min-width: 1000px) {
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

.kpi-card {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--pf-shadow);
}
@media (min-width: 768px) {
  .kpi-card {
    padding: 24px;
  }
}

.kpi-label {
  font-size: 10px;
  color: var(--pf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
@media (min-width: 768px) {
  .kpi-label {
    font-size: 12px;
  }
}

.kpi-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}
@media (min-width: 480px) {
  .kpi-value {
    font-size: 1.5rem;
  }
}
@media (min-width: 768px) {
  .kpi-value {
    font-size: 1.75rem;
  }
}
.kpi-value.positive {
  color: var(--pf-positive);
}
.kpi-value.negative {
  color: var(--pf-negative);
}

.kpi-change {
  font-size: 11px;
  margin-top: 4px;
}
@media (min-width: 768px) {
  .kpi-change {
    font-size: 14px;
  }
}
.kpi-change.positive {
  color: var(--pf-positive);
}
.kpi-change.negative {
  color: var(--pf-negative);
}

.kpi-card--performance .kpi-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 4px;
}
.kpi-card--performance .kpi-label-row span {
  font-size: 10px;
  color: var(--pf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
@media (min-width: 768px) {
  .kpi-card--performance .kpi-label-row span {
    font-size: 12px;
  }
}
.kpi-card--performance .kpi-label-row select {
  padding: 4px 8px;
  font-size: 10px;
  background: var(--pf-input-bg);
  border: 1px solid var(--pf-input-border);
  border-radius: 4px;
  color: var(--pf-text-primary);
  cursor: pointer;
  min-height: 28px;
}
.kpi-card--performance .kpi-label-row select:focus {
  outline: none;
  border-color: var(--pf-accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  min-height: 44px;
  min-width: 44px;
  min-height: 44px;
}
@media (min-width: 768px) {
  .btn {
    font-size: 14px;
    min-height: 36px;
  }
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn svg {
  flex-shrink: 0;
}

.btn-primary {
  background: var(--pf-accent);
  color: white;
}
.btn-primary:hover:not(:disabled) {
  background: var(--pf-accent-hover);
}

.btn-secondary {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
  border: 1px solid var(--pf-border-color);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--pf-border-color);
}

.btn-danger {
  background: var(--pf-negative);
  color: white;
}
.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-ghost {
  background: transparent;
  color: var(--pf-text-secondary);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--pf-accent);
  border: 1px solid var(--pf-accent);
}
.btn-outline:hover:not(:disabled) {
  background: var(--pf-accent);
  color: white;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
  min-height: 36px;
}
@media (min-width: 768px) {
  .btn-sm {
    min-height: 32px;
  }
}

.btn-lg {
  padding: 16px 24px;
  font-size: 16px;
  min-height: 48px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--pf-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-icon span {
  font-size: 14px;
  font-weight: 600;
}
.btn-icon:hover {
  background: var(--pf-bg-secondary);
  color: var(--pf-accent);
  transform: scale(1.05);
}
.btn-icon--bordered {
  border: 1px solid var(--pf-border-color);
}
.btn-icon--bordered:hover {
  border-color: var(--pf-accent);
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (min-width: 768px) {
  .chart-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
  }
}

.chart-container {
  position: relative;
  height: 200px;
  background: var(--pf-bg-secondary);
  border-radius: 8px;
  padding: 8px;
}
@media (min-width: 480px) {
  .chart-container {
    height: 250px;
  }
}
@media (min-width: 768px) {
  .chart-container {
    height: 300px;
    padding: 16px;
  }
}
.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}
@media (min-width: 768px) {
  .chart-container--wide {
    grid-column: 1/-1;
  }
}

.chart-card {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  overflow: hidden;
}
.chart-card .chart-card-header {
  padding: 8px 16px;
  border-bottom: 1px solid var(--pf-border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
@media (min-width: 768px) {
  .chart-card .chart-card-header {
    padding: 16px 24px;
  }
}
.chart-card .chart-card-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
@media (min-width: 768px) {
  .chart-card .chart-card-title {
    font-size: 16px;
  }
}
.chart-card .chart-card-body {
  padding: 8px;
}
@media (min-width: 768px) {
  .chart-card .chart-card-body {
    padding: 16px;
  }
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
}
.empty-state-text {
  color: var(--pf-text-secondary);
  margin-bottom: 24px;
}
.empty-state-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--pf-border-color);
  border-top-color: var(--pf-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.skeleton {
  background: linear-gradient(90deg, var(--pf-bg-tertiary) 25%, var(--pf-border-color) 50%, var(--pf-bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.performance-selector {
  display: flex;
  gap: 4px;
}
.performance-selector button {
  padding: 4px 16px;
  background: none;
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  color: var(--pf-text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.performance-selector button:hover {
  background: var(--pf-bg-tertiary);
}
.performance-selector button.active {
  background: var(--pf-accent);
  color: white;
  border-color: var(--pf-accent);
}

.bulk-actions-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: var(--pf-bg-secondary);
  border-top: 1px solid var(--pf-border-color);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 90;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.bulk-actions-bar.visible {
  transform: translateY(0);
}
@media (min-width: 768px) {
  .bulk-actions-bar {
    padding-bottom: 16px;
  }
}
.bulk-actions-bar .selection-count {
  font-size: 14px;
  color: var(--pf-text-secondary);
}
.bulk-actions-bar .bulk-actions {
  display: flex;
  gap: 8px;
}

.asset-search-container {
  position: relative;
}

.asset-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  max-height: 400px;
  overflow-y: auto;
  z-index: 10001;
  display: none;
}
.asset-search-results.active {
  display: block;
}

.asset-result {
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid var(--pf-border-color);
  transition: background 0.15s;
}
.asset-result:last-child {
  border-bottom: none;
}
.asset-result:hover {
  background: var(--pf-table-hover);
}

.asset-result-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.asset-result-ticker {
  font-weight: 600;
  font-size: 0.875rem;
  min-width: 60px;
  color: var(--pf-text-primary);
}

.asset-result-name {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--pf-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-result-hint {
  font-size: 0.6875rem;
  color: var(--pf-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-result-type {
  font-size: 0.6875rem;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-muted);
  text-transform: uppercase;
  flex-shrink: 0;
}
.asset-result-type.custom {
  background: var(--pf-warning-bg);
  color: var(--pf-warning);
}
.asset-result-type.new {
  background: var(--pf-accent-light);
  color: var(--pf-accent);
}

.asset-search-hint {
  font-size: 0.75rem;
  color: var(--pf-text-muted);
  margin-top: 0.5rem;
}

.pf-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border-radius: 50%;
  color: var(--pf-text-muted);
  cursor: help;
  vertical-align: middle;
  position: relative;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s ease;
}
.pf-info svg {
  width: 14px;
  height: 14px;
  display: block;
}
.pf-info:hover, .pf-info:focus-visible {
  color: var(--pf-accent);
  outline: none;
}

.pf-tooltip-portal {
  position: fixed;
  background: var(--pf-text-primary);
  color: var(--pf-bg-primary);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: normal;
  max-width: 260px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 10000;
}
.pf-tooltip-portal.is-visible {
  opacity: 1;
}
.pf-tooltip-portal::after {
  content: "";
  position: absolute;
  left: var(--pf-arrow-x, 50%);
  transform: translateX(-50%);
  border: 5px solid transparent;
}
.pf-tooltip-portal.pf-tooltip--top::after {
  top: 100%;
  border-top-color: var(--pf-text-primary);
}
.pf-tooltip-portal.pf-tooltip--bottom::after {
  bottom: 100%;
  border-bottom-color: var(--pf-text-primary);
}

@media (max-width: 768px) {
  .pf-tooltip-portal {
    max-width: 220px;
    font-size: 0.7rem;
  }
}
.pf-table-wrapper {
  overflow-x: visible;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) {
  .pf-table-wrapper {
    overflow-x: auto;
  }
}
@media (min-width: 1200px) {
  .pf-table-wrapper {
    overflow-x: visible;
  }
}

.pf-table {
  width: 100%;
  font-size: 12px;
}
@media (min-width: 768px) {
  .pf-table {
    border-collapse: collapse;
    font-size: 14px;
  }
}
.pf-table thead {
  display: none;
}
@media (min-width: 768px) {
  .pf-table thead {
    display: table-header-group;
  }
}
.pf-table tbody {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@media (min-width: 768px) {
  .pf-table tbody {
    display: table-row-group;
  }
}
.pf-table tr {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 8px;
  padding: 16px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
}
@media (min-width: 768px) {
  .pf-table tr {
    display: table-row;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
  }
}
@media (min-width: 768px) {
  .pf-table tbody tr:nth-child(odd) td {
    background: var(--pf-bg-secondary);
  }
  .pf-table tbody tr:nth-child(even) td {
    background: var(--pf-table-stripe);
  }
  .pf-table tbody tr:hover td {
    background: var(--pf-table-hover);
  }
}
@media (min-width: 768px) {
  .pf-table th, .pf-table td {
    padding: 4px 8px;
    text-align: left;
    border-bottom: 1px solid var(--pf-border-color);
    white-space: nowrap;
  }
}
@media (min-width: 768px) {
  .pf-table th {
    font-weight: 600;
    color: var(--pf-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 10px;
    background: var(--pf-bg-tertiary);
    position: sticky;
    top: 0;
    padding: 8px;
  }
}
.pf-table td {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
}
@media (min-width: 768px) {
  .pf-table td {
    display: table-cell;
    padding: 4px 8px;
  }
}
.pf-table td::before {
  content: attr(data-label);
  font-size: 10px;
  color: var(--pf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
@media (min-width: 768px) {
  .pf-table td::before {
    display: none;
  }
}
.pf-table .positive {
  color: var(--pf-positive);
}
.pf-table .negative {
  color: var(--pf-negative);
}
@media (min-width: 768px) {
  .pf-table .text-right {
    text-align: right;
  }
}
@media (min-width: 768px) {
  .pf-table .text-center {
    text-align: center;
  }
}
.pf-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.pf-table th.sortable:hover {
  background: var(--pf-table-hover);
}
.pf-table th.sortable .sort-icon {
  display: inline-block;
  width: 10px;
  margin-left: 4px;
  opacity: 0.3;
}
.pf-table th.sortable .sort-icon::after {
  content: "⇅";
  font-size: 10px;
}
.pf-table th.sortable.sort-asc .sort-icon {
  opacity: 1;
}
.pf-table th.sortable.sort-asc .sort-icon::after {
  content: "↑";
}
.pf-table th.sortable.sort-desc .sort-icon {
  opacity: 1;
}
.pf-table th.sortable.sort-desc .sort-icon::after {
  content: "↓";
}
.pf-table .hide-mobile-cell {
  display: none;
}
@media (min-width: 768px) {
  .pf-table .hide-mobile-cell {
    display: table-cell;
  }
}
.pf-table .mobile-full-width {
  grid-column: 1/-1;
}
@media (min-width: 768px) {
  .pf-table .mobile-full-width {
    grid-column: auto;
  }
}
.pf-table .mobile-primary {
  grid-column: 1/-1;
  font-weight: 600;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--pf-border-light);
  margin-bottom: 4px;
}
@media (min-width: 768px) {
  .pf-table .mobile-primary {
    grid-column: auto;
    padding-bottom: 0;
    border-bottom: none;
    margin-bottom: 0;
  }
}
.pf-table .mobile-actions {
  grid-column: 1/-1;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--pf-border-light);
  margin-top: 4px;
}
@media (min-width: 768px) {
  .pf-table .mobile-actions {
    grid-column: auto;
    padding-top: 0;
    border-top: none;
    margin-top: 0;
  }
}

.pf-table.performance-grid-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}
.pf-table.performance-grid-table thead {
  display: table-header-group !important;
}
.pf-table.performance-grid-table tbody {
  display: table-row-group !important;
  gap: 0;
}
.pf-table.performance-grid-table tr {
  display: table-row !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  gap: 0 !important;
}
.pf-table.performance-grid-table th,
.pf-table.performance-grid-table td {
  display: table-cell !important;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 10px;
  padding: 4px 4px;
}
.pf-table.performance-grid-table th::before,
.pf-table.performance-grid-table td::before {
  display: none !important;
}
.pf-table.performance-grid-table th {
  font-size: 9px;
}
.pf-table.performance-grid-table td.text-muted {
  opacity: 0.65;
}
@media (min-width: 480px) {
  .pf-table.performance-grid-table th,
  .pf-table.performance-grid-table td {
    padding: 4px 8px;
    font-size: 11px;
  }
  .pf-table.performance-grid-table th {
    font-size: 10px;
  }
}
@media (min-width: 1200px) {
  .pf-table.performance-grid-table th,
  .pf-table.performance-grid-table td {
    padding: 8px 16px;
    font-size: 12px;
  }
  .pf-table.performance-grid-table th {
    font-size: 11px;
  }
}

.ticker-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.ticker-link:hover .ticker-cell strong {
  color: var(--pf-accent);
}

.ticker-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ticker-cell strong {
  font-weight: 600;
  transition: color 0.2s;
}

.row-actions {
  display: flex;
  gap: 4px;
  opacity: 1;
}
@media (min-width: 768px) {
  .row-actions {
    opacity: 0;
    transition: opacity 0.2s;
  }
  tr:hover .row-actions {
    opacity: 1;
  }
}

.row-positive {
  background: var(--pf-positive-bg) !important;
}
.row-positive:hover {
  background: color-mix(in srgb, var(--pf-positive-bg) 80%, var(--pf-table-hover)) !important;
}

.row-negative {
  background: var(--pf-negative-bg) !important;
}
.row-negative:hover {
  background: color-mix(in srgb, var(--pf-negative-bg) 80%, var(--pf-table-hover)) !important;
}

.row-income {
  background: var(--pf-info-bg) !important;
}
.row-income:hover {
  background: color-mix(in srgb, var(--pf-info-bg) 80%, var(--pf-table-hover)) !important;
}

.row-corporate {
  background: var(--pf-warning-bg) !important;
}
.row-corporate:hover {
  background: color-mix(in srgb, var(--pf-warning-bg) 80%, var(--pf-table-hover)) !important;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--pf-text-secondary);
}
@media (min-width: 768px) {
  .form-label {
    font-size: 14px;
  }
}

.form-control {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px 16px;
  background: var(--pf-input-bg);
  border: 1px solid var(--pf-input-border);
  border-radius: 8px;
  color: var(--pf-text-primary);
  font-size: 16px;
  transition: border-color 0.2s;
  min-height: 44px;
}
@media (min-width: 768px) {
  .form-control {
    font-size: 14px;
    min-height: 40px;
  }
}
.form-control:focus {
  outline: none;
  border-color: var(--pf-accent);
  box-shadow: 0 0 0 3px var(--pf-accent-light);
}
.form-control::placeholder {
  color: var(--pf-text-muted);
}
.form-control:disabled {
  background: var(--pf-bg-tertiary);
  cursor: not-allowed;
}
.form-control[type=text], .form-control[type=number], .form-control[type=date], .form-control[type=email] {
  height: 44px;
}
@media (min-width: 768px) {
  .form-control[type=text], .form-control[type=number], .form-control[type=date], .form-control[type=email] {
    height: 40px;
  }
}

select.form-control,
.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M2.5 4.5L6 8l3.5-3.5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.5rem;
  cursor: pointer;
}
select.form-control option,
.form-select option {
  background: var(--pf-bg-secondary);
  color: var(--pf-text-primary);
}

.portfolio-app.darkmode select.form-control,
.portfolio-app.darkmode .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M2.5 4.5L6 8l3.5-3.5' stroke='%239ca3af' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.form-check input[type=checkbox] {
  width: 22px;
  height: 22px;
  cursor: pointer;
}
@media (min-width: 768px) {
  .form-check input[type=checkbox] {
    width: 18px;
    height: 18px;
  }
}
.form-check label {
  font-size: 16px;
  cursor: pointer;
}
@media (min-width: 768px) {
  .form-check label {
    font-size: 14px;
  }
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 480px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}
.form-row .form-group {
  min-width: 0;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--pf-border-color);
}
@media (min-width: 480px) {
  .form-actions {
    flex-direction: row;
    margin-top: 24px;
    padding-top: 24px;
  }
}
.form-actions .btn {
  width: 100%;
  justify-content: center;
}
@media (min-width: 480px) {
  .form-actions .btn {
    width: auto;
  }
}

.inline-edit {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.inline-edit input {
  width: 100%;
  max-width: 120px;
  padding: 8px;
  font-size: 16px;
  min-height: 40px;
}
@media (min-width: 768px) {
  .inline-edit input {
    width: 100px;
    padding: 4px;
    font-size: 14px;
    min-height: auto;
  }
}

.inline-price-edit {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.inline-price-edit .currency-label {
  font-size: 12px;
  color: var(--pf-text-muted);
}
@media (min-width: 768px) {
  .inline-price-edit .currency-label {
    font-size: 14px;
  }
}
.inline-price-edit .inline-price-input {
  width: 100%;
  max-width: 100px;
  padding: 8px;
  font-size: 16px;
  text-align: right;
  border: 1px solid var(--pf-border-color);
  background: var(--pf-input-bg);
  border-radius: 4px;
  transition: all 0.2s;
  min-height: 40px;
}
@media (min-width: 768px) {
  .inline-price-edit .inline-price-input {
    width: 80px;
    padding: 4px 8px;
    font-size: 14px;
    border: 1px solid transparent;
    background: transparent;
    min-height: auto;
  }
}
.inline-price-edit .inline-price-input:hover {
  border-color: var(--pf-border-color);
  background: var(--pf-input-bg);
}
.inline-price-edit .inline-price-input:focus {
  border-color: var(--pf-accent);
  background: var(--pf-input-bg);
  outline: none;
  box-shadow: 0 0 0 2px var(--pf-accent-light);
}
.inline-price-edit .htmx-indicator {
  display: none;
  font-size: 10px;
  color: var(--pf-text-muted);
}
.inline-price-edit .htmx-request ~ .htmx-indicator {
  display: inline;
}

.pf-input-uppercase {
  text-transform: uppercase;
}

.form-page {
  max-width: 600px;
}
.form-page.form-page-narrow {
  max-width: 500px;
}
.form-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-card {
  border-radius: 12px;
}
.form-card .pf-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-help {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--pf-text-muted);
}

.asset-info {
  display: flex;
  gap: 2rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  background: var(--pf-bg-tertiary);
  border-radius: 8px;
}
@media (max-width: 768px) {
  .asset-info {
    flex-direction: column;
    gap: 1rem;
  }
}
.asset-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.asset-info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--pf-text-muted);
  font-weight: 500;
}
.asset-info-value {
  font-weight: 600;
  color: var(--pf-text-primary);
}

.price-history {
  display: flex;
  flex-direction: column;
}
.price-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--pf-border-color);
}
.price-history-item:last-child {
  border-bottom: none;
}
.price-history-date {
  font-size: 0.875rem;
  color: var(--pf-text-secondary);
}
.price-history-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--pf-text-primary);
}

.pf-card-danger {
  border-color: rgba(239, 68, 68, 0.3);
}
.pf-card-danger .pf-card-header {
  background: rgba(239, 68, 68, 0.05);
}
.pf-card-danger .pf-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ef4444;
}

.delete-impact {
  padding: 1rem;
  background: var(--pf-bg-tertiary);
  border-radius: 8px;
  margin-bottom: 1rem;
}
.delete-impact h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--pf-text-primary);
}
.delete-impact ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--pf-text-secondary);
  font-size: 0.875rem;
}
.delete-impact li {
  margin-bottom: 0.25rem;
}

.delete-irreversible {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #ef4444;
}

.delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--pf-border-color);
}

.ticker-validation-feedback {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.875rem;
  vertical-align: middle;
}
.ticker-validation-feedback.loading {
  color: var(--pf-text-muted, #6b7280);
}
.ticker-validation-feedback.valid {
  color: var(--pf-positive, #10b981);
}
.ticker-validation-feedback.invalid {
  color: var(--pf-negative, #ef4444);
}
.ticker-validation-feedback .ticker-icon {
  margin-right: 0.25rem;
}

.ticker-input-wrapper {
  position: relative;
}
.ticker-input-wrapper .ticker-validation-inline {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  pointer-events: none;
}
.ticker-input-wrapper input {
  padding-right: 8rem;
}

.rename-container {
  max-width: 500px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.rename-card {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-color, #e0e0e0);
}

.rename-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary, #1a1a1a);
}

.rename-subtitle {
  color: var(--text-secondary, #666);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.current-ticker {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--hover-bg, #f5f5f5);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.ticker-badge {
  font-size: 1.25rem;
  font-weight: 700;
  background: #3b82f6;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.ticker-info {
  font-size: 0.875rem;
  color: var(--text-secondary, #666);
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.exchange-hints {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 8px;
  font-size: 0.85rem;
}
.exchange-hints h4 {
  margin: 0 0 0.5rem 0;
  color: #3b82f6;
  font-size: 0.9rem;
}
.exchange-hints ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-secondary, #666);
}
.exchange-hints li {
  margin-bottom: 0.25rem;
}
.exchange-hints code {
  background: rgba(0, 0, 0, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.pf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pf-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.pf-modal-content {
  position: relative;
  background: var(--pf-bg-secondary);
  border-radius: 12px;
  box-shadow: var(--pf-shadow-lg);
  max-width: 550px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.pf-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--pf-border-color);
}

.pf-modal .modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.pf-modal .modal-body {
  padding: 1.5rem;
}

.pf-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--pf-border-color);
}

.pf-modal .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pf-modal .form-group {
  margin-bottom: 1rem;
}

.pf-modal .form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.modal-close-btn {
  background: none;
  border: none;
  padding: 0.375rem;
  cursor: pointer;
  color: var(--pf-text-muted);
  border-radius: 8px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close-btn:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}

.pf-modal-narrow {
  max-width: 420px;
}

.pf-modal-xs {
  max-width: 400px;
}

.pf-modal-sm {
  max-width: 500px;
}

.pf-modal-md {
  max-width: 600px;
}

.pf-modal-lg {
  max-width: 700px;
}

.edit-price-modal-content {
  max-width: 420px;
}

.pf-modal--rename .pf-modal-content {
  max-width: 460px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
}

.pf-modal--rename .pf-modal-content > .tx-modal-header {
  flex-shrink: 0;
}

.pf-modal--rename #rename-modal-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: visible;
}

.pf-modal--rename .rename-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pf-modal--rename .tx-modal-footer {
  flex-shrink: 0;
  flex-wrap: nowrap;
  position: relative;
  z-index: 0;
}
.pf-modal--rename .tx-modal-footer .btn {
  min-height: 44px;
  touch-action: manipulation;
}

.pf-modal--rename .rename-search-section {
  flex-shrink: 0;
  padding: 0 1.5rem 0.25rem;
  position: relative;
  z-index: 2;
}

.rename-search-hint-text {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--pf-text-muted);
}

.rename-search-field-group {
  margin-bottom: 0;
}

.pf-modal--rename .rename-search-section .asset-search-results {
  z-index: 100;
  max-height: min(260px, 38vh);
}

.price-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.price-modal-overlay.open {
  display: flex;
}

.price-modal-dialog {
  background: var(--pf-bg-secondary);
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--pf-border-color);
}

.price-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--pf-border-color);
}

.price-modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--pf-text-primary);
}

.price-modal-ticker {
  padding: 0.25rem 0.625rem;
  background: var(--pf-bg-tertiary);
  border: 1px solid var(--pf-border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  color: var(--pf-text-primary);
  letter-spacing: 0.025em;
}

.price-modal-close {
  background: none;
  border: none;
  padding: 0.375rem;
  cursor: pointer;
  color: var(--pf-text-muted);
  border-radius: 8px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.price-modal-close:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}

.price-modal-body {
  padding: 1.5rem;
}

.price-modal-field {
  margin-bottom: 1rem;
}
.price-modal-field:last-child {
  margin-bottom: 0;
}
.price-modal-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pf-text-secondary);
  margin-bottom: 0.5rem;
}
.price-modal-field input[type=date],
.price-modal-field input[type=text]:not(.price-modal-input-group input) {
  width: 100%;
  height: 44px !important;
  padding: 0.625rem 0.875rem !important;
  border: 1px solid var(--pf-border-color) !important;
  border-radius: 8px !important;
  background: var(--pf-bg-primary) !important;
  color: var(--pf-text-primary) !important;
  font-size: 1rem !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  transition: all 0.15s;
  box-sizing: border-box !important;
  margin: 0 !important;
}
.price-modal-field input[type=date]:focus,
.price-modal-field input[type=text]:not(.price-modal-input-group input):focus {
  outline: none !important;
  border-color: var(--pf-accent) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}
.price-modal-field input[type=date]:hover,
.price-modal-field input[type=text]:not(.price-modal-input-group input):hover {
  border-color: var(--pf-text-muted);
}

.price-modal-input-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.price-modal-input-group input[type=number] {
  flex: 1;
  min-width: 0;
  height: 44px !important;
  padding: 0.625rem 0.875rem !important;
  border: 1px solid var(--pf-border-color) !important;
  border-radius: 8px !important;
  background: var(--pf-bg-primary) !important;
  color: var(--pf-text-primary) !important;
  font-size: 1rem !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  transition: all 0.15s;
  box-sizing: border-box !important;
  margin: 0 !important;
  vertical-align: middle !important;
}
.price-modal-input-group input[type=number]:focus {
  outline: none !important;
  border-color: var(--pf-accent) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}
.price-modal-input-group input[type=number]::placeholder {
  color: var(--pf-text-muted);
  opacity: 0.5;
}
.price-modal-input-group .price-modal-currency-select {
  flex: 0 0 95px;
  height: 44px !important;
  padding: 0.625rem 2rem 0.625rem 0.875rem !important;
  border: 1px solid var(--pf-border-color) !important;
  border-radius: 8px !important;
  background: var(--pf-bg-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath fill='%236b7280' stroke='none' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E") no-repeat right 0.5rem center !important;
  background-size: 14px !important;
  color: var(--pf-text-primary) !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
  line-height: 1.5 !important;
  cursor: pointer;
  transition: all 0.15s;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  text-align: left;
  box-sizing: border-box !important;
  margin: 0 !important;
  vertical-align: middle !important;
}
.price-modal-input-group .price-modal-currency-select:focus {
  outline: none !important;
  border-color: var(--pf-accent) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}
.price-modal-input-group .price-modal-currency-select:hover {
  border-color: var(--pf-text-muted);
}
.price-modal-input-group .price-modal-currency-select option {
  background: var(--pf-bg-secondary) !important;
  color: var(--pf-text-primary) !important;
  padding: 0.5rem;
  font-size: 1rem;
}

.price-modal-hint {
  display: block;
  margin-top: 0.5rem;
  padding: 0.375rem 0.5rem;
  background: rgba(59, 130, 246, 0.05);
  border-radius: 6px;
  color: var(--pf-text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}
.portfolio-app.darkmode .price-modal-hint {
  background: rgba(59, 130, 246, 0.1);
}

.price-modal-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--pf-border-color);
  background: var(--pf-bg-tertiary);
  border-radius: 0 0 16px 16px;
}

.price-modal-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.price-modal-btn-cancel {
  background: var(--pf-bg-secondary);
  color: var(--pf-text-secondary);
  border: 1px solid var(--pf-border-color);
}
.price-modal-btn-cancel:hover {
  background: var(--pf-bg-primary);
  color: var(--pf-text-primary);
}

.price-modal-btn-save {
  background: var(--pf-accent);
  color: #fff;
}
.price-modal-btn-save:hover {
  background: var(--pf-accent-hover);
}
.price-modal-btn-save:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.rename-modal-info {
  background: var(--pf-bg-tertiary);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
}
.rename-modal-info p {
  margin: 0 0 0.5rem 0;
  color: var(--pf-text-secondary);
}
.rename-modal-info p:last-child {
  margin-bottom: 0;
}
.rename-modal-info strong {
  color: var(--pf-text-primary);
}

.pf-modal--rename .rename-modal-swap-field {
  margin-bottom: 1rem;
}

.rename-modal-swap-explainer {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--pf-text-muted);
}

.rename-modal-value-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.5rem;
  min-height: 42px;
  padding: 0 0.75rem;
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  background: var(--pf-bg-primary);
  box-sizing: border-box;
}

.rename-modal-current-ticker {
  flex: 0 0 auto;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.02em;
  color: var(--pf-text-primary);
}

.rename-modal-current-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--pf-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-modal--rename .rename-modal-custom-badge {
  background: var(--pf-selection-bg);
  color: var(--pf-accent);
}

.rename-modal-swap-connector {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.15rem 0 0.65rem;
}

.rename-modal-swap-connector-line {
  flex: 1 1 0;
  min-width: 0;
  border-top: 1px solid var(--pf-border-color);
}

.rename-modal-swap-connector-icon {
  flex-shrink: 0;
  font-size: 0.8125rem;
  line-height: 1;
  color: var(--pf-text-muted);
  opacity: 0.75;
}

.rename-btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.rename-modal-warning {
  align-items: flex-start;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.04) 100%);
  border: 1px solid rgba(245, 158, 11, 0.22);
  border-radius: 8px;
  line-height: 1.5;
  color: var(--pf-text-secondary);
}
.rename-modal-warning svg {
  flex-shrink: 0;
  color: #f59e0b;
  margin-top: 0.125rem;
}

.rename-action-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.rename-action-card {
  display: block;
  width: 100%;
  padding: 1rem 1rem;
  background: var(--pf-bg-primary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-align: left;
}
.rename-action-card:hover {
  border-color: var(--pf-accent);
  background: var(--pf-bg-tertiary);
}
.rename-action-card.loading {
  opacity: 0.7;
  cursor: wait;
}

.rename-action-content {
  min-width: 0;
}

.rename-action-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--pf-text-primary);
  margin-bottom: 0.35rem;
}

.rename-action-desc {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--pf-text-muted);
}

.rename-search-hint--tip {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--pf-text-muted);
}

.rename-search-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pf-modal--tx-form .pf-modal-content {
  max-width: 460px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pf-modal--tx-form .tx-modal-header {
  flex-shrink: 0;
}

.pf-modal--tx-form form#transaction-form,
.pf-modal--tx-form form#edit-transaction-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.pf-modal--tx-form .tx-category-tabs {
  flex-shrink: 0;
}

.pf-modal--tx-form .tx-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pf-modal--tx-form .tx-modal-footer {
  flex-shrink: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.pf-modal--tx-form .tx-modal-footer .btn {
  min-height: 44px;
  touch-action: manipulation;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

@media (max-width: 400px) {
  .pf-modal--tx-form .tx-form-row {
    flex-direction: row;
    align-items: flex-start;
  }
}
.pf-modal--tx-form .tx-form-row > .tx-field-group--flex {
  min-width: 0;
}

.pf-modal--tx-form .tx-field-group--date {
  flex: 1 1 0;
  min-width: 0;
}

.pf-modal--tx-form .tx-field-group--date .form-control,
.pf-modal--tx-form .tx-field-group--date .flatpickr-alt-input,
.pf-modal--tx-form .tx-field-group--date .tx-date-picker--alt {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: 42px;
  padding: 0 0.75rem;
  font-size: 0.9375rem;
}

.tx-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--pf-border-color);
  gap: 0.75rem;
}
.tx-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.tx-modal-header-leading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
}

.tx-modal-ticker {
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  color: var(--pf-text-secondary);
  letter-spacing: 0.025em;
}

.tx-modal-close {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--pf-text-muted);
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tx-modal-close:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}

.tx-category-tabs {
  display: flex;
  border-bottom: 1px solid var(--pf-border-color);
}

.tx-category-tab {
  flex: 1;
  padding: 0.75rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pf-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.tx-category-tab:hover {
  color: var(--pf-text-primary);
  background: var(--pf-bg-tertiary);
}
.tx-category-tab.active {
  color: var(--pf-accent);
  border-bottom-color: var(--pf-accent);
}

.tx-modal-body {
  padding: 1.25rem 1.5rem;
  font-size: 0.875rem;
}

.pf-modal--tx-form .tx-modal-body,
.pf-modal--rename .tx-modal-body,
.pf-modal--move .tx-modal-body,
.pf-modal--settings .tx-modal-body,
.pf-modal--import .tx-modal-body {
  font-size: 0.9375rem;
}
.pf-modal--tx-form .tx-modal-header h3,
.pf-modal--rename .tx-modal-header h3,
.pf-modal--move .tx-modal-header h3,
.pf-modal--settings .tx-modal-header h3,
.pf-modal--import .tx-modal-header h3 {
  font-size: 1.0625rem;
}
.pf-modal--tx-form .tx-field-header > label,
.pf-modal--rename .tx-field-header > label,
.pf-modal--move .tx-field-header > label,
.pf-modal--settings .tx-field-header > label,
.pf-modal--import .tx-field-header > label {
  font-size: 0.875rem;
}
.pf-modal--tx-form .tx-field-hint,
.pf-modal--rename .tx-field-hint,
.pf-modal--move .tx-field-hint,
.pf-modal--settings .tx-field-hint,
.pf-modal--import .tx-field-hint {
  font-size: 0.8125rem;
}
.pf-modal--tx-form .tx-field-group > label,
.pf-modal--rename .tx-field-group > label,
.pf-modal--move .tx-field-group > label,
.pf-modal--settings .tx-field-group > label,
.pf-modal--import .tx-field-group > label {
  font-size: 0.875rem;
}

.pf-modal--tx-form .tx-category-tab {
  font-size: 0.9375rem;
}

.pf-modal--tx-form .tx-ratio-hint small {
  font-size: 0.8125rem;
}

.pf-modal--rename .rename-modal-swap-explainer,
.pf-modal--rename .rename-search-hint-text,
.pf-modal--move .rename-modal-swap-explainer {
  font-size: 0.8125rem;
  line-height: 1.45;
}

.pf-modal--rename .rename-modal-current-name {
  font-size: 0.875rem;
}

.pf-modal--rename .rename-modal-current-ticker {
  font-size: 1rem;
}

.pf-modal--move .move-modal-from-main {
  font-size: 0.9375rem;
}

.pf-modal--move .move-modal-from-ticker {
  font-size: 1rem;
}

.pf-modal--move .move-modal-from-meta {
  font-size: 0.8125rem;
}

.pf-modal--move .move-info-badge {
  font-size: 0.75rem;
}

.tx-modal-alert {
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
}

.tx-field-group {
  margin-bottom: 1rem;
}
.tx-field-group > label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pf-text-secondary);
  margin-bottom: 0.375rem;
}
.tx-field-group .form-control {
  width: 100%;
  height: 42px;
  padding: 0 0.75rem;
  font-size: 0.9375rem;
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  background: var(--pf-bg-primary);
  color: var(--pf-text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tx-field-group .form-control::placeholder {
  color: var(--pf-text-muted);
  opacity: 0.6;
}
.tx-field-group .form-control:focus {
  outline: none;
  border-color: var(--pf-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.tx-field-group select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 12px;
  padding-right: 2.25rem;
  cursor: pointer;
}
.tx-field-group textarea.form-control {
  height: auto;
  min-height: 60px;
  padding: 0.625rem 0.75rem;
  resize: vertical;
}
.tx-field-group.has-error .form-control {
  border-color: var(--pf-negative, #dc3545);
}

.tx-field-group--flex {
  flex: 1;
  min-width: 0;
}

.tx-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.375rem;
}
.tx-field-header > label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pf-text-secondary);
}

.tx-field-hint {
  font-size: 0.75rem;
  color: var(--pf-text-muted);
}

.tx-input-with-currency {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  background: var(--pf-bg-primary);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tx-input-with-currency:focus-within {
  border-color: var(--pf-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.tx-input-with-currency .form-control {
  flex: 1;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  min-width: 0;
}
.tx-input-with-currency .form-control:focus {
  box-shadow: none !important;
}

.tx-currency-select {
  flex: 0 0 auto;
  padding: 0 0.75rem;
  border: none;
  border-left: 1px solid var(--pf-border-color);
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 10px;
  padding-right: 1.75rem;
  min-width: 70px;
}
.tx-currency-select:focus {
  outline: none;
}

.tx-currency-display {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  border-left: 1px solid var(--pf-border-color);
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 50px;
}

.tx-ratio-hint {
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--pf-bg-tertiary);
  border-radius: 6px;
}
.tx-ratio-hint small {
  font-size: 0.75rem;
  color: var(--pf-text-muted);
}

.tx-optional-hint {
  font-size: 0.75rem;
  font-weight: normal;
  color: var(--pf-text-muted);
}

.tx-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--pf-border-color);
}

.tx-total-label {
  font-size: 0.875rem;
  color: var(--pf-text-secondary);
}

.tx-total-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--pf-text-primary);
}

.tx-form-field {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}
.tx-form-field > label {
  flex: 0 0 52px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pf-text-secondary);
  padding-top: 0.5rem;
  text-align: right;
}
.tx-form-field .tx-form-input,
.tx-form-field > .form-control,
.tx-form-field > .asset-search-container,
.tx-form-field > textarea {
  flex: 1;
  min-width: 0;
}
.tx-form-field .form-control {
  height: 36px;
  padding: 0 0.625rem;
  font-size: 0.875rem;
}
.tx-form-field textarea.form-control {
  height: auto;
  min-height: 36px;
  padding: 0.5rem 0.625rem;
  resize: vertical;
}
.tx-form-field.has-error .form-control {
  border-color: var(--pf-negative, #dc3545);
}
@media (max-width: 400px) {
  .tx-form-field {
    flex-direction: column;
    gap: 0.25rem;
  }
  .tx-form-field > label {
    flex: none;
    text-align: left;
    padding-top: 0;
  }
}

.tx-form-field--flex {
  flex: 1;
}

.tx-form-field--sm {
  flex: 0 0 115px;
}
.tx-form-field--sm > label {
  flex: 0 0 32px;
  min-width: 32px;
}
.tx-form-field--sm .form-control {
  flex: 1;
  min-width: 0;
}
@media (max-width: 400px) {
  .tx-form-field--sm {
    flex: 1;
  }
}

.tx-form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.tx-form-row > .tx-field-group {
  margin-bottom: 0;
}
@media (max-width: 400px) {
  .tx-form-row {
    flex-direction: column;
    gap: 1rem;
  }
}

.asset-search-container {
  position: relative;
  flex: 1;
}

.asset-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  box-shadow: var(--pf-shadow-md);
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}
.asset-search-results.active {
  display: block;
}

.asset-result {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.1s;
}
.asset-result:hover {
  background: var(--pf-bg-tertiary);
}

.asset-result-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.asset-result-ticker {
  font-weight: 600;
  font-size: 0.875rem;
}

.asset-result-name {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--pf-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-result-type {
  font-size: 0.6875rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-muted);
  text-transform: uppercase;
}
.asset-result-type.new {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}
.asset-result-type.custom {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.asset-result-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--pf-text-muted);
  margin-top: 0.125rem;
}

.tx-asset-info {
  margin-top: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.asset-badge {
  font-size: 0.6875rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--pf-bg-tertiary);
  text-transform: uppercase;
}

.asset-name {
  font-size: 0.8125rem;
  color: var(--pf-text-secondary);
}

.tx-custom-warning {
  margin-top: 0.375rem;
  padding: 0.375rem 0.5rem;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 4px;
  font-size: 0.75rem;
  color: #d97706;
}

.tx-notes-input {
  min-height: 56px;
  overflow: hidden;
  resize: none;
}

.tx-cash-info {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.625rem;
  background: var(--pf-bg-tertiary);
  border-radius: 6px;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--pf-text-muted);
}
.tx-cash-info svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.tx-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--pf-border-color);
  background: var(--pf-bg-tertiary);
}
.tx-modal-footer .btn-ghost {
  margin-right: auto;
}

.tx-form-field.has-error .form-control,
.form-control.is-invalid {
  border-color: var(--pf-negative, #dc3545);
  background-color: rgba(220, 53, 69, 0.05);
}
.tx-form-field.has-error .form-control:focus,
.form-control.is-invalid:focus {
  border-color: var(--pf-negative, #dc3545);
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.field-error {
  color: var(--pf-negative, #dc3545);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.no-results {
  padding: 0.75rem;
  text-align: center;
  color: var(--pf-text-muted);
  font-size: 0.8125rem;
}

#modal-submit-btn {
  position: relative;
  min-width: 70px;
}
#modal-submit-btn.htmx-request {
  pointer-events: none;
  opacity: 0.8;
}
#modal-submit-btn.htmx-request .btn-text {
  visibility: hidden;
}
#modal-submit-btn.htmx-request .btn-spinner {
  display: flex !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#modal-upload-btn {
  position: relative;
}
#modal-upload-btn.is-loading {
  pointer-events: none;
}
#modal-upload-btn.is-loading .btn-text {
  visibility: hidden;
}
#modal-upload-btn.is-loading .btn-spinner {
  display: inline-flex !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.spinner-icon {
  animation: modal-spin 0.8s linear infinite;
}

@keyframes modal-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.pf-modal--import .pf-modal-content {
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pf-modal--import .pf-modal-content > .tx-modal-header {
  flex-shrink: 0;
  background: var(--pf-bg-secondary);
}

.pf-modal--import #import-modal-form {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-width: 0;
}

.pf-modal--import #import-modal-form > .tx-modal-body {
  flex: 0 1 auto;
  overflow-y: visible;
}

.pf-modal--import #import-modal-form > .tx-modal-footer {
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  background: var(--pf-bg-secondary);
  border-top-color: var(--pf-border-color);
}

.pf-modal--import .tx-modal-footer .btn {
  min-height: 44px;
  touch-action: manipulation;
}

.pf-modal--import .tx-modal-footer .btn-primary .btn-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.import-modal-body .import-source-field,
.import-modal-body .import-file-field {
  margin-bottom: 1rem;
}

#import-modal-content {
  position: relative;
}
#import-modal-content .import-source-heading,
#import-modal-content .import-file-heading {
  display: block;
  margin-bottom: 0.25rem;
}
#import-modal-content .import-source-legend,
#import-modal-content .import-file-legend {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pf-text-secondary);
}
#import-modal-content .import-source-intro {
  margin: 0 0 0.5rem;
  line-height: 1.45;
}
#import-modal-content .import-file-hint {
  margin: 0 0 0.5rem;
  line-height: 1.45;
}

.import-help-modal {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--pf-bg-tertiary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
}
.import-help-modal .help-panel {
  font-size: 0.8125rem;
  color: var(--pf-text-secondary);
}
.import-help-modal .help-panel-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--pf-text-primary);
  margin-bottom: 0.375rem;
}
.import-help-modal .help-panel p {
  margin: 0 0 0.25rem;
}
.import-help-modal .help-panel ol {
  margin: 0;
  padding-left: 1.25rem;
}
.import-help-modal .help-panel li {
  margin-bottom: 0.125rem;
}
.import-help-modal .help-panel code {
  display: block;
  padding: 0.375rem 0.5rem;
  background: var(--pf-bg-primary);
  border-radius: 4px;
  font-size: 0.6875rem;
  margin: 0.375rem 0;
  word-break: break-word;
}
.import-help-modal .help-note {
  color: var(--pf-text-muted);
}
.import-help-modal .help-warning {
  color: var(--pf-warning, #f59e0b);
  margin-top: 0.5rem;
}
.import-help-modal .help-actions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.375rem;
}
.import-help-modal .action-tag {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  font-size: 0.625rem;
  font-weight: 500;
  border-radius: 3px;
  background: var(--pf-bg-primary);
  color: var(--pf-text-secondary);
}
.import-help-modal .action-tag.positive {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}
.import-help-modal .action-tag.negative {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.import-help-modal .action-tag.income {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}
.import-help-modal .download-example {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--pf-accent);
  background: rgba(59, 130, 246, 0.08);
  border-radius: 4px;
  text-decoration: none;
}
.import-help-modal .download-example:hover {
  background: rgba(59, 130, 246, 0.15);
}

#import-modal-content .dropzone.import-dropzone {
  display: block;
  margin: 0;
  position: relative;
  border: 1px dashed color-mix(in srgb, var(--pf-border-color) 85%, var(--pf-text-muted));
  border-radius: 8px;
  background: var(--pf-bg-primary);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
#import-modal-content .dropzone.import-dropzone:hover, #import-modal-content .dropzone.import-dropzone.dragover {
  border-color: var(--pf-accent);
  background: rgba(59, 130, 246, 0.04);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}
#import-modal-content .dropzone.import-dropzone.has-file {
  border-style: solid;
  border-color: var(--pf-accent);
  cursor: default;
}
#import-modal-content .dropzone.import-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#import-modal-content .dropzone.import-dropzone .dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.1rem 1rem;
  text-align: center;
  gap: 0.35rem;
}
#import-modal-content .dropzone.import-dropzone .dropzone-icon {
  color: var(--pf-text-muted);
  transition: color 0.2s;
}
#import-modal-content .dropzone.import-dropzone:hover .dropzone-icon, #import-modal-content .dropzone.import-dropzone.dragover .dropzone-icon {
  color: var(--pf-accent);
}
#import-modal-content .dropzone.import-dropzone .dropzone-text {
  font-size: 0.875rem;
  color: var(--pf-text-primary);
}
#import-modal-content .dropzone.import-dropzone .dropzone-link {
  color: var(--pf-accent);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 2px;
}
#import-modal-content .dropzone.import-dropzone .dropzone-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
}
#import-modal-content .file-list {
  flex: 1;
  min-width: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 160px;
  overflow-y: auto;
}
#import-modal-content .file-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
  min-width: 0;
}
#import-modal-content .file-list-item .file-name {
  flex: 1;
  min-width: 0;
}
#import-modal-content .file-list-item .file-size {
  flex-shrink: 0;
}
#import-modal-content .file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--pf-accent-light);
  color: var(--pf-accent);
  border-radius: 8px;
  flex-shrink: 0;
}
#import-modal-content .file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
#import-modal-content .file-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--pf-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#import-modal-content .file-size {
  font-size: 0.75rem;
  color: var(--pf-text-muted);
}
#import-modal-content .file-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--pf-text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}
#import-modal-content .file-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
#import-modal-content .import-processing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--pf-bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
}
#import-modal-content .processing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}
#import-modal-content .processing-spinner .spinner-icon {
  animation: spin 1s linear infinite;
  color: var(--pf-accent);
}
#import-modal-content .processing-status {
  font-size: 1rem;
  font-weight: 500;
  color: var(--pf-text-primary);
}
#import-modal-content .processing-substatus {
  font-size: 0.8125rem;
  color: var(--pf-text-muted);
}
#import-modal-content .btn-spinner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
#import-modal-content .btn-spinner-text {
  font-size: 0.875rem;
}

.settings-delete-row {
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  background: var(--pf-bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.settings-delete-row__text {
  flex: 1 1 12rem;
  min-width: 0;
}

.settings-delete-row__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pf-text-primary);
  margin-bottom: 0.25rem;
}

.settings-delete-row__desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--pf-text-muted);
  line-height: 1.45;
}

.settings-delete-row__btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  background: var(--pf-bg-primary);
  color: var(--pf-text-muted);
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.settings-delete-row__btn:hover {
  color: var(--pf-negative);
  background: var(--pf-negative-bg);
  border-color: color-mix(in srgb, var(--pf-negative) 35%, var(--pf-border-color));
}
.settings-delete-row__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pf-negative) 25%, transparent);
}
.settings-delete-row__btn svg {
  flex-shrink: 0;
}

.settings-empty-modal {
  text-align: center;
  padding: 2.5rem 1rem;
}
.settings-empty-modal .settings-empty-icon {
  color: var(--pf-text-muted);
  opacity: 0.5;
  margin-bottom: 0.875rem;
}
.settings-empty-modal .settings-empty-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.375rem;
  color: var(--pf-text-primary);
}
.settings-empty-modal .settings-empty-text {
  font-size: 0.875rem;
  color: var(--pf-text-muted);
  margin: 0;
  line-height: 1.5;
}

.pf-modal--move .pf-modal-content {
  max-width: 460px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.pf-modal--move .pf-modal-content > .tx-modal-header {
  flex-shrink: 0;
}

.pf-modal--move .pf-modal-content > #move-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.pf-modal--move .move-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pf-modal--move .tx-modal-footer {
  flex-shrink: 0;
}

.pf-modal--settings .pf-modal-content {
  max-width: 460px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pf-modal--settings .pf-modal-content > .tx-modal-header {
  flex-shrink: 0;
  background: var(--pf-bg-secondary);
}

.pf-modal--settings #settings-modal-form,
.pf-modal--settings #portfolio-create-form {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-width: 0;
}

.pf-modal--settings #settings-modal-form > .tx-modal-body,
.pf-modal--settings #portfolio-create-form > .tx-modal-body {
  flex: 0 1 auto;
  overflow-y: visible;
}

.pf-modal--settings #settings-modal-form > .tx-modal-footer,
.pf-modal--settings #portfolio-create-form > .tx-modal-footer {
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  background: var(--pf-bg-secondary);
  border-top-color: var(--pf-border-color);
}

.pf-modal--settings .pf-modal-content > .tx-modal-body.move-modal-body {
  flex: 0 1 auto;
  overflow-y: visible;
}

.pf-modal--settings .pf-modal-content > .tx-modal-footer {
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.pf-modal--settings .tx-modal-footer .btn {
  min-height: 44px;
  touch-action: manipulation;
}

.settings-modal-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  line-height: 1.45;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.settings-modal-alert svg {
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.settings-modal-alert--error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: var(--pf-text-secondary);
}
.settings-modal-alert--error svg {
  color: #ef4444;
}
.settings-modal-alert--success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.22);
  color: var(--pf-text-secondary);
}
.settings-modal-alert--success svg {
  color: #22c55e;
}
.settings-modal-alert--warning {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.28);
  color: var(--pf-text-secondary);
}
.settings-modal-alert--warning svg {
  color: #ca8a04;
}

.settings-modal-alert__text {
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
}
.settings-modal-alert__text p {
  margin: 0;
}
.settings-modal-alert__text p:not(:last-child) {
  margin-bottom: 0.25rem;
}

.pf-modal--settings .settings-modal-notes {
  margin-bottom: 0.25rem;
}

.pf-modal--move .move-modal-swap-field {
  margin-bottom: 0.15rem;
}

.pf-modal--move .move-modal-target-field {
  margin-bottom: 0;
}

.move-modal-from-box--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-height: auto;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.move-modal-from-ticker {
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.02em;
  color: var(--pf-text-primary);
}

.move-modal-from-main {
  font-size: 0.875rem;
  color: var(--pf-text-primary);
  font-weight: 500;
  line-height: 1.45;
}

.move-modal-from-main--tx-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.move-modal-from-tx-line {
  font-weight: 500;
  min-width: 0;
}

.move-modal-from-meta {
  font-size: 0.75rem;
  color: var(--pf-text-muted);
}

.move-info-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  background: var(--pf-selection-bg);
  color: var(--pf-accent);
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 0.5rem;
}

.move-modal-from-main--tx-row .move-info-badge {
  margin-right: 0;
  flex-shrink: 0;
}

.move-btn-loading {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

#move-submit-btn {
  position: relative;
  min-width: 5.5rem;
}
#move-submit-btn.htmx-request {
  pointer-events: none;
  opacity: 0.85;
}
#move-submit-btn.htmx-request .move-btn-text {
  visibility: hidden;
}
#move-submit-btn.htmx-request .move-btn-loading {
  display: inline-flex !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.move-modal-empty {
  text-align: center;
  padding: 2rem 1rem;
}
.move-modal-empty svg {
  color: var(--pf-text-muted);
  opacity: 0.5;
  margin-bottom: 1rem;
}
.move-modal-empty p {
  font-size: 0.875rem;
  color: var(--pf-text-muted);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.dashboard-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@container (max-width: 700px) {
  .dashboard-page {
    gap: 8px;
  }
}

.dashboard-loading {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 16px;
}
@container (max-width: 500px) {
  .dashboard-loading {
    padding: 16px;
  }
}

.dashboard-loading-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--pf-border-color);
  border-top-color: var(--pf-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

.dashboard-loading-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dashboard-loading-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--pf-text-primary);
}

.dashboard-loading-subtitle {
  font-size: 14px;
  color: var(--pf-text-muted);
}

.dashboard-loading-progress {
  height: 4px;
  background: var(--pf-bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.dashboard-loading-progress-bar {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--pf-accent) 0%, var(--pf-accent-hover, #5BA3E8) 50%, var(--pf-accent) 100%);
  border-radius: 4px;
  animation: loading-progress 2s ease-in-out infinite;
}

@keyframes loading-progress {
  0% {
    width: 5%;
    transform: translateX(0);
  }
  50% {
    width: 60%;
    transform: translateX(30%);
  }
  100% {
    width: 5%;
    transform: translateX(1800%);
  }
}
.pos-section[data-section-id=db-summary] .pos-collapsible-content {
  container-type: inline-size;
}

.kpi-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
}
@container (max-width: 500px) {
  .kpi-summary {
    flex-direction: column;
    gap: 8px;
    padding: 8px;
  }
}

.kpi-group {
  display: flex;
  flex: 1 1 auto;
  min-width: 200px;
  gap: 24px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  padding: 8px 16px;
  justify-content: space-around;
}
@container (max-width: 700px) {
  .kpi-group {
    gap: 16px;
    padding: 8px;
  }
}
@container (max-width: 500px) {
  .kpi-group {
    min-width: 0;
    flex: 1;
    justify-content: space-around;
  }
}

.kpi-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}
@container (max-width: 500px) {
  .kpi-item {
    min-width: 60px;
    align-items: center;
    text-align: center;
  }
}
.kpi-item .kpi-label {
  font-size: 10px;
  color: var(--pf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
@container (max-width: 500px) {
  .kpi-item .kpi-label {
    font-size: 9px;
  }
}
.kpi-item .kpi-value {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--pf-text-primary);
  white-space: nowrap;
}
.kpi-item .kpi-value.positive {
  color: var(--pf-positive);
}
.kpi-item .kpi-value.negative {
  color: var(--pf-negative);
}
@container (max-width: 700px) {
  .kpi-item .kpi-value {
    font-size: 1.2rem;
  }
}
@container (max-width: 500px) {
  .kpi-item .kpi-value {
    font-size: 1rem;
  }
}
.kpi-item .kpi-pct {
  font-size: 0.8rem;
  font-weight: 400;
  margin-left: 4px;
  opacity: 0.85;
}
@container (max-width: 500px) {
  .kpi-item .kpi-pct {
    display: block;
    margin-left: 0;
    font-size: 0.75rem;
  }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  padding: 16px;
}
@container (max-width: 500px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
  }
}

.kpi-card {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
@container (max-width: 500px) {
  .kpi-card {
    padding: 8px;
  }
}

.kpi-label {
  font-size: 14px;
  color: var(--pf-text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
@container (max-width: 500px) {
  .kpi-label {
    font-size: 0.65rem;
  }
}

.kpi-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--pf-text-primary);
  line-height: 1.2;
}
.kpi-value.positive {
  color: var(--pf-positive);
}
.kpi-value.negative {
  color: var(--pf-negative);
}
@container (max-width: 500px) {
  .kpi-value {
    font-size: 1rem;
  }
}

.kpi-sublabel {
  font-size: 14px;
  color: var(--pf-text-muted);
  margin-top: 4px;
}
.kpi-sublabel.positive {
  color: var(--pf-positive);
}
.kpi-sublabel.negative {
  color: var(--pf-negative);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 16px;
}
@container (max-width: 700px) {
  .chart-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }
}

.chart-card {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  overflow: hidden;
}

.chart-card-header {
  padding: 8px 16px;
  border-bottom: 1px solid var(--pf-border-color);
  background: var(--pf-bg-tertiary);
}

.chart-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--pf-text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chart-year-label {
  font-weight: 400;
  color: var(--pf-text-muted);
  font-size: 14px;
}

.chart-card-body {
  padding: 16px;
  background: var(--pf-bg-secondary);
}
@container (max-width: 500px) {
  .chart-card-body {
    padding: 8px;
  }
}

.pos-section[data-section-id=db-performance] .pos-collapsible-content,
.pos-section[data-section-id=db-allocation] .pos-collapsible-content {
  padding: 0;
  container-type: inline-size;
}
.pos-section[data-section-id=db-performance] .chart-grid,
.pos-section[data-section-id=db-allocation] .chart-grid {
  padding: 16px;
  gap: 16px;
  margin: 0;
  padding-bottom: 16px;
}
@container (max-width: 700px) {
  .pos-section[data-section-id=db-performance] .chart-grid,
  .pos-section[data-section-id=db-allocation] .chart-grid {
    gap: 8px;
    padding: 8px;
    padding-bottom: 8px;
  }
}
.pos-section[data-section-id=db-performance] .chart-grid > .chart-card,
.pos-section[data-section-id=db-allocation] .chart-grid > .chart-card {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.pos-section[data-section-id=db-performance] .chart-grid .chart-card-header,
.pos-section[data-section-id=db-allocation] .chart-grid .chart-card-header {
  background: transparent;
  border-bottom: none;
  padding: 0 0 8px;
}
.pos-section[data-section-id=db-performance] .chart-grid .chart-card-body,
.pos-section[data-section-id=db-allocation] .chart-grid .chart-card-body {
  background: transparent;
  padding: 0;
}
.pos-section[data-section-id=db-performance] .chart-grid .chart-container,
.pos-section[data-section-id=db-allocation] .chart-grid .chart-container {
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.pos-section[data-section-id=db-performance] .chart-card-title,
.pos-section[data-section-id=db-allocation] .chart-card-title {
  color: var(--pf-text-primary);
  font-weight: 600;
}

.pos-section[data-section-id=db-allocation] .chart-grid {
  align-items: stretch;
}
.pos-section[data-section-id=db-allocation] .chart-grid > .chart-card:first-child {
  display: flex;
  flex-direction: column;
}
.pos-section[data-section-id=db-allocation] .chart-grid > .chart-card:first-child .chart-card-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.pos-section[data-section-id=db-performance] .chart-grid {
  border-bottom: 1px solid var(--pf-border-color);
}
.pos-section[data-section-id=db-performance] .chart-year-label {
  color: var(--pf-text-muted);
  font-weight: 400;
}
.pos-section[data-section-id=db-performance] .pos-collapsible-content > .chart-card {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  margin: 0;
  padding: 16px;
}
@media (max-width: 768px) {
  .pos-section[data-section-id=db-performance] .pos-collapsible-content > .chart-card {
    padding: 8px;
  }
}
.pos-section[data-section-id=db-performance] .pos-collapsible-content > .chart-card .chart-card-header {
  background: transparent;
  border-bottom: none;
  padding: 0 0 8px;
}
.pos-section[data-section-id=db-performance] .pos-collapsible-content > .chart-card .chart-card-body {
  background: transparent;
  padding: 0;
}
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table tbody tr:nth-child(odd) td:not(:first-child),
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table tbody tr:nth-child(even) td:not(:first-child) {
  background: transparent;
}
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table tbody tr:hover td {
  background: var(--pf-table-hover);
}
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table th {
  background: var(--pf-bg-secondary);
  border-bottom: 1px solid var(--pf-border-color);
}
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table td {
  border-bottom: 1px solid var(--pf-border-light);
}
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table tbody tr:last-child td {
  border-bottom: none;
}
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table th:first-child {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--pf-bg-secondary);
  min-width: 3.5rem;
}
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table th:first-child::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.08), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table th:first-child {
  top: 0;
}
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table td:first-child {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--pf-bg-secondary);
  min-width: 3.5rem;
}
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table td:first-child::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.08), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table tbody tr:nth-child(even) td:first-child {
  background: var(--pf-table-stripe);
}
.pos-section[data-section-id=db-performance] .pf-table.performance-grid-table tbody tr:hover td:first-child {
  background: var(--pf-table-hover);
}
.pos-section[data-section-id=db-performance] .performance-grid-wrapper.is-scrolled .pf-table.performance-grid-table th:first-child::after,
.pos-section[data-section-id=db-performance] .performance-grid-wrapper.is-scrolled .pf-table.performance-grid-table td:first-child::after {
  opacity: 1;
}

.chart-container {
  position: relative;
  height: 280px;
}
@container (max-width: 500px) {
  .chart-container {
    height: 220px;
  }
}

.chart-container-donut {
  height: 300px;
}
@container (max-width: 500px) {
  .chart-container-donut {
    height: 260px;
  }
}

.allocation-donut-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
@container (max-width: 500px) {
  .allocation-donut-wrapper {
    flex-direction: column;
    gap: 8px;
  }
}

.allocation-donut-canvas {
  position: relative;
  flex: 0 1 auto;
  height: 100%;
  aspect-ratio: 1/1;
  min-width: 0;
}
.allocation-donut-canvas canvas {
  max-width: 100%;
  max-height: 100%;
}

.allocation-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
}
@container (max-width: 500px) {
  .allocation-donut-legend {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 12px;
  }
}

.allocation-donut-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--pf-text-primary);
  font-size: 14px;
  line-height: 1.2;
  user-select: none;
}
.allocation-donut-legend-item.is-hidden {
  opacity: 0.4;
  text-decoration: line-through;
}

.allocation-donut-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.allocation-donut-legend-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-container-bar {
  min-height: 200px;
  height: auto;
}
@container (max-width: 500px) {
  .chart-container-bar {
    min-height: 160px;
  }
}

.position-results-expand {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--pf-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
}
.position-results-expand:hover {
  color: var(--pf-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.position-results-expand:focus-visible {
  outline: 2px solid var(--pf-accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.position-results-expand[hidden] {
  display: none;
}

.chart-container-growth {
  height: 320px;
}
@container (max-width: 700px) {
  .chart-container-growth {
    height: 260px;
  }
}
@container (max-width: 500px) {
  .chart-container-growth {
    height: 200px;
  }
}

.pos-section[data-section-id=db-growth] .pos-collapsible-content {
  container-type: inline-size;
}

.growth-chart-wrapper {
  padding: 16px;
}
@container (max-width: 500px) {
  .growth-chart-wrapper {
    padding: 8px;
  }
}

.range-selector-block {
  margin-top: 16px;
}
@container (max-width: 500px) {
  .range-selector-block {
    margin-top: 8px;
  }
}

.range-selector-caption {
  margin: 0 0 4px;
  min-height: 1.25em;
  font-size: 14px;
  color: var(--pf-text-secondary);
  font-variant-numeric: tabular-nums;
}

.range-selector-wrapper {
  position: relative;
  height: 60px;
  border: 1px solid var(--pf-border-color);
  border-radius: 4px;
  overflow: hidden;
  background: var(--pf-bg-tertiary);
}
@container (max-width: 500px) {
  .range-selector-wrapper {
    height: 50px;
  }
}

.range-selector-chart {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.range-selector-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.range-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(59, 130, 246, 0.15);
  border-left: 2px solid var(--pf-accent);
  border-right: 2px solid var(--pf-accent);
  cursor: grab;
  pointer-events: auto;
}
.range-selection:active {
  cursor: grabbing;
}
.darkmode .range-selection {
  background: rgba(59, 130, 246, 0.25);
}

.range-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 32px;
  background: var(--pf-accent);
  border-radius: 4px;
  cursor: ew-resize;
  pointer-events: auto;
  z-index: 2;
}
.range-handle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 12px;
  background: repeating-linear-gradient(to bottom, white 0px, white 2px, transparent 2px, transparent 4px);
  opacity: 0.6;
}
.range-handle:hover {
  background: var(--pf-accent-hover);
}
@container (max-width: 500px) {
  .range-handle {
    width: 12px;
    height: 28px;
  }
}

.range-selector-overlay::before,
.range-selector-overlay::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--pf-bg-primary);
  opacity: 0.7;
  pointer-events: none;
}

.performance-grid-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 24px;
  scrollbar-width: thin;
  scrollbar-color: rgb(212, 214, 221) transparent;
}
.performance-grid-wrapper::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.performance-grid-wrapper::-webkit-scrollbar-track {
  background-color: transparent;
  border-radius: 10px;
}
.performance-grid-wrapper::-webkit-scrollbar-thumb {
  background-color: rgb(212, 214, 221);
  border-radius: 10px;
}
.performance-grid-wrapper:hover::-webkit-scrollbar-thumb {
  background-color: rgb(192, 194, 201);
}
.darkmode .performance-grid-wrapper {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.darkmode .performance-grid-wrapper::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.15);
}
.darkmode .performance-grid-wrapper:hover::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.25);
}

.performance-grid-table {
  font-size: 14px;
}
.performance-grid-table th, .performance-grid-table td {
  padding: 4px 8px;
  white-space: nowrap;
}
.performance-grid-table th {
  font-weight: 500;
  color: var(--pf-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.65rem;
}
.performance-grid-table td {
  font-variant-numeric: tabular-nums;
}
.performance-grid-table .positive {
  color: var(--pf-positive);
}
.performance-grid-table .negative {
  color: var(--pf-negative);
}
.performance-grid-table .text-muted {
  color: var(--pf-text-muted);
}
.performance-grid-table .perf-grid-cell {
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  border-radius: 4px;
}
.performance-grid-table .perf-grid-cell:hover:not(.selected) {
  background-color: var(--pf-bg-tertiary) !important;
}
.performance-grid-table .perf-grid-cell.selected {
  background-color: var(--pf-accent) !important;
  color: #fff !important;
  font-weight: 600;
}
.performance-grid-table .perf-grid-cell.is-approximate {
  position: relative;
}
.performance-grid-table .perf-grid-cell.is-approximate::after {
  content: "~";
  position: absolute;
  top: 0;
  right: 2px;
  font-size: 0.6rem;
  opacity: 0.6;
}
@container (max-width: 500px) {
  .performance-grid-table {
    font-size: 0.65rem;
  }
  .performance-grid-table th, .performance-grid-table td {
    padding: 4px;
  }
}

.pos-section[data-section-id=db-attribution] .pos-section-header {
  position: relative;
  z-index: 3;
}
.pos-section[data-section-id=db-attribution] .pos-collapsible-content {
  position: relative;
  z-index: 0;
}

.attribution-heading-text {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4em;
  min-width: 0;
}

.attribution-heading-prefix {
  flex: 0 1 auto;
}

.attribution-period-picker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  max-width: 100%;
  vertical-align: baseline;
}

.attribution-period-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--pf-accent);
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}
.attribution-period-trigger:hover:not(:disabled) {
  color: var(--pf-accent-hover);
}
.attribution-period-trigger:focus-visible {
  outline: 2px solid var(--pf-accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.attribution-period-trigger:disabled {
  cursor: default;
  color: var(--pf-text-muted);
  text-decoration: none;
}
.attribution-period-trigger #attribution-period-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(100%, 14rem);
}

.attribution-period-trigger-icon {
  flex-shrink: 0;
  opacity: 0.75;
}

.attribution-period-dropdown.pos-column-config-dropdown {
  left: 0;
  right: auto;
  z-index: 10010;
}
.attribution-period-dropdown {
  min-width: min(280px, 100vw - 1.5rem);
  max-width: min(360px, 100vw - 1.5rem);
}
@media (max-width: 767px) {
  .attribution-period-dropdown.pos-column-config-dropdown {
    left: auto;
    right: 0;
  }
  .attribution-period-dropdown {
    min-width: 0;
    width: min(360px, 100vw - 1rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-width: min(360px, 100vw - 1rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  }
}

.attribution-period-dropdown-inner {
  padding: 0.5rem;
  overflow: visible;
}

.attribution-period-latest {
  display: block;
  width: 100%;
  margin: 0 0 0.5rem 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--pf-border-color);
  border-radius: 6px;
  background: var(--pf-bg-secondary);
  color: var(--pf-text-primary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
}
.attribution-period-latest:hover {
  background: var(--pf-bg-tertiary);
  border-color: var(--pf-text-muted);
}
.attribution-period-latest:focus-visible {
  outline: 2px solid var(--pf-accent);
  outline-offset: 2px;
}
.attribution-period-latest.is-selected {
  background: var(--pf-bg-secondary);
  color: var(--pf-text-primary);
  border: 1px solid var(--pf-border-color);
  border-left: 3px solid var(--pf-accent);
  padding-left: calc(0.75rem - 2px);
}
.attribution-period-latest.is-selected:hover {
  background: var(--pf-bg-tertiary);
  border-color: var(--pf-border-color);
  border-left-color: var(--pf-accent);
}

.attribution-period-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attribution-period-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.attribution-period-label {
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pf-text-muted);
}

.attribution-period-select {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.45rem 2rem 0.45rem 0.55rem;
  border: 1px solid var(--pf-border-color);
  border-radius: 6px;
  background-color: var(--pf-bg-secondary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 12px 12px;
  color: var(--pf-text-primary);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.attribution-period-select:focus-visible {
  outline: 2px solid var(--pf-accent);
  outline-offset: 1px;
}
.attribution-period-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.darkmode .attribution-period-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.attribution-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px;
  color: var(--pf-text-muted);
  font-size: 16px;
  text-align: center;
}
.attribution-empty svg {
  opacity: 0.5;
}

.attribution-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px;
  color: var(--pf-text-muted);
  font-size: 16px;
}

.attribution-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--pf-border-color);
  border-top-color: var(--pf-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.attribution-table .pos-td {
  font-variant-numeric: tabular-nums;
}
.attribution-table .positive {
  color: var(--pf-positive);
}
.attribution-table .negative {
  color: var(--pf-negative);
}
.attribution-table .approx-indicator {
  margin-left: 2px;
  opacity: 0.6;
  font-size: 0.75em;
}
.attribution-table .pos-row.is-approximate {
  opacity: 0.8;
}

.performance-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  font-size: 14px;
  color: var(--pf-text-muted);
  background: var(--pf-bg-tertiary);
  border-radius: 8px;
  margin: 16px;
}
.performance-note svg {
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.7;
}
@container (max-width: 500px) {
  .performance-note {
    margin: 8px;
    padding: 8px;
  }
}

.onboarding {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px;
}

.onboarding-header {
  text-align: center;
  margin-bottom: 32px;
}
.onboarding-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--pf-text-primary);
}
.onboarding-header p {
  font-size: 0.9375rem;
  color: var(--pf-text-muted);
  margin: 0;
}

.onboarding-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@container (max-width: 600px) {
  .onboarding-cards {
    grid-template-columns: 1fr;
    max-width: 320px;
    margin: 0 auto;
    gap: 16px;
  }
}

.onboarding-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px 24px;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 20px;
}
.onboarding-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--pf-text-primary);
}
.onboarding-card p {
  font-size: 0.8125rem;
  color: var(--pf-text-muted);
  margin: 0;
  line-height: 1.5;
}

.onboarding-card-actions {
  width: 100%;
  margin-top: auto;
}
.onboarding-card-actions .btn {
  display: block;
  width: 100%;
}

.onboarding-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pf-bg-secondary);
  border-radius: 8px;
  color: var(--pf-text-muted);
  margin-bottom: 16px;
  flex-shrink: 0;
}

.onboarding-card-primary {
  border-color: var(--pf-accent);
  border-width: 2px;
}
.onboarding-card-primary .onboarding-card-icon {
  background: rgba(59, 130, 246, 0.1);
  color: var(--pf-accent);
}

.onboarding-card-tag {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 10px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
  background: var(--pf-accent);
  border-radius: 10px;
  white-space: nowrap;
}

.onboarding-card-tag-soft {
  background: var(--pf-positive);
}

.dashboard-summary-refresh-btn {
  position: relative;
}

.transactions-page {
  width: 100%;
}

.transactions-loading {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 16px;
}
@media (max-width: 480px) {
  .transactions-loading {
    padding: 16px;
  }
}

.transactions-loading-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.transactions-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--pf-border-color);
  border-top-color: var(--pf-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

.transactions-loading-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.transactions-loading-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--pf-text-primary);
}

.transactions-loading-subtitle {
  font-size: 14px;
  color: var(--pf-text-muted);
}

.transactions-loading-progress {
  height: 4px;
  background: var(--pf-bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.transactions-loading-progress-bar {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--pf-accent) 0%, var(--pf-accent-hover, #5BA3E8) 50%, var(--pf-accent) 100%);
  border-radius: 4px;
  animation: loading-progress 2s ease-in-out infinite;
}

.tx-row-skeleton .tx-td {
  padding: 0.75rem 0.5rem;
}

.tx-section {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 12px;
  overflow: clip;
}

.tx-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  background: var(--pf-bg-tertiary);
  border-bottom: 1px solid var(--pf-border-color);
  border-radius: 12px 12px 0 0;
  overflow: visible;
}

.tx-section-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
  color: var(--pf-text-primary);
}

.tx-section-count {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--pf-text-muted);
}

.tx-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 0.5rem;
  padding: 0;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--pf-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tx-add-btn:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-accent);
}
.tx-add-btn svg {
  width: 16px;
  height: 16px;
}

.tx-section-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.tx-section-actions form {
  display: contents;
}
.tx-section-actions .btn {
  white-space: nowrap;
}

.tx-section-divider {
  width: 1px;
  height: 20px;
  background: var(--pf-border-color);
  margin: 0 0.25rem;
}

.tx-section-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--pf-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tx-section-btn:hover {
  background: var(--pf-bg-secondary);
  color: var(--pf-text-primary);
}
.tx-section-btn.active {
  color: var(--pf-accent);
  background: rgba(74, 144, 217, 0.1);
}
.tx-section-btn svg {
  width: 16px;
  height: 16px;
}

.tx-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 12px;
}
@media (max-width: 768px) {
  .tx-header {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
  }
}

.tx-header-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
}
@media (max-width: 768px) {
  .tx-header-stats {
    gap: 0.5rem;
  }
}

.tx-stat-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tx-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--pf-text-primary);
  line-height: 1.2;
}

.tx-stat-label {
  font-size: 0.75rem;
  color: var(--pf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tx-stat-divider {
  width: 1px;
  height: 32px;
  background: var(--pf-border-color);
}

.tx-header-actions {
  display: flex;
  gap: 0.5rem;
}
.tx-header-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.tx-header-actions .btn svg {
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .tx-header-actions {
    gap: 0.25rem;
  }
  .tx-header-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
  }
  .tx-header-actions .btn svg {
    width: 14px;
    height: 14px;
  }
  .tx-header-actions .btn-text {
    display: none;
  }
}

.tx-filter-panel {
  display: none;
  padding: 0.625rem 1rem;
  background: var(--pf-bg-secondary);
  border-bottom: 1px solid var(--pf-border-color);
}
.tx-filter-panel.tx-filter-panel-open {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
@media (max-width: 600px) {
  .tx-filter-panel.tx-filter-panel-open {
    flex-direction: column;
    align-items: stretch;
  }
}

.tx-filter-input,
.tx-filter-select {
  height: 34px;
  padding: 0 0.625rem;
  border: 1px solid var(--pf-border-color);
  border-radius: 6px;
  background: var(--pf-bg-primary);
  color: var(--pf-text-primary);
  font-size: 0.8125rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tx-filter-input:focus,
.tx-filter-select:focus {
  outline: none;
  border-color: var(--pf-accent);
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.12);
}
.tx-filter-input::placeholder,
.tx-filter-select::placeholder {
  color: var(--pf-text-muted);
}

.tx-filter-ticker {
  width: 110px;
}
@media (max-width: 600px) {
  .tx-filter-ticker {
    width: 100%;
  }
}

.tx-filter-multiselect {
  position: relative;
  min-width: 110px;
}
@media (max-width: 600px) {
  .tx-filter-multiselect {
    width: 100%;
  }
}

.tx-filter-multiselect-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  height: 34px;
  padding: 0 0.625rem;
  border: 1px solid var(--pf-border-color);
  border-radius: 6px;
  background: var(--pf-bg-primary);
  color: var(--pf-text-primary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tx-filter-multiselect-btn:hover {
  border-color: var(--pf-text-muted);
}
.tx-filter-multiselect-btn svg {
  flex-shrink: 0;
  color: var(--pf-text-muted);
  transition: transform 0.15s ease;
}
.tx-filter-multiselect.open .tx-filter-multiselect-btn svg {
  transform: rotate(180deg);
}
.tx-filter-multiselect.has-selection .tx-filter-multiselect-btn {
  border-color: var(--pf-accent);
  background: rgba(74, 144, 217, 0.08);
}

.tx-filter-multiselect-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-filter-multiselect-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  background: var(--pf-bg-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.tx-filter-multiselect.open .tx-filter-multiselect-dropdown {
  display: block;
}
.tx-filter-multiselect-dropdown.tx-filter-dropdown-portal {
  position: fixed;
  z-index: 1000;
}
.tx-filter-multiselect-dropdown.tx-filter-dropdown-portal.open {
  display: block;
  opacity: 1;
  visibility: visible;
}
.darkmode .tx-filter-multiselect-dropdown {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tx-filter-multiselect-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem 1rem;
  padding: 0.75rem;
}
@media (max-width: 768px) {
  .tx-filter-multiselect-groups {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .tx-filter-multiselect-groups {
    grid-template-columns: 1fr;
  }
}

.tx-filter-multiselect-group {
  display: flex;
  flex-direction: column;
}

.tx-filter-group-label {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pf-text-muted);
  margin-bottom: 0.25rem;
  padding-left: 0.25rem;
}

.tx-filter-multiselect-option {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.tx-filter-multiselect-option:hover {
  background: var(--pf-bg-secondary);
}
.tx-filter-multiselect-option input[type=checkbox] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--pf-accent);
  cursor: pointer;
}
.tx-filter-multiselect-option span {
  font-size: 0.75rem;
  color: var(--pf-text-primary);
  white-space: nowrap;
}

.tx-filter-dates {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
@media (max-width: 600px) {
  .tx-filter-dates {
    width: 100%;
  }
}

.tx-filter-date {
  width: 125px;
}
@media (max-width: 600px) {
  .tx-filter-date {
    flex: 1;
  }
}

.tx-filter-sep {
  color: var(--pf-text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
}

.tx-filter-actions {
  display: flex;
  gap: 0.375rem;
  margin-left: auto;
}
@media (max-width: 600px) {
  .tx-filter-actions {
    margin-left: 0;
    width: 100%;
  }
}

.tx-filter-btn {
  height: 34px;
  padding: 0 0.875rem;
  border: none;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tx-filter-btn--apply {
  background: var(--pf-accent);
  color: white;
}
.tx-filter-btn--apply:hover {
  background: var(--pf-accent-hover, #3a7bc8);
}
.tx-filter-btn--clear {
  background: var(--pf-bg-secondary);
  color: var(--pf-text-secondary);
  border: 1px solid var(--pf-border-color);
}
.tx-filter-btn--clear:hover {
  background: var(--pf-bg-primary);
  border-color: var(--pf-text-muted);
}
@media (max-width: 600px) {
  .tx-filter-btn {
    flex: 1;
  }
}

.flatpickr-calendar {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.flatpickr-calendar * {
  font-family: inherit !important;
}

.darkmode .flatpickr-calendar {
  background: var(--pf-bg-secondary);
  border-color: var(--pf-border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.darkmode .flatpickr-months .flatpickr-month {
  background: var(--pf-bg-secondary);
  color: var(--pf-text-primary);
}
.darkmode .flatpickr-weekdays {
  background: var(--pf-bg-secondary);
}
.darkmode span.flatpickr-weekday {
  color: var(--pf-text-muted);
  background: var(--pf-bg-secondary);
}
.darkmode .flatpickr-days {
  border-color: var(--pf-border-color);
}
.darkmode .dayContainer .flatpickr-day {
  color: var(--pf-text-primary);
}
.darkmode .dayContainer .flatpickr-day:hover {
  background: var(--pf-bg-tertiary);
}
.darkmode .dayContainer .flatpickr-day.selected {
  background: var(--pf-accent);
  border-color: var(--pf-accent);
}

.tx-list {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.tx-list:not(.tx-section .tx-list) {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 12px;
}

.tx-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.tx-header-row {
  background: var(--pf-bg-tertiary);
}

.tx-th {
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--pf-text-secondary);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--pf-border-color);
  background: var(--pf-bg-tertiary);
}
.tx-th a {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  color: inherit;
  transition: color 0.15s ease;
}
.tx-th a:hover {
  color: var(--pf-text-primary);
}

.tx-th-asset {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--pf-bg-tertiary);
  min-width: 140px;
}
.tx-th-asset::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.08), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.tx-th-asset {
  white-space: nowrap;
}

.tx-td-asset {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--pf-bg-secondary);
  min-width: 140px;
}
.tx-td-asset::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.08), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.tx-select-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 0.5rem;
  padding: 0;
  background: none;
  border: none;
  border-radius: 3px;
  color: var(--pf-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
}
.tx-select-all-btn:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text);
}
.tx-select-all-btn.active {
  color: var(--pf-accent);
}
.tx-select-all-btn svg {
  width: 14px;
  height: 14px;
}

.tx-th-asset a {
  display: inline-flex;
  vertical-align: middle;
}

.tx-th-actions {
  position: -webkit-sticky;
  position: sticky;
  right: 0;
  z-index: 3;
  background: var(--pf-bg-tertiary);
  width: 50px;
  min-width: 50px;
  padding: 0.75rem 0.5rem;
}
.tx-th-actions:has(.dropdown.open) {
  z-index: 1000;
}

.tx-td-actions {
  position: -webkit-sticky;
  position: sticky;
  right: 0;
  z-index: 3;
  background: var(--pf-bg-secondary);
  width: 50px;
  padding: 0.75rem 0.5rem;
}
.tx-td-actions:has(.dropdown.open) {
  z-index: 1000;
}

.tx-list.is-scrolled .tx-th-asset::after,
.tx-list.is-scrolled .tx-td-asset::after {
  opacity: 1;
}

.tx-th-qty,
.tx-th-price,
.tx-th-total,
.tx-td-qty,
.tx-td-price,
.tx-td-total {
  text-align: right;
}

.tx-col-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.tx-col-sortable:hover {
  color: var(--pf-text-primary);
}
.tx-col-sortable.sorted {
  color: var(--pf-accent);
}
.tx-col-sortable.sorted a {
  color: var(--pf-accent);
}
.tx-col-sortable .sort-icon {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.25rem;
  opacity: 0.4;
  transition: opacity 0.15s, transform 0.15s;
}
.tx-col-sortable:hover .sort-icon {
  opacity: 0.7;
}
.tx-col-sortable.sorted .sort-icon {
  opacity: 1;
}
.tx-col-sortable .sort-icon.asc {
  transform: rotate(180deg);
}

.tx-td {
  padding: 0.75rem 1rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: left;
  white-space: nowrap;
  color: var(--pf-text-muted);
  border-bottom: 1px solid var(--pf-border-color);
  background: var(--pf-bg-secondary);
}

.tx-th-date,
.tx-td-date {
  width: 85px;
  min-width: 80px;
}

.tx-td-actions {
  background: var(--pf-bg-secondary);
  text-align: center;
}

.tx-row {
  transition: background 0.15s ease;
  cursor: pointer;
  user-select: none;
}
.tx-row:not(.tx-row-empty):not(.tx-row-loading):not(.tx-row-skeleton):nth-child(even) .tx-td {
  background: var(--pf-table-stripe);
}
.tx-row:hover .tx-td {
  background: var(--pf-table-hover);
}
.darkmode .tx-row:hover .tx-td {
  background: #3a3d4a;
}
.tx-row:last-child .tx-td {
  border-bottom: none;
}
.tx-row.selected {
  box-shadow: inset 3px 0 0 var(--pf-accent);
}
.tx-row.selected .tx-td {
  background: var(--pf-selection-bg) !important;
}
.tx-row.duplicate .tx-td {
  opacity: 0.5;
}
.tx-row.duplicate .tx-td-asset,
.tx-row.duplicate .tx-td-actions {
  opacity: 1;
}
.tx-row.duplicate.selected .tx-td {
  opacity: 1;
}

.tx-row-empty .tx-td {
  padding: 0;
}

.tx-row-loading .tx-td {
  border-bottom: none;
}

.tx-date {
  font-size: 0.8125rem;
  color: var(--pf-text-muted);
  font-variant-numeric: tabular-nums;
}

.tx-asset {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
  user-select: none;
}

.tx-ticker {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--pf-text-primary);
  line-height: 1.3;
  text-decoration: none;
  user-select: none;
}
.tx-ticker:hover {
  color: var(--pf-accent);
  text-decoration: underline;
}

.tx-name {
  font-size: 0.6875rem;
  color: var(--pf-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  max-width: 200px;
  user-select: none;
}

.tx-cat {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  line-height: 1.2;
  letter-spacing: 0.3px;
}
.tx-cat-stock {
  background: #f1f5f9;
  color: #475569;
}
.tx-cat-etf {
  background: #dbeafe;
  color: #1d4ed8;
}
.tx-cat-cash {
  background: #d1fae5;
  color: #047857;
}
.tx-cat-crypto {
  background: #ffedd5;
  color: #c2410c;
}
.tx-cat-other {
  background: #fef3c7;
  color: #b45309;
}
.darkmode .tx-cat-stock {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}
.darkmode .tx-cat-etf {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}
.darkmode .tx-cat-cash {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.darkmode .tx-cat-crypto {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
}
.darkmode .tx-cat-other {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.tx-badge {
  display: inline-block;
  font-size: 0.5625rem;
  padding: 0.125rem 0.3125rem;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
  vertical-align: middle;
  margin-left: 0.25rem;
}
.tx-badge-duplicate {
  background: var(--pf-negative-bg);
  color: var(--pf-negative);
}
.tx-badge-uncertain {
  background: var(--pf-warning-bg, rgba(245, 158, 11, 0.1));
  color: var(--pf-warning, #f59e0b);
  cursor: help;
}
.tx-badge-pending-price {
  background: var(--pf-warning-bg, rgba(245, 158, 11, 0.12));
  color: var(--pf-warning, #d97706);
  text-transform: none;
  font-size: 0.625rem;
  cursor: help;
}

.tx-type {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
}
.tx-type-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tx-type-buy .tx-type-dot {
  background: var(--pf-positive);
}
.tx-type-sell .tx-type-dot {
  background: var(--pf-negative);
}
.tx-type-income .tx-type-dot {
  background: #8b5cf6;
}
.tx-type-fee .tx-type-dot {
  background: #f59e0b;
}
.tx-type-corporate .tx-type-dot {
  background: #6366f1;
}
.tx-type-transfer .tx-type-dot {
  background: #64748b;
}
.tx-type-buy {
  color: var(--pf-positive);
}
.tx-type-sell {
  color: var(--pf-negative);
}
.tx-type-income {
  color: #8b5cf6;
}
.tx-type-fee {
  color: #f59e0b;
}
.tx-type-corporate {
  color: #6366f1;
}
.tx-type-transfer {
  color: #64748b;
}

.tx-qty,
.tx-price,
.tx-total {
  text-align: right;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.tx-qty {
  color: var(--pf-text-muted);
}

.tx-ratio {
  font-weight: 500;
  color: var(--pf-text-secondary);
}

.tx-na {
  color: var(--pf-text-muted);
  opacity: 0.5;
}

.tx-price-currency {
  font-size: 0.6875rem;
  color: var(--pf-text-muted);
  margin-left: 3px;
}

.tx-total {
  font-weight: 600;
  color: var(--pf-text-primary);
}
.tx-total-positive {
  color: var(--pf-positive);
}
.tx-total-negative {
  color: var(--pf-negative);
}

.tx-td-actions .dropdown {
  position: relative;
}

.tx-td-actions .dropdown-toggle {
  padding: 0.375rem;
  border: none;
  background: transparent;
  color: var(--pf-text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tx-td-actions .dropdown-toggle:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}

.tx-td-actions .dropdown-menu,
.tx-dropdown-portal {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 9999;
  min-width: 140px;
  background: var(--pf-bg-primary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 0.375rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease-out, visibility 0.15s ease-out, transform 0.15s ease-out;
}
.dropdown.open .tx-td-actions .dropdown-menu, .tx-td-actions .dropdown-menu.open,
.dropdown.open .tx-dropdown-portal,
.tx-dropdown-portal.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.darkmode .tx-td-actions .dropdown-menu,
.darkmode .tx-dropdown-portal {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: none;
  color: var(--pf-text-primary);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.dropdown-item svg {
  flex-shrink: 0;
  color: var(--pf-text-muted);
}
.dropdown-item:hover {
  background: var(--pf-bg-secondary);
}
.dropdown-item.dropdown-item-danger {
  color: var(--pf-negative);
}
.dropdown-item.dropdown-item-danger svg {
  color: var(--pf-negative);
}
.dropdown-item.dropdown-item-danger:hover {
  background: var(--pf-negative-bg);
}

.dropdown-divider {
  height: 1px;
  margin: 0.375rem 0;
  background: var(--pf-border-color);
}

.tx-empty-simple {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--pf-text-muted);
  font-size: 0.875rem;
}

.tx-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tx-empty-illustration {
  margin-bottom: 1.25rem;
}
.tx-empty-illustration svg {
  width: 120px;
  height: 120px;
}
.tx-empty-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--pf-text-primary);
}
.tx-empty-text {
  font-size: 0.875rem;
  color: var(--pf-text-muted);
  margin-bottom: 1.5rem;
  max-width: 340px;
  line-height: 1.5;
}
.tx-empty-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.tx-empty-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.tx-loading {
  padding: 1.5rem;
  text-align: center;
  color: var(--pf-text-muted);
  font-size: 0.875rem;
}
.tx-loading .spinner {
  animation: tx-spin 1s linear infinite;
}

@keyframes tx-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.bulk-actions-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 200;
  max-width: calc(100% - 2rem);
}
@media (max-width: 768px) {
  .bulk-actions-bar {
    bottom: calc(64px + 1rem + env(safe-area-inset-bottom, 0px));
    left: 1rem;
    right: 1rem;
    transform: none;
    justify-content: space-between;
  }
}

.bulk-count {
  font-size: 0.875rem;
  color: var(--pf-text-muted);
}
.bulk-count span {
  font-weight: 600;
  color: var(--pf-text-primary);
}

.import-review-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.import-review-page.transactions-page {
  max-width: none;
}

.import-info-message {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(74, 144, 217, 0.1);
  border-left: 3px solid #4A90D9;
  color: #2C5282;
  font-size: 14px;
  margin-bottom: 16px;
  border-radius: 4px;
}
.import-info-message svg {
  flex-shrink: 0;
}
.darkmode .import-info-message {
  background: rgba(74, 144, 217, 0.15);
  color: #5BA3E8;
}

.import-alerts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.import-alerts:empty {
  display: none;
}

.import-alert {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 10px;
  overflow: hidden;
}
.import-alert summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  list-style: none;
  user-select: none;
}
.import-alert summary::-webkit-details-marker {
  display: none;
}
.import-alert summary strong {
  font-weight: 600;
}
.import-alert[open] .alert-chevron {
  transform: rotate(180deg);
}
.import-alert-error {
  border-color: var(--pf-negative);
  background: var(--pf-negative-bg);
}
.import-alert-error .alert-icon {
  color: var(--pf-negative);
}
.import-alert-warning {
  border-color: var(--pf-warning);
  background: var(--pf-warning-bg);
}
.import-alert-warning .alert-icon {
  color: var(--pf-warning);
}
.import-alert-info {
  border-color: var(--pf-info);
  background: var(--pf-info-bg);
}
.import-alert-info .alert-icon {
  color: var(--pf-info);
}

.import-alert-inline {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

.alert-icon {
  display: flex;
  flex-shrink: 0;
}

.alert-chevron {
  margin-left: auto;
  display: flex;
  transition: transform 0.2s ease;
}

.alert-list {
  margin: 0;
  padding: 0 1rem 0.75rem 2.5rem;
  font-size: 0.8125rem;
  max-height: 150px;
  overflow-y: auto;
}
.alert-list li {
  margin-bottom: 0.25rem;
}

.alert-content {
  padding: 0 1rem 0.75rem;
}

.alert-description {
  font-size: 0.8125rem;
  color: var(--pf-text-secondary);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.ticker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.ticker-chip {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 6px;
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ticker-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.ticker-chip:active {
  transform: translateY(0);
}
.ticker-chip-stock {
  background: #f1f5f9;
  color: #475569;
}
.ticker-chip-stock:hover {
  background: #e2e8f0;
}
.ticker-chip-etf {
  background: #dbeafe;
  color: #1d4ed8;
}
.ticker-chip-etf:hover {
  background: #bfdbfe;
}
.ticker-chip-cash {
  background: #d1fae5;
  color: #047857;
}
.ticker-chip-cash:hover {
  background: #a7f3d0;
}
.ticker-chip-other {
  background: #fef3c7;
  color: #b45309;
}
.ticker-chip-other:hover {
  background: #fde68a;
}
.darkmode .ticker-chip-stock {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}
.darkmode .ticker-chip-stock:hover {
  background: rgba(100, 116, 139, 0.3);
}
.darkmode .ticker-chip-etf {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}
.darkmode .ticker-chip-etf:hover {
  background: rgba(59, 130, 246, 0.3);
}
.darkmode .ticker-chip-cash {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
.darkmode .ticker-chip-cash:hover {
  background: rgba(16, 185, 129, 0.3);
}
.darkmode .ticker-chip-other {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}
.darkmode .ticker-chip-other:hover {
  background: rgba(245, 158, 11, 0.3);
}

.import-loading {
  padding: 1.5rem;
  text-align: center;
  color: var(--pf-text-muted);
  font-size: 0.875rem;
}

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

:root {
  --pf-green: #22c55e;
  --pf-red: #ef4444;
}

.darkmode {
  --pf-green: #34d399;
  --pf-red: #f87171;
}

.positions-page {
  width: 100%;
}

.positions-loading {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 16px;
}
@media (max-width: 480px) {
  .positions-loading {
    padding: 16px;
  }
}

.positions-loading-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.positions-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--pf-border-color);
  border-top-color: var(--pf-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

.positions-loading-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.positions-loading-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--pf-text-primary);
}

.positions-loading-subtitle {
  font-size: 14px;
  color: var(--pf-text-muted);
}

.positions-loading-progress {
  height: 4px;
  background: var(--pf-bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.positions-loading-progress-bar {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--pf-accent) 0%, var(--pf-accent-hover, #5BA3E8) 50%, var(--pf-accent) 100%);
  border-radius: 4px;
  animation: loading-progress 2s ease-in-out infinite;
}

@keyframes loading-progress {
  0% {
    width: 5%;
    transform: translateX(0);
  }
  50% {
    width: 60%;
    transform: translateX(30%);
  }
  100% {
    width: 5%;
    transform: translateX(1000%);
  }
}
.pos-skeleton-table {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  overflow: hidden;
}

.pos-skeleton-header {
  display: flex;
  gap: 24px;
  padding: 8px 16px;
  background: var(--pf-bg-tertiary);
  border-bottom: 1px solid var(--pf-border-color);
}

.pos-skeleton-row {
  display: flex;
  gap: 24px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--pf-border-color);
  align-items: center;
}
.pos-skeleton-row:last-child {
  border-bottom: none;
}

.pos-skeleton-cell {
  display: flex;
  flex-direction: column;
  min-width: 100px;
}

.pos-list {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgb(212, 214, 221) transparent;
}
.pos-list::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.pos-list::-webkit-scrollbar-track {
  background-color: transparent;
  border-radius: 10px;
}
.pos-list::-webkit-scrollbar-thumb {
  background-color: rgb(212, 214, 221);
  border-radius: 10px;
}
.pos-list:hover::-webkit-scrollbar-thumb {
  background-color: rgb(192, 194, 201);
}
.darkmode .pos-list {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.darkmode .pos-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.15);
}
.darkmode .pos-list:hover::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.25);
}
.pos-list .pos-row:not(.pos-row-totals) {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.pos-list .pos-row:not(.pos-row-totals):hover .pos-td {
  background-color: var(--pf-table-hover);
}
.darkmode .pos-list .pos-row:not(.pos-row-totals):hover .pos-td {
  background-color: #3a3d4a;
}
.pos-list .pos-row:not(.pos-row-totals).selected {
  box-shadow: inset 3px 0 0 var(--pf-accent);
}
.pos-list .pos-row:not(.pos-row-totals).selected .pos-td {
  background-color: var(--pf-selection-bg) !important;
}
.pos-list .pos-th-asset .tx-select-all-btn {
  margin-right: 0.5rem;
  vertical-align: middle;
}

.pos-collapsible-content {
  border-radius: 0 0 12px 12px;
  overflow: clip;
}
.pos-collapsible-content .pos-list {
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 0;
  padding: 0;
}
.pos-collapsible-content .pos-table {
  margin: 0;
}
.pos-collapsible-content thead {
  margin: 0;
}

.custom-assets-header {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--pf-text-secondary);
  border-bottom: 1px solid var(--pf-border-color);
  background: var(--pf-bg-tertiary);
}

.pos-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.pos-table-closed {
  margin-top: 1rem;
  border-top: 1px solid var(--pf-border-color);
  padding-top: 0.5rem;
}
.pos-table-closed .pos-row-closed .pos-td {
  opacity: 0.7;
}
.pos-table-closed .pos-row-closed:hover .pos-td {
  opacity: 1;
}

.pos-th {
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--pf-text-secondary);
  text-align: left;
  white-space: nowrap;
  border-bottom: none;
  box-shadow: inset 0 -1px 0 0 var(--pf-border-color);
  background-color: var(--pf-bg-tertiary);
}

.pos-th-asset {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--pf-bg-tertiary);
}
.pos-th-asset::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.08), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.pos-th-asset {
  max-width: 200px;
}

.pos-th-actions {
  position: -webkit-sticky;
  position: sticky;
  right: 0;
  z-index: 3;
  background: var(--pf-bg-tertiary);
  width: 36px;
  padding: 0.75rem 0.5rem;
}

.pos-th-right {
  text-align: right !important;
}

.pos-td {
  padding: 0.75rem 1rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: left;
  white-space: nowrap;
  color: var(--pf-text-muted);
  border-bottom: none;
  box-shadow: inset 0 -1px 0 0 var(--pf-border-color);
  background-color: var(--pf-bg-secondary);
}

.pos-td-asset {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--pf-bg-secondary);
}
.pos-td-asset::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.08), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.pos-td-asset {
  max-width: 200px;
}

.pos-td-actions {
  position: -webkit-sticky;
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--pf-bg-secondary);
  width: 36px;
  text-align: center;
  padding: 0.75rem 0.5rem;
}
.pos-td-actions:has(.dropdown.open) {
  z-index: 1000;
}

.pos-td-right {
  text-align: right !important;
}

.pos-list.is-scrolled .pos-th-asset::after,
.pos-list.is-scrolled .pos-td-asset::after {
  opacity: 1;
}

.pos-row:not(.pos-row-totals):nth-child(even) .pos-td {
  background-color: var(--pf-table-stripe);
}

.pos-row:hover .pos-td {
  background-color: var(--pf-table-hover);
}
.darkmode .pos-row:hover .pos-td {
  background-color: #3a3d4a;
}

.pos-row:last-child .pos-td {
  box-shadow: none;
}

.pos-row-closed .pos-td {
  opacity: 0.6;
}
.pos-row-closed:hover .pos-td {
  opacity: 1;
}

.pos-row-empty .pos-empty {
  padding: 2rem;
  text-align: center;
  color: var(--pf-text-muted);
}

.pos-col-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.pos-col-sortable:hover {
  color: var(--pf-text-primary);
}
.pos-col-sortable .sort-icon {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.25rem;
  opacity: 0.4;
  transition: opacity 0.15s, transform 0.15s;
}
.pos-col-sortable.sort-asc .sort-icon {
  opacity: 1;
  transform: rotate(180deg);
}
.pos-col-sortable.sort-desc .sort-icon {
  opacity: 1;
}

.pos-col-hidden {
  display: none !important;
}

.pos-td.positive {
  color: var(--pf-green) !important;
}
.pos-td.negative {
  color: var(--pf-red) !important;
}

.pos-col {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pos-col-muted {
  color: var(--pf-text-muted);
}

.pos-mobile-row1,
.pos-mobile-row2 {
  display: none !important;
}

.pos-ticker-link {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  text-decoration: none;
  transition: color 0.15s;
  min-width: 0;
}
.pos-ticker-link:hover .pos-ticker {
  color: var(--pf-accent);
}

.pos-ticker-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}

.pos-ticker {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  color: var(--pf-text-primary);
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.pos-asset-name {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.625rem;
  font-weight: 400;
  color: var(--pf-text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos-ticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 0.375rem;
  flex-shrink: 0;
}
.pos-ticker-badge svg {
  width: 8px;
  height: 8px;
}

.pos-ticker-badge-icon {
  padding: 0;
  width: 16px;
  height: 16px;
  justify-content: center;
}
.pos-ticker-badge-icon svg {
  width: 10px;
  height: 10px;
}

.pos-col {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pos-price-warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.2);
  border: none;
  border-radius: 4px;
  padding: 0.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.pos-price-warning:hover {
  background: rgba(245, 158, 11, 0.35);
  transform: scale(1.1);
}
.pos-price-warning:active {
  transform: scale(0.95);
}
.pos-price-warning svg {
  animation: pulse 2s ease-in-out infinite;
}

.pos-pnl-amount {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
}

.pos-pnl-pct {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
}

.pos-empty {
  padding: 2rem;
  text-align: center;
  color: var(--pf-text-muted);
}

.positive {
  color: var(--pf-green) !important;
}

.negative {
  color: var(--pf-red) !important;
}

.pos-row-totals .pos-td {
  background-color: var(--pf-bg-tertiary);
  font-weight: 600;
}

.pos-totals-top .pos-row-totals .pos-td {
  box-shadow: none;
  border-bottom: 2px solid var(--pf-border-color);
}

.pos-totals-bottom .pos-row-totals .pos-td {
  border-top: 2px solid var(--pf-border-color);
  border-bottom: none;
  box-shadow: none;
}

.pos-section {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  max-height: none;
  height: auto;
  overflow: visible;
}

.pos-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--pf-border-color);
  background: var(--pf-bg-tertiary);
  border-radius: 12px 12px 0 0;
  overflow: visible;
}
.pos-section-header:has(+ .pos-collapsible-content[style*="display: none"]) {
  border-bottom-color: transparent;
  border-radius: 12px;
}
.pos-section-header-clickable {
  cursor: pointer;
  user-select: none;
}
.pos-section-header-clickable:hover {
  background: var(--pf-bg-hover);
}

.pos-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
  color: var(--pf-text-primary);
}
.pos-section-title svg {
  color: var(--pf-text-muted);
}

.pos-section-count {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--pf-text-muted);
  margin-left: 0.25rem;
}

.pos-section-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: visible;
}

.pos-column-config {
  position: relative;
}

.pos-column-config-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--pf-text-muted);
  cursor: pointer;
  transition: all 0.1s ease;
}
.pos-column-config-btn:hover {
  background: var(--pf-bg-secondary);
  color: var(--pf-text-primary);
}
.pos-column-config-btn svg {
  width: 16px;
  height: 16px;
}

.pos-column-config-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 1000;
  min-width: 280px;
  max-width: calc(100vw - 32px);
  background: var(--pf-bg-primary);
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.pos-column-config-dropdown.open {
  display: block;
}
.pos-column-config-dropdown.flip-left {
  right: auto;
  left: 0;
}
.darkmode .pos-column-config-dropdown {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pos-column-config-header {
  padding: 0.5rem 0.75rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pf-text-muted);
  border-bottom: 1px solid var(--pf-border-color);
}

.pos-column-config-list {
  padding: 0.5rem;
}

.pos-column-config-section {
  padding: 0.375rem 0.5rem 0.25rem;
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pf-text-muted);
}
.pos-column-config-section:not(:first-child) {
  margin-top: 0.375rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--pf-border-color);
}

.pos-column-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.125rem 0.5rem;
}

.pos-column-config-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.pos-column-config-item:hover {
  background: var(--pf-bg-secondary);
}
.pos-column-config-item input[type=checkbox] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--pf-accent);
  flex-shrink: 0;
}
.pos-column-config-item span {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--pf-text-primary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.pos-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--pf-text-muted);
}

.pos-loading-spinner {
  display: none;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--pf-text-muted);
}
.pos-loading-spinner svg {
  animation: pos-spin 0.8s linear infinite;
}

.htmx-request .pos-loading-spinner,
.htmx-request.pos-loading-spinner {
  display: inline-flex;
}

@keyframes pos-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.pos-toggle-switch {
  display: flex;
  cursor: pointer;
}
.pos-toggle-switch input {
  display: none;
}

.pos-toggle-slider {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--pf-border-color);
  border-radius: 10px;
  transition: background 0.2s;
}
.pos-toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.pos-toggle-switch input:checked + .pos-toggle-slider {
  background: var(--pf-accent);
}
.pos-toggle-switch input:checked + .pos-toggle-slider::after {
  transform: translateX(16px);
}

.pos-toggle-label {
  user-select: none;
}

.pos-toggle-sm .pos-toggle-slider {
  width: 32px;
  height: 18px;
}
.pos-toggle-sm .pos-toggle-slider::after {
  width: 14px;
  height: 14px;
}
.pos-toggle-sm .pos-toggle-switch input:checked + .pos-toggle-slider::after {
  transform: translateX(14px);
}
.pos-toggle-sm .pos-toggle-label {
  font-size: 0.75rem;
}

.pos-collapse-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--pf-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}
.pos-collapse-btn:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}

.pos-collapse-icon {
  transition: transform 0.2s ease;
  transform: rotate(-90deg);
}
.pos-section-collapsible.expanded .pos-collapse-icon {
  transform: rotate(0deg);
}

.custom-assets-list {
  display: flex;
  flex-direction: column;
}

.custom-assets-disclaimer {
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: var(--pf-text-muted);
  background: var(--pf-bg-subtle, rgba(0, 0, 0, 0.02));
  border-bottom: 1px solid var(--pf-border-color);
}

.custom-assets-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
}

.custom-assets-header-name {
  flex: 1;
  min-width: 0;
}

.custom-assets-header-price {
  width: 100px;
  text-align: right;
}

.custom-assets-header-actions {
  width: 32px;
}

.custom-assets-empty {
  margin: 0;
  padding: 1.5rem 1rem;
  font-size: 0.875rem;
  color: var(--pf-text-muted);
  text-align: center;
}

.custom-asset-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--pf-border-color);
  transition: background 0.15s;
}
.custom-asset-item:last-child {
  border-bottom: none;
}
.custom-asset-item:hover {
  background: var(--pf-bg-hover);
}
@media (max-width: 480px) {
  .custom-asset-item {
    padding: 0.5rem 1rem;
  }
}

.custom-asset-main {
  flex: 1;
  min-width: 0;
}

.custom-asset-ticker {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--pf-text-primary);
}

.custom-asset-ticker-link {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--pf-text-primary);
  text-decoration: none;
  display: block;
}
.custom-asset-ticker-link:hover {
  color: var(--pf-accent);
}

.custom-asset-name {
  font-size: 0.75rem;
  color: var(--pf-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.125rem;
}

.custom-asset-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100px;
  flex-shrink: 0;
}

.custom-asset-price-value {
  font-weight: 600;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--pf-text-primary);
}

.custom-asset-price-date {
  font-size: 0.6875rem;
  color: var(--pf-text-muted);
}

.custom-asset-price-none {
  font-size: 0.75rem;
  color: var(--pf-text-muted);
  font-style: italic;
}

.custom-asset-actions {
  width: 32px;
  flex-shrink: 0;
}

.modal-asset-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--pf-border-color);
}

.modal-asset-ticker {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--pf-text-primary);
}

.modal-asset-name {
  font-size: 0.875rem;
  color: var(--pf-text-muted);
}

.btn-close {
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--pf-text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-close:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}

.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .form-control {
  border-radius: 0 8px 8px 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 0.875rem;
  background: var(--pf-bg-tertiary);
  border: 1px solid var(--pf-border-color);
  border-right: none;
  border-radius: 8px 0 0 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--pf-text-muted);
}

.form-text {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
}

.pos-table-container {
  overflow: visible;
}

.pos-table-wrapper {
  overflow: visible;
}

.pos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.pos-table thead {
  background: var(--pf-bg-tertiary);
}
.pos-table th {
  padding: 0.625rem 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pf-text-muted);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--pf-border-color);
}
.pos-table th.text-right {
  text-align: right;
}
.pos-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.pos-table th.sortable:hover {
  color: var(--pf-text-primary);
}
.pos-table th.sortable.sort-asc .sort-icon::after {
  content: " ↑";
}
.pos-table th.sortable.sort-desc .sort-icon::after {
  content: " ↓";
}
.pos-table tbody tr {
  border-bottom: 1px solid var(--pf-border-color);
  transition: background 0.15s;
}
.pos-table tbody tr:last-child {
  border-bottom: none;
}
.pos-table tbody tr:hover {
  background: var(--pf-bg-hover);
}
.pos-table tbody tr.closed-position {
  opacity: 0.6;
}
.pos-table tbody tr.closed-position:hover {
  opacity: 1;
}
.pos-table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
}
.pos-table td.text-right {
  text-align: right;
}
.pos-table td.text-muted {
  color: var(--pf-text-muted);
}
.pos-table .ticker-link {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  text-decoration: none;
  transition: color 0.15s;
}
.pos-table .ticker-link:hover {
  color: var(--pf-accent);
}
.pos-table .ticker-link:hover .ticker {
  color: var(--pf-accent);
}
.pos-table .ticker-link .ticker {
  font-weight: 700;
  color: var(--pf-text-primary);
  font-size: 0.9375rem;
}
.pos-table .ticker-link .asset-name {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--pf-text-muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pos-table .asset-cell {
  min-width: 140px;
}
.pos-table .pnl-amount {
  font-weight: 600;
  font-size: 0.875rem;
}
.pos-table .pnl-percent {
  font-size: 0.75rem;
  opacity: 0.85;
}
.pos-table .ticker-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.pos-table .price-warning-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.2);
  border: none;
  border-radius: 4px;
  padding: 0.25rem;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.pos-table .price-warning-badge:hover {
  background: rgba(245, 158, 11, 0.35);
  transform: scale(1.1);
}
.pos-table .price-warning-badge:active {
  transform: scale(0.95);
}
.pos-table .price-warning-badge svg {
  animation: pulse 2s ease-in-out infinite;
}
.pos-table td.positive,
.pos-table .positive {
  color: var(--pf-green) !important;
  font-weight: 600;
}
.pos-table td.negative,
.pos-table .negative {
  color: var(--pf-red) !important;
  font-weight: 600;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}
.badge-stock {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.badge-etf {
  background: rgba(147, 51, 234, 0.1);
  color: #9333ea;
}

.badge-crypto {
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c;
}

.badge-short {
  background: rgba(239, 68, 68, 0.1);
  color: var(--pf-red);
}

.badge-closed {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-muted);
}

.badge-custom {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.position-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 480px) {
  .position-summary-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 24px;
  }
}
@media (min-width: 768px) {
  .position-summary-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

.summary-item .summary-label {
  font-size: 11px;
  color: var(--pf-text-muted);
  margin-bottom: 4px;
}
@media (min-width: 768px) {
  .summary-item .summary-label {
    font-size: 14px;
  }
}
.summary-item .summary-value {
  font-size: 18px;
  font-weight: 600;
}
@media (min-width: 768px) {
  .summary-item .summary-value {
    font-size: 24px;
  }
}
.summary-item .summary-pct {
  font-size: 14px;
  font-weight: 400;
  margin-left: 4px;
  display: block;
}
@media (min-width: 480px) {
  .summary-item .summary-pct {
    display: inline;
    font-size: 16px;
  }
}

.management-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .management-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
  }
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--pf-border-light);
}
.stat-row:last-child {
  border-bottom: none;
}
.stat-row .stat-label {
  color: var(--pf-text-secondary);
}
.stat-row .stat-value {
  font-weight: 500;
}

.breadcrumb-link {
  color: var(--pf-text-muted);
  text-decoration: none;
}
.breadcrumb-link:hover {
  color: var(--pf-accent);
}

.breadcrumb-separator {
  color: var(--pf-text-muted);
  margin: 0 8px;
}

.position-detail-page {
  width: 100%;
}

.position-header-card {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.position-header-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--pf-border-color);
}
@media (max-width: 480px) {
  .position-header-main {
    flex-direction: column;
  }
}

.position-identity {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.position-ticker-badge {
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--pf-accent);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.position-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.position-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.position-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.position-current-price {
  text-align: right;
}
@media (max-width: 480px) {
  .position-current-price {
    text-align: left;
  }
}

.price-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pf-text-muted);
  margin-bottom: 0.25rem;
}

.price-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.price-date {
  font-size: 0.75rem;
  color: var(--pf-text-muted);
}

.position-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) {
  .position-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .position-metrics-grid {
    grid-template-columns: 1fr;
  }
}

.metric-item {
  padding: 0.75rem;
  background: var(--pf-bg-tertiary);
  border-radius: 8px;
}

.metric-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pf-text-muted);
  margin-bottom: 0.25rem;
}

.metric-value {
  font-size: 1rem;
  font-weight: 600;
}
.metric-value.positive {
  color: var(--pf-positive);
}
.metric-value.negative {
  color: var(--pf-negative);
}

.metric-converted,
.metric-pct {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.8;
}

.position-management-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 768px) {
  .position-management-grid {
    grid-template-columns: 1fr;
  }
}

.info-box {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--pf-bg-tertiary);
  border-radius: 8px;
  align-items: flex-start;
}
.info-box svg {
  flex-shrink: 0;
  color: var(--pf-text-muted);
  margin-top: 2px;
}
.info-box strong {
  display: block;
  margin-bottom: 0.25rem;
}
.info-box p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--pf-text-secondary);
}
.info-box-highlight {
  background: var(--pf-info-bg);
}
.info-box-highlight svg {
  color: var(--pf-info);
}

.action-divider {
  height: 1px;
  background: var(--pf-border-color);
  margin: 1rem 0;
}

.action-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.action-info h4 {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
}
.action-info p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--pf-text-muted);
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.form-actions-inline {
  margin-top: 1rem;
}

.price-chart-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.price-chart-wrapper-custom {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--pf-border-color);
}

.price-chart-container {
  height: 200px;
}
.price-chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.last-price-info {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--pf-border-color);
}

.price-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}
.price-row span:first-child {
  color: var(--pf-text-muted);
}

.tx-list-embedded {
  border-top: 1px solid var(--pf-border-color);
}
.tx-list-embedded .tx-list-header {
  display: grid;
  grid-template-columns: 100px 150px 90px 110px 120px 70px;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--pf-bg-tertiary);
  border-bottom: 1px solid var(--pf-border-color);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pf-text-muted);
  align-items: center;
}
.tx-list-embedded .tx-row {
  display: grid;
  grid-template-columns: 100px 150px 90px 110px 120px 70px;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--pf-border-color);
  align-items: center;
  transition: background 0.15s ease;
}
.tx-list-embedded .tx-row:last-child {
  border-bottom: none;
}
.tx-list-embedded .tx-row:hover {
  background: var(--pf-table-hover);
}
.tx-list-embedded .tx-col-qty,
.tx-list-embedded .tx-col-price,
.tx-list-embedded .tx-col-total {
  text-align: right;
}
@media (max-width: 640px) {
  .tx-list-embedded .tx-list-header,
  .tx-list-embedded .tx-row {
    grid-template-columns: 80px 1fr 80px 50px;
    padding: 0.75rem 1rem;
  }
  .tx-list-embedded .tx-col-qty,
  .tx-list-embedded .tx-col-price {
    display: none;
  }
}

.tx-empty-compact {
  padding: 2rem;
  text-align: center;
  color: var(--pf-text-muted);
}

.price-history-table .row-actions {
  display: flex;
  gap: 0.25rem;
  justify-content: flex-end;
}

.btn-danger-ghost {
  color: var(--pf-text-muted);
}
.btn-danger-ghost:hover {
  color: var(--pf-negative);
  background: var(--pf-negative-bg);
}

.pf-card-info .pf-card-header {
  background: var(--pf-bg-tertiary);
}

.badge-cash {
  background: var(--pf-info-bg);
  color: var(--pf-info);
}

.tx-list-cash .tx-list-header,
.tx-list-cash .tx-row {
  grid-template-columns: 100px 1fr 120px 70px;
}
.tx-list-cash .tx-col-total {
  text-align: right;
}

.asset-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 1rem;
}
@media (max-width: 480px) {
  .asset-header-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

.asset-header-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
}

.asset-header-ticker {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--pf-text);
  letter-spacing: 0.5px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.asset-header-ticker-editable {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}
.asset-header-ticker-editable .asset-header-edit-icon {
  opacity: 0;
  transition: opacity 0.15s ease;
  color: var(--pf-text-muted);
}
.asset-header-ticker-editable:hover {
  color: var(--pf-accent);
}
.asset-header-ticker-editable:hover .asset-header-edit-icon {
  opacity: 1;
}

.asset-header-name {
  font-size: 0.875rem;
  font-weight: 400;
  margin: 0;
  line-height: 1.3;
  color: var(--pf-text-muted);
}

.asset-header-name-editable {
  font-size: 0.875rem;
  font-weight: 400;
  margin: 0;
  line-height: 1.3;
  color: var(--pf-text-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: color 0.15s ease;
}
.asset-header-name-editable .asset-header-edit-icon {
  opacity: 0;
  transition: opacity 0.15s ease;
}
.asset-header-name-editable:hover {
  color: var(--pf-text);
}
.asset-header-name-editable:hover .asset-header-edit-icon {
  opacity: 0.6;
}

.asset-header-badge-cash {
  font-size: 1rem;
  font-weight: 700;
  background: var(--pf-info);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.asset-header-badge-cash svg {
  flex-shrink: 0;
}

.asset-header-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
}
@media (max-width: 480px) {
  .asset-header-price {
    align-items: flex-start;
  }
}

.asset-header-price-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--pf-text-muted);
  margin-bottom: 0.125rem;
}

.asset-header-price-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.asset-header-price-decimals {
  font-size: 0.75em;
  opacity: 0.7;
}

.asset-header-price-date {
  font-size: 0.6875rem;
  color: var(--pf-text-muted);
}

.pos-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pos-section-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pos-tx-list {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}
.pos-tx-list .pos-table {
  min-width: 500px;
}

.pos-th-date .tx-select-all-btn {
  margin-right: 0.5rem;
  vertical-align: middle;
}

.pos-tx-list .tx-row {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.pos-tx-list .tx-row:hover .pos-td {
  background-color: var(--pf-table-hover);
}
.darkmode .pos-tx-list .tx-row:hover .pos-td {
  background-color: #3a3d4a;
}
.pos-tx-list .tx-row.selected {
  box-shadow: inset 3px 0 0 var(--pf-accent);
}
.pos-tx-list .tx-row.selected .pos-td {
  background-color: var(--pf-selection-bg) !important;
}

.pos-price-list {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgb(212, 214, 221) transparent;
}
.pos-price-list::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
.pos-price-list::-webkit-scrollbar-track {
  background-color: transparent;
  border-radius: 10px;
}
.pos-price-list::-webkit-scrollbar-thumb {
  background-color: rgb(212, 214, 221);
  border-radius: 10px;
}
.pos-price-list:hover::-webkit-scrollbar-thumb {
  background-color: rgb(192, 194, 201);
}
.darkmode .pos-price-list {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.darkmode .pos-price-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.15);
}
.darkmode .pos-price-list:hover::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.25);
}
.pos-price-list .pos-table {
  min-width: 420px;
}

.pos-price-list .pos-price-row {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.pos-price-list .pos-price-row:hover .pos-td {
  background-color: var(--pf-table-hover);
}
.darkmode .pos-price-list .pos-price-row:hover .pos-td {
  background-color: #3a3d4a;
}
.pos-price-list .pos-price-row.selected {
  box-shadow: inset 3px 0 0 var(--pf-accent);
}
.pos-price-list .pos-price-row.selected .pos-td {
  background-color: var(--pf-selection-bg) !important;
}

.pos-detail-filter-panel {
  margin-bottom: 1rem;
}

.position-detail-page ~ .bulk-actions-bar {
  max-width: calc(100% - 2rem);
}
@media (min-width: 769px) {
  .position-detail-page ~ .bulk-actions-bar {
    max-width: 600px;
  }
}

#bulk-actions:not(.pf-hidden) ~ #price-bulk-actions:not(.pf-hidden) {
  bottom: 5.5rem;
}
@media (max-width: 768px) {
  #bulk-actions:not(.pf-hidden) ~ #price-bulk-actions:not(.pf-hidden) {
    bottom: calc(64px + 4rem + env(safe-area-inset-bottom, 0px));
  }
}

.delete-modal {
  max-width: 420px;
}

.delete-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--pf-border-color);
}

.delete-modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--pf-text-primary);
}

.delete-modal-close {
  background: none;
  border: none;
  padding: 0.375rem;
  cursor: pointer;
  color: var(--pf-text-muted);
  border-radius: 8px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.delete-modal-close:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}

.delete-modal-body {
  padding: 1.25rem;
}

.delete-modal-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--pf-text-primary);
  margin: 0 0 1rem;
  padding: 0.75rem;
  background: var(--pf-bg-tertiary);
  border-radius: 8px;
}

.delete-modal-desc {
  font-size: 0.875rem;
  color: var(--pf-text-muted);
  margin: 0 0 0.5rem;
}

.delete-modal-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--pf-text-secondary);
}
.delete-modal-list li {
  padding: 0.375rem 0;
  padding-left: 1.25rem;
  position: relative;
}
.delete-modal-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--pf-text-muted);
}

.delete-modal-warning {
  font-size: 0.8125rem;
  color: #ef4444;
  font-weight: 500;
  margin: 0;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 8px;
}

.delete-modal-actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--pf-border-color);
}
.delete-modal-actions .btn {
  flex: 1;
  justify-content: center;
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
@media (min-width: 480px) {
  .quick-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
.quick-actions .btn {
  justify-content: center;
}
@media (min-width: 480px) {
  .quick-actions .btn {
    justify-content: flex-start;
  }
}

.editable-price {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.2s;
}
.editable-price:hover {
  background: var(--pf-accent-light);
}

.chart-container--wide {
  height: 200px;
}
@media (min-width: 480px) {
  .chart-container--wide {
    height: 250px;
  }
}
@media (min-width: 768px) {
  .chart-container--wide {
    height: 300px;
  }
}

.performance-note {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--pf-surface-secondary, #f8f9fa);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--pf-text-secondary, #666);
  line-height: 1.4;
}
@media (min-width: 480px) {
  .performance-note {
    flex-direction: row;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
}
.performance-note svg {
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.7;
}

.kpi-sublabel {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}
@media (min-width: 768px) {
  .kpi-sublabel {
    font-size: 0.85rem;
  }
}

.create-portfolio-page {
  max-width: 480px;
  margin: 0 auto;
}

.create-portfolio-card {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 12px;
  padding: 1.25rem;
}
@media (min-width: 480px) {
  .create-portfolio-card {
    padding: 1.5rem;
  }
}

.total-preview {
  background: var(--pf-bg-tertiary);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.total-preview-label {
  font-size: 0.75rem;
  color: var(--pf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}
.total-preview-value {
  font-size: 1.5rem;
  font-weight: 600;
}

.my-lg {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.delete-container {
  max-width: 500px;
  margin: 0 auto;
}

.delete-card {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color, #e0e0e0);
  text-align: center;
}

.delete-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.delete-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary, #1a1a1a);
}

.transaction-details {
  background: var(--hover-bg, #f9fafb);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.transaction-detail {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
}
.transaction-detail:last-child {
  border-bottom: none;
}

.delete-warning {
  text-align: center;
}
.delete-warning-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.delete-warning h3 {
  margin-bottom: 1rem;
}
.delete-warning ul {
  text-align: left;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.delete-warning li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--pf-border-color);
}
.delete-warning li:last-child {
  border-bottom: none;
}

.position-summary {
  background: var(--pf-bg-tertiary);
  border-radius: 8px;
  padding: 1rem;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--pf-border-color);
}
.settings-item:last-child {
  border-bottom: none;
}

.settings-label {
  color: var(--pf-text-secondary);
}

.settings-value {
  font-weight: 500;
}

.delete-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.delete-option {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.delete-option:hover {
  background: var(--pf-bg-tertiary);
}
.delete-option input[type=radio] {
  margin-top: 0.25rem;
}
.delete-option-content {
  flex: 1;
}
.delete-option-content strong {
  display: block;
  margin-bottom: 0.25rem;
}
.delete-option-content p {
  margin: 0;
  font-size: 0.875rem;
}
.delete-option input[type=radio]:checked + .delete-option-content strong {
  color: var(--pf-accent);
}

html:has(body.pf-landing-body) {
  overflow-x: hidden;
  height: auto;
  min-height: 100%;
}

.pf-landing-body {
  height: auto;
  min-height: 100vh;
  display: block;
  overflow: visible;
}

.pf-landing-header {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 768px) {
  .pf-landing-header {
    gap: 16px;
    padding: 24px 48px;
  }
}

.pf-landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: var(--pf-text-primary);
  text-decoration: none;
}
.pf-landing-logo img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.pf-landing-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (min-width: 768px) {
  .pf-landing-nav {
    gap: 16px;
  }
}
.pf-landing-nav > .pf-landing-btn {
  display: none;
}
@media (min-width: 768px) {
  .pf-landing-nav > .pf-landing-btn {
    display: inline-flex;
  }
}
.pf-landing-nav > a:not(.pf-landing-btn) {
  color: var(--pf-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: none;
}
@media (min-width: 768px) {
  .pf-landing-nav > a:not(.pf-landing-btn) {
    display: inline;
  }
}
.pf-landing-nav > a:not(.pf-landing-btn):hover {
  color: var(--pf-text-primary);
}
.pf-landing-nav__login {
  display: inline !important;
}

.pf-landing-langswitch {
  display: inline-flex;
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
}
.pf-landing-langswitch__btn {
  padding: 6px 10px;
  color: var(--pf-text-secondary);
  text-decoration: none;
  line-height: 1;
  transition: all 0.2s ease;
  letter-spacing: 0.04em;
}
.pf-landing-langswitch__btn:hover {
  background: var(--pf-bg-secondary);
  color: var(--pf-text-primary);
}
.pf-landing-langswitch__btn.is-active {
  background: var(--pf-accent);
  color: #FFF;
}
.pf-landing-langswitch__btn + .pf-landing-langswitch__btn {
  border-left: 1px solid var(--pf-border-color);
}

.pf-landing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  .pf-landing-btn {
    padding: 10px 18px;
  }
}
.pf-landing-btn--primary {
  background: var(--pf-accent);
  color: #FFF;
}
.pf-landing-btn--primary:hover {
  background: var(--pf-accent-hover);
  transform: translateY(-1px);
}
.pf-landing-btn--ghost {
  background: transparent;
  color: var(--pf-text-primary);
  border-color: var(--pf-border-color);
}
.pf-landing-btn--ghost:hover {
  background: var(--pf-bg-secondary);
  border-color: var(--pf-text-secondary);
}
.pf-landing-btn--lg {
  padding: 14px 26px;
  font-size: 16px;
}
.pf-landing-btn__play {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.pf-landing {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 48px;
}
@media (min-width: 768px) {
  .pf-landing {
    padding: 0 48px 48px;
  }
}

.pf-landing-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FFF;
  background: var(--pf-accent);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.pf-landing-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding: 32px 0 48px;
}
@media (min-width: 850px) {
  .pf-landing-hero {
    grid-template-columns: minmax(480px, 560px) minmax(0, 1fr);
    gap: 56px;
    align-items: center;
    padding: 64px 0 80px;
  }
}
.pf-landing-hero__title {
  font-size: 36px;
  line-height: 1.1;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--pf-text-primary);
  letter-spacing: -0.02em;
}
@media (min-width: 768px) {
  .pf-landing-hero__title {
    font-size: 56px;
  }
}
.pf-landing-hero__title-accent {
  display: block;
  color: var(--pf-accent);
}
.pf-landing-hero__lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--pf-text-secondary);
  margin: 0 0 24px;
  max-width: 540px;
}
.pf-landing-hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.pf-landing-hero__proof {
  flex-basis: 100%;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--pf-text-muted);
  max-width: 540px;
}
@media (min-width: 768px) {
  .pf-landing-hero__proof {
    flex: 1 1 0;
    min-width: 240px;
    max-width: 360px;
  }
}
.pf-landing-hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.pf-hero-carousel {
  width: 100%;
  max-width: 100%;
  flex: 1 1 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}
.pf-hero-carousel__viewport {
  width: 100%;
  border-radius: 12px;
  background-color: var(--pf-bg-primary);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.1), 0 6px 14px rgba(15, 23, 42, 0.06);
}
.darkmode .pf-hero-carousel__viewport {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.25);
}
.pf-hero-carousel__track {
  display: flex;
  align-items: flex-start;
  border-radius: 12px;
  background-color: var(--pf-bg-primary);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.pf-hero-carousel__track::-webkit-scrollbar {
  display: none;
}
.pf-hero-carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.pf-hero-carousel__frame {
  display: block;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--pf-bg-primary);
}
.pf-hero-carousel__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}
.pf-hero-carousel__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  align-self: center;
  width: max-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06);
}
.darkmode .pf-hero-carousel__dots {
  background: rgba(30, 41, 59, 0.82);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
}
.pf-hero-carousel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pf-border-color);
  cursor: pointer;
  transition: background-color 0.18s ease, width 0.18s ease;
}
.pf-hero-carousel__dot:hover {
  background: var(--pf-text-muted);
}
.pf-hero-carousel__dot.is-active {
  background: var(--pf-accent);
  width: 22px;
  border-radius: 999px;
}
.pf-hero-carousel__dot:focus-visible {
  outline: 2px solid var(--pf-accent);
  outline-offset: 3px;
}
.darkmode .pf-hero-carousel__dot {
  background: rgba(148, 163, 184, 0.45);
}
.darkmode .pf-hero-carousel__dot:hover {
  background: rgba(148, 163, 184, 0.65);
}
.darkmode .pf-hero-carousel__dot.is-active {
  background: var(--pf-accent);
}

.pf-landing-section {
  padding: 48px 0;
}
@media (min-width: 768px) {
  .pf-landing-section {
    padding: 80px 0;
  }
}
.pf-landing-section--alt {
  background: var(--pf-bg-secondary);
  border-radius: 20px;
  padding-left: 24px;
  padding-right: 24px;
  margin: 0 calc(-1 * 24px);
}
@media (min-width: 768px) {
  .pf-landing-section--alt {
    padding-left: 48px;
    padding-right: 48px;
    margin: 0;
  }
}
.pf-landing-section__head {
  text-align: center;
  margin-bottom: 48px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.pf-landing-section__head h2 {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--pf-text-primary);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}
@media (min-width: 768px) {
  .pf-landing-section__head h2 {
    font-size: 42px;
  }
}
.pf-landing-section__head p {
  font-size: 18px;
  color: var(--pf-text-secondary);
  margin: 0;
}

.pf-landing-pain {
  padding-top: 24px;
}
@media (min-width: 768px) {
  .pf-landing-pain {
    padding-top: 32px;
  }
}
.pf-landing-pain .pf-landing-section__head {
  margin-bottom: 32px;
}
.pf-landing-pain__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  max-width: 880px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .pf-landing-pain__list {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 64px;
    max-width: none;
  }
}
.pf-landing-pain__quote {
  margin: 0;
  padding: 6px 0 6px 24px;
  border-left: 2px solid var(--pf-border-color);
}
.pf-landing-pain__voice {
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  color: var(--pf-text-primary);
  margin: 0 0 8px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.pf-landing-pain__detail {
  font-size: 16px;
  line-height: 1.65;
  color: var(--pf-text-secondary);
  margin: 0;
}

.pf-landing-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 768px) {
  .pf-landing-features {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

.pf-landing-feature {
  background: var(--pf-bg-primary);
  border: 1px solid var(--pf-border-light);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.pf-landing-feature:hover {
  transform: translateY(-2px);
  border-color: var(--pf-accent);
  box-shadow: var(--pf-shadow-md);
}
.pf-landing-feature h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--pf-text-primary);
  line-height: 1.3;
}
.pf-landing-feature__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--pf-text-muted);
}
.pf-landing-feature p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--pf-text-secondary);
  margin: 0;
}

.pf-landing-import {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 0;
}
@media (min-width: 768px) {
  .pf-landing-import {
    padding: 48px 0;
  }
}
.pf-landing-import h2 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--pf-text-primary);
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}
@media (min-width: 768px) {
  .pf-landing-import h2 {
    font-size: 32px;
  }
}
.pf-landing-import__lead {
  font-size: 18px;
  line-height: 1.65;
  color: var(--pf-text-secondary);
  margin: 0;
}

.pf-landing-faq {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-width: 760px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .pf-landing-faq {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: none;
    align-items: start;
  }
}
.pf-landing-faq__item {
  background: var(--pf-bg-primary);
  border: 1px solid var(--pf-border-light);
  border-radius: 8px;
  padding: 16px 24px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.pf-landing-faq__item:hover {
  border-color: var(--pf-border-color);
}
.pf-landing-faq__item[open] {
  border-color: var(--pf-accent);
  box-shadow: var(--pf-shadow-sm);
}
.pf-landing-faq__item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--pf-text-primary);
  font-size: 16px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.pf-landing-faq__item summary::-webkit-details-marker {
  display: none;
}
.pf-landing-faq__item summary::after {
  content: "+";
  font-size: 20px;
  line-height: 1;
  color: var(--pf-text-muted);
  font-weight: 400;
  transition: color 0.18s ease;
}
.pf-landing-faq__item[open] summary::after {
  content: "−";
  color: var(--pf-accent);
}
.pf-landing-faq__item p {
  margin: 16px 0 0;
  color: var(--pf-text-secondary);
  line-height: 1.6;
  font-size: 16px;
}
.pf-landing-faq__item p a {
  color: var(--pf-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pf-landing-faq__item p a:hover {
  text-decoration: none;
}

.pf-landing-cta {
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(135deg, var(--pf-accent) 0%, var(--pf-accent-hover) 100%);
  border-radius: 20px;
  margin: 48px 0;
  color: #FFF;
}
@media (min-width: 768px) {
  .pf-landing-cta {
    padding: 80px 48px;
  }
}
.pf-landing-cta h2 {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 16px;
  color: #FFF;
  letter-spacing: -0.02em;
}
@media (min-width: 768px) {
  .pf-landing-cta h2 {
    font-size: 42px;
  }
}
.pf-landing-cta p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 32px;
}
.pf-landing-cta__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}
.pf-landing-cta p.pf-landing-cta__note {
  margin: 64px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}
.pf-landing-cta p.pf-landing-cta__note a,
.pf-landing-cta p.pf-landing-cta__note a:link,
.pf-landing-cta p.pf-landing-cta__note a:visited {
  color: #FFF;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  margin-left: 4px;
}
.pf-landing-cta p.pf-landing-cta__note a:hover {
  opacity: 0.85;
  color: #FFF;
}
.pf-landing-cta .pf-landing-btn--primary {
  background: #FFF;
  color: var(--pf-accent);
}
.pf-landing-cta .pf-landing-btn--primary:hover {
  background: var(--pf-bg-secondary);
}
.pf-landing-cta .pf-landing-btn--ghost {
  color: #FFF;
  border-color: rgba(255, 255, 255, 0.4);
  background: transparent;
}
.pf-landing-cta .pf-landing-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #FFF;
}

.pf-landing-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.pf-landing-modal.is-hidden {
  display: none;
}
.pf-landing-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  cursor: pointer;
}
.pf-landing-modal__content {
  position: relative;
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 14px;
  box-shadow: var(--pf-shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 32px 24px 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
@media (min-width: 768px) {
  .pf-landing-modal__content {
    padding: 48px 32px 32px;
  }
}
.pf-landing-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: 4px;
  color: var(--pf-text-muted);
  cursor: pointer;
  line-height: 0;
  transition: all 0.2s ease;
}
.pf-landing-modal__close:hover {
  background: var(--pf-bg-tertiary);
  color: var(--pf-text-primary);
}
.pf-landing-modal__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--pf-text-primary);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
@media (min-width: 768px) {
  .pf-landing-modal__title {
    font-size: 28px;
  }
}
.pf-landing-modal__subtitle {
  font-size: 14px;
  color: var(--pf-text-secondary);
  margin: 0 0 24px;
  line-height: 1.5;
}
.pf-landing-modal__alt {
  margin: 24px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--pf-text-secondary);
}
.pf-landing-modal__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pf-landing-modal--video .pf-landing-modal__content, .pf-landing-modal__content--video {
  max-width: min(960px, 100%);
  padding: 0;
  background: #000;
  border-color: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.pf-landing-modal--video .pf-landing-modal__close, .pf-landing-modal__content--video + .pf-landing-modal__close {
  color: rgba(255, 255, 255, 0.85);
}
.pf-landing-modal--video .pf-landing-modal__close:hover, .pf-landing-modal__content--video + .pf-landing-modal__close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #FFF;
}

.pf-landing-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}
.pf-landing-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.pf-landing-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.pf-landing-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pf-landing-form__field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--pf-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pf-landing-form__field > small {
  font-size: 11px;
  color: var(--pf-text-muted);
}
.pf-landing-form__field input {
  font-family: inherit;
  font-size: 16px;
  padding: 10px 12px;
  background: var(--pf-input-bg);
  border: 1px solid var(--pf-input-border);
  border-radius: 8px;
  color: var(--pf-text-primary);
  transition: all 0.2s ease;
}
.pf-landing-form__field input::placeholder {
  color: var(--pf-text-muted);
}
.pf-landing-form__field input:focus {
  outline: none;
  border-color: var(--pf-accent);
  box-shadow: 0 0 0 3px var(--pf-accent-light);
}
.pf-landing-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: -4px;
  font-size: 14px;
}
.pf-landing-form__row--end {
  justify-content: flex-end;
}
.pf-landing-form__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--pf-text-secondary);
  cursor: pointer;
  line-height: 1.5;
}
.pf-landing-form__check input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--pf-accent);
  cursor: pointer;
  flex-shrink: 0;
}
.pf-landing-form__check--terms {
  align-items: flex-start;
}
.pf-landing-form__check--terms input[type=checkbox] {
  margin-top: 2px;
}
.pf-landing-form__check--terms a {
  color: var(--pf-accent);
  text-decoration: underline;
}
.pf-landing-form__check--terms a:hover {
  color: var(--pf-accent-hover);
}
.pf-landing-form__link {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--pf-accent);
  font-size: inherit;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.pf-landing-form__link:hover {
  color: var(--pf-accent-hover);
  text-decoration: underline;
}
.pf-landing-form__divider {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--pf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 4px 0;
}
.pf-landing-form__divider::before, .pf-landing-form__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--pf-border-light);
}
.pf-landing-form__google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--pf-border-color);
  border-radius: 8px;
  background: var(--pf-bg-primary);
  color: var(--pf-text-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.pf-landing-form__google:hover {
  background: var(--pf-bg-tertiary);
  border-color: var(--pf-text-secondary);
}

.pf-landing-btn--block {
  width: 100%;
  padding: 12px 18px;
  font-size: 16px;
}

.pf-landing-body.pf-landing--modal-open {
  overflow: hidden;
}

.pf-landing-footer {
  border-top: 1px solid var(--pf-border-light);
  padding: 32px 0 24px;
  font-size: 14px;
  color: var(--pf-text-muted);
}
.pf-landing-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
@media (min-width: 768px) {
  .pf-landing-footer__inner {
    padding: 0 48px;
  }
}
.pf-landing-footer__row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
@media (min-width: 768px) {
  .pf-landing-footer__row {
    flex-direction: row;
    justify-content: space-between;
  }
}
.pf-landing-footer__contacts, .pf-landing-footer__legal {
  display: flex;
  align-items: center;
  gap: 16px;
}
.pf-landing-footer__tg-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  transition: opacity 0.18s ease;
}
.pf-landing-footer__tg-icon:hover {
  opacity: 1;
}
.pf-landing-footer__disclaimer {
  margin: 0;
  text-align: center;
  line-height: 1.55;
  color: var(--pf-text-muted);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  font-size: 12px;
}
@media (min-width: 768px) {
  .pf-landing-footer__disclaimer {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
  }
}
.pf-landing-footer nav {
  display: flex;
  gap: 24px;
}
.pf-landing-footer nav a {
  color: var(--pf-text-secondary);
  text-decoration: none;
}
.pf-landing-footer nav a:hover {
  color: var(--pf-text-primary);
}
.pf-landing-footer nav a.is-active {
  color: var(--pf-accent);
  font-weight: 600;
}

.text-positive {
  color: var(--pf-positive) !important;
}

.text-negative {
  color: var(--pf-negative) !important;
}

.text-info {
  color: var(--pf-info) !important;
}

.text-warning {
  color: var(--pf-warning) !important;
}

.text-muted {
  color: var(--pf-text-muted) !important;
}

.text-right {
  text-align: right !important;
}

.text-center {
  text-align: center !important;
}

.mt-0 {
  margin-top: 0 !important;
}

.mt-md {
  margin-top: 16px !important;
}

.mt-lg {
  margin-top: 24px !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-md {
  margin-bottom: 16px !important;
}

.mb-lg {
  margin-bottom: 24px !important;
}

.p-0 {
  padding: 0 !important;
}

.pt-0 {
  padding-top: 0 !important;
}

.pb-0 {
  padding-bottom: 0 !important;
}

.flex {
  display: flex !important;
}

.flex-1 {
  flex: 1 !important;
}

.items-center {
  align-items: center !important;
}

.justify-between {
  justify-content: space-between !important;
}

.gap-sm {
  gap: 8px !important;
}

.gap-md {
  gap: 16px !important;
}

.d-none {
  display: none !important;
}

.d-inline {
  display: inline !important;
}

.d-inline-block {
  display: inline-block !important;
}

.d-block {
  display: block !important;
}

.d-contents {
  display: contents !important;
}

.hidden {
  display: none !important;
}

.pf-hidden {
  display: none !important;
}

.hide-mobile {
  display: none !important;
}
@media (min-width: 768px) {
  .hide-mobile {
    display: initial !important;
  }
}

@media (min-width: 768px) {
  .hide-tablet-up {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .show-mobile-only {
    display: none !important;
  }
}

.show-tablet-up {
  display: none !important;
}
@media (min-width: 768px) {
  .show-tablet-up {
    display: initial !important;
  }
}

.icon-inline {
  vertical-align: middle;
  margin-right: 4px;
}

.icon-inline-sm {
  vertical-align: -1px;
  margin-right: 3px;
}

.icon-inline-xs {
  vertical-align: -1px;
  margin-right: 2px;
}

.pf-icon-inline {
  vertical-align: middle;
  margin-right: 0.25rem;
}

.cursor-pointer {
  cursor: pointer;
}

.mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}

.max-w-sm {
  max-width: 400px !important;
}

.max-w-md {
  max-width: 500px !important;
}

.max-w-lg {
  max-width: 600px !important;
}

.max-w-xl {
  max-width: 800px !important;
}

.pf-card-centered {
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.pf-card-centered-lg {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.text-uppercase {
  text-transform: uppercase !important;
}

.text-lowercase {
  text-transform: lowercase !important;
}

.text-capitalize {
  text-transform: capitalize !important;
}

.m-0 {
  margin: 0 !important;
}

.ml-sm {
  margin-left: 0.5rem !important;
}

.mr-sm {
  margin-right: 0.5rem !important;
}

.p-lg {
  padding: 2rem !important;
}

.opacity-100 {
  opacity: 1 !important;
}

.welcome-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--pf-bg);
}

.welcome-content {
  width: 100%;
  max-width: 420px;
}

.welcome-header {
  text-align: center;
  margin-bottom: 32px;
}
.welcome-header h1 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--pf-text-primary);
}
.welcome-header p {
  font-size: 0.9375rem;
  color: var(--pf-text-muted);
  margin: 0;
}

.welcome-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 20px;
  color: var(--pf-accent);
  margin: 0 auto 24px;
}

.welcome-form {
  background: var(--pf-bg-secondary);
  border: 1px solid var(--pf-border-color);
  border-radius: 20px;
  padding: 32px;
}
.welcome-form .tx-form-field {
  margin-bottom: 24px;
}
.welcome-form .tx-form-field:last-of-type {
  margin-bottom: 32px;
}
.welcome-form .tx-form-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--pf-text-primary);
}
.welcome-form .tx-form-field .form-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--pf-text-muted);
}
.welcome-form .alert {
  margin-bottom: 24px;
}

.welcome-submit {
  width: 100%;
}

.welcome-footer {
  text-align: center;
  margin-top: 32px;
}
.welcome-footer a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  color: var(--pf-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
.welcome-footer a:hover {
  color: var(--pf-accent);
}
.welcome-footer a svg {
  flex-shrink: 0;
}

/*# sourceMappingURL=portfolio.css.map */
