/* A quiet messenger, backed by a deliberately curated card collection. */
#page-wordcards { --font-body:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif; font-family:var(--font-body); display:flex; flex-direction:column; background:var(--bg); overflow:hidden; }
#page-wordcards [hidden] { display:none !important; }
#page-wordcards > .topbar { position:relative; inset:auto; display:flex !important; align-items:center; gap:12px; flex:0 0 auto; height:calc(72px + var(--safe-top)) !important; min-height:calc(72px + var(--safe-top)); padding:calc(12px + var(--safe-top)) 18px 12px !important; border-bottom:1px solid var(--border) !important; box-shadow:none; background:var(--bg) !important; }
#page-wordcards .topbar .chat-topbar-leading, #page-wordcards .topbar .chat-topbar-actions { position:static; inset:auto; transform:none; flex:0 0 auto; }
#page-wordcards .topbar .wordcards-library-entry { display:grid; place-items:center; width:44px !important; height:44px !important; padding:0 !important; border:0 !important; border-radius:12px !important; background:transparent !important; color:var(--text) !important; box-shadow:none !important; }
#page-wordcards .topbar .wordcards-library-entry svg { width:24px !important; height:24px !important; }
#page-wordcards .topbar .chat-identity-btn { position:static; transform:none; flex:1; width:auto; height:auto; min-width:0; padding:0; display:flex; flex-direction:row; justify-content:flex-start; gap:10px; }
#page-wordcards .topbar .chat-identity-meta { flex:1; min-width:0; overflow:hidden; flex-direction:column; align-items:flex-start; gap:4px; }
#page-wordcards .topbar .chat-identity-meta .topbar-title { width:100%; max-width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
#page-wordcards > .topbar .chat-identity-meta .topbar-title { font-size:17px !important; font-weight:650 !important; color:var(--text) !important; line-height:22px; text-align:left; }
#page-wordcards .chat-header-avatar { width:43px; height:43px; flex:0 0 43px; border-radius:50%; border:0; box-shadow:none; background:var(--surface2); }
#page-wordcards #wordcards-assistant-avatar { display:grid; place-items:center; overflow:hidden; min-width:43px; max-width:43px; min-height:43px; max-height:43px; }
#page-wordcards #wordcards-assistant-avatar img, #page-wordcards .msg-avatar img { display:block; width:100% !important; height:100% !important; max-width:100%; object-fit:cover; object-position:center; }
#page-wordcards #wordcards-contact-open { color:var(--text); background:transparent; border:0; text-align:left; cursor:pointer; pointer-events:auto; }
#page-wordcards #wordcards-contact-open:active { transform:none; }
#page-wordcards .wordcards-message-time { display:block; margin:7px 2px 0; color:var(--text3); font-size:10px; line-height:1.6; }
#page-wordcards .assistant .bubble[role="button"], #page-wordcards [data-wordcards-contact] { cursor:pointer; }
#page-wordcards #wordcards-contact-sheet.wordcards-contact-sheet { position:absolute; inset:0; z-index:12; display:flex; align-items:center; justify-content:center; padding:calc(16px + var(--safe-top)) 18px calc(16px + var(--safe-bottom)); background:color-mix(in srgb,var(--text) 20%,transparent); }
.wordcards-contact-sheet form { width:min(420px,100%); max-height:100%; overflow:auto; padding:22px; border:1px solid var(--border); border-radius:16px; background:var(--bg); color:var(--text); }
.wordcards-contact-sheet header { display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.wordcards-contact-sheet h2 { font-size:18px; font-weight:600; }
.wordcards-contact-sheet header button { width:44px; height:44px; font-size:24px; }
.wordcards-contact-avatar-row { display:flex; align-items:center; gap:18px; margin-bottom:22px; }
#wordcards-contact-avatar-pick { display:grid; place-items:center; overflow:hidden; width:70px; height:70px; border-radius:14px; background:var(--surface2); flex:0 0 70px; }
#wordcards-contact-avatar-pick img { width:100%; height:100%; object-fit:cover; }
.wordcards-contact-avatar-row > div { display:flex; flex-direction:column; align-items:flex-start; }
.wordcards-contact-avatar-row > div button { min-height:36px; font-size:12px; color:var(--text2); }
.wordcards-contact-sheet label { display:flex; flex-direction:column; gap:8px; margin:16px 0; font-size:12px; color:var(--text2); }
.wordcards-contact-sheet input:not([type="checkbox"]) { width:100%; padding:11px 12px; border:1px solid var(--border); border-radius:8px; background:var(--surface); color:var(--text); font-size:16px; }
.wordcards-contact-sheet .wordcards-contact-check { flex-direction:row; align-items:center; gap:10px; }
.wordcards-contact-check input { width:17px; height:17px; accent-color:var(--text); }
.wordcards-contact-sheet small { display:block; font-size:10px; color:var(--text3); line-height:1.6; }
.wordcards-contact-sheet footer { display:flex; justify-content:flex-end; margin-top:20px; }
.wordcards-contact-sheet footer button { min-height:44px; padding:10px 24px; border-radius:8px; background:var(--text); color:var(--bg); }
.wordcards-contact-sheet button:disabled { opacity:.4; }
#page-wordcards :focus-visible { outline:2px solid var(--text2); outline-offset:3px; }
#page-wordcards #home-room-echo-input:focus, #page-wordcards #home-room-echo-input:focus-visible { outline:none!important; box-shadow:none!important; border:0!important; }
#page-wordcards .input-wrap:focus-within { border-color:var(--text3)!important; box-shadow:none!important; }
#page-wordcards .chat-identity-meta .topbar-title { font-size:17px; font-weight:650; }
#page-wordcards .chat-topbar-actions { border:0; background:transparent; }
#page-wordcards .chat-topbar-actions .chat-model-btn { border:1px solid var(--border); border-radius:14px; min-height:38px; background:var(--surface); }
#page-wordcards .home-room-echo { position:relative; display:flex; flex:1; flex-direction:column; min-height:0; animation:none; overflow:hidden; }
#page-wordcards .chat-messages { flex:1; min-height:0; width:100%; padding:20px 18px !important; display:flex; flex-direction:column; gap:22px; overflow-y:auto; overflow-x:hidden; overscroll-behavior:contain; overflow-anchor:none; scroll-behavior:auto!important; }
#home-room-echo-messages:has(.msg-row)::before { display:none; }
#page-wordcards .home-room-echo-row { display:flex; flex:0 0 auto; align-items:flex-start; gap:10px; opacity:1; transform:none; animation:none; }
#page-wordcards .home-room-echo-row.user { flex-direction:row-reverse; }
#page-wordcards .home-room-echo-row.msg-row { align-items:flex-start !important; gap:10px !important; padding:0 !important; margin:0 !important; }
#page-wordcards #home-room-echo-messages .msg-row .msg-avatar { display:grid !important; visibility:visible !important; opacity:1 !important; align-self:flex-start !important; place-items:center; width:33px !important; height:33px !important; flex:0 0 33px; border-radius:50%; background:var(--surface2); overflow:hidden; font-size:13px; }
#page-wordcards .msg-avatar img { width:100%; height:100%; object-fit:cover; }
#page-wordcards .msg-body { flex:0 1 auto; min-width:0; max-width:calc(100% - 54px); gap:7px; }
#page-wordcards .wordcards-message-stamp { display:block; max-width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; margin:0 2px 7px; color:var(--text3); font-size:10px; }
#page-wordcards .user .wordcards-message-stamp { text-align:right; }
#page-wordcards .home-room-echo-row.msg-row .bubble { width:fit-content; max-width:100%; min-width:0; padding:12px 15px !important; border:0; border-radius:3px 18px 18px 18px !important; background:var(--surface2) !important; color:var(--text) !important; font-size:15px; line-height:1.75; white-space:pre-wrap; overflow-wrap:anywhere; box-shadow:none !important; }
#page-wordcards .home-room-echo-row .bubble::before, #page-wordcards .home-room-echo-row .bubble::after { display:none !important; }
#page-wordcards .home-room-echo-row.msg-row.user .bubble { margin-left:auto; border-radius:18px 3px 18px 18px !important; background:var(--text) !important; color:var(--bg) !important; }
#page-wordcards .input-bar { position:relative !important; inset:auto !important; flex:0 0 auto; display:flex; width:100%; gap:10px !important; margin:0; padding:12px max(16px,env(safe-area-inset-right,0px)) calc(12px + var(--safe-bottom)) !important; border:0 !important; border-radius:0; background:var(--bg); transform:none !important; }
body.chat-keyboard-open #page-wordcards .input-bar { padding-bottom:10px !important; }
#page-wordcards .input-wrap { flex:1; min-width:0; padding:10px 14px !important; border:1px solid var(--border) !important; border-radius:20px !important; background:var(--surface) !important; }
#page-wordcards #home-room-echo-input { min-height:24px; padding:0; font-size:16px; line-height:24px; background:transparent; color:var(--text); }
#page-wordcards .send-btn { position:static !important; inset:auto !important; align-self:flex-end; flex:0 0 44px; width:44px !important; height:44px !important; border-radius:14px !important; background:var(--text) !important; color:var(--bg) !important; }
#page-wordcards .send-btn svg { width:22px !important; height:22px !important; }
.wordcards-history-control { flex:0 0 auto; align-self:center; padding:6px 12px; color:var(--text3); font-size:11px; }
#page-wordcards .wordcards-library { flex:1; min-height:0; padding:20px 18px max(24px,var(--safe-bottom)); gap:18px; overflow-y:auto; }
.wordcards-boxes { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.wordcards-boxes button { display:flex; align-items:center; gap:10px; min-height:68px; padding:14px; border:1px solid var(--border); border-radius:20px; background:var(--surface); color:var(--text); }
.wordcards-boxes button > span { width:32px; font-size:25px; }
.wordcards-boxes strong { font-size:13px; font-weight:600; }
.wordcards-boxes small { margin-left:auto; color:var(--text3); font-size:12px; }
.wordcards-review { padding:18px; border:1px solid var(--border); border-radius:24px; background:var(--surface); }
.wordcards-review header { display:flex; justify-content:space-between; align-items:center; color:var(--text3); font-size:11px; }
.wordcards-review header button { width:32px; height:32px; font-size:22px; color:var(--text); }
.wordcards-review p { min-height:100px; display:flex; align-items:center; justify-content:center; padding:20px 6px; font-size:20px; line-height:1.7; white-space:pre-wrap; overflow-wrap:anywhere; }
.wordcards-review select, .wordcards-import select { min-width:0; padding:9px; border-radius:10px; background:var(--surface2); color:var(--text); border:1px solid var(--border); font-size:16px; }
.wordcards-review-actions { display:flex; justify-content:center; gap:36px; padding:20px 0 4px; }
.wordcards-review-actions button { width:62px; height:62px; display:grid; place-items:center; border-radius:50%; border:1px solid var(--border); color:var(--text); background:var(--surface2); font-size:25px; }
#wordcards-approve { color:var(--bg); background:var(--text); }
.wordcards-import { padding:15px; border-radius:18px; border:1px solid var(--border); background:var(--surface); }
.wordcards-import summary { cursor:pointer; font-size:14px; }
.wordcards-import form { margin-top:15px; }
.wordcards-import textarea { width:100%; min-height:130px; padding:12px; border:1px solid var(--border); border-radius:12px; font-size:16px; line-height:1.6; color:var(--text); background:var(--bg); resize:vertical; }
.wordcards-import form > div { display:flex; gap:10px; margin-top:10px; }
.wordcards-import select { flex:1; }
.wordcards-import button { padding:8px 22px; border-radius:12px; background:var(--text); color:var(--bg); font-size:13px; }
#page-wordcards .wordcards-card { border-radius:18px; background:var(--surface); box-shadow:none; }
#page-wordcards .wordcards-card > p { font-size:15px; line-height:1.7; white-space:pre-wrap; }
#page-wordcards #wordcards-message-overlay.wordcards-message-overlay { position:absolute; inset:0; z-index:15; background:rgba(0,0,0,.08); }
#wordcards-message-menu { position:absolute; display:flex; padding:5px; border:1px solid var(--border); border-radius:15px; background:var(--surface); box-shadow:0 8px 30px rgba(0,0,0,.13); }
#wordcards-message-menu button { min-width:62px; min-height:44px; padding:9px 13px; color:var(--text); font-size:14px; border-radius:10px; }
#wordcards-message-menu button:hover, #wordcards-message-menu button:focus-visible { background:var(--surface2); }
#wordcards-message-edit { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:min(340px,calc(100% - 32px)); padding:20px; border-radius:20px; background:var(--surface); border:1px solid var(--border); }
#wordcards-message-edit h3 { margin:0 0 14px; font-size:16px; color:var(--text); }
#wordcards-message-edit textarea { width:100%; min-height:110px; max-height:28dvh; padding:12px; border-radius:12px; border:1px solid var(--border); background:var(--bg); color:var(--text); resize:vertical; font-size:16px; }
#wordcards-message-edit > div { display:flex; justify-content:flex-end; gap:10px; margin-top:14px; }
#wordcards-message-edit button { min-height:44px; padding:8px 18px; border-radius:12px; color:var(--text); }
#wordcards-message-edit button[type=submit] { background:var(--text); color:var(--bg); }
#page-wordcards .wordcards-action-target .bubble { outline:1px solid var(--text3); outline-offset:3px; }
#page-wordcards .home-room-echo-row .bubble { -webkit-touch-callout:none; }
#wordcards-reply-preview { flex:0 0 auto; min-width:0; }

/* Library: one task per view; forms live in a separate sheet. */
#page-wordcards:has(.wordcards-library:not([hidden])) .chat-topbar-actions { display:none; }
#page-wordcards .wordcards-library { gap:20px; padding:18px 18px max(24px,var(--safe-bottom)); }
.wordcards-library-nav { display:flex; gap:4px; padding:4px; background:var(--surface2); border-radius:12px; }
.wordcards-library-nav button { flex:1; min-height:42px; border-radius:9px; font-size:13px; color:var(--text3); }
.wordcards-library-nav button[aria-pressed=true] { background:var(--surface); color:var(--text); box-shadow:0 1px 5px rgba(0,0,0,.04); }
.wordcards-library-nav small { margin-left:4px; font-size:10px; }
.wordcards-management-panel { display:flex; flex-direction:column; gap:16px; min-width:0; }
#page-wordcards .wordcards-library-heading { gap:10px; }
#page-wordcards .wordcards-library-heading > span { flex:1; text-align:center; font-size:12px; color:var(--text3); }
#page-wordcards .wordcards-library-heading button, #page-wordcards .wordcards-library-tools button { min-height:40px; padding:7px 11px; border-radius:10px; font-size:12px; }
#page-wordcards #wordcards-add-open { background:var(--text); color:var(--bg); }
#page-wordcards .wordcards-library-tools { display:flex; flex-wrap:nowrap; gap:8px; }
#page-wordcards .wordcards-library-tools select { flex:1; min-width:0; font-size:14px; min-height:40px; background:var(--surface); }
#page-wordcards .wordcards-search { width:100%; min-height:42px; padding:9px 12px; border:0; border-radius:10px; background:var(--surface2); }
#page-wordcards .wordcards-grid { grid-template-columns:1fr; gap:12px; padding:0; }
#page-wordcards .wordcards-card { min-height:0; padding:16px; gap:12px; border-radius:14px; border-color:var(--border); }
#page-wordcards .wordcards-card > p { font-family:inherit; font-size:15px; margin:0; }
#page-wordcards .wordcards-card footer { align-items:center; }
#page-wordcards .wordcards-card footer span { font-family:inherit; font-size:10px; }
#page-wordcards .wordcards-card footer button { min-height:36px; font-size:12px; background:transparent; padding:6px 10px; }
#page-wordcards .wordcards-card-select input { display:none; }
#page-wordcards .is-selecting .wordcards-card-select input { display:block; }
#page-wordcards .wordcards-batch { gap:10px; padding:14px; background:var(--surface2); border-radius:12px; }
#page-wordcards .wordcards-batch label { display:flex; align-items:center; gap:5px; }
.wordcards-pagination { margin-top:4px; }
#wordcards-group-list { display:flex; flex-direction:column; gap:10px; }
.wordcards-group-row { display:flex; align-items:center; gap:12px; padding:10px 12px; min-height:70px; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.wordcards-group-row > button:first-child { display:flex; flex:1; min-width:0; flex-direction:column; align-items:flex-start; gap:5px; text-align:left; min-height:44px; color:var(--text); }
.wordcards-group-row strong { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; font-weight:550; }
.wordcards-group-row small { font-size:11px; color:var(--text3); }
.wordcards-group-row input[role=switch] { appearance:none; -webkit-appearance:none; width:40px; height:24px; flex:0 0 40px; border:1px solid var(--border); border-radius:20px; background:var(--surface2); cursor:pointer; position:relative; }
.wordcards-group-row input[role=switch]::after { content:''; position:absolute; top:3px; left:3px; width:16px; height:16px; border-radius:50%; background:var(--text3); transition:transform .15s; }
.wordcards-group-row input[role=switch]:checked { background:var(--text); border-color:var(--text); }
.wordcards-group-row input[role=switch]:checked::after { transform:translateX(16px); background:var(--bg); }
.wordcards-group-edit, .wordcards-group-spacer { width:32px; flex:0 0 32px; min-height:44px; font-size:20px; color:var(--text3); }
.wordcards-new-group { display:flex; gap:10px; }
.wordcards-new-group input { flex:1; min-width:0; min-height:44px; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--surface); color:var(--text); font-size:16px; }
.wordcards-new-group button { min-height:44px; padding:9px 12px; border-radius:10px; background:var(--text); color:var(--bg); font-size:12px; }
.wordcards-chat-options { margin-top:12px; padding-top:16px; border-top:1px solid var(--border); color:var(--text3); font-size:12px; }
.wordcards-chat-options summary { cursor:pointer; padding:5px 0; }
.wordcards-chat-options label { display:flex; margin:12px 0; }
.wordcards-chat-options button { min-height:40px; padding:8px 12px; color:var(--text2); }
#page-wordcards .wordcards-review { padding:20px; border-radius:16px; }
#page-wordcards .wordcards-review header { gap:8px; }
#page-wordcards .wordcards-review header small { flex:1; }
#page-wordcards #wordcards-review-edit { width:auto; min-height:40px; padding:6px 10px; font-size:13px; }
#page-wordcards .wordcards-review p { min-height:180px; font-size:21px; }
#page-wordcards .wordcards-review select { width:100%; font-size:14px; }
#page-wordcards #wordcards-library-sheet.wordcards-library-sheet { position:absolute; inset:0; z-index:14; display:flex; align-items:center; justify-content:center; padding:16px; background:color-mix(in srgb,var(--text) 18%,transparent); }
.wordcards-library-dialog { width:min(420px,100%); max-height:calc(100% - 16px); overflow-y:auto; padding:22px; border:1px solid var(--border); border-radius:18px; background:var(--bg); color:var(--text); }
.wordcards-library-dialog > header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.wordcards-library-dialog h2 { font-size:17px; font-weight:600; margin:0; }
.wordcards-library-dialog > header button { min-width:40px; min-height:40px; border-radius:8px; color:var(--text3); font-size:24px; }
#page-wordcards .wordcards-library-dialog form { margin:0; padding:0; border:0; border-radius:0; background:none; }
.wordcards-library-dialog textarea { width:100%; min-height:130px; max-height:34dvh; padding:14px; border:1px solid var(--border); border-radius:12px; background:var(--surface); color:var(--text); font-size:16px; line-height:1.7; resize:vertical; }
.wordcards-library-dialog label { display:flex; flex-direction:column; gap:8px; margin-top:16px; font-size:12px; color:var(--text3); }
.wordcards-library-dialog select, .wordcards-library-dialog input { width:100%; min-height:44px; border:1px solid var(--border); border-radius:10px; padding:10px; color:var(--text); background:var(--surface); font-size:16px; }
.wordcards-library-dialog footer { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-top:22px; }
.wordcards-library-dialog footer small { margin-right:auto; color:var(--text3); font-size:12px; }
.wordcards-library-dialog footer button { min-height:44px; padding:10px 18px; border-radius:10px; color:var(--text3); font-size:13px; }
#page-wordcards .wordcards-library-dialog footer button[type=submit] { background:var(--text); color:var(--bg); }

/* Contact identity and icon-classified settings. */
#wordcards-contact-form { width:min(580px,100%); padding:20px; border-radius:22px; }
#wordcards-contact-form .wc-contact-identity { display:flex; align-items:center; gap:20px; margin:20px 0 28px; }
#wordcards-contact-form .wc-contact-identity > input { flex:1; min-width:0; padding:8px 0; border:0; border-radius:0; background:transparent; box-shadow:none; font-size:23px; font-weight:600; color:var(--text); }
.wc-avatar-anchor { position:relative; flex:0 0 84px; }
#wordcards-contact-avatar-pick { width:84px; height:84px; border-radius:24px; display:grid; place-items:center; overflow:hidden; background:var(--surface2); font-size:30px; color:var(--text); }
#wordcards-contact-avatar-pick img { width:100%; height:100%; object-fit:cover; }
.wc-small-menu { position:absolute; top:92px; left:0; z-index:3; width:124px; padding:5px; border:1px solid var(--border); border-radius:12px; background:var(--surface); box-shadow:0 8px 25px rgba(0,0,0,.1); }
.wc-small-menu button { display:block; width:100%; min-height:40px; text-align:left; padding:8px 12px; font-size:13px; color:var(--text); }
.wc-settings-layout { display:grid; grid-template-columns:48px minmax(0,1fr); gap:14px; align-items:start; }
.wc-settings-layout > nav { position:sticky; top:0; display:flex; flex-direction:column; gap:10px; }
.wc-settings-layout > nav button { display:grid; place-items:center; width:48px; height:48px; border-radius:14px; background:var(--surface2); color:var(--text3); }
.wc-settings-layout svg { width:23px; height:23px; }
.wc-settings-layout > nav button[aria-pressed=true] { background:var(--text); color:var(--bg); }
.wc-settings-layout .hourglass-fill { stroke:none; }
.wc-settings-layout > nav button[aria-pressed=true] .hourglass-fill { fill:currentColor; }
.wc-settings-content { min-width:0; padding:4px 0; }
#wordcards-contact-form label.wc-setting-row { display:flex; flex-direction:row; align-items:center; justify-content:space-between; gap:8px; min-height:48px; margin:0 0 8px; color:var(--text); font-size:13px; }
.wc-setting-row > span { min-width:0; }
#wordcards-contact-form input.wc-switch { appearance:none; -webkit-appearance:none; position:relative; width:42px; height:26px; flex:0 0 42px; border:1px solid var(--border); border-radius:20px; background:var(--surface2); cursor:pointer; }
#wordcards-contact-form input.wc-switch::after { content:''; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:var(--text3); transition:transform .15s; }
#wordcards-contact-form input.wc-switch:checked { background:var(--text); border-color:var(--text); }
#wordcards-contact-form input.wc-switch:checked::after { transform:translateX(16px); background:var(--bg); }
#wordcards-contact-form input.wc-inline-number { display:inline-block; width:44px; min-width:0; padding:4px 0; border:0; border-radius:0; background:transparent; color:var(--text); text-align:center; font-size:14px; appearance:textfield; -moz-appearance:textfield; }
#wordcards-contact-form input.wc-inline-number::-webkit-inner-spin-button { appearance:none; }
#wordcards-contact-form input[type=range] { width:100%; min-height:24px; padding:0; border:0; background:transparent; accent-color:var(--text); }
#wordcards-contact-form label.wc-slider-label, #wordcards-contact-form .wc-chances label { display:block; margin:16px 0; color:var(--text); font-size:12px; }
.wc-slider-label output, .wc-chances output { float:right; color:var(--text3); font-size:11px; }
.wc-slider-label input, .wc-chances input { display:block; margin-top:12px; }
.wc-pokes { display:grid; grid-template-columns:minmax(0,1fr) 36px; align-items:end; gap:6px; margin:12px 0 20px; }
#wordcards-contact-form .wc-pokes label { margin:0; font-size:12px; }
#wordcards-contact-form .wc-pokes input { padding:8px; font-size:13px; border-radius:10px; }
.wc-pokes > button { height:38px; border-radius:10px; background:var(--text); color:var(--bg); font-size:20px; }
#wordcards-poke-list { grid-column:1/-1; display:flex; flex-wrap:wrap; gap:6px; margin-top:7px; }
#wordcards-poke-list button { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:7px 10px; border-radius:10px; background:var(--surface2); color:var(--text2); font-size:11px; }
.wc-chances { margin-top:20px; border-top:1px solid var(--border); padding-top:14px; color:var(--text3); font-size:12px; }
.wc-chances summary { cursor:pointer; }
.wc-call-history-heading { display:flex; align-items:center; justify-content:space-between; margin-top:20px; font-size:12px; color:var(--text3); }
.wc-call-history-heading button { display:grid; place-items:center; width:40px; height:40px; border-radius:12px; background:var(--surface2); color:var(--text); }
#wordcards-call-history { max-height:180px; overflow:auto; font-size:11px; line-height:1.6; color:var(--text3); }
.wc-call-history-item { display:block; width:100%; min-height:38px; padding:8px 0; text-align:left; color:var(--text2); font-size:11px; }
#wordcards-call-history-more { margin-top:8px; min-height:36px; color:var(--text3); font-size:11px; }
.wc-background-preview { width:100%; aspect-ratio:4/3; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; background:var(--surface2); background-size:cover; background-position:center; border:1px solid var(--border); border-radius:14px; font-size:12px; color:var(--text3); }
.wc-background-preview.has-image > * { visibility:hidden; }
#wordcards-background-reset { min-height:40px; color:var(--text3); font-size:11px; }
#wordcards-contact-form.is-uploading { pointer-events:none; opacity:.65; }
#page-wordcards #wordcards-chat-background[aria-hidden] { position:absolute; inset:0; z-index:0; background-size:cover; background-position:center; pointer-events:none; }
#page-wordcards .chat-messages, #page-wordcards .home-room-echo { background:transparent; }
#page-wordcards #wordcards-expression-open { display:grid; place-items:center; align-self:flex-end; flex:0 0 32px; width:32px; height:44px; color:var(--text2); }
#wordcards-expression-open svg { width:25px; height:25px; }
#wordcards-expression-picker { position:absolute; bottom:84px; left:12px; right:12px; z-index:7; max-height:260px; border:1px solid var(--border); border-radius:18px; background:var(--surface); box-shadow:0 10px 30px rgba(0,0,0,.1); overflow:hidden; }
#wordcards-expression-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; min-height:70px; max-height:210px; overflow:auto; padding:12px; color:var(--text3); font-size:12px; }
#wordcards-expression-grid button { min-height:50px; min-width:0; overflow:hidden; border-radius:10px; background:var(--surface2); font-size:11px; color:var(--text); }
#wordcards-expression-grid img { width:100%; height:66px; object-fit:contain; }
#wordcards-expression-picker nav { display:flex; justify-content:center; gap:10px; padding:5px 10px; border-top:1px solid var(--border); }
#wordcards-expression-picker nav button { min-height:36px; padding:6px 14px; color:var(--text3); font-size:12px; border-radius:10px; }
#wordcards-expression-picker nav button[aria-pressed=true] { background:var(--text); color:var(--bg); }
#page-wordcards .wordcards-sticker-row .bubble:not(:has(.bubble-quote)) { padding:0!important; background:transparent!important; }
.wordcards-sticker-row .bubble > img { display:block; max-width:130px; max-height:150px; object-fit:contain; }
#page-wordcards .wordcards-event { flex:0 0 auto; align-self:center; max-width:90%; }
.wordcards-event-label { padding:6px 12px; border-radius:12px; background:var(--surface2); color:var(--text3); font-size:11px; line-height:1.6; overflow-wrap:anywhere; }
.wordcards-event-label svg { width:14px; height:14px; margin-right:6px; vertical-align:-3px; }
@keyframes wc-poke-shake { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-8deg)} 75%{transform:rotate(8deg)} }
.wc-poke-shake { animation:wc-poke-shake .2s 3; }
@media(prefers-reduced-motion:reduce){.wc-poke-shake{animation:none}}

/* Text-call placement follows the references; colors follow the active theme. */
#wordcards-call-overlay { position:fixed; inset:0; z-index:800; background:color-mix(in srgb,var(--text) 10%,transparent); color:var(--text); }
#wordcards-incoming-call { position:absolute; top:calc(16px + var(--safe-top)); left:50%; transform:translateX(-50%); width:min(520px,calc(100% - 24px)); display:flex; align-items:center; gap:12px; padding:14px 16px; border:1px solid var(--border); border-radius:28px; background:var(--surface); box-shadow:0 15px 50px rgba(0,0,0,.12); }
.wc-incoming-avatar { width:50px; height:50px; flex:0 0 50px; display:grid; place-items:center; overflow:hidden; border-radius:50%; background:var(--surface2); }
.wc-incoming-avatar img { width:100%; height:100%; object-fit:cover; }
#wordcards-incoming-call > div:nth-child(2) { flex:1; min-width:0; }
#wordcards-incoming-call strong { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:16px; }
#wordcards-incoming-call small { display:block; margin-top:5px; font-size:10px; color:var(--text3); }
#wordcards-incoming-call button { display:grid; place-items:center; flex:0 0 42px; width:42px; height:42px; border-radius:50%; background:var(--surface2); color:var(--text); }
#wordcards-incoming-call #wordcards-call-accept { background:var(--text); color:var(--bg); }
#wordcards-call-overlay svg, #wordcards-call-resume svg { width:23px; height:23px; }
#wordcards-call-screen { width:100%; height:100%; display:flex; flex-direction:column; align-items:center; padding:calc(16px + var(--safe-top)) 20px calc(20px + var(--safe-bottom)); background:var(--bg); overflow:hidden; }
#wordcards-call-screen > header { width:min(560px,100%); display:flex; align-items:center; gap:12px; color:var(--text3); font-size:12px; }
#wordcards-call-screen > header button { width:40px; height:40px; border-radius:10px; color:var(--text); }
.wc-call-person { flex:0 0 auto; text-align:center; padding:clamp(16px,6vh,60px) 0 16px; }
#wordcards-call-avatar { width:100px; height:100px; margin:0 auto 16px; display:grid; place-items:center; border-radius:50%; overflow:hidden; background:var(--surface2); font-size:32px; }
#wordcards-call-avatar img { width:100%; height:100%; object-fit:cover; }
.wc-call-person h2 { margin:8px 0; font-size:24px; }
.wc-call-person p { color:var(--text3); font-size:13px; }
.wc-call-wave { display:flex; justify-content:center; gap:7px; height:20px; margin-top:18px; }
.wc-call-wave i { width:5px; height:5px; border-radius:50%; background:var(--text3); }
#wordcards-call-turns { width:min(560px,100%); flex:1; min-height:0; overflow:auto; display:flex; flex-direction:column; gap:12px; padding:12px 2px; }
#wordcards-call-turns p { flex:0 0 auto; align-self:flex-start; max-width:85%; padding:12px 15px; border-radius:16px; background:var(--surface2); line-height:1.6; font-size:14px; white-space:pre-wrap; overflow-wrap:anywhere; }
#wordcards-call-turns p.user { align-self:flex-end; background:var(--text); color:var(--bg); }
#wordcards-call-input-form { display:flex; width:min(560px,100%); flex:0 0 auto; gap:12px; margin:16px 0; padding:10px 12px; background:var(--surface2); border-radius:20px; }
#wordcards-call-input { flex:1; width:0; min-width:0; background:transparent; color:var(--text); font-size:16px; }
#wordcards-call-input-form button { display:grid; place-items:center; width:42px; height:42px; border-radius:14px; background:var(--text); color:var(--bg); }
.wc-call-controls { display:flex; flex:0 0 auto; justify-content:center; gap:24px; margin:10px 0; }
.wc-call-controls button { display:flex; flex-direction:column; align-items:center; justify-content:center; width:72px; min-height:76px; gap:10px; border-radius:20px; color:var(--text); background:var(--surface2); }
.wc-call-controls button small { font-size:11px; }
.wc-call-controls button:disabled { opacity:.4; }
.wc-call-controls #wordcards-call-end { background:var(--text); color:var(--bg); }
.wc-call-controls button[aria-pressed=true] { outline:2px solid var(--text3); }
#wordcards-call-older { min-height:30px; color:var(--text3); font-size:11px; }
#wordcards-call-resume { position:fixed; top:calc(12px + var(--safe-top)); right:12px; z-index:799; display:flex; align-items:center; gap:8px; padding:10px 14px; border-radius:18px; background:var(--text); color:var(--bg); font-size:12px; }
#wordcards-call-overlay [hidden], #wordcards-call-overlay[hidden], #wordcards-call-resume[hidden] { display:none!important; }
@media(max-height:650px){.wc-call-person{padding:10px 0}.wc-call-person h2{font-size:18px}#wordcards-call-avatar{width:60px;height:60px;margin-bottom:8px}.wc-call-wave{display:none}.wc-call-controls button{min-height:56px}}
