:root {
  --primary: #2563eb;
  --danger: #dc2626;
  --success: #16a34a;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: #f4f5f7;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
}

.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  background: #fff;
}

.app-title {
  font-size: 1.4rem;
  font-weight: bold;
  text-align: center;
  margin: 8px 0 16px;
}

.page-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: #555;
  text-decoration: none;
}

.summary-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.summary-month {
  font-weight: bold;
  margin-bottom: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 1.05rem;
}

.amount-expense { color: var(--danger); font-weight: bold; }
.amount-income { color: var(--success); font-weight: bold; }
.amount-balance { color: var(--primary); font-weight: bold; }

.main-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-main {
  display: block;
  width: 100%;
  padding: 18px;
  font-size: 1.15rem;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  margin-top: 8px;
}

.capture-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.preview-area img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 8px;
}

.upload-status {
  text-align: center;
  color: #555;
}

.receipt-preview img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 16px;
}

.ocr-status {
  text-align: center;
  color: #555;
  margin-bottom: 8px;
  min-height: 1.2em;
}

.ocr-reference {
  font-size: 0.85rem;
  color: #666;
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 16px;
}

.confirm-form .form-label {
  font-weight: bold;
}

.form-message {
  color: var(--danger);
  margin: 8px 0;
  min-height: 1.2em;
}

.login-screen {
  padding-top: 40px;
}

.tx-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tx-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  text-decoration: none;
  color: inherit;
}

.tx-date { font-size: 0.85rem; color: #666; }
.tx-category { font-size: 0.85rem; color: #666; text-align: right; }
.tx-vendor { font-weight: bold; grid-column: 1 / -1; overflow-wrap: break-word; }
.tx-amount { text-align: right; font-weight: bold; }
.tx-balance { grid-column: 1 / -1; text-align: right; font-size: 0.85rem; color: #666; }

.month-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.month-nav-btn {
  text-decoration: none;
  color: var(--primary);
  font-weight: bold;
  padding: 6px 10px;
}

.month-label {
  font-weight: bold;
  font-size: 1.1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}

.detail-row span:last-child {
  text-align: right;
  overflow-wrap: break-word;
  min-width: 0;
}

.detail-label {
  color: #666;
}

.detail-buttons {
  margin-top: 20px;
}

.summary-list {
  margin-bottom: 8px;
}

.summary-item-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 1.05rem;
}

.summary-item-row span:first-child {
  overflow-wrap: break-word;
  min-width: 0;
}

.summary-total-row {
  border-top: 2px solid #333;
  border-bottom: none;
  margin-top: 8px;
  padding-top: 12px;
  font-weight: bold;
  font-size: 1.15rem;
}

.export-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
