:root{
  --card-border: #e5e7eb;
  --muted: #9ca3af;
  --muted-2: #e5e7eb;
  --bg-ghost: #fafafa;
  --danger: #ef4444;
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --modal-padding: 32px;
  --modal-fixed-width: 1024px;
  --modal-max-height: 90vh;
  --air-bg: #F7F8FA;
  --air-surface: rgba(255,255,255,0.55);
  --air-text: #2E2F33;
  --air-secondary: #7A7F87;
  --air-muted-text: #9DA3AE;
  --air-line: #E6E6E6;
  --air-pill: #F7F8FA;
  --air-shadow: 0px 4px 16px rgba(0,0,0,0.04);
  --air-radius: 32px;
}

body{
  background: var(--air-bg);
  color: var(--air-text);
  font-family: "Inter","Noto Sans TC","Segoe UI",sans-serif;
}

button{
  transition: background 0.2s ease-out, color 0.2s ease-out, border-color 0.2s ease-out;
}
button:hover{
  background: rgba(0,0,0,0.04);
}

aside{
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--air-line);
  box-shadow: var(--air-shadow);
}

.main-air{
  min-height: 100vh;
  padding-top: 40px;
  padding-bottom: 60px;
}

.glass-panel{
  background: var(--air-surface);
  backdrop-filter: blur(14px);
  border-radius: var(--air-radius);
  box-shadow: var(--air-shadow);
  border: 1px solid rgba(255,255,255,0.6);
}

.page-heading{
  margin-bottom: 24px;
}
.heading-tabs{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--air-muted-text);
}
.heading-link{
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 12px;
  transition: background 0.2s ease-out, color 0.2s ease-out;
}
.heading-link.active{
  color: var(--air-text);
  font-weight: 600;
  background: rgba(0,0,0,0.02);
}
.heading-divider{
  color: var(--air-muted-text);
}

.hero-section{
  margin-bottom: 24px;
}
.hero-card{
  display: grid;
  gap: 18px;
  padding: 20px 22px;
  border-radius: var(--air-radius);
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}
@media (min-width: 900px){
  .hero-card.hero-grid{
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}
.hero-main{
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-trend{
  border-left: 1px solid rgba(0,0,0,0.04);
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero-trend-header{
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--air-muted-text);
  margin-bottom: 10px;
}
#today-sparkline{
  width: 100%;
  height: 80px;
}
#today-sparkline-line{
  fill: none;
  stroke: #8bd3c7;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}
.hero-activity{
  border-left: 1px solid rgba(0,0,0,0.04);
  padding-left: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.hero-activity-block{
  text-align: right;
  flex: 1;
}
.hero-activity-label{
  font-size: 12px;
  color: var(--air-muted-text);
}
.hero-activity-value{
  font-size: 20px;
  font-weight: 600;
  color: var(--air-text);
}

.portfolio-hero-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
  gap: 20px;
  align-items: stretch;
  grid-auto-rows: 1fr;
}
.asset-card{
  height: 100%;
  display:flex;
  flex-direction:column;
}

.hero-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:10px;
  font-size:14px;
  color:var(--air-muted-text);
}
.hero-summary-grid{
  margin-top:16px;
  display:grid;
  grid-template-columns: repeat(auto-fit,minmax(140px,1fr));
  gap:12px;
}
.hero-summary-item{
  padding:10px 12px;
  border-radius:16px;
  background:#fff;
  border:1px solid rgba(0,0,0,0.04);
  box-shadow:0 3px 12px rgba(0,0,0,0.06);
}
.hero-summary-label{
  font-size:12px;
  color:var(--air-muted-text);
  margin-bottom:4px;
}
.hero-summary-value{
  font-size:14px;
  font-weight:600;
  color:var(--air-text);
}
.hero-summary-label{
  font-size:12px;
  color:var(--air-muted-text);
  margin-bottom:4px;
}
.hero-summary-value{
  font-size:14px;
  font-weight:600;
  color:var(--air-text);
}

.hero-chart{
  border-radius: 28px;
  border: 1px solid rgba(0,0,0,0.04);
  background: #ffffff;
  padding: 16px 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.asset-curve-card .hero-chart-head{
  align-items: center;
}
.hero-chart-head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.hero-chart-label{
  font-size: 13px;
  color: var(--air-muted-text);
}
.hero-chart-controls{
  display: flex;
  gap: 6px;
}
.segmented-control{
  background: #f1f3f5;
  border-radius: 999px;
  padding: 4px;
}
.segmented-control .asset-range-btn{
  border: 1px solid #E5E7EB;
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 12px;
  color: #9CA3AF;
  background: #ffffff;
  box-shadow: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.segmented-control .asset-range-btn.active{
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  color: #1F2937;
  border-color: #D1D5DB;
}
#asset-trend{
  width: 100%;
  height: 240px;
  flex: 1;
}
.curve-hitbox{
  fill: transparent;
  cursor: crosshair;
}
.asset-curve-body{
  position: relative;
  min-height: 240px;
  padding-top: 12px;
  padding-bottom: 4px;
  display: flex;
  align-items: center;
}
.asset-curve-tooltip{
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -100%);
  background: #ffffff;
  color: #475569;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #F1F5F9;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-size: 12px;
  pointer-events: none;
  transition: opacity 0.2s ease;
  opacity: 0;
}
.asset-curve-tooltip:not(.hidden){
  opacity: 1;
}
.asset-curve-empty{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #b0bdd8;
  letter-spacing: 0.03em;
  pointer-events: none;
}
.asset-curve-empty.hidden{
  display: none;
}
.asset-curve-axis{
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #C9CED6;
  margin-top: 4px;
  gap: 4px;
}
.asset-curve-axis span{
  flex: 1;
  text-align: center;
  white-space: nowrap;
}
.asset-curve-footer{
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--air-muted-text);
}
.asset-curve-min,
.asset-curve-max{
  font-weight: 600;
  color: var(--air-text);
}

.portfolio-summary{
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.summary-card{
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 20px;
  padding: 18px 20px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15,23,42,0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.summary-main{
  grid-column: span 2;
  padding: 22px 24px;
}
.summary-card-head{
  display:flex;
  justify-content:space-between;
  color: var(--air-muted-text);
  font-size: 13px;
}
.summary-label{
  font-size:13px;
  color: var(--air-muted-text);
  letter-spacing:0.04em;
}
.summary-value{
  font-size:32px;
  font-weight:700;
  color:#0f172a;
}
.summary-subvalue{
  font-size:14px;
  color:#94a3b8;
}
.summary-meta{
  display:flex;
  justify-content:space-between;
  gap:20px;
  font-size:13px;
  color:#64748b;
}
.summary-meta strong{
  color:#0f172a;
  font-size:15px;
}
.summary-card .summary-mini{
  font-size:20px;
  font-weight:600;
  color:#0f172a;
}
.summary-note{
  font-size:13px;
  color:#94a3b8;
}

.portfolio-analytics{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:20px;
  margin-bottom:32px;
}
.analytics-card{
  background:#fff;
  border:1px solid rgba(0,0,0,0.05);
  border-radius:24px;
  padding:20px;
  box-shadow:0 8px 24px rgba(15,23,42,0.05);
  display:flex;
  flex-direction:column;
  gap:14px;
}
.breakdown-card{
  align-items:center;
}
.indicator-card{
  padding:24px;
}
.analytics-title{
  font-size:15px;
  font-weight:600;
  color:#0f172a;
}
.holdings-card{
  background:#fff;
  border:1px solid rgba(0,0,0,0.05);
  border-radius:24px;
  padding:20px;
  box-shadow:0 8px 24px rgba(15,23,42,0.04);
  overflow:auto;
}
.asset-range-btn{
  border: 1px solid rgba(0,0,0,0.08);
  background: transparent;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--air-muted-text);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.asset-range-btn.active{
  background: #ffffff;
  border-color: rgba(0,0,0,0.2);
  color: var(--air-text);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
#asset-trend{
  width: 100%;
  height: 110px;
}
#asset-trend-line{
  fill: none;
  stroke: #4c9eb5;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-chart-note{
  font-size: 12px;
  color: var(--air-muted-text);
  text-align: right;
}
.text-muted{
  color: var(--air-muted-text);
}

.spotlight-section,
.timeline-section,
.behavior-section,
.results-section,
.quick-actions-section{
  margin-top: 36px;
}
.spotlight-card{
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(0,0,0,0.04);
}
.spotlight-card.empty{
  display: flex;
  justify-content: center;
}
.spotlight-card.empty{
  justify-content: center;
  min-height: 90px;
}
.spotlight-image{
  width: 100%;
  height: 70px;
  border-radius: 16px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spotlight-image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.spotlight-info{
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.spotlight-meta{
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.spotlight-empty{
  font-size: 14px;
  color: var(--air-muted-text);
}

.timeline-card{
  padding: 18px;
  border: 1px solid rgba(0,0,0,0.04);
  min-height: 90px;
}
.timeline-card.compact #activity-details{
  margin-top: 12px;
}
.timeline-dots{
  display: grid;
  grid-template-columns: repeat(7, minmax(0,1fr));
  gap: 10px;
  justify-items: center;
  margin-bottom: 6px;
}
.timeline-dot{
  width: 8px;
  height: 8px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease-out;
}
.timeline-dot:hover{
  transform: translateY(-2px);
}
.timeline-dot[data-state="empty"]{
  border: 1px dashed var(--air-line);
  background: transparent;
}
.timeline-dot[data-state="filled"]{
  background: #16a34a;
}
.timeline-dot[data-state="loss"]{
  background: #ef4444;
}
.timeline-dot::after{
  content: attr(data-label);
  margin-top: 10px;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--air-muted-text);
}
.timeline-dot::before{
  content: attr(data-tooltip);
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translate(-50%, -100%);
  font-size: 10px;
  color: #fff;
  background: rgba(0,0,0,0.75);
  padding: 2px 6px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}
.timeline-dot:hover::before{
  opacity: 1;
}
.timeline-details{
  margin-top: 20px;
  border-top: 1px solid var(--air-line);
  padding-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.timeline-details .activity-card{
  padding: 12px 16px;
  border: 1px solid var(--air-line);
  border-radius: 14px;
  font-size: 12px;
}

.behavior-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(140px,1fr));
  gap: 16px;
}
.behavior-card{
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(0,0,0,0.04);
  min-height: 90px;
}
.behavior-icon{
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: var(--air-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.behavior-label{
  font-size: 12px;
  color: var(--air-muted-text);
}
.behavior-value{
  font-size: 20px;
  font-weight: 600;
}

.results-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 16px;
}
.result-card{
  padding: 18px;
  border: 1px solid rgba(0,0,0,0.04);
  min-height: 150px;
}
.result-card-title{
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}
.result-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-item{
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--air-line);
}
.result-item .pnl-positive{
  color: #16a34a;
}
.result-item .pnl-negative{
  color: #dc2626;
}

.records-list-section{
  margin-top: 48px;
}

.text-positive{
  color: #16a34a;
}
.text-negative{
  color: #ef4444;
}
.hero-label{
  font-size: 14px;
  color: var(--air-muted-text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero-amount{
  font-size: 32px;
  font-weight: 600;
  margin-top: 10px;
  color: var(--air-text);
}
.hero-subtext{
  font-size: 12px;
  color: var(--air-muted-text);
  margin-top: 6px;
}
.hero-side{
  text-align: right;
}
.hero-meta-label{
  font-size: 12px;
  color: var(--air-muted-text);
  margin-bottom: 6px;
}
.hero-meta-value{
  font-size: 24px;
  color: #27ae60;
  font-weight: 600;
}

#record-modal .record-modal-body{
  padding-bottom: 8px;
}
#record-modal .record-left-stack,
#record-modal .record-right-stack{
  height: 100%;
}
.record-image-drop{
  height: 240px;
  border: 1px dashed #d1d5db;
  border-radius: 24px;
  background: #f8f8f8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease-out, border-color 0.2s ease-out;
}
.record-image-drop:hover{
  background: #f1f5f9;
}
.record-image-drop img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
}
.record-image-placeholder{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.record-section{
  background: #fff;
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 24px;
  padding: 18px 20px;
  box-shadow: 0 8px 20px rgba(15,23,42,0.04);
}
.record-section-title{
  font-size: 13px;
  color: var(--air-muted-text);
  font-weight: 600;
  margin-bottom: 12px;
}
.form-grid{
  display: grid;
  grid-template-columns: repeat(1,minmax(0,1fr));
  gap: 14px;
}
@media (min-width: 640px){
  .form-grid{
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}
#record-modal .record-input-control{
  width: 100%;
  height: 48px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 0 14px;
  font-size: 14px;
  background: #fff;
}
#record-modal select.record-input-control{
  padding-right: 32px;
}
#record-modal .record-textarea{
  width: 100%;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  padding: 12px 14px;
  font-size: 14px;
  resize: vertical;
  min-height: 140px;
  background: #fff;
}
.record-card-panel{
  background: #fff;
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 8px 20px rgba(15,23,42,0.04);
}
.record-modal-actions{
  padding-top: 24px;
  border-top: 1px solid #f1f1f1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.record-action-btn{
  border-radius: 14px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
}
#record-modal .extra-field-line{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 10px 20px rgba(15,23,42,0.08);
  position: relative;
}
#record-modal .extra-field-line::before{
  display: none;
}
#record-modal .extra-field-label{
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}
#record-modal .extra-field-input{
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  background: #fff;
}
#record-modal .extra-field-remove{
  position: absolute;
  top: 10px;
  right: 12px;
  color: #94a3b8;
  cursor: pointer;
  font-weight: 600;
}
#record-modal .extra-field-remove:hover{
  color: #ef4444;
}

.asset-section{
  margin-bottom: 32px;
}
.asset-card{
  padding: 28px 32px;
}
.asset-card-top{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 20px;
  flex-wrap: wrap;
}
.asset-title{
  font-size: 16px;
  font-weight: 600;
  color: var(--air-text);
}
.asset-subtitle{
  font-size: 12px;
  color: var(--air-muted-text);
}
.segment-control{
  display: inline-flex;
  background: #F2F3F5;
  border-radius: 12px;
  padding: 4px;
  gap: 6px;
}
.segment-control .asset-btn{
  border: none;
  background: transparent;
  font-size: 12px;
  padding: 6px 16px;
  border-radius: 10px;
  color: var(--air-secondary);
  cursor: pointer;
  transition: background 0.2s ease-out, color 0.2s ease-out;
}
.segment-control .asset-btn.active{
  background: #fff;
  color: var(--air-text);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.segment-control .asset-btn:hover{
  background: rgba(0,0,0,0.04);
}
.asset-chart-wrap{
  height: 180px;
}

.records-section{
  margin-top: 32px;
}
.section-header{
  margin-bottom: 16px;
}
.section-title{
  font-size: 16px;
  font-weight: 600;
  color: var(--air-text);
}

.records-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
.view-panel{
  width: 100%;
}
.no-record{
  font-size: 13px;
  color: var(--air-muted-text);
  padding: 12px 0;
  text-align: center;
}
.records-grid .no-record{
  grid-column: 1 / -1;
}

.portfolio-distribution{
  margin-bottom: 32px;
}
.portfolio-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.portfolio-card{
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  padding: 24px;
}
.portfolio-card-title{
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--air-text);
}
.portfolio-pie-wrap{
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
}
#portfolio-pie{
  width: 160px;
  height: 160px;
  display: block;
  margin: 0 auto;
}
#portfolio-pie circle{
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-linecap: round;
}
.portfolio-pie-center{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--air-text);
}
.pie-value{
  font-size: 20px;
}
.pie-label{
  font-size: 12px;
  color: var(--air-muted-text);
}
.portfolio-legend{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.portfolio-legend li{
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--air-text);
}
.legend-left{
  display: flex;
  align-items: center;
  gap: 8px;
}
.legend-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.portfolio-stats{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
}
.portfolio-stat-item{
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}
.portfolio-stat-label{
  color: var(--air-muted-text);
  font-size: 12px;
  letter-spacing: 0.05em;
}
.portfolio-stat-value{
  font-size: 16px;
  font-weight: 600;
  color: var(--air-text);
}
.portfolio-card-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.portfolio-exchange-card{
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.portfolio-exchange-card .card-head{
  font-size: 15px;
  font-weight: 600;
}
.portfolio-exchange-card .card-amount{
  font-size: 20px;
  font-weight: 600;
  color: var(--air-text);
}
.portfolio-exchange-card .card-change{
  font-size: 12px;
}
.portfolio-exchange-card .card-row{
  display:flex;
  justify-content:space-between;
  font-size:13px;
  color:var(--air-muted-text);
}
.portfolio-exchange-card .card-row strong{
  color:var(--air-text);
  font-weight:600;
}
.portfolio-holdings{
  margin-top: 36px;
}
.portfolio-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.portfolio-table th,
.portfolio-table td{
  padding: 8px 10px;
  text-align: left;
}
.portfolio-table th{
  font-size: 12px;
  color: var(--air-muted-text);
  font-weight: 600;
  border-bottom: 1px solid var(--air-line);
}
.portfolio-table tbody tr + tr{
  border-top: 1px solid rgba(0,0,0,0.04);
}
.text-positive{
  color: #2f9d62;
}
.text-negative{
  color: #e45858;
}

.exchange-pill{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--air-pill);
  border: 1px solid var(--air-line);
  margin-bottom: 12px;
}
.exchange-pill-logo{
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.exchange-pill-logo img{
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.exchange-pill-name{
  flex: 1;
  line-height: 1.2;
  font-size: 15px;
  font-weight: 600;
  color: var(--air-text);
}
.status-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c7c9d1;
  display: inline-block;
}
.status-dot.status-ok{
  background: #3ecf8e;
}
.status-dot.status-warn{
  background: #f6c344;
}
.status-dot.status-error{
  background: #f27272;
}


.record-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  width: 100%;
  margin-top: 10px;
}
.record-body > .record-left,
.record-body > .record-right {
  width: 100%;
  margin: 0;
}

.form-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  margin-top: 14px;
}

.form-pane {
  background: #fff;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  width: 100%;
  margin: 0;
}

.form-pane .record-bottom {
  margin: 0;
  padding: 0;
  border-top: 0;
  gap: 8px;
}

#dynamic-fields-area {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  min-height: 100%;
}

#dynamic-fields-area .tag-title {
  display: none;
}

.record-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-left .image-slot,
.record-image-area {
  width: 100%;
  height: 18rem;
  border-radius: 24px;
  border: 1px solid #e5e7eb;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
  padding: 10px;
  margin: 0;
  box-sizing: border-box;
  transition: background 0.2s ease;
}
.record-left .image-slot:hover,
.record-image-area:hover{
  background: #f9fafb;
}

#record-left-extra {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.record-line,
.extra-field-line {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--muted-2);
  font-size: 14px;
  box-sizing: border-box;
}

.record-line-label,
.extra-field-label {
  color: #475569;
  font-size: 13px;
  margin-left: 2px;
  font-weight: 600;
}

.record-line-input,
.extra-field-input-wrap {
  display: block;
  width: 100%;
}

.record-line-input input,
.record-line-input select,
#record-bottom input,
#record-bottom select,
#record-extra-fields .extra-field-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 6px 4px;
  font-size: 15px;            
  color: #111;
}

#record-extra-fields .extra-field-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 6px;
  font-size: 15px;            
  color: #111;
  border-bottom: 1px solid #e6e6e6; 
  box-shadow: none;
}

.record-line-input input::placeholder,
#record-bottom input::placeholder,
.extra-field-input::placeholder {
  color: rgba(0,0,0,0.30);
}

#record-left-extra .extra-field-remove {
  margin-left: 0;
  color: #999;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  background: transparent;
  align-self: flex-end;
}
#record-left-extra .extra-field-remove:hover { color: var(--danger); background: rgba(239,68,68,0.06); }

.tag-title { font-size: 13px; color: #6b7280; margin-bottom: 4px; }

#record-tag-chips,
.tag-chip-row,
.record-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  max-height: none;
  overflow: visible;
}

.tag-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: #f4f4f7;
  color: #374151;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s ease, color 0.2s ease;
}
.tag-chip.active { background: #111827; color: #fff; border-color: #111827; }
.tag-edit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-edit-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  font-size: 13px;
}
.tag-edit-remove {
  cursor: pointer;
  color: #9ca3af;
  font-weight: 600;
}
.tag-edit-remove:hover { color: #ef4444; }

#record-bottom label {
  display: block;
  font-size: 14px;
  color: #4b5563;
  font-weight: 600;
  margin-bottom: 4px;
}
#record-bottom input,
#record-bottom select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
  background: #fff;
  outline: none;
}

.record-footer {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 32px;
}
.record-footer button{
  border-radius: 16px;
  border: 1px solid #d1d5db;
  padding: 10px 24px;
  font-size: 14px;
  transition: background 0.2s ease;
}
.record-footer .submit-btn{
  background: #111;
  color: #fff;
  border-color: #111;
}
.record-footer .submit-btn:hover{
  background: #1f2937;
}
.record-footer .btn-secondary{
  background: #fff;
  color: #111;
}
.record-footer .btn-secondary:hover{
  background: #f3f4f6;
}

.record-card{
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 24px;
  background: rgba(255,255,255,0.55);
  box-shadow: 0px 4px 12px rgba(0,0,0,0.03);
  border: 1px solid rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  position: relative;
  overflow: hidden;
}
.record-card:hover{
  transform: translateY(-4px);
  box-shadow: 0px 12px 22px rgba(0,0,0,0.12);
}
.record-card.dragging{
  opacity: 0.85;
  cursor: grabbing;
  box-shadow: 0px 16px 28px rgba(0,0,0,0.12);
}
.record-card.placeholder{
  visibility: hidden;
  pointer-events: none;
}
.record-card-media{
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #F5F5F7;
  aspect-ratio: 16 / 9;
  position: relative;
}
.record-card-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.record-card-placeholder{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.placeholder-icon{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  border: 1px dashed #d8dae2;
  background: rgba(255,255,255,0.7);
}
.record-card-body{
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.record-card-symbol{
  font-size: 14px;
  color: var(--air-text);
  font-weight: 600;
}
.record-card-date{
  font-size: 12px;
  color: var(--air-secondary);
}
.record-card-meta{
  font-size: 12px;
  color: var(--air-muted-text);
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}
.record-card-hover{
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
  font-size: 12px;
  color: var(--air-muted-text);
  margin-top: 6px;
}
.record-card:hover .record-card-hover{
  opacity: 1;
  transform: translateY(0);
}
.record-hover-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.record-hover-tag{
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--air-pill);
  border: 1px solid var(--air-line);
  font-size: 11px;
}

@supports not (aspect-ratio: 1) {
  .record-card-media{
    position: relative;
    padding-top: calc(100% * 9 / 16);
    aspect-ratio: auto;
  }
  .record-card-media > *{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }
}

@media (max-width: 900px){
  .hero-card{
    flex-direction: column;
    gap: 24px;
  }
  .hero-side{
    text-align: left;
  }
  .records-scroll{
    padding-left: 4px;
  }
}

@media (max-width: 900px) {
  .modal-box { width: 92vw; max-width: 680px; }
  .record-body { grid-template-columns: 1fr; }
  .record-right { width: 100%; order: 2; }
  .form-split { grid-template-columns: 1fr; }
  #record-left-extra { order: 1; }
  .record-bottom { grid-template-columns: 1fr; }
  .record-image-area { aspect-ratio: 4 / 3; }
}

.hidden { display: none !important; }

.input-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#record-extra-fields {
  margin-top: 6px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 0;
  border-top: 0;
  max-height: none;
  overflow: visible;
}

.extra-field-line {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  box-shadow: none;
  position: relative;
}
.extra-field-line::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 4px solid #e5e7eb;
  border-radius: 10px;
  opacity: 0.6;
  pointer-events: none;
}

.extra-field-label {
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

.extra-field-input {
  border: none;
  border-bottom: 1px dashed #d4d4d8;
  padding: 6px 4px;
  background: transparent;
  outline: none;
}

.extra-field-remove {
  position: absolute;
  right: 10px;
  top: 10px;
  color: #94a3b8;
  cursor: pointer;
  font-weight: 600;
}
.extra-field-remove:hover { color: #ef4444; }
.exchange-picker-logo{
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}

.logo-circle{
  border-radius: 50%;
  object-fit: cover;
}

.recent-activity-section{
  margin-top: 32px;
}
.recent-grid{
  display: grid;
  grid-template-columns: repeat(1, minmax(0,1fr));
  gap: 18px;
}
@media (min-width: 900px){
  .recent-grid{
    grid-template-columns: 55% 45%;
  }
}

.exchange-pill{
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.exchange-pill:hover{
  transform: translateY(-3px);
  box-shadow: 0 12px 20px rgba(0,0,0,0.08);
}

.spotlight-card{
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.spotlight-card.empty{
  cursor: default;
}
.spotlight-card:not(.empty):hover{
  transform: translateY(-3px);
  box-shadow: 0 14px 24px rgba(0,0,0,0.08);
}

.result-item{
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.result-item:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}

#avatar-box,
#user-name,
#user-uid{
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  cursor: pointer;
}
#avatar-box:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
#user-name:hover,
#user-uid:hover{
  color: #0f172a;
}

#record-modal {
  max-width: 1080px;
  width: min(1080px, 100vw - 32px);
  max-height: min(90vh, 720px);
  overflow-y: auto;
}

#modal-bg,
#record-modal-bg {
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
}
#profile-modal-bg > div,
#modal-bg > div,
#record-modal-bg > div {
  max-height: 90vh;
  overflow-y: auto;
}

.record-modal-body {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

@media (max-width: 1440px) {
  #record-modal {
    max-width: 90vw !important;
    transform: scale(0.9);
  }
}

@media (max-width: 1024px) {
  .record-modal-body {
    grid-template-columns: 1fr;
  }
  #record-modal {
    max-height: 90vh;
    max-width: 95vw !important;
    transform: scale(0.8);
  }
}

@media (max-width: 640px) {
  #record-modal {
    padding: 16px;
  }
}

#record-image-area {
  min-height: 220px;
}
