/* Re-skin of the pre-v1.16 classes (style.css) with v1.16 tokens, so legacy screens match the
   design system before they are rewritten. Loaded after components.css. Tokens only. */

main { padding-top: 0; }
header.page-header { padding: calc(env(safe-area-inset-top) + var(--sp-2)) 0 var(--sp-2); background: var(--bg); }
header.page-header h1 { font-size: var(--fs-largetitle); line-height: var(--lh-largetitle); letter-spacing: 0.01em; }
header.page-header p { font-size: var(--fs-subhead); color: var(--label-2); }

/* cards → iOS grouped surfaces: no border, soft depth, larger radius */
.card {
  background: var(--surface-1); border: none; border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); padding: var(--sp-4); margin-bottom: var(--sp-3);
}
.card h2 { font-size: var(--fs-headline); line-height: var(--lh-headline); font-weight: 600; color: var(--label); margin: 0 0 var(--sp-2); }

.list-item { padding: 11px 0; border-bottom: 0.5px solid var(--separator); }
.list-item .title { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: 400; }
.list-item .meta { font-size: var(--fs-footnote); color: var(--label-2); }

.muted { color: var(--label-2); font-size: var(--fs-footnote); }
.loading {
  height: 88px; margin: var(--sp-3) 0; padding: 0; border-radius: var(--r-md); color: transparent; overflow: hidden;
  background: linear-gradient(90deg, var(--fill) 25%, var(--fill-strong) 37%, var(--fill) 63%);
  background-size: 400% 100%; animation: ui-shimmer 1.4s ease infinite;
}

.badge {
  border: none; background: var(--fill); color: var(--label-2); border-radius: var(--r-pill);
  font-size: var(--fs-caption); font-weight: 600; padding: 2px 8px;
}

/* buttons */
.btn {
  min-height: 44px; border: none; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent);
  font-size: var(--fs-body); font-weight: 600;
}
.btn.secondary { background: var(--accent-soft); color: var(--accent); border: none; }
.btn.mini { min-height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-subhead); border-radius: var(--r-pill); }
.icon-btn { border: none; background: var(--fill); color: var(--label); }
.send-btn { background: var(--accent); }
.send-btn.stop { background: var(--critical); }

/* inputs */
textarea, select, input[type="text"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="file"] {
  border: none; border-radius: var(--r-sm); background: var(--fill); color: var(--label);
  font-size: var(--fs-body); min-height: 44px;
}
textarea::placeholder, input::placeholder { color: var(--label-3); }

/* segmented / pills */
.segmented { background: var(--fill); border: none; border-radius: 9px; padding: 2px; }
.segmented button { border-radius: 7px; color: var(--label); font-size: var(--fs-footnote); font-weight: 500; min-height: 32px; }
.segmented button.active { background: var(--surface-1); color: var(--label); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.pill { border: none; background: var(--surface-1); color: var(--label); box-shadow: var(--shadow-1); }
.pill.active { background: var(--label); color: var(--surface-1); }
.chip { border: none; background: var(--surface-1); color: var(--label); box-shadow: var(--shadow-1); }

/* tiles */
.stat-tile, .kpi-tile, .widget-card { background: var(--surface-1); border: none; border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.kpi-label { text-transform: none; letter-spacing: 0; font-size: var(--fs-footnote); font-weight: 500; color: var(--label-2); }
.kpi-value, .stat-tile .value { color: var(--label); white-space: nowrap; }
.kpi-delta { white-space: nowrap; }
.kpi-unit, .kpi-delta { font-size: var(--fs-caption); }

/* sheets & toast */
.modal-overlay { background: var(--overlay); }
.modal-sheet { background: var(--bg); border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-2); }
.modal-sheet h2 { font-size: var(--fs-headline); font-weight: 600; text-align: center; }
.toast {
  background: var(--material); color: var(--label); border-radius: var(--r-pill); box-shadow: var(--shadow-2);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  font-size: var(--fs-subhead);
}

/* chat bubbles */
.msg .bubble { border: none; background: var(--surface-1); box-shadow: var(--shadow-1); border-radius: 18px; font-size: var(--fs-body); line-height: 1.45; }
.msg.user .bubble { background: var(--accent); color: var(--on-accent); box-shadow: none; }

/* feed (legacy home, until 「今日」 replaces it) — one quiet accent instead of 6 colour bars */
.feed-item { border: none; border-left: 3px solid var(--separator); background: var(--surface-1); box-shadow: var(--shadow-1); border-radius: var(--r-md); }
.feed-item.kind-approval, .feed-item.kind-error, .feed-item.kind-todo_overdue { border-left-color: var(--accent); }
.feed-kind { text-transform: none; letter-spacing: 0; }
