/* Portal home: shares tokens, buttons and the login card with app.css */
body.portal { overflow-y: auto; }
#home { min-height: 100%; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

.p-top { max-width: 920px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 18px 24px 0; }
.p-brand { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.p-brand i { font-style: normal; color: var(--accent); font-size: 18px; }

.p-main { max-width: 920px; margin: 0 auto; padding: 30px 24px 56px; }
.p-hello { font: 500 30px/1.25 var(--serif); margin: 0; letter-spacing: .01em; }
.p-today { color: var(--muted); margin: 6px 0 26px; font-size: 14px; }
.p-h { font: 600 13px var(--sans); color: var(--faint); letter-spacing: .06em; margin: 34px 2px 12px; }
.p-label { font-size: 12px; color: var(--faint); margin-bottom: 8px; }

.p-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }

/* Claude Code card */
.p-code-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; color: inherit; text-decoration: none; border-radius: 18px 18px 0 0; transition: background .15s; }
.p-code-head:hover { background: var(--accent-soft); }
.p-code-head > svg { color: var(--muted); width: 20px; height: 20px; transition: transform .15s; }
.p-code-head:hover > svg { transform: translateX(3px); color: var(--accent); }
.p-logo { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 24px; flex: none; }
.p-code-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.p-code-text b { font-size: 17px; font-weight: 600; }
.p-code-text span { color: var(--muted); font-size: 13.5px; }
.p-code-text span.live { color: var(--accent); }
.p-code-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 280px); gap: 18px 28px; padding: 16px 20px 18px; border-top: 1px solid var(--line); }
.p-spaces { display: flex; flex-wrap: wrap; gap: 8px; }
.p-space { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--chip); color: var(--text); text-decoration: none; font-size: 13.5px; transition: background .15s; }
.p-space:hover { background: var(--accent-soft); }
.p-space svg { width: 15px; height: 15px; color: var(--muted); }
.p-space em { font-style: normal; color: var(--faint); font-size: 12px; }
.p-usage { display: flex; flex-direction: column; gap: 9px; }

/* courses: one compact row each, inside a single card */
.p-list { overflow: hidden; }
.p-course { display: flex; align-items: center; gap: 14px; padding: 11px 14px 11px 20px; min-width: 0; }
.p-course + .p-course { border-top: 1px solid var(--line); }
.p-course-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.p-course-main b { font: 600 15.5px/1.4 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-course-main span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-course-main:hover b { color: var(--accent); }
.p-prog { flex: none; width: 56px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-prog i { display: block; width: 100%; height: 4px; border-radius: 4px; background: var(--chip); overflow: hidden; }
.p-prog i b { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.p-cont { flex: none; font-size: 13px; padding: 5px 12px; border-radius: 999px; text-decoration: none; color: var(--accent); background: var(--accent-soft); white-space: nowrap; transition: filter .15s; }
.p-cont:hover { filter: brightness(.95); }
.p-empty { padding: 18px 20px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.p-empty code { font: 13px var(--mono); background: var(--code); padding: 1px 6px; border-radius: 5px; }

@media (max-width: 640px) {
  .p-top { padding: 14px 18px 0; }
  .p-main { padding: 22px 16px 44px; }
  .p-hello { font-size: 26px; }
  .p-code-body { grid-template-columns: minmax(0, 1fr); }
  .p-course { gap: 10px; padding: 10px 12px 10px 20px; }
  .p-prog { width: 44px; }
}
