:root {
  --portal-bg: #07110f;
  --portal-surface: rgba(13, 29, 25, .88);
  --portal-surface-strong: #10251f;
  --portal-border: rgba(123, 218, 187, .18);
  --portal-text: #eefaf6;
  --portal-muted: #9db8af;
  --portal-accent: #59e0b2;
  --portal-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

:root[data-theme="light"] {
  --portal-bg: #f4f7f6;
  --portal-surface: rgba(255, 255, 255, .92);
  --portal-surface-strong: #ffffff;
  --portal-border: rgba(20, 85, 66, .14);
  --portal-text: #17231f;
  --portal-muted: #60736c;
  --portal-accent: #087f5b;
  --portal-shadow: 0 18px 50px rgba(35, 62, 53, .12);
  color-scheme: light;
}

html[data-theme="light"] body,
html[data-theme="light"] .public-home { background: var(--portal-bg); color: var(--portal-text); }
html[data-theme="light"] .site-header,
html[data-theme="light"] .sidebar,
html[data-theme="light"] article[data-page],
html[data-theme="light"] .site-footer { background: var(--portal-surface); border-color: var(--portal-border); color: var(--portal-text); }
html[data-theme="light"] :is(.h2,.h3,.name,.project-title,.blog-item-title,.site-brand strong) { color: var(--portal-text); }
html[data-theme="light"] :is(.about-text,.section-intro,.project-description,.blog-text,.title) { color: var(--portal-muted); }
html[data-theme="light"] .brand-hero { background: linear-gradient(135deg, #e8fff6, #f5fbf8 60%, #edf4ff); border-color: var(--portal-border); }

.modern-header { gap: 18px; }
.modern-header .site-brand > span:last-child { display: grid; gap: 2px; }
.modern-header .site-brand small { color: var(--portal-muted); font-size: 11px; font-weight: 500; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 220px; }
.account-summary { max-width: 110px; overflow: hidden; color: var(--portal-muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-action { min-height: 36px; padding: 0 13px; border: 1px solid var(--portal-border); border-radius: 10px; background: transparent; color: var(--portal-text); cursor: pointer; }
.account-action.primary { border-color: color-mix(in srgb, var(--portal-accent) 55%, transparent); color: var(--portal-accent); }
.icon-action { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; padding: 0; border: 1px solid var(--portal-border); border-radius: 50%; background: var(--portal-surface-strong); color: var(--portal-text); cursor: pointer; }
.theme-glyph { position: relative; width: 16px; height: 16px; display: block; box-sizing: border-box; border: 2px solid currentColor; border-radius: 50%; }
.theme-glyph::before { content: ""; position: absolute; inset: -6px; background: repeating-conic-gradient(from 0deg, currentColor 0 5deg, transparent 5deg 45deg); -webkit-mask: radial-gradient(circle, transparent 0 8px, #000 8.5px 10px, transparent 10.5px); mask: radial-gradient(circle, transparent 0 8px, #000 8.5px 10px, transparent 10.5px); }
:root[data-theme="light"] .theme-glyph { width: 17px; height: 17px; border: 0; background: currentColor; }
:root[data-theme="light"] .theme-glyph::before { inset: -2px 3px 3px -2px; border-radius: 50%; background: var(--portal-surface-strong); -webkit-mask: none; mask: none; }
.music-action { position: relative; }
.speaker-glyph { position: relative; width: 24px; height: 20px; display: block; color: currentColor; }
.speaker-glyph i::before { content: ""; position: absolute; left: 1px; top: 7px; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.speaker-glyph i::after { content: ""; position: absolute; left: 6px; top: 3px; width: 10px; height: 15px; background: currentColor; clip-path: polygon(0 29%,100% 0,100% 100%,0 71%); }
.speaker-glyph::before { content: ""; position: absolute; right: 2px; top: 6px; width: 5px; height: 8px; box-sizing: border-box; border: 2px solid currentColor; border-left: 0; border-radius: 0 50% 50% 0; }
.speaker-glyph::after { content: ""; position: absolute; right: -2px; top: 3px; width: 9px; height: 14px; box-sizing: border-box; border: 2px solid currentColor; border-left: 0; border-radius: 0 50% 50% 0; opacity: .68; }
.music-action.is-muted .speaker-glyph { color: var(--portal-muted); }
.music-action.is-muted::after { content: ""; position: absolute; width: 23px; height: 2px; border-radius: 2px; background: #ff7f7f; transform: rotate(-45deg); }

.announcement-card { display: flex; align-items: flex-start; gap: 14px; margin: 0 0 26px; padding: 18px 20px; border: 1px solid var(--portal-border); border-radius: 18px; background: var(--portal-surface); box-shadow: var(--portal-shadow); }
.announcement-card span { flex: 0 0 auto; padding: 5px 9px; border-radius: 8px; background: var(--portal-accent); color: #04120d; font-weight: 800; font-size: 12px; }
.announcement-card p { margin: 2px 0 0; color: var(--portal-text); line-height: 1.7; white-space: pre-wrap; }

.resource-section { margin-top: 34px; }
.resource-section h3 { margin-bottom: 14px; color: var(--portal-text); }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.resource-card { display: grid; gap: 7px; padding: 18px; border: 1px solid var(--portal-border); border-radius: 16px; background: var(--portal-surface); color: var(--portal-text); text-decoration: none; transition: transform .2s, border-color .2s; }
.resource-card:hover { transform: translateY(-3px); border-color: var(--portal-accent); }
.resource-card span { color: var(--portal-muted); font-size: 13px; }

.message-form { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 14px; padding: 22px; border: 1px solid var(--portal-border); border-radius: 20px; background: var(--portal-surface); box-shadow: var(--portal-shadow); }
.message-form label { display: grid; gap: 7px; color: var(--portal-muted); font-size: 13px; }
.message-form .wide { grid-column: 2; grid-row: 1 / span 3; }
.message-visibility { display: inline-flex; width: fit-content; margin-left: 9px; padding: 3px 8px; border: 1px solid var(--portal-border); border-radius: 999px; color: var(--portal-accent); font-size: 11px; font-weight: 700; }
.message-form :is(input,textarea) { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--portal-border); border-radius: 12px; background: var(--portal-bg); color: var(--portal-text); resize: vertical; }
.primary-action { align-self: end; width: fit-content; padding: 11px 20px; border: 0; border-radius: 12px; background: var(--portal-accent); color: #04120d; font-weight: 800; cursor: pointer; }
#messageNotice { align-self: center; color: var(--portal-muted); }
.message-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.message-toolbar p { max-width: 720px; margin: 0; color: var(--portal-muted); line-height: 1.7; }
.message-toolbar button { flex: 0 0 auto; padding: 10px 15px; border: 1px solid var(--portal-border); border-radius: 10px; background: var(--portal-surface); color: var(--portal-text); cursor: pointer; }
.message-toolbar button:disabled { opacity: .45; cursor: not-allowed; }
.message-primary-actions { display: flex; align-items: center; gap: 10px; }
.message-primary-actions button.primary { border-color: var(--portal-accent); background: var(--portal-accent); color: #04120d; font-weight: 800; }
/* badge removed */
.message-mode-tabs { display: flex; gap: 8px; padding: 4px; border: 1px solid var(--portal-border); border-radius: 13px; background: var(--portal-surface); }
.message-mode-tabs[hidden] { display: none; }
.message-mode-tabs button { border: 0; background: transparent; }
.message-mode-tabs button.active { background: var(--portal-accent); color: #04120d; font-weight: 800; }
.message-list { margin-top: 18px; }
.message-slider { position: relative; width: 100%; max-height: 420px; min-height: 240px; display: grid; gap: 10px; padding: 2px 8px 18px 2px; overflow-x: hidden; overflow-y: auto; scrollbar-color: var(--portal-accent) transparent; -webkit-mask-image: linear-gradient(180deg,#000 0,#000 92%,transparent); mask-image: linear-gradient(180deg,#000 0,#000 92%,transparent); }
.message-card { display: block; width: 100%; min-height: 0; padding: 14px 18px; border: 1px solid var(--portal-border); border-radius: 16px; background: linear-gradient(145deg,var(--portal-surface),color-mix(in srgb,var(--portal-accent) 5%,var(--portal-surface))); box-shadow: 0 10px 28px rgba(0,0,0,.12); }
.message-card header { display: flex; justify-content: space-between; gap: 14px; color: var(--portal-text); }
.message-card time { color: var(--portal-muted); font-size: 12px; }
.message-card p { margin: 8px 0 0; color: var(--portal-text); white-space: pre-wrap; line-height: 1.65; }
.message-reply { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--portal-accent); border-radius: 8px; background: color-mix(in srgb, var(--portal-accent) 8%, transparent); color: var(--portal-muted); }
.message-delete { margin-top: 12px; border: 0; background: transparent; color: #e06c75; cursor: pointer; }
.message-chat { min-height: 420px; padding: 18px; border: 1px solid var(--portal-border); border-radius: 20px; background: radial-gradient(circle at 15% 0,color-mix(in srgb,var(--portal-accent) 9%,transparent),transparent 38%),var(--portal-surface); }
.chat-transcript { max-height: min(60vh,620px); display: grid; gap: 12px; padding: 8px 12px 22px; overflow-y: auto; scrollbar-color: var(--portal-accent) transparent; }
.chat-row { display: flex; }
.chat-row.customer { justify-content: flex-end; }
.chat-row.admin { justify-content: flex-start; }
.chat-bubble { position: relative; max-width: min(70%,680px); padding: 13px 16px; border: 1px solid var(--portal-border); border-radius: 18px; background: var(--portal-surface-strong); color: var(--portal-text); box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.chat-row.customer .chat-bubble { border-bottom-right-radius: 5px; background: color-mix(in srgb,var(--portal-accent) 18%,var(--portal-surface-strong)); }
.chat-row.admin .chat-bubble { border-bottom-left-radius: 5px; }
.chat-bubble strong { display: block; margin-bottom: 5px; color: var(--portal-accent); font-size: 12px; }
.chat-bubble p { margin: 0; line-height: 1.7; white-space: pre-wrap; }
.chat-bubble small { display: block; margin-top: 8px; color: var(--portal-muted); font-size: 11px; }
.chat-delete { position: absolute; right: 10px; bottom: 8px; padding: 0; border: 0; background: transparent; color: #e88989; font-size: 11px; cursor: pointer; }
.chat-row.customer .chat-bubble small { padding-right: 38px; }
.chat-pending { justify-self: end; margin: -5px 12px 2px 0; color: var(--portal-muted); font-size: 11px; }
.chat-empty { margin: auto; padding: 70px 20px; color: var(--portal-muted); text-align: center; line-height: 1.8; }
.message-compose-fab { position: fixed; z-index: 45; right: 28px; bottom: 28px; padding: 14px 21px; border: 0; border-radius: 999px; background: var(--portal-accent); color: #04120d; box-shadow: 0 14px 38px rgba(0,0,0,.3); font-weight: 800; cursor: pointer; }

.direct-dialog { width: min(1040px, calc(100vw - 30px)); max-width: 1040px; height: min(720px, calc(100vh - 34px)); max-height: 720px; overflow: hidden; }
.direct-messenger { height: 100%; display: grid; grid-template-columns: 260px minmax(0,1fr); }
.direct-sidebar { padding: 20px 14px; border-right: 1px solid var(--portal-border); background: color-mix(in srgb,var(--portal-bg) 78%,var(--portal-surface)); }
.direct-self { display: grid; gap: 5px; padding: 4px 10px 18px; border-bottom: 1px solid var(--portal-border); }
.direct-self small,.direct-contact small { color: var(--portal-muted); }
.direct-contact { display: grid; grid-template-columns: 46px minmax(0,1fr); align-items: center; gap: 11px; margin-top: 14px; padding: 12px; border: 1px solid color-mix(in srgb,var(--portal-accent) 45%,var(--portal-border)); border-radius: 14px; background: color-mix(in srgb,var(--portal-accent) 10%,var(--portal-surface)); }
.direct-contact img { width: 46px; height: 46px; object-fit: cover; border-radius: 12px; background: #fff; }
.direct-contact div { min-width: 0; display: grid; gap: 4px; }
.direct-contact strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.direct-thread { min-width: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto; background: var(--portal-surface-strong); }
.direct-thread > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; border-bottom: 1px solid var(--portal-border); }
.direct-thread > header div { display: grid; gap: 4px; }
.direct-thread > header small { color: var(--portal-muted); }
.direct-thread > header button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--portal-text); font-size: 26px; cursor: pointer; }
.direct-transcript { min-height: 0; display: flex; flex-direction: column; gap: 13px; padding: 22px; overflow-y: auto; background: radial-gradient(circle at 20% 0,color-mix(in srgb,var(--portal-accent) 7%,transparent),transparent 36%); scrollbar-color: var(--portal-accent) transparent; }
.direct-row { display: flex; }
.direct-row.customer { justify-content: flex-end; }
.direct-row.owner { justify-content: flex-start; }
.direct-bubble { max-width: min(72%,650px); padding: 11px 14px; border: 1px solid var(--portal-border); border-radius: 16px; background: var(--portal-surface); box-shadow: 0 9px 22px rgba(0,0,0,.12); }
.direct-row.customer .direct-bubble { border-bottom-right-radius: 4px; background: color-mix(in srgb,var(--portal-accent) 22%,var(--portal-surface)); }
.direct-row.owner .direct-bubble { border-bottom-left-radius: 4px; }
.direct-bubble strong { display: block; margin-bottom: 5px; color: var(--portal-accent); font-size: 11px; }
.direct-bubble p { margin: 0; color: var(--portal-text); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.direct-bubble a { display: block; margin-top: 8px; }
.direct-bubble img { display: block; max-width: min(100%,420px); max-height: 360px; border-radius: 11px; object-fit: contain; }
.direct-bubble small { display: block; margin-top: 7px; color: var(--portal-muted); font-size: 10px; text-align: right; }
.direct-empty { margin: auto; max-width: 420px; color: var(--portal-muted); text-align: center; line-height: 1.8; }
.direct-composer { display: grid; gap: 9px; padding: 14px 18px; border-top: 1px solid var(--portal-border); background: var(--portal-surface); }
.direct-composer textarea { width: 100%; box-sizing: border-box; padding: 11px 13px; border: 1px solid var(--portal-border); border-radius: 11px; background: var(--portal-bg); color: var(--portal-text); resize: none; }
.direct-compose-actions { min-width: 0; display: flex; align-items: center; gap: 10px; }
.direct-image-button { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--portal-border); border-radius: 9px; color: var(--portal-text); cursor: pointer; }
.direct-image-button input { display: none; }
#directImageName { min-width: 0; flex: 1; overflow: hidden; color: var(--portal-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
#directNotice { min-height: 18px; color: #f08b8b; font-size: 12px; }

.lab-overview,.lab-roadmap,.lab-future,.lab-grid-cards article,.lab-gallery-section { margin-top: 20px; padding: 24px; border: 1px solid var(--portal-border); border-radius: 18px; background: var(--portal-surface); box-shadow: var(--portal-shadow); }
.lab-overview > p,.lab-roadmap p,.lab-future p { margin: 0; color: var(--portal-muted); line-height: 1.8; white-space: pre-wrap; }
.lab-overview .research-pills { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.lab-overview .research-pills span { padding: 8px 12px; border: 1px solid var(--portal-border); border-radius: 999px; color: var(--portal-accent); }
.lab-grid-cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.lab-grid-cards article { display: block; }
.lab-grid-cards article > span { color: var(--portal-accent); font: 800 12px/1 monospace; }
.lab-grid-cards ul { display: grid; gap: 9px; margin: 15px 0 0; padding-left: 20px; color: var(--portal-muted); }
.lab-gallery { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 12px; }
.lab-gallery img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 12px; }

.portal-dialog { position: fixed; inset: 0; width: min(560px, calc(100vw - 28px)); max-width: 560px; max-height: calc(100vh - 36px); margin: auto; padding: 0; overflow: auto; border: 1px solid var(--portal-border); border-radius: 20px; background: var(--portal-surface-strong); color: var(--portal-text); box-shadow: 0 28px 90px rgba(0,0,0,.5); }
.portal-dialog[open] { display: block; }
.portal-dialog::backdrop { background: rgba(0, 0, 0, .68); backdrop-filter: blur(5px); }
.dialog-form,.account-panel { display: grid; gap: 18px; padding: 24px; }
.dialog-form > header,.account-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-form header span,.account-panel header span { color: var(--portal-accent); font: 800 11px/1 monospace; letter-spacing: .14em; }
.dialog-form h2,.account-panel h2 { margin: 6px 0 0; color: var(--portal-text); }
.dialog-form header button,.account-panel header button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--portal-border); border-radius: 10px; background: transparent; color: var(--portal-text); font-size: 22px; line-height: 1; cursor: pointer; }
.account-panel header .dialog-close { border: 0; border-radius: 50%; background: transparent; font-size: 28px; }
.account-panel header .dialog-close:hover { background: color-mix(in srgb,var(--portal-accent) 10%,transparent); color: var(--portal-accent); }
.dialog-form label,.account-form label { display: grid; gap: 7px; color: var(--portal-muted); font-size: 13px; }
.dialog-form :is(select,textarea),.account-form input { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid var(--portal-border); border-radius: 11px; background: var(--portal-bg); color: var(--portal-text); }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.account-tabs { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.account-tabs button { padding: 10px 8px; border: 1px solid var(--portal-border); border-radius: 10px; background: transparent; color: var(--portal-muted); cursor: pointer; }
.account-tabs button.active { border-color: var(--portal-accent); background: color-mix(in srgb,var(--portal-accent) 12%,transparent); color: var(--portal-accent); }
.account-form { display: grid; gap: 14px; }
.account-form[hidden] { display: none; }
.account-submit { width: 100%; justify-self: stretch; text-align: center; }
.account-divider { position: relative; display: grid; place-items: center; margin: 2px 0; color: var(--portal-muted); font-size: 12px; }
.account-divider::before { content: ""; position: absolute; right: 0; left: 0; height: 1px; background: var(--portal-border); }
.account-divider span { position: relative; padding: 0 12px; background: var(--portal-surface-strong); }
.guest-enter-button { width: 100%; padding: 12px; border: 1px solid color-mix(in srgb,var(--portal-accent) 50%,transparent); border-radius: 11px; background: color-mix(in srgb,var(--portal-accent) 8%,transparent); color: var(--portal-accent); font-weight: 700; cursor: pointer; }
.guest-hint { color: var(--portal-muted); text-align: center; }
.guest-account,.generated-account { padding: 16px; border: 1px solid var(--portal-border); border-radius: 13px; color: var(--portal-muted); }
.generated-account code { color: var(--portal-accent); user-select: all; }
.generated-account button { padding: 8px 12px; border: 1px solid var(--portal-border); border-radius: 9px; background: transparent; color: var(--portal-text); cursor: pointer; }
.account-notice { min-height: 22px; margin: 0; color: var(--portal-accent); }

.post-content img { display: block; max-width: 100%; max-height: 680px; margin: 22px auto; border-radius: 16px; box-shadow: var(--portal-shadow); }
.post-content a { color: var(--portal-accent); text-decoration: underline; text-underline-offset: 3px; }

#siteAudio { display: none; }
.footer-brand-line { display: flex; align-items: center; gap: 18px; }
.site-visit-counter { color: var(--shell-text); white-space: nowrap; }
.site-visit-counter strong { color: #15966f; font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }
html[data-theme="light"] .site-visit-counter { color: var(--portal-text); }

@media (max-width: 760px) {
  .modern-header { flex-wrap: wrap; }
  .modern-header .header-actions { min-width: 0; margin-left: auto; }
  .modern-header .account-summary { display: none; }
  .modern-header nav { order: 3; width: 100%; overflow-x: auto; justify-content: flex-start; }
  .message-form { grid-template-columns: 1fr; }
  .message-form .wide { grid-column: auto; grid-row: auto; }
  .lab-grid-cards { grid-template-columns: 1fr; }
  .message-toolbar { align-items: flex-start; flex-direction: column; }
  .message-mode-tabs { width: 100%; }
  .message-mode-tabs button { flex: 1; }
  .message-primary-actions { width: 100%; }
  .message-primary-actions button { flex: 1; }
  .direct-dialog { width: calc(100vw - 14px); height: calc(100vh - 14px); max-height: none; }
  .direct-messenger { grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr); }
  .direct-sidebar { padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--portal-border); }
  .direct-self { display: none; }
  .direct-contact { margin: 0; padding: 8px 10px; }
  .direct-contact img { width: 38px; height: 38px; }
  .direct-transcript { padding: 14px; }
  .direct-bubble { max-width: 86%; }
  .chat-bubble { max-width: 88%; }
  .message-compose-fab { right: 16px; bottom: 18px; }
  .account-tabs { grid-template-columns: 1fr; }
}

/* ===== Tool cards ===== */
/* tools-section merged into portfolio */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 24px; }
.tool-empty { color: var(--portal-muted); text-align: center; padding: 32px 0; }
.tool-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 1px solid var(--portal-border); border-radius: 16px; background: var(--portal-surface); color: var(--portal-text); cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .15s; text-align: left; }
.tool-card:hover { border-color: var(--portal-accent); box-shadow: var(--portal-shadow); transform: translateY(-2px); }
.tool-card-icon { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--portal-accent) 12%, transparent); color: var(--portal-accent); font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.tool-card-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.tool-card-body strong { color: var(--portal-text); font-size: 15px; }
.tool-card-body small { color: var(--portal-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-tag { flex: 0 0 auto; padding: 3px 10px; border-radius: 8px; background: color-mix(in srgb, var(--portal-accent) 14%, transparent); color: var(--portal-accent); font-size: 11px; font-weight: 700; }
.tool-card-arrow { color: var(--portal-muted); font-size: 18px; transition: transform .15s, color .15s; }
.tool-card:hover .tool-card-arrow { transform: translateX(3px); color: var(--portal-accent); }

/* ===== Account row (remember + forgot) ===== */
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.account-check { display: flex; align-items: center; gap: 6px; color: var(--portal-muted); font-size: 13px; cursor: pointer; }
.account-check input { width: auto; accent-color: var(--portal-accent); }
.link-button { padding: 0; border: 0; background: none; color: var(--portal-accent); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ===== OAuth buttons ===== */
.account-oauth { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.oauth-button { padding: 10px; border: 1px solid var(--portal-border); border-radius: 11px; background: transparent; color: var(--portal-text); font-size: 13px; cursor: pointer; transition: border-color .2s, color .2s; }
.oauth-button:hover { border-color: var(--portal-accent); color: var(--portal-accent); }

/* ===== Tool embed overlay ===== */
.tool-embed { display: grid; grid-template-rows: auto 1fr; background: var(--portal-bg); }
.tool-embed[hidden] { display: none; }
body.embed-active main { max-width: none !important; margin: 0 !important; padding: 0 !important; width: 100% !important; }
body.embed-active .main-content { width: 100% !important; min-width: 100% !important; margin: 0 !important; padding: 0 !important; }
body.embed-active .main-content > article { display: none !important; }
body.embed-active .main-content > .tool-embed { display: grid; height: calc(100vh - 64px); }
body.embed-active .site-footer { display: none; }
.tool-embed-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-bottom: 1px solid var(--portal-border); background: var(--portal-surface); }
.tool-embed-bar strong { color: var(--portal-text); }
.tool-embed-controls { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.tool-embed-controls > [hidden] { display: none !important; }
.tool-embed-controls span { padding: 6px 11px; border: 1px solid var(--portal-border); border-radius: 999px; color: var(--portal-muted); font-size: 12px; white-space: nowrap; }
.tool-embed-bar button { padding: 6px 16px; border: 1px solid var(--portal-border); border-radius: 9px; background: transparent; color: var(--portal-text); cursor: pointer; }
.tool-embed-bar button:hover { border-color: var(--portal-accent); color: var(--portal-accent); }
.tool-embed iframe { width: 100%; height: 100%; border: 0; }

@media (max-width: 760px) {
  .tool-grid { grid-template-columns: 1fr; }
  .account-oauth { grid-template-columns: 1fr; }
  .tool-embed-bar { align-items: flex-start; gap: 8px; }
  .tool-embed-controls { flex-wrap: wrap; }
  .tool-embed-controls span { display: none; }
}
