@import url('https://fonts.googleapis.com/css2?family=Gothic+A1:wght@400;500;600;700;800&display=swap');

body { margin: 0; font-family: var(--font-sans); letter-spacing: -0.01em; background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased; }
.ny-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-4); }
.ny-col { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.ny-icon { width: 1em; height: 1em; flex: none; }
.ny-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:where(.ny-btn, .ny-chip, .ny-seg button, .ny-card, .ny-chatinput button):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Button */
.ny-btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); border: 1px solid transparent; border-radius: var(--radius-md); cursor: pointer; font-weight: 700; white-space: nowrap; transition: background .15s, border-color .15s; }
.ny-btn-md { height: 44px; padding: 0 var(--space-4); font-size: 14px; }
.ny-btn-lg { height: 56px; padding: 0 var(--space-6); font-size: 16px; }
.ny-btn-block { display: flex; width: 100%; }
.ny-btn-primary { background: var(--ink); color: var(--surface); }
.ny-btn-primary:hover { opacity: .88; }
.ny-btn-secondary { background: var(--surface-sunken); color: var(--ink); }
.ny-btn-secondary:hover { background: var(--line); }
.ny-btn-ghost { background: transparent; color: var(--ink); }
.ny-btn-ghost:hover { background: var(--surface-sunken); }
.ny-btn:disabled { cursor: not-allowed; background: var(--surface-sunken); color: var(--ink-muted); border-color: var(--line); }
.ny-btn-cost { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: var(--radius-pill); background: var(--gold); color: var(--on-gold); }
.ny-btn-cost .ny-icon { color: var(--on-gold); }
.ny-btn:disabled .ny-btn-cost { background: var(--line); color: var(--ink-muted); }
.ny-btn:disabled .ny-btn-cost .ny-icon { color: var(--ink-muted); }

/* TopicChip */
.ny-chip { font: inherit; font-size: 14px; font-weight: 600; height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-pill); border: 0; background: var(--surface-sunken); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-1); }
.ny-chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); font-weight: 700; }

/* ToneSwitch */
.ny-seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--radius-pill); background: var(--surface-sunken); }
.ny-seg button { font: inherit; font-size: 14px; height: 32px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-muted); cursor: pointer; }
.ny-seg button[aria-checked="true"] { background: var(--surface-raised); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(23,21,31,0.12); }

/* TarotCard */
.ny-card { --w: 112px; position: relative; width: var(--w); aspect-ratio: 7 / 12; border-radius: var(--radius-card); padding: 0; border: 0; font: inherit; color: inherit; cursor: pointer; box-shadow: var(--shadow-card); flex: none; transition: transform .2s; display: block; text-align: center; }
.ny-card-sm { --w: 72px; }
.ny-card-lg { --w: 168px; }
.ny-card:hover { transform: translateY(-4px); }
.ny-card[aria-pressed="true"] { box-shadow: var(--shadow-glow); transform: translateY(-8px); }
.ny-card-back { background: var(--night); overflow: hidden; }
.ny-card-back::before { content: none; }
.ny-card-back svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ny-card-face { background: var(--surface-raised); border: 0; display: flex; flex-direction: column; overflow: visible; padding: 5px; box-sizing: border-box; }
.ny-card-face::after { content: ""; position: absolute; inset: 4px; border: 1px solid var(--gold); border-radius: 12px; pointer-events: none; }
.ny-card-top { font-size: calc(var(--w) * .085); letter-spacing: .12em; font-weight: 600; color: var(--gold-ink); padding: calc(var(--w) * .05) 0 calc(var(--w) * .03); line-height: 1; min-height: 1em; }
.ny-card-art { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; background: var(--surface-soft); margin: 0 calc(var(--w) * .04); border-radius: 8px; overflow: hidden; }
.ny-card-art img { width: 100%; height: 100%; object-fit: cover; }
.ny-card-emblem { width: 68%; height: auto; --gold: var(--gold-ink); opacity: .75; }
.ny-card-name { font-family: var(--font-sans); font-weight: 700; font-size: calc(var(--w) * .105); line-height: 1.2; padding: calc(var(--w) * .05) 2px calc(var(--w) * .06); color: var(--ink); letter-spacing: -0.01em; }
.ny-card-reversed .ny-card-art > * { transform: rotate(180deg); }
.ny-card-tag { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: var(--radius-pill); background: var(--ink); color: var(--surface); white-space: nowrap; z-index: 2; }

/* CardSpread */
.ny-spread { display: flex; gap: var(--space-6); justify-content: center; align-items: flex-start; padding: var(--space-6) var(--space-4); }
.ny-spread-slot { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.ny-spread-label { font-size: 12px; font-weight: 500; color: var(--ink-muted); }
.ny-spread-empty { width: 112px; box-sizing: border-box; aspect-ratio: 7 / 12; border-radius: var(--radius-card); border: 2px dashed var(--line-strong); background: var(--surface-sunken); display: flex; align-items: center; justify-content: center; color: var(--ink-muted); font-size: 12px; }

.ny-spread-empty-sm { width: 72px; font-size: 10.5px; }
.ny-spread-empty-lg { width: 168px; }

/* Avatar + chat */
.ny-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-pill); background: var(--night); color: var(--gold); font-weight: 800; overflow: hidden; flex: none; }
.ny-avatar > .ny-icon { width: 58%; height: 58%; }
.ny-avatar img, .ny-avatar svg { width: 100%; height: 100%; object-fit: cover; }
.ny-msg { display: flex; gap: var(--space-2); align-items: flex-end; max-width: 520px; }
.ny-msg-user { margin-left: auto; flex-direction: row-reverse; }
.ny-msg-body { display: flex; flex-direction: column; gap: 4px; }
.ny-msg-name { font-size: 12px; font-weight: 500; color: var(--ink-muted); }
.ny-bubble { font-size: 15px; line-height: 24px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); }
.ny-msg-reader .ny-bubble { background: var(--surface-soft); border-bottom-left-radius: 6px; }
.ny-msg-user .ny-bubble { background: var(--ink); color: var(--surface); border-bottom-right-radius: 6px; }
.ny-chatinput { display: flex; flex-direction: column; gap: var(--space-1); }
.ny-chatinput-box { display: flex; gap: var(--space-2); align-items: center; padding: 6px 6px 6px var(--space-4); border-radius: var(--radius-pill); background: var(--surface-sunken); border: 2px solid transparent; }
.ny-chatinput input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); min-width: 0; }
.ny-chatinput input::placeholder { color: var(--ink-muted); }
.ny-chatinput input:focus { outline: none; }
.ny-chatinput-box:focus-within { border-color: var(--robe); }
.ny-chatinput button { width: 40px; height: 40px; border-radius: var(--radius-pill); border: 0; background: var(--ink); color: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; }
.ny-chatinput button:disabled { background: var(--surface-sunken); color: var(--ink-muted); cursor: not-allowed; }
.ny-chatinput-note { font-size: 12px; color: var(--ink-muted); padding-left: var(--space-4); }

/* CreditBadge */
.ny-credit { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 6px; border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--ink); font-weight: 800; font-size: 14px; }
.ny-credit .ny-icon { color: var(--on-gold); font-size: 14px; background: var(--gold); border-radius: 999px; padding: 5px; box-sizing: content-box; }

/* PostCard */
.ny-post { background: var(--surface-raised); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(23,21,31,0.04); border-radius: var(--radius-md); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); max-width: 560px; }
.ny-post-top { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; color: var(--ink-muted); }
.ny-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--space-2); border-radius: var(--radius-pill); font-size: 12px; font-weight: 500; background: var(--robe-soft); color: var(--robe); }
.ny-tag-gold { background: var(--gold-soft); color: var(--gold-ink); }
.ny-tag-good { background: var(--good-soft); color: var(--good); }
.ny-tag-bad { background: var(--bad-soft); color: var(--bad); }
.ny-tag-muted { background: var(--surface-sunken); color: var(--ink-muted); }
.ny-post-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 700; }
.ny-post-excerpt { margin: 0; font-size: 14px; line-height: 22px; color: var(--ink-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ny-post-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); font-size: 13px; color: var(--ink-muted); padding-top: var(--space-1); }
.ny-minicards { display: flex; gap: 4px; }
.ny-minicard { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 8px; background: var(--robe-soft); color: var(--robe); }

/* DiaryEntry */
.ny-diary { display: grid; grid-template-columns: 56px 1fr auto; gap: var(--space-3); align-items: center; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); max-width: 560px; }
.ny-diary-date { text-align: center; font-size: 12px; color: var(--ink-muted); line-height: 16px; }
.ny-diary-date b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 28px; color: var(--ink); }
.ny-diary-q { margin: 0 0 4px; font-size: 15px; font-weight: 700; line-height: 22px; }

/* CustomerCard */
.ny-customer { color: var(--ink); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); max-width: 360px; }
.ny-customer-head { display: flex; align-items: center; gap: var(--space-3); }
.ny-customer-name { font-weight: 700; font-size: 15px; }
.ny-customer-sub { font-size: 12px; color: var(--ink-muted); }
.ny-customer-worry { margin: 0; background: var(--surface-sunken); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); font-size: 15px; line-height: 24px; }
.ny-meter { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink-muted); }
.ny-meter-row { display: flex; justify-content: space-between; }
.ny-meter-track { height: 8px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.ny-meter-fill { height: 100%; border-radius: var(--radius-pill); background: var(--ink); }
