/* ================== Reset ================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans KR",
    sans-serif;
  background: #f2f4f7;
  color: #111827;
}

/* ================== Layout ================== */

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 12px 32px;
}

/* ================== Header ================== */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

.app-subtitle {
  font-size: 0.75rem;
  color: #6b7280;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #9ca3af;
}

.status-indicator.on {
  background: #22c55e;
}

.status-indicator.off {
  background: #9ca3af;
}

/* 토글 버튼 */

.toggle-btn {
  min-width: 56px;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-out;
}

.toggle-btn.on {
  background: #22c55e;
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15);
}

.toggle-btn.off {
  background: #e5e7eb;
  color: #4b5563;
}

/* ================== Card 공통 ================== */

.card {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px 12px 10px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}

/* ================== 자산 카드 ================== */

.assets-card {
  padding-top: 10px;
}

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

.asset-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.asset-label {
  font-size: 0.7rem;
  color: #6b7280;
}

.asset-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
}

/* 수익 계열 색상 */

.pnl-plus {
  color: #16a34a;
}

.pnl-minus {
  color: #dc2626;
}

.pnl-zero {
  color: #4b5563;
}

/* ================== 오늘 포지션 ================== */

.today-card {
}

.status-badge {
  padding: 2px 8px;
  font-size: 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.status-waiting {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #e5e7eb;
}

.status-holding {
  background: #d1fae5;
  color: #047857;
  border-color: #a7f3d0;
}

.status-stopped {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.today-main {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.today-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.today-label {
  color: #6b7280;
}

.today-value {
  color: #111827;
  font-weight: 500;
}

.today-updated-row {
  margin-top: 2px;
  font-size: 0.72rem;
}

.today-updated {
  color: #9ca3af;
}

/* ================== 로그 ================== */

.logs-card {
}

.logs-body {
  margin-top: 4px;
  background: #0b1120;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.7rem;
  max-height: 160px;
  overflow-y: auto;
}

/* 스크롤바 */

.logs-body::-webkit-scrollbar,
.history-scroll::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.logs-body::-webkit-scrollbar-thumb,
.history-scroll::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 999px;
}

/* ================== 히스토리 ================== */

.history-card {
}

.history-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.month-btn {
  border: none;
  background: #f3f4f6;
  color: #4b5563;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.7rem;
  cursor: pointer;
}

.history-month-label {
  font-size: 0.78rem;
  color: #374151;
}

.history-scroll {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

/* ▶ 카드 폭을 조금 넓혀서 줄바꿈 여유 확보 */
.history-item {
  min-width: 190px;
  max-width: 190px;
  background: #f9fafb;
  border-radius: 12px;
  padding: 6px 8px;
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.history-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: #111827;
}

.history-tag {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 999px;
}

.history-tag.entry-true {
  background: #dcfce7;
  color: #166534;
}

.history-tag.entry-false {
  background: #e5e7eb;
  color: #4b5563;
}

/* ▶ 폰트 조금 줄이고, 오른쪽 값은 줄바꿈 없이 한 줄 유지 */
.history-body {
  font-size: 0.7rem;
  color: #374151;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-body-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 왼쪽 라벨 */
.history-body-line span:first-child {
  color: #6b7280;
}

/* 오른쪽 값: 한 줄 유지 + 오른쪽 정렬 */
.history-body-line span:last-child {
  white-space: nowrap;
  text-align: right;
}
/* PC 화면 약간 여백 */
@media (min-width: 480px) {
  .app {
    margin-top: 10px;
    margin-bottom: 10px;
  }
}