/* AIWA account pages v3 — clean centered design (login / register / reset). Layered on aiwa-core.css. */

.account-page { min-height: 100vh; display: flex; flex-direction: column; background: #f6f8f7; }
.account-page main { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(24px, 4vw, 48px) 16px; }
.account-page main::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 420px; background: radial-gradient(720px 300px at 50% -80px, rgba(19, 122, 61, 0.07), transparent 70%); pointer-events: none; }

.aiwa-auth-home-link { margin-left: auto; color: var(--aiwa-brand-dark); font-size: 13px; font-weight: 700; text-decoration: none; }
.aiwa-auth-home-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- card ---- */
.account-shell { position: relative; z-index: 1; width: 100%; max-width: 448px; display: flex; flex-direction: column; align-items: stretch; }
.account-card { padding: 38px 38px 32px; border: 1px solid #e6ebe7; border-radius: 20px; background: #fff; box-shadow: 0 1px 2px rgba(15, 42, 26, 0.04), 0 16px 44px rgba(15, 42, 26, 0.08); animation: acct-in 480ms cubic-bezier(0.22, 0.8, 0.3, 1) both; }
@keyframes acct-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.account-card.do-shake { animation: acct-shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes acct-shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }

.account-logo { display: block; width: 46px; height: 46px; margin: 0 auto 14px; }
.account-card h2 { margin: 0 0 6px; font-family: "Poppins", var(--aiwa-font, system-ui), sans-serif; font-size: 25px; font-weight: 700; letter-spacing: -0.02em; text-align: center; color: var(--aiwa-ink); }
.account-card > p { margin: 0 0 22px; color: var(--aiwa-muted); font-size: 14px; line-height: 1.55; text-align: center; }

/* ---- Google first ---- */
.google-button { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #d6ded8; border-radius: 12px; background: #fff; color: var(--aiwa-ink); font-size: 14px; font-weight: 650; text-decoration: none; transition: border-color 150ms, box-shadow 150ms, background-color 150ms; }
.google-button:hover { border-color: #b9c8be; background: #fafcfa; box-shadow: 0 3px 12px rgba(15, 42, 26, 0.07); }
.google-button svg { width: 20px; height: 20px; }

.account-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: #9aa79f; font-size: 12px; }
.account-divider::before, .account-divider::after { content: ""; height: 1px; flex: 1; background: #e9eeea; }

/* ---- form ---- */
.account-form { display: grid; gap: 14px; }
.af-field { display: grid; gap: 6px; }
.af-field > label { color: var(--aiwa-text); font-size: 13px; font-weight: 650; }
.af-wrap { position: relative; }
.af-wrap > .aiwa-ui-icon { position: absolute; top: 50%; left: 14px; width: 16px; height: 16px; transform: translateY(-50%); opacity: 0.4; transition: opacity 140ms, filter 140ms; pointer-events: none; }
.af-wrap:focus-within > .aiwa-ui-icon { opacity: 1; filter: invert(35%) sepia(70%) saturate(680%) hue-rotate(97deg) brightness(91%); }
.account-form input { width: 100%; min-height: 48px; padding: 11px 14px 11px 40px; border: 1px solid #d6ded8; border-radius: 12px; background: #fff; color: var(--aiwa-ink); font: inherit; font-size: 15px; transition: border-color 140ms, box-shadow 140ms; }
.account-form input::placeholder { color: #aab6ad; }
.account-form input:hover { border-color: #b9c8be; }
.account-form input:focus { border-color: var(--aiwa-brand); outline: none; box-shadow: 0 0 0 4px rgba(19, 122, 61, 0.12); }
.af-eye { position: absolute; top: 50%; right: 7px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; transform: translateY(-50%); cursor: pointer; }
.af-eye:hover { background: #f1f5f2; }
.af-eye .aiwa-ui-icon { width: 17px; height: 17px; opacity: 0.5; }
.af-eye:hover .aiwa-ui-icon { opacity: 0.85; }
.af-wrap.has-eye input { padding-right: 48px; }

.af-caps { display: none; align-items: center; gap: 6px; margin-top: 2px; color: #8a5a00; font-size: 12px; font-weight: 650; }
.af-caps.show { display: inline-flex; animation: acct-fade 200ms ease both; }
.af-caps::before { content: "⇪"; font-size: 13px; }
@keyframes acct-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.af-strength { display: none; grid-template-columns: 1fr 1fr 1fr 1fr auto; align-items: center; gap: 6px; margin-top: 4px; }
.af-strength.show { display: grid; }
.af-strength i { height: 4px; border-radius: 999px; background: #e6ebe7; transition: background-color 220ms; }
.af-strength span { min-width: 48px; color: var(--aiwa-muted); font-size: 11.5px; font-weight: 700; text-align: right; }
.af-strength.s1 i:nth-child(1) { background: #d94f43; }
.af-strength.s2 i:nth-child(-n+2) { background: #e59b2e; }
.af-strength.s3 i:nth-child(-n+3) { background: #9fc93c; }
.af-strength.s4 i:nth-child(-n+4) { background: var(--aiwa-brand); }
.af-strength.s1 span { color: #b3402f; }
.af-strength.s2 span { color: #9a6a10; }
.af-strength.s3 span { color: #5c7d18; }
.af-strength.s4 span { color: var(--aiwa-brand-dark); }

.field-help { margin: -6px 0 0; color: var(--aiwa-muted); font-size: 12px; line-height: 1.5; }

.hp-wrap { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* ---- submit ---- */
.account-submit { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin-top: 4px; border: 0; border-radius: 12px; background: var(--aiwa-brand); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: background-color 150ms, transform 150ms, box-shadow 150ms; }
.account-submit .aiwa-ui-icon { width: 15px; height: 15px; filter: invert(1); transition: transform 180ms; }
.account-submit:hover { background: var(--aiwa-brand-dark); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(19, 122, 61, 0.25); }
.account-submit:hover .aiwa-ui-icon { transform: translateX(3px); }
.account-submit:active { transform: none; }
.account-submit:disabled { cursor: wait; opacity: 0.85; transform: none; box-shadow: none; }
.account-submit.is-busy .aiwa-ui-icon { display: none; }
.account-submit.is-busy::before { content: ""; width: 16px; height: 16px; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: acct-spin 700ms linear infinite; }
@keyframes acct-spin { to { transform: rotate(360deg); } }

/* ---- messages ---- */
.account-message { display: none; margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.55; }
.account-message.show { display: flex; align-items: flex-start; gap: 9px; animation: acct-fade 240ms ease both; }
.account-message::before { flex: 0 0 auto; margin-top: 1px; font-weight: 800; }
.account-message.error { border: 1px solid #f0c4c0; background: #fdf2f1; color: #8c1d18; }
.account-message.error::before { content: "!"; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: #d94f43; color: #fff; font-size: 12px; }
.account-message.success { border: 1px solid #bfe0ca; background: #f0f9f3; color: var(--aiwa-brand-dark); }
.account-message.success::before { content: "✓"; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--aiwa-brand); color: #fff; font-size: 11px; animation: acct-pop 340ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes acct-pop { from { transform: scale(0.3); } to { transform: scale(1); } }
.account-message.info { border: 1px solid #e6ebe7; background: #f8faf8; color: var(--aiwa-text); }
.account-message.info::before { content: "…"; }

/* ---- secondary / forgot / cooldown / legal ---- */
.account-secondary { display: flex; justify-content: center; gap: 6px; margin-top: 18px; color: var(--aiwa-muted); font-size: 13.5px; flex-wrap: wrap; }
.account-secondary a, .account-secondary button { border: 0; padding: 0; background: transparent; color: var(--aiwa-brand-dark); font: inherit; font-size: 13.5px; font-weight: 700; text-decoration: none; cursor: pointer; }
.account-secondary a:hover, .account-secondary button:hover { text-decoration: underline; text-underline-offset: 3px; }
.account-links { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; }
.account-links a, .account-links button { border: 0; padding: 0; background: transparent; color: var(--aiwa-muted); font: inherit; font-size: 13px; font-weight: 650; text-decoration: none; cursor: pointer; }
.account-links a:hover, .account-links button:hover { color: var(--aiwa-brand-dark); text-decoration: underline; text-underline-offset: 3px; }

.forgot-panel { display: none; margin-top: 14px; padding: 14px; border: 1px solid #e6ebe7; border-radius: 12px; background: #f8faf8; }
.forgot-panel.show { display: block; animation: acct-fade 220ms ease both; }
.forgot-panel p { margin: 0 0 10px; color: var(--aiwa-muted); font-size: 12.5px; line-height: 1.55; }
.forgot-panel button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 14px; border: 1px solid #d6ded8; border-radius: 10px; background: #fff; color: var(--aiwa-ink); font-size: 12.5px; font-weight: 700; cursor: pointer; transition: border-color 140ms, background-color 140ms; }
.forgot-panel button:hover { border-color: #9bc7aa; background: var(--aiwa-brand-soft); }
.forgot-panel button:disabled { opacity: 0.6; cursor: wait; }
.forgot-panel button .aiwa-ui-icon { width: 14px; height: 14px; }

.af-cooldown { display: none; margin-top: 12px; padding: 10px 12px; border: 1px solid #f0dcae; border-radius: 12px; background: #fdf7e7; color: #8a5a00; font-size: 12.5px; font-weight: 650; }
.af-cooldown.show { display: block; animation: acct-fade 220ms ease both; }

.account-legal { margin: 20px 0 0; color: #9aa79f; font-size: 11.5px; line-height: 1.6; text-align: center; }
.account-legal a { color: var(--aiwa-muted); font-weight: 650; }

/* ---- trust strip under the card ---- */
.account-perks { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 7px 18px; margin: 18px 4px 0; color: var(--aiwa-muted); font-size: 12.5px; animation: acct-in 480ms cubic-bezier(0.22, 0.8, 0.3, 1) 140ms both; }
.account-perks span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.account-perks .aiwa-ui-icon { width: 14px; height: 14px; opacity: 0.85; filter: invert(35%) sepia(70%) saturate(680%) hue-rotate(97deg) brightness(91%); }

.af-token-missing .account-form, .af-token-missing .field-help { display: none; }

@media (max-width: 480px) {
  .account-card { padding: 28px 20px 26px; border-radius: 16px; }
  .account-links { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .account-card, .account-perks, .account-message.show, .account-message.success::before, .forgot-panel.show, .af-caps.show, .af-cooldown.show { animation: none !important; }
  .account-submit, .google-button, .account-form input { transition: none !important; }
}

/* ---- Account details page (v3.1) ---- */
.acd-page main { display: block; padding: 0 16px clamp(40px, 6vw, 64px); }
.acd-page main::before { display: none; }
.acd-wrap { width: 100%; max-width: 720px; margin: 0 auto; }
.acd-head { padding: clamp(28px, 5vw, 44px) 0 6px; }
.acd-head h1 { margin: 0 0 8px; font-family: "Poppins", var(--aiwa-font, system-ui), sans-serif; font-size: clamp(1.6rem, 3.4vw, 2.1rem); font-weight: 700; letter-spacing: -0.02em; }
.acd-head p { margin: 0; color: var(--aiwa-muted); font-size: 14.5px; line-height: 1.6; }
.acd-card { margin-top: 18px; padding: 26px 26px 24px; border: 1px solid #e6ebe7; border-radius: 18px; background: #fff; box-shadow: 0 1px 2px rgba(15, 42, 26, 0.03), 0 10px 30px rgba(15, 42, 26, 0.05); animation: acct-in 460ms cubic-bezier(0.22, 0.8, 0.3, 1) both; }
.acd-card:nth-of-type(2) { animation-delay: 70ms; }
.acd-card:nth-of-type(3) { animation-delay: 140ms; }
.acd-card h2 { margin: 0 0 16px; font-family: "Poppins", var(--aiwa-font, system-ui), sans-serif; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.acd-profile-row { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid #eef2ef; }
.aiwa-avatar.acd-avatar { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 18px; font-size: 22px; font-weight: 800; }
.acd-avatar-side { flex: 1; min-width: 0; }
.acd-avatar-side > b { display: block; margin-bottom: 8px; color: var(--aiwa-text); font-size: 13px; font-weight: 650; }
.acd-avatar-side.has-photo .acd-swatches { opacity: 0.45; pointer-events: none; }
.acd-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.acd-swatch { width: 26px; height: 26px; border: 2px solid transparent; border-radius: 9px; cursor: pointer; transition: transform 130ms, box-shadow 130ms; }
.acd-swatch:hover { transform: scale(1.12); }
.acd-swatch.is-on { border-color: #fff; box-shadow: 0 0 0 2px var(--aiwa-brand); }
.acd-hint { margin: 10px 0 0; color: var(--aiwa-muted); font-size: 11.5px; line-height: 1.55; }
.acd-email-wrap input[readonly] { background: #f8faf8; color: var(--aiwa-muted); cursor: default; }
.acd-email-wrap input[readonly]:focus { border-color: #d6ded8; box-shadow: none; }
.acd-verified { position: absolute; top: 50%; right: 12px; display: inline-flex; align-items: center; gap: 5px; transform: translateY(-50%); color: var(--aiwa-brand-dark); font-size: 11.5px; font-weight: 750; }
.acd-verified .aiwa-ui-icon { width: 14px; height: 14px; filter: invert(35%) sepia(70%) saturate(680%) hue-rotate(97deg) brightness(91%); }
.account-submit.acd-submit { justify-self: start; min-height: 44px; margin-top: 8px; padding: 10px 22px; width: auto; }
.acd-plan-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.acd-plan-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acd-plan-note { color: var(--aiwa-muted); font-size: 12.5px; }
.acd-plan-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 9px 18px; border: 1px solid var(--aiwa-brand); border-radius: 999px; background: var(--aiwa-brand); color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; transition: background-color 140ms, transform 140ms; }
.acd-plan-btn:hover { background: var(--aiwa-brand-dark); transform: translateY(-1px); }
.acd-plan-btn.is-pro { border-color: #d6ded8; background: #fff; color: var(--aiwa-ink); }
.acd-plan-btn.is-pro:hover { background: var(--aiwa-bg); }
.acd-usage { padding: 14px; border: 1px solid #e6ebe7; border-radius: 12px; background: #fafcfa; }
.acd-usage-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 9px; color: var(--aiwa-muted); font-size: 12px; font-weight: 650; }
.acd-usage-top b { color: var(--aiwa-ink); font-size: 13.5px; font-weight: 780; }
.acd-limits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.acd-limits > div { padding: 12px; border: 1px solid #e6ebe7; border-radius: 12px; background: #fff; text-align: center; }
.acd-limits b { display: block; color: var(--aiwa-ink); font-size: 15px; font-weight: 780; }
.acd-limits span { display: block; margin-top: 3px; color: var(--aiwa-muted); font-size: 10.5px; font-weight: 650; }
.acd-google-note { margin: -4px 0 14px; padding: 11px 13px; border: 1px solid #cfe4d6; border-radius: 12px; background: #f0f9f3; color: var(--aiwa-brand-dark); font-size: 12.5px; line-height: 1.55; }
.acd-devices { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 20px; padding-top: 18px; border-top: 1px solid #eef2ef; }
.acd-devices b { display: block; color: var(--aiwa-ink); font-size: 13.5px; }
.acd-devices span { display: block; max-width: 380px; margin-top: 3px; color: var(--aiwa-muted); font-size: 12px; line-height: 1.5; }
.acd-devices-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 9px 16px; border: 1px solid #d6ded8; border-radius: 10px; background: #fff; color: var(--aiwa-ink); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: border-color 140ms, background-color 140ms; }
.acd-devices-btn:hover { border-color: #b9c8be; background: #fafcfa; }
.acd-devices-btn:disabled { opacity: 0.6; cursor: wait; }
.acd-devices-btn .aiwa-ui-icon { width: 14px; height: 14px; }
@media (max-width: 560px) {
  .acd-card { padding: 20px 16px; }
  .acd-limits { grid-template-columns: 1fr; }
  .acd-profile-row { flex-direction: column; }
}

/* ---- Account v2: sidebar + hero + preferences (20260823d1) ---- */
.acd2-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; width: 100%; max-width: 940px; margin: 0 auto; padding-top: clamp(24px, 4vw, 40px); }
.acd2-side { position: relative; }
.acd2-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; }
.acd2-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 11px; color: var(--aiwa-muted); font-size: 13.5px; font-weight: 650; text-decoration: none; transition: background-color 130ms, color 130ms; }
.acd2-nav a .aiwa-ui-icon { width: 16px; height: 16px; opacity: 0.65; }
.acd2-nav a:hover { background: rgba(19, 122, 61, 0.06); color: var(--aiwa-ink); }
.acd2-nav a.is-active { background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); }
.acd2-nav a.is-active .aiwa-ui-icon { filter: invert(35%) sepia(70%) saturate(680%) hue-rotate(97deg) brightness(91%); opacity: 1; }
.acd2-nav a.is-danger:hover, .acd2-nav a.is-danger.is-active { background: rgba(217, 79, 67, 0.09); color: #b3402f; }
.acd2-content { min-width: 0; }

/* hero */
.acd2-hero { position: relative; margin-bottom: 18px; border: 1px solid #e6ebe7; border-radius: 20px; background: #fff; box-shadow: 0 1px 2px rgba(15, 42, 26, 0.03), 0 12px 34px rgba(15, 42, 26, 0.06); overflow: hidden; animation: acct-in 460ms cubic-bezier(0.22, 0.8, 0.3, 1) both; }
.acd2-hero-band { height: 88px; background: linear-gradient(120deg, #0d4527 0%, #137a3d 55%, #1fa155 100%); position: relative; }
.acd2-hero-band::after { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 120px at 80% 0%, rgba(163, 230, 137, 0.35), transparent 65%); }
.acd2-hero-body { display: flex; align-items: flex-end; gap: 16px; padding: 0 24px 16px; margin-top: -34px; position: relative; }
.aiwa-avatar.acd2-avatar { width: 88px; height: 88px; flex: 0 0 88px; border: 4px solid #fff; border-radius: 24px; font-size: 30px; font-weight: 800; box-shadow: 0 8px 22px rgba(15, 42, 26, 0.18); }
.acd2-hero-id { flex: 1; min-width: 0; padding-bottom: 4px; }
.acd2-hero-id h1 { margin: 0; font-family: "Poppins", var(--aiwa-font, system-ui), sans-serif; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acd2-hero-id p { margin: 2px 0 0; color: var(--aiwa-muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acd2-hero-body .aiwa-pm-chip { margin-bottom: 10px; }
.acd2-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 24px 18px; }
.acd2-meta-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid #e6ebe7; border-radius: 999px; background: #fafcfa; color: var(--aiwa-text); font-size: 12px; font-weight: 650; }
.acd2-meta-chip .aiwa-ui-icon { width: 13px; height: 13px; opacity: 0.7; }

.acd2-card h2 { display: flex; align-items: center; gap: 9px; }
.acd2-card h2 .aiwa-ui-icon { width: 17px; height: 17px; filter: invert(35%) sepia(70%) saturate(680%) hue-rotate(97deg) brightness(91%); }
.acd2-card { scroll-margin-top: 84px; }

/* preferences rows */
.acd2-pref { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 0; border-top: 1px solid #eef2ef; flex-wrap: wrap; }
.acd2-pref:first-of-type { border-top: 0; padding-top: 4px; }
.acd2-pref-info { flex: 1; min-width: 220px; }
.acd2-pref-info b { display: block; color: var(--aiwa-ink); font-size: 13.5px; }
.acd2-pref-info span { display: block; max-width: 360px; margin-top: 3px; color: var(--aiwa-muted); font-size: 12px; line-height: 1.5; }
.acd2-seg { display: inline-flex; padding: 4px; border: 1px solid #e2e8e3; border-radius: 12px; background: #f6f8f7; gap: 2px; }
.acd2-seg button { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 7px 13px; border: 0; border-radius: 9px; background: transparent; color: var(--aiwa-muted); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: background-color 140ms, color 140ms, box-shadow 140ms; }
.acd2-seg button .aiwa-ui-icon { width: 14px; height: 14px; opacity: 0.7; }
.acd2-seg button:hover { color: var(--aiwa-ink); }
.acd2-seg button.is-on { background: #fff; color: var(--aiwa-brand-dark); box-shadow: 0 2px 8px rgba(15, 42, 26, 0.12); }
.acd2-seg button.is-on .aiwa-ui-icon { filter: invert(35%) sepia(70%) saturate(680%) hue-rotate(97deg) brightness(91%); opacity: 1; }
.acd2-switch { position: relative; width: 44px; height: 24px; flex: 0 0 44px; border: 0; border-radius: 999px; background: #cfd9d2; cursor: pointer; transition: background-color 160ms; }
.acd2-switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: left 160ms; }
.acd2-switch[aria-checked="true"] { background: var(--aiwa-brand); }
.acd2-switch[aria-checked="true"] i { left: 23px; }

/* danger zone */
.acd2-danger { border-color: #f0c4c0; }
.acd2-danger h2 .aiwa-ui-icon { filter: invert(38%) sepia(51%) saturate(1548%) hue-rotate(335deg) brightness(92%); }
.acd2-danger .acd-devices { border-top: 0; margin-top: 0; padding-top: 4px; }
.acd2-danger-btn { min-height: 40px; padding: 9px 18px; border: 1px solid #e5a5a0; border-radius: 10px; background: #fff; color: #b3402f; font: inherit; font-size: 13px; font-weight: 750; cursor: pointer; transition: background-color 140ms, border-color 140ms, color 140ms; }
.acd2-danger-btn:hover { background: #b3402f; border-color: #b3402f; color: #fff; }

/* delete dialog */
.acd2-dialog { width: min(420px, calc(100vw - 32px)); border: 1px solid #e6ebe7; border-radius: 18px; padding: 24px; background: #fff; color: var(--aiwa-ink); box-shadow: 0 24px 70px rgba(15, 42, 26, 0.25); }
.acd2-dialog::backdrop { background: rgba(10, 20, 14, 0.45); backdrop-filter: blur(2px); }
.acd2-dialog h3 { margin: 0 0 8px; font-family: "Poppins", var(--aiwa-font, system-ui), sans-serif; font-size: 18px; font-weight: 700; }
.acd2-dialog > p { margin: 0 0 16px; color: var(--aiwa-muted); font-size: 13px; line-height: 1.6; }
.acd2-dialog form { display: grid; gap: 14px; }
.acd2-dialog input { width: 100%; min-height: 46px; padding: 10px 13px 10px 40px; border: 1px solid #d6ded8; border-radius: 11px; background: #fff; color: var(--aiwa-ink); font: inherit; font-size: 14px; }
.acd2-dialog input:focus { border-color: #b3402f; outline: none; box-shadow: 0 0 0 4px rgba(179, 64, 47, 0.12); }
.acd2-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.acd2-dialog-actions button { min-height: 40px; padding: 9px 16px; border: 1px solid #d6ded8; border-radius: 10px; background: #fff; color: var(--aiwa-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.acd2-dialog-actions button:hover { background: #f6f8f7; }
.acd2-dialog-actions button.is-danger { border-color: #b3402f; background: #b3402f; color: #fff; }
.acd2-dialog-actions button.is-danger:hover { background: #93332a; }
.acd2-dialog-actions button:disabled { opacity: 0.65; cursor: wait; }

.acd-usage-sub { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; color: var(--aiwa-muted); font-size: 11px; font-weight: 650; }

@media (max-width: 900px) {
  .acd2-shell { grid-template-columns: 1fr; gap: 14px; }
  .acd2-side { position: sticky; top: 64px; z-index: 20; margin: 0 -4px; }
  .acd2-nav { position: static; flex-direction: row; overflow-x: auto; padding: 8px 4px; background: linear-gradient(#f6f8f7 85%, rgba(246,248,247,0)); }
  .acd2-nav a { flex: 0 0 auto; padding: 8px 12px; }
  .acd2-hero-body { padding: 0 16px 12px; }
  .acd2-hero-meta { padding: 0 16px 14px; }
  .aiwa-avatar.acd2-avatar { width: 72px; height: 72px; flex-basis: 72px; font-size: 24px; border-radius: 20px; }
  .acd2-pref { align-items: flex-start; flex-direction: column; }
}

/* dark refinements for v2 pieces */
html[data-theme="dark"] .acd2-hero { background: var(--aiwa-card, #161d19); border-color: #28332c; }
html[data-theme="dark"] .aiwa-avatar.acd2-avatar { border-color: var(--aiwa-card, #161d19); }
html[data-theme="dark"] .acd2-meta-chip { background: #1b241f; border-color: #28332c; }
html[data-theme="dark"] .acd2-seg { background: #1b241f; border-color: #28332c; }
html[data-theme="dark"] .acd2-seg button.is-on { background: #26302a; }
html[data-theme="dark"] .acd2-nav a:hover { background: rgba(47, 174, 99, 0.1); }
html[data-theme="dark"] .acd2-nav .is-active { background: rgba(47, 174, 99, 0.16); }
html[data-theme="dark"] .acd2-pref { border-color: #28332c; }
html[data-theme="dark"] .acd2-dialog { background: #161d19; border-color: #28332c; }
html[data-theme="dark"] .acd2-dialog input { background: #1b241f; border-color: #3a473f; color: #e9efeb; }
html[data-theme="dark"] .acd2-dialog-actions button { background: #1b241f; border-color: #3a473f; color: #e9efeb; }
html[data-theme="dark"] .acd2-danger { border-color: rgba(240, 133, 123, 0.4); }
html[data-theme="dark"] .acd2-danger-btn { background: transparent; }
html[data-theme="dark"] .acd2-nav { background: none; }
