/* 1Mail shared components (ui/1Mail-components: actions, fields, feedback, dialog) */

/* Menu (dropdown) */
.om-menu { position: fixed; z-index: 120; min-width: 220px; max-width: 320px; max-height: min(420px, calc(100vh - 24px)); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 44px rgba(16,28,34,.16); padding: 6px;
  animation: om-pop var(--t-quick) var(--ease); }
@keyframes om-pop { from { opacity: 0; transform: translateY(-4px); } }
.om-menu [role=menuitem], .om-menu [role=menuitemcheckbox] { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 12px;
  border: 0; background: transparent; border-radius: 8px; font-size: 13px; text-align: left; cursor: pointer; text-decoration: none; color: var(--text); }
.om-menu [role^=menuitem]:hover, .om-menu [role^=menuitem]:focus-visible { background: var(--hover); outline: none; }
.om-menu [role^=menuitem] .icon { width: 18px; height: 18px; color: var(--text-muted); }
.om-menu .danger, .om-menu .danger .icon { color: var(--action); }
.om-menu .hint { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.om-menu .check { margin-left: auto; color: var(--teal); }
.om-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.om-menu .label { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 8px 12px 4px; }
.om-menu .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Tooltip */
.om-tip { position: fixed; z-index: 130; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; line-height: 1.3; padding: 6px 10px;
  border-radius: 8px; white-space: nowrap; box-shadow: 0 6px 20px rgba(16,28,34,.2); }
.om-tip kbd { font: inherit; font-size: 11px; color: var(--on-ink-muted); margin-left: 6px; }

/* Toast variants */
.toast { min-width: 280px; max-width: min(560px, calc(100vw - 32px)); }
.toast .icon { flex: none; }
.toast.ok .icon { color: #8FD7C9; } .toast.err .icon { color: #FFB8A6; }
.toast span { flex: 1; }

/* Banners (feedback block in the kit) */
.om-banner { display: grid; grid-template-columns: 24px 1fr auto; gap: 14px; align-items: start; padding: 16px 18px; border-radius: 12px; font-size: 13px; }
.om-banner b { display: block; font-size: 14px; }
.om-banner p { margin-top: 4px; color: inherit; opacity: .9; }
.om-banner .act { background: transparent; border: 0; padding: 0; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--action); margin-top: 8px; display: inline-block; }
.om-banner.ok { background: #E3EFEA; color: var(--ink); } .om-banner.ok > .icon { color: var(--teal); }
.om-banner.warn { background: #FCEFD3; color: var(--ink); } .om-banner.warn > .icon { color: var(--warn-text); }
.om-banner.err { background: var(--danger-bg); color: var(--ink); } .om-banner.err > .icon { color: var(--action); }
.om-banner.info { background: var(--chip); border: 1px solid var(--line); color: var(--text); } .om-banner.info > .icon { color: var(--text-muted); }
[data-theme="dark"] .om-banner.ok { background: var(--teal-soft); color: var(--text); }
[data-theme="dark"] .om-banner.warn, [data-theme="dark"] .om-banner.err { color: var(--text); }
.offline-bar { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 110; display: flex; gap: 12px; align-items: center;
  background: #FCEFD3; color: var(--ink); border-radius: 12px; padding: 10px 16px; font-size: 13px; box-shadow: 0 10px 30px rgba(16,28,34,.15); }
.offline-bar .icon { color: var(--warn-text); }

/* Checkbox */
.om-check { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; cursor: pointer; }
.om-check input { position: absolute; inset: -10px; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.om-check span { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #9AA6AB; background: var(--surface); display: grid; place-items: center;
  transition: background var(--t-quick) var(--ease), border-color var(--t-quick) var(--ease); }
.om-check span::after { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.om-check input:checked + span { background: var(--teal); border-color: var(--teal); }
.om-check input:checked + span::after { opacity: 1; }
.om-check input:indeterminate + span { background: var(--teal); border-color: var(--teal); }
.om-check input:indeterminate + span::after { opacity: 1; border-width: 0 0 2px 0; transform: none; width: 9px; height: 0; }
.om-check input:focus-visible + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--teal); }

/* Password field */
.om-pass { position: relative; }
.om-pass .input { padding-right: 48px; }
.om-pass .icon-btn { position: absolute; right: 0; top: 0; color: var(--text-muted); }
.om-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.om-meter i { height: 4px; border-radius: 2px; background: var(--line); transition: background var(--t-default) var(--ease); }
.om-meter[data-s="1"] i:nth-child(-n+1) { background: var(--action); }
.om-meter[data-s="2"] i:nth-child(-n+2) { background: #D9952B; }
.om-meter[data-s="3"] i:nth-child(-n+3) { background: var(--teal); }
.om-meter[data-s="4"] i { background: var(--teal); }
.om-meter-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Copy button */
.om-copy { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); font-size: 12px; font-weight: 700; cursor: pointer; color: var(--text); }
.om-copy:hover { background: var(--hover); }
.om-copy.done { color: var(--teal); border-color: var(--teal); }
.om-copy .icon { width: 16px; height: 16px; }

/* Keyboard hints */
kbd.k { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 7px; border: 1px solid var(--line);
  border-bottom-width: 2px; background: var(--surface); font: 700 12px var(--font); color: var(--text); }
.om-keys { display: grid; grid-template-columns: 1fr auto; gap: 10px 24px; align-items: center; font-size: 13px; }
.om-keys > span:nth-child(even) { display: flex; gap: 4px; justify-content: flex-end; }

/* Skeleton */
.om-skel { border-radius: 6px; background: linear-gradient(90deg, var(--hover) 0%, var(--line) 50%, var(--hover) 100%); background-size: 200% 100%;
  animation: om-shimmer 1.4s linear infinite; }
@keyframes om-shimmer { to { background-position: -200% 0; } }

/* Drawer (side panel) */
.om-drawer-back { position: fixed; inset: 0; background: rgba(16,28,34,.35); z-index: 85; animation: om-fade var(--t-default) var(--ease); }
@keyframes om-fade { from { opacity: 0; } }
.om-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--surface); z-index: 86; display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(16,28,34,.18); animation: om-slide var(--t-panel) var(--ease); }
@keyframes om-slide { from { transform: translateX(32px); opacity: .4; } }
.om-drawer header { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px 28px; border-bottom: 1px solid var(--line); }
.om-drawer header h2 { font-size: 20px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.om-drawer .body { flex: 1; overflow-y: auto; padding: 24px 28px; display: grid; gap: 22px; align-content: start; }
.om-drawer footer { padding: 16px 28px; border-top: 1px solid var(--line); display: flex; gap: 12px; justify-content: flex-end; }

/* Accordion */
.om-acc { border-top: 1px solid var(--line); }
.om-acc details { border-bottom: 1px solid var(--line); }
.om-acc summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; cursor: pointer; font-size: 18px; font-weight: 700; }
.om-acc summary::-webkit-details-marker { display: none; }
.om-acc summary .icon { transition: transform var(--t-default) var(--ease); color: var(--text-muted); flex: none; }
.om-acc details[open] summary .icon { transform: rotate(45deg); color: var(--action); }
.om-acc .a { padding: 0 48px 24px 0; color: var(--text-muted); font-size: 15px; line-height: 1.65; max-width: 760px; }

/* Danger primary */
.btn-danger { background: var(--action); color: #fff; }
.btn-danger:hover { background: #A3301F; }

/* Modal polish */
.modal .lead { color: var(--text-muted); font-size: 14px; line-height: 1.55; }
.modal .actions { margin-top: 4px; }
.modal-back { animation: om-fade var(--t-default) var(--ease); }
.modal { animation: om-pop var(--t-default) var(--ease); }
