/* 推し活ログ */
@charset "utf-8";

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

html {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #111;
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Utility ── */
.hidden {
  display: none !important;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* ════════════════════════════════
   AUTH
   ════════════════════════════════ */
#auth-screen {
  background: #fff;
  min-height: 100dvh;
}

#auth-screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

.auth-wrap {
  width: 100%;
  max-width: 380px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: #F43F5E;
  color: #fff;
  font-size: 24px;
  margin-bottom: 12px;
}

.auth-brand h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-brand p {
  font-size: 13px;
  color: #888;
  margin-top: 4px;
}

.auth-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 24px;
}

/* Segment control */
.seg-ctrl {
  display: flex;
  gap: 4px;
  background: #f3f3f3;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 20px;
}

.seg-btn {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #999;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.seg-btn.active {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Fields */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form.hidden {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}

.field input,
.field textarea,
.select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fafafa;
  color: #111;
  outline: none;
  transition: border 0.15s;
}

.field input:focus,
.field textarea:focus,
.select:focus {
  border-color: #F43F5E;
  background: #fff;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #bbb;
}

.field textarea {
  resize: vertical;
  min-height: 56px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.req {
  color: #F43F5E;
}

.form-error {
  color: #dc2626;
  font-size: 12px;
  min-height: 16px;
}

.form-msg {
  font-size: 12px;
  min-height: 16px;
}

/* Buttons */
.btn-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 12px;
  background: #F43F5E;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-main:hover {
  opacity: 0.92;
}

.btn-main:active {
  opacity: 0.85;
}

.btn-main.btn-sm {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-sub {
  padding: 8px 16px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  background: #f3f3f3;
  color: #555;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.btn-sub:hover {
  background: #eaeaea;
}

.btn-outline-sm {
  padding: 8px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  color: #F43F5E;
  border: 1px solid #F43F5E;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-outline-sm:hover {
  background: #FFF1F2;
}

.btn-text {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
}

.btn-text:hover {
  color: #F43F5E;
}

/* ════════════════════════════════
   TOP BAR
   ════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 52px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #F43F5E;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
}

.topbar-name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.topbar-nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.tnav {
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #999;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s;
}

.tnav:hover {
  color: #333;
  background: #f7f7f7;
}

.tnav.active {
  color: #F43F5E;
  background: #FFF1F2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-user {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  background: #f7f7f7;
  padding: 4px 10px;
  border-radius: 20px;
}

/* ════════════════════════════════
   BOTTOM NAV (mobile)
   ════════════════════════════════ */
.btm-nav {
  display: none;
}

@media (max-width: 768px) {

  .topbar-nav,
  .topbar-right {
    display: none;
  }

  .btm-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 56px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .btm {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: #bbb;
    cursor: pointer;
    font: inherit;
    transition: color 0.12s;
  }

  .btm svg {
    width: 20px;
    height: 20px;
  }

  .btm span {
    font-size: 10px;
    font-weight: 600;
  }

  .btm.active {
    color: #F43F5E;
  }
}

/* ════════════════════════════════
   APP BODY
   ════════════════════════════════ */
.app-body {
  max-width: 560px;
  margin: 0 auto;
  padding: 68px 16px 80px;
}

@media (max-width: 768px) {
  .app-body {
    padding-top: 64px;
  }
}

/* ── Pages ── */
.page {
  display: none;
}

.page.active {
  display: block;
  animation: up 0.2s ease;
}

@keyframes up {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.greeting {
  font-size: 13px;
  color: #888;
  margin-bottom: 2px;
}

.page-h {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

/* ── KPI ── */
.kpi-row {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  gap: 0;
}

.kpi {
  flex: 1;
  text-align: center;
}

.kpi-num {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111;
}

.kpi-label {
  font-size: 11px;
  color: #999;
  font-weight: 500;
  margin-top: 2px;
}

.kpi-divider {
  width: 1px;
  height: 36px;
  background: #f0f0f0;
  flex-shrink: 0;
}

/* ── Card ── */
.card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
}

.card-h {
  font-size: 13px;
  font-weight: 700;
  color: #555;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f5f5f5;
}

/* ── Form inside card ── */
.form-section {
  font-size: 11px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 8px;
  padding-left: 8px;
  border-left: 2px solid #F43F5E;
}

.form-section:first-child {
  margin-top: 0;
}

.row-input {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.row-input .select {
  flex: 1;
}

/* Filter */
.filter-wrap {
  margin-bottom: 12px;
}

.filter-wrap .select {
  max-width: 200px;
}

/* ── Breakdown ── */
.breakdown {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bar-item {}

.bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.bar-name {
  font-size: 13px;
  font-weight: 700;
}

.bar-val {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #F43F5E;
}

.bar-track {
  height: 6px;
  background: #f3f3f3;
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: #F43F5E;
  transition: width 0.5s ease;
}

.bar-sub {
  font-size: 11px;
  color: #bbb;
  margin-top: 4px;
}

/* ── Empty ── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #bbb;
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 13px;
}

.empty-sub {
  font-size: 12px;
  color: #ccc;
  margin-top: 2px;
}

/* ── Goods list ── */
.g-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.g-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  padding: 14px 16px;
  transition: box-shadow 0.15s;
}

.g-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.g-artist {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: #FFF1F2;
  color: #F43F5E;
  margin-bottom: 2px;
}

.g-name {
  font-size: 13px;
  font-weight: 700;
}

.g-meta {
  font-size: 11px;
  color: #999;
}

.g-right {
  text-align: right;
  flex-shrink: 0;
  margin-left: auto;
}

.g-price {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.g-del {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  color: #ccc;
  background: none;
  border: none;
  cursor: pointer;
}

.g-del:hover {
  color: #ef4444;
}

/* ── Ranking ── */
.rank-section.hidden {
  display: none;
}

.rank-desc {
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.r-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  padding: 12px 16px;
}

.r-item.r-1 {
  border-color: #fde68a;
  background: #fffdf5;
}

.r-item.r-2 {
  border-color: #e2e8f0;
  background: #fafbfc;
}

.r-item.r-3 {
  border-color: #fed7aa;
  background: #fffcf8;
}

.r-pos {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 800;
  border-radius: 50%;
  flex-shrink: 0;
  color: #ccc;
}

.r-1 .r-pos {
  background: #fef3c7;
  color: #b45309;
}

.r-2 .r-pos {
  background: #f1f5f9;
  color: #64748b;
}

.r-3 .r-pos {
  background: #ffedd5;
  color: #c2410c;
}

.r-info {
  flex: 1;
  min-width: 0;
}

.r-name {
  font-size: 13px;
  font-weight: 700;
}

.r-meta {
  font-size: 11px;
  color: #999;
}

.r-amount {
  text-align: right;
  flex-shrink: 0;
}

.r-amount-val {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #F43F5E;
}

.r-amount-label {
  font-size: 10px;
  color: #bbb;
}

/* ════════════════════════════════
   MODAL
   ════════════════════════════════ */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-bg.hidden {
  display: none;
}

.modal {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
}

.modal-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* ════════════════════════════════
   TOAST
   ════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  border-radius: 100px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  z-index: 999;
  animation: toast-in 0.2s ease;
}

.toast.hidden {
  display: none;
}

.toast.success {
  background: #16a34a;
}

.toast.error {
  background: #dc2626;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) none;
  }
}