/* The cabinet uses the same milk, sky-blue and hand-drawn controls as training. */
html body #dictionaryModal {padding:12px!important;overflow:hidden!important;align-items:center!important;}
html body #dictionaryForm {display:flex!important;flex-direction:column!important;gap:14px!important;width:min(1080px,100%)!important;max-width:100%!important;max-height:calc(100dvh - 24px)!important;margin:0!important;padding:22px!important;overflow:hidden!important;border-radius:26px!important;background:linear-gradient(150deg,#fffef9,#f3faff)!important;}
html body #dictionaryForm>.auth-head,html body #dictionaryForm>.cabinet-tabs,html body #dictionaryForm>.dictionary-message {flex:0 0 auto!important;}
html body #dictionaryForm>.cabinet-panel {min-height:0!important;overflow:auto!important;overscroll-behavior:contain;padding:4px 4px 12px!important;}
html body #dictionaryForm>.cabinet-panel:not([hidden]) {display:block!important;}
html body #dictionaryForm .cabinet-tabs {display:flex!important;flex-wrap:wrap!important;gap:8px!important;padding:0!important;border:0!important;}
html body #dictionaryForm .cabinet-tab {flex:1 1 auto!important;min-height:42px!important;padding:8px 13px!important;border-radius:15px 18px 16px 17px!important;border:1px solid #c8dce9!important;background:linear-gradient(#fffefb,#edf6fc)!important;white-space:normal!important;}
html body #dictionaryForm .cabinet-tab.is-active {background:#d7eaf7!important;border-color:#7fa8c5!important;}
html body #dictionaryForm .cabinet-field-grid,html body #dictionaryForm .profile-settings {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important;}
html body #dictionaryForm label {display:flex!important;flex-direction:column!important;gap:7px!important;margin:0 0 14px!important;min-width:0!important;}
html body #dictionaryForm label>span {font-weight:650!important;}
html body #dictionaryForm input,html body #dictionaryForm select,html body #dictionaryForm textarea {width:100%!important;min-width:0!important;min-height:44px!important;box-sizing:border-box!important;padding:10px 12px!important;border-radius:12px!important;border:1px solid #cbdde8!important;background:#fffefb!important;}
html body #dictionaryForm input[type=file] {padding:8px!important;}
html body #dictionaryForm select[multiple] {height:150px!important;}
html body #dictionaryForm textarea {min-height:150px!important;resize:vertical!important;}
html body #dictionaryForm .profile-actions {grid-column:1/-1!important;}
html body #dictionaryForm h3 {margin:4px 0 12px!important;}
html body #dictionaryForm .dictionary-actions {display:flex!important;flex-wrap:wrap!important;gap:8px!important;margin:12px 0 18px!important;}
html body #dictionaryForm .cabinet-section {border:1px solid #d8e6ef!important;border-radius:18px!important;padding:16px!important;margin:0 0 14px!important;background:rgba(255,255,255,.65)!important;}
html body #dictionaryForm details.cabinet-section>summary {cursor:pointer;font-weight:700!important;padding:3px 0!important;}
html body #dictionaryForm details[open].cabinet-section>summary {margin-bottom:14px!important;}
html body #dictionaryForm .cabinet-note,html body #dictionaryForm .dictionary-meta {color:#435360!important;font-size:14px!important;line-height:1.5!important;margin:8px 0 14px!important;white-space:normal!important;}
html body #dictionaryForm .cabinet-current-plan {display:flex!important;align-items:baseline!important;gap:12px!important;flex-wrap:wrap!important;padding:14px 16px!important;border-radius:16px!important;background:#e6f1f8!important;margin-bottom:14px!important;}
html body #dictionaryForm .cabinet-current-plan strong {font-size:24px!important;}
html body #dictionaryForm .cabinet-plans {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:12px!important;}
html body #dictionaryForm .cabinet-plan {display:flex!important;flex-direction:column!important;padding:18px!important;border:1px solid #d3e1ea!important;border-radius:20px!important;background:#fffefb!important;}
html body #dictionaryForm .cabinet-plan.is-current {border:2px solid #7aabc5!important;padding:17px!important;}
html body #dictionaryForm .cabinet-plan ul {margin:10px 0 20px!important;padding-left:20px!important;line-height:1.7!important;flex:1!important;}
html body #dictionaryForm .cabinet-plan-price {font-size:24px!important;margin:4px 0!important;}
html body #dictionaryForm .cabinet-plan-price small {font-size:13px!important;}
html body #dictionaryForm button:disabled {cursor:default!important;opacity:.65!important;}
html body #dictionaryForm .dictionary-library {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important;margin:12px 0 20px!important;}
html body #dictionaryForm .dictionary-library-card {display:flex!important;flex-direction:column!important;justify-content:space-between!important;gap:12px!important;min-width:0!important;padding:16px!important;border:1px solid #d3e1ea!important;border-radius:18px!important;background:#fffefb!important;}
html body #dictionaryForm .dictionary-library-card.is-selected {border-color:#78aac5!important;background:#edf7fd!important;}
html body #dictionaryForm .dictionary-library-card p {margin:7px 0!important;font-size:14px!important;line-height:1.4!important;}
html body #dictionaryForm .dictionary-library-card strong {overflow-wrap:anywhere!important;}
html body #dictionaryForm .dictionary-message {margin:0!important;min-height:20px!important;max-height:72px!important;overflow:auto!important;}
html body #dictionaryForm .cabinet-danger {border-color:#e6c7c7!important;}
html body #dictionaryForm .danger {color:#8c2931!important;}
html body #authForm {width:min(430px,100%)!important;max-height:calc(100dvh - 24px)!important;overflow:auto!important;background:linear-gradient(150deg,#fffef9,#edf7fe)!important;border-radius:24px!important;padding:24px!important;}
html body #authForm .auth-language {display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;}
html body #authForm .auth-language select {max-width:200px;min-width:0;min-height:36px;font-size:13px;border:1px solid #c8dce9;border-radius:10px;background:#fffefb;}
html body #authForm .cabinet-check {display:flex;flex-direction:row;align-items:flex-start;gap:9px;font-size:13px;line-height:1.4;}
html body #authForm .cabinet-check input {width:18px!important;min-height:18px!important;height:18px!important;flex:0 0 18px;}
html body #authForm input {min-width:0!important;width:100%!important;box-sizing:border-box!important;}
html body #authForm .auth-help {font-size:14px!important;line-height:1.45!important;}
html body #dictionaryForm [hidden],html body #authForm [hidden] {display:none!important;}
@media(max-width:650px){
 html body #dictionaryModal {padding:6px!important;}
 html body #dictionaryForm {max-height:calc(100dvh - 12px)!important;padding:14px!important;gap:10px!important;border-radius:20px!important;}
 html body #dictionaryForm .cabinet-field-grid,html body #dictionaryForm .profile-settings,html body #dictionaryForm .cabinet-plans,html body #dictionaryForm .dictionary-library {grid-template-columns:minmax(0,1fr)!important;}
 html body #dictionaryForm .cabinet-tab {min-height:38px!important;padding:7px 9px!important;font-size:14px!important;}
 html body #dictionaryForm .voice-choice-list {grid-template-columns:minmax(0,1fr)!important;}
 html body #dictionaryForm .avatar-picker-grid {grid-template-columns:minmax(0,1fr)!important;}
}

/* Avatar menu: direct destinations, identity above, session actions below. */
html body .topbar #userMenuBtn {
  display:flex!important;align-items:center!important;gap:9px!important;
  height:40px!important;min-height:40px!important;padding:4px 11px 4px 5px!important;
  max-width:min(38vw,220px)!important;
}
html body #userMenuBtn .account-menu-avatar {
  display:grid!important;place-items:center!important;flex:0 0 29px!important;
  width:29px!important;height:29px!important;border-radius:50%!important;
  background:#dceef0!important;color:#20383f!important;font-size:14px!important;font-weight:700!important;
}
html body #userMenuBtn .account-menu-name {min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;font-size:15px!important;}
html body #userMenuBtn .account-menu-chevron {font-size:16px!important;opacity:.65!important;}
html body #userDropdown {
  width:250px!important;max-width:calc(100vw - 26px)!important;
  max-height:calc(100dvh - 78px)!important;overflow:auto!important;
  padding:7px!important;top:calc(100% + 8px)!important;right:0!important;
  background:#fffefb!important;border-radius:18px 20px 18px 19px!important;
}
html body #userDropdown[hidden] {display:none!important;}
html body #userDropdown .account-menu-identity {
  display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;
  padding:10px 10px 13px!important;margin-bottom:5px!important;border-bottom:1px solid #dce6ea!important;
}
html body #userDropdown .account-menu-identity>div {display:flex!important;flex-direction:column!important;gap:4px!important;min-width:0!important;}
html body #userDropdown .account-menu-identity strong {font-size:15px!important;font-weight:700!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
html body #userDropdown .account-menu-identity small {font-size:12px!important;color:#5c6670!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;}
html body #userDropdown #accountMenuPlan {padding:4px 7px!important;border:1px solid #d2e0e8!important;border-radius:9px!important;background:#edf6f8!important;font-size:11px!important;font-weight:600!important;}
html body #userDropdown button {
  display:block!important;width:100%!important;text-align:left!important;min-height:39px!important;
  padding:9px 11px!important;font-size:15px!important;font-weight:500!important;line-height:1.25!important;
}
html body #userDropdown button[hidden],html body #userDropdown [hidden] {display:none!important;}
html body #userDropdown button:hover,html body #userDropdown button:focus-visible {background:#edf5f7!important;outline:0!important;}
html body #userDropdown .account-menu-divider {height:1px!important;background:#dce6ea!important;margin:5px 7px!important;}
html body #dictionaryForm .dictionary-message:empty {display:none!important;}
html body #dictionaryForm .cabinet-field-grid:empty {display:none!important;}
html body #dictionaryForm .cabinet-tabs {gap:5px!important;}
html body #dictionaryForm .cabinet-tab {min-height:38px!important;font-size:14px!important;padding:7px 12px!important;font-weight:600!important;}
@media(max-width:560px) {
  html body .topbar #userMenuBtn {max-width:47vw!important;}
  html body #userDropdown {max-height:calc(100dvh - 70px)!important;}
}

/* New avatar settings reuse the existing milk-and-sky controls. */
html body #dictionaryForm .avatar-settings-grid {grid-template-columns:minmax(0,1fr)!important;}
html body #dictionaryForm .avatar-name-field {margin:0!important;}
html body #dictionaryForm .avatar-studio-link {
  width:100%!important;min-height:42px!important;padding:9px 13px!important;
  border:1px solid #c8dce9!important;border-radius:15px 18px 16px 17px!important;
  background:linear-gradient(#fffefb,#edf6fc)!important;
}

html body #dictionaryForm a.avatar-studio-link {display:flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;text-decoration:none!important;}
