.account-page main{max-width:1200px;padding-bottom:50px}
.account-title{display:flex;align-items:center;gap:12px;margin:12px 0 25px}
.account-title h1{font-size:29px;margin:0;letter-spacing:0}
.account-icon{display:inline-grid;place-items:center;flex:none;width:44px;height:44px;border-radius:13px;background:#eaf1e4;color:#397b5d}
.account-icon svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.account-title>.account-icon{background:none;width:30px}
.account-overview .member-summary{display:grid;grid-template-columns:1.2fr 1fr;padding:0;overflow:hidden;margin:0 0 32px}
.account-identity{display:flex;align-items:center;gap:17px;padding:27px 30px;min-width:0}
.account-identity>.account-icon{width:62px;height:62px;border-radius:50%}
.account-identity>div{min-width:0}
.account-identity h2{font-size:21px;margin:0 0 5px;overflow-wrap:anywhere}
.member-summary p{font-size:13px;margin:0;overflow-wrap:anywhere}
.account-membership{display:flex;align-items:center;gap:15px;padding:24px 30px;border-left:1px solid var(--line);background:#f0f5eb}
.account-membership>div{min-width:0}.account-membership h1{font-size:18px;margin:0 0 7px;letter-spacing:0}
.account-membership .primary{font-size:11px;padding:7px 12px;margin-top:10px}
.account-membership button:not(.primary){font-size:11px}
.account-groups{display:grid;grid-template-columns:1fr 1fr;gap:28px;align-items:start;color:var(--ink)}
.account-group>h2{font-size:13px;letter-spacing:1px;color:#82917d;font-weight:500;margin:0 0 12px 5px}
.account-list{border:1px solid var(--line);border-radius:12px;background:#fff;overflow:hidden}
.account-list button{display:flex;align-items:center;gap:15px;width:100%;padding:19px 22px;text-align:left}
.account-list button+button{border-top:1px solid var(--line)}
.account-list button:hover{background:#f3f7ef}
.account-link-copy{display:flex;flex-direction:column;gap:5px;flex:1;min-width:0}
.account-link-copy strong{font-size:15px;font-weight:550;color:#284238}
html[data-theme=dark] .account-link-copy strong{color:#e0ebe4}
.account-link-copy small{font-size:11px;color:#95a08e}
.account-list button>span:last-child{font-size:25px;color:#9baa95}
.account-detail{max-width:1000px;margin:auto}
.account-back{padding:0;margin:0 0 18px;color:var(--green);font-size:13px}
.account-content{min-height:250px}
.member-form-field{margin:18px 0}
.member-field-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.member-form .member-field-heading label{display:block;margin:0}
.member-field-heading a{flex:none;color:var(--green);font-size:12px}
.member-form .member-auth-switch{justify-content:center;align-items:center;gap:8px;margin-top:20px;color:var(--ink);font-size:15px;flex-wrap:wrap}
.member-auth-switch a{color:var(--green)}
.saved-words-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}
.saved-words-grid .saved-word-card{position:relative;min-width:0;padding:20px 52px 18px 18px;border:1px solid var(--line);border-radius:10px}
.saved-word-card h3{margin:0 0 6px;font-size:19px;line-height:1.5}
.saved-word-pronunciation{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;min-height:32px;color:var(--muted);font-size:13px}
.saved-word-card p{margin:8px 0 0;font-size:14px;line-height:1.7}
.saved-word-card .saved-word-audio,.saved-word-card .saved-word-star{display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;padding:4px;margin:0;border:0;background:transparent;color:var(--green);cursor:pointer}
.saved-word-audio svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.saved-word-card .saved-word-star{position:absolute;top:12px;right:12px}
.saved-word-star svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round}
.saved-word-star[aria-pressed=true] svg{fill:#d8b655;stroke:#b38a27}
.saved-word-card button:focus-visible{outline:2px solid var(--green);outline-offset:2px;border-radius:4px}
.saved-word-card button:disabled{opacity:.5;cursor:wait}
@media(max-width:700px){.saved-words-grid{grid-template-columns:minmax(0,1fr)}}
.saved-sentences-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.saved-sentences-grid .saved-sentence-card{display:flex;align-items:flex-start;gap:12px;position:relative;border:1px solid var(--line);border-radius:10px;padding:38px 14px 14px;min-width:0}
.saved-sentence-card .saved-sentence-cover{flex:0 0 35%;aspect-ratio:16/9;display:flex;align-items:center;justify-content:center;background:#e8eee5;border-radius:6px;overflow:hidden;margin:0;font-size:11px;color:var(--muted)}
.saved-sentence-cover img{display:block;width:100%;height:100%;object-fit:cover}
.saved-sentence-media{flex:0 0 35%;min-width:0}
.saved-sentence-media .saved-sentence-cover{width:100%;flex:none}
.saved-sentence-card .saved-sentence-title{display:block;max-width:100%;margin:6px 0 0;font-size:11px;line-height:1.5;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:clip}
.saved-sentence-copy{min-width:0;flex:1}
.saved-sentence-card .saved-sentence-copy h3{font-size:15px;line-height:1.65;margin:0 0 6px;max-height:3.3em;overflow:hidden}
.saved-sentence-copy p{font-size:13px;line-height:1.6;margin:0 0 10px;white-space:nowrap;overflow:hidden;text-overflow:clip}
.saved-sentence-copy>a,.saved-sentence-copy>button{display:inline-block;margin:4px 8px 0 0;font-size:12px}
.saved-sentence-card .saved-sentence-star{position:absolute;right:10px;top:5px;margin:0;padding:3px 7px;font-size:25px;line-height:1;color:#929b94}
.saved-sentence-card .saved-sentence-star[aria-pressed=true]{color:#d1a62c}
html[data-theme=dark] .saved-sentence-cover{background:#293e2f}
@media(max-width:700px){
 .saved-sentences-grid{grid-template-columns:minmax(0,1fr)}
 .saved-sentences-grid .saved-sentence-card{flex-direction:column;align-items:stretch}
 .saved-sentence-media,.saved-sentence-copy{flex:none;width:100%}
 .saved-sentence-copy h3{overflow-wrap:anywhere}
}
.history-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.history-grid .history-card{display:flex;align-items:center;gap:14px;padding:14px;border:1px solid var(--line);border-radius:10px;min-width:0}
.history-card .history-cover{display:flex;align-items:center;justify-content:center;flex:0 0 40%;aspect-ratio:16/9;overflow:hidden;border-radius:6px;background:#e8eee5;margin:0;color:var(--muted);font-size:11px}
.history-cover img{display:block;width:100%;height:100%;object-fit:cover}
.history-copy{min-width:0;flex:1}
.history-card .history-copy h3{font-size:15px;line-height:1.5;margin:0 0 6px}
.history-card .history-copy h3 a{font:inherit;color:var(--ink);margin:0}
.history-copy p{font-size:12px;color:var(--muted);margin:0 0 8px;line-height:1.5}
.history-copy>a{font-size:12px;margin:0}
html[data-theme=dark] .history-cover{background:#293e2f}
@media(max-width:700px){
 .history-grid{grid-template-columns:minmax(0,1fr);gap:16px}
 .history-grid .history-card{flex-direction:column;align-items:stretch;gap:0;padding:0;overflow:hidden}
 .history-card .history-cover{flex:none;width:100%;border-radius:0}
 .history-card .history-copy{padding:13px 14px}
 .history-card .history-copy h3{font-size:15px}
 .history-copy p,.history-copy>a{font-size:12px}
}
.saved-sentence-word{cursor:pointer;border-radius:3px}
.saved-sentence-word:hover,.saved-sentence-word:focus-visible{background:#dceedd;outline:1px solid #79a77d}
html[data-theme=dark] .saved-sentence-word:hover{background:#34533d}
.account-content .member-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:25px 0}
.account-content .member-stats>div{background:#f1f5ec;padding:18px;border-radius:8px}
.account-content .member-stats p{font-size:12px;margin-bottom:0}
html[data-theme=dark] .account-list{background:#1d2922}
html[data-theme=dark] :is(.account-icon,.account-content .member-stats>div){background:#2b4031;color:#a9d9b8}
html[data-theme=dark] .account-membership{background:#25382a}
html[data-theme=dark] .account-list button:hover{background:#293e2f}
@media(max-width:700px){
 .account-page main{padding:24px 16px 35px}.account-title{margin:0 0 20px;gap:8px}.account-title h1{font-size:25px}
 .account-overview .member-summary{grid-template-columns:1fr;margin-bottom:27px}
 .account-identity{padding:22px 20px;gap:13px}.account-identity>.account-icon{width:52px;height:52px}
 .account-identity h2{font-size:19px}.account-identity p{font-size:12px}
 .account-membership{border-left:0;border-top:1px solid var(--line);padding:20px;gap:13px}
 .account-membership h1{font-size:17px}.account-membership p{font-size:12px;line-height:1.7}
 .account-groups{grid-template-columns:1fr;gap:25px}.account-list button{padding:17px 18px;gap:13px}
 .account-content .member-stats{grid-template-columns:1fr 1fr}.account-content{padding:20px}
}

.saved-sentences-grid{align-items:start}
.saved-sentence-card.sentence-expanded .saved-sentence-copy h3{max-height:none}
.saved-sentence-card.sentence-expanded .saved-sentence-copy p,.saved-sentence-card.sentence-expanded .saved-sentence-title{white-space:normal;overflow-wrap:anywhere;overflow:visible}
.saved-sentence-actions{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;margin-top:4px}
.saved-sentence-actions>a,.saved-sentence-actions>button{margin:0;font-size:12px}
.saved-sentence-actions>a{white-space:nowrap}
.saved-sentence-card .sentence-expand{display:inline-flex;flex:none;align-items:center;justify-content:center;width:32px;height:32px;margin:0;padding:6px;color:var(--green);border-radius:5px}
.saved-sentence-card .sentence-expand[hidden]{display:none}
.sentence-expand svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.sentence-expand[aria-expanded=true] svg{transform:rotate(180deg)}

/* Segmented login/register navigation. */
.member-form .member-auth-tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:5px;margin:0 0 24px;border:1px solid #e1e9df;border-radius:12px;background:#eef3eb;font-size:15px}
.member-auth-tabs>a{display:flex;align-items:center;justify-content:center;min-height:42px;padding:8px 16px;border-radius:8px;color:#82917e;font-weight:600;transition:background .15s,color .15s}
.member-auth-tabs>a[aria-current=page]{background:#fff;color:#26745f;box-shadow:0 2px 6px #244d2710}
.member-auth-tabs>a:hover{color:#26745f}
.member-auth-tabs>a:focus-visible{outline:2px solid #86b785;outline-offset:1px}
html[data-theme=dark] .member-form .member-auth-tabs{background:#15231b;border-color:#35483a}
html[data-theme=dark] .member-auth-tabs>a{color:#9bb19f}
html[data-theme=dark] .member-auth-tabs>a[aria-current=page]{background:#314c3b;color:#d3edda;box-shadow:none}
@media(max-width:600px){.member-form .member-auth-tabs{margin-bottom:20px;font-size:14px}.member-auth-tabs>a{min-height:40px}}

/* Compact audio sentence favorites: two English lines, translation, actions. */
.saved-sentences-grid .saved-audio-sentence-card{display:block;padding:18px 16px 7px}
.saved-audio-sentence-card .saved-sentence-copy h3{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-height:1.65;height:auto;max-height:3.3em;margin:0 30px 8px 0;font-weight:500;overflow-wrap:anywhere;overflow:hidden}
.saved-audio-sentence-card .saved-sentence-copy p{margin:0 0 10px;line-height:1.6;height:1.6em;white-space:nowrap;text-overflow:ellipsis}
.saved-audio-sentence-card .saved-sentence-actions{min-height:28px;margin:0;gap:6px 14px}
.saved-audio-sentence-card .saved-sentence-star{top:15px;right:10px}

.saved-audio-sentence-card .saved-sentence-actions{min-height:0;line-height:1.5}

/* Account word popup stays centered regardless of document scrolling. */
.account-page>dialog.dictionary-dialog{position:fixed;inset:0;margin:auto;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain}
