/* arrange-meeting.css — "Arrange meeting" modal (mail view actions menu).
   Built on the css/ui.css tokens, so light/dark follow the theme with no extra rules.
   Switches reuse the house .switch (index.php: input + .track + .thumb). */

#arrMtgModal .am-panel { max-width: 34rem; max-height: min(94vh, 100svh); display: flex; flex-direction: column; overflow: hidden; }
#arrMtgModal .am-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
#arrMtgModal .am-head h2 { font-size: var(--fs-lg); font-weight: 600; margin: 0; display: flex; align-items: center; gap: .5rem; }
#arrMtgModal .am-head h2 i { color: var(--accent); }
#arrMtgModal .am-body { padding: 1rem; overflow-y: auto; flex: 1 1 auto; display: flex; flex-direction: column; gap: 1rem; -webkit-overflow-scrolling: touch; }
#arrMtgModal .am-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; padding: .75rem 1rem; border-top: 1px solid var(--border); flex: 0 0 auto; }
#arrMtgModal .am-foot .am-hint { font-size: var(--fs-xs); color: var(--text-muted); min-width: 0; flex: 1 1 10rem; }
#arrMtgModal .am-foot .am-btns { display: flex; gap: .5rem; margin-left: auto; }

#arrMtgModal .am-label { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: .35rem; }
#arrMtgModal .am-label .am-opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-faint); }
#arrMtgModal .am-input { width: 100%; box-sizing: border-box; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: .75rem; padding: .55rem .85rem; font-size: var(--fs-md); font-family: inherit; }
#arrMtgModal textarea.am-input { resize: vertical; min-height: 4.2rem; line-height: 1.4; }
#arrMtgModal .am-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
#arrMtgModal .am-input::placeholder { color: var(--text-faint); }

/* Video / In person segmented control */
#arrMtgModal .am-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9999px; }
#arrMtgModal .am-seg button { border: 0; background: transparent; color: var(--text-2); border-radius: 9999px; padding: .5rem .75rem; font-size: var(--fs-md); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; transition: background .15s, color .15s, box-shadow .15s; min-height: 38px; }
#arrMtgModal .am-seg button[aria-checked="true"] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-1); }
#arrMtgModal .am-seg button:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 1px; }

/* People */
#arrMtgModal .am-people { display: flex; flex-direction: column; gap: .5rem; }
#arrMtgModal .am-person { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: .85rem; background: var(--surface); }
#arrMtgModal .am-avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9999px; display: grid; place-items: center; font-size: var(--fs-sm); font-weight: 700; color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
#arrMtgModal .am-pmain { min-width: 0; flex: 1 1 auto; }
#arrMtgModal .am-pname { font-size: var(--fs-md); font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#arrMtgModal .am-pemail { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#arrMtgModal .am-chip { display: inline-flex; align-items: center; gap: .3rem; margin-top: .25rem; padding: .1rem .5rem; border-radius: 9999px; font-size: var(--fs-2xs); font-weight: 600; max-width: 100%; }
#arrMtgModal .am-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#arrMtgModal .am-chip.ok { background: var(--success-soft); color: var(--success); }
#arrMtgModal .am-chip.no { background: var(--warn-soft); color: var(--warn); }
#arrMtgModal .am-chip.wait { background: var(--surface-2); color: var(--text-muted); }
#arrMtgModal .am-chip.sender { background: var(--accent-soft); color: var(--accent); margin-left: .35rem; }
#arrMtgModal .am-pside { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
#arrMtgModal .am-addcrm { display: flex; align-items: center; gap: .45rem; font-size: var(--fs-2xs); color: var(--text-2); font-weight: 600; cursor: pointer; user-select: none; }
#arrMtgModal .am-note { font-size: var(--fs-2xs); color: var(--text-muted); margin-top: .2rem; }
#arrMtgModal .am-x { flex: 0 0 auto; width: 30px; height: 30px; border: 0; border-radius: 9999px; background: transparent; color: var(--text-faint); cursor: pointer; display: grid; place-items: center; }
#arrMtgModal .am-x:hover { background: var(--surface-2); color: var(--danger); }
#arrMtgModal .am-add { display: flex; gap: .5rem; }
#arrMtgModal .am-add .am-input { flex: 1 1 auto; }
#arrMtgModal .am-empty { padding: .75rem; text-align: center; font-size: var(--fs-sm); color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: .85rem; }

/* When: custom date + time picker (no native date/time inputs) */
#arrMtgModal .am-when { position: relative; }
#arrMtgModal .am-whenbtn { width: 100%; display: flex; align-items: center; gap: .6rem; text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: .75rem; padding: .6rem .85rem; font-size: var(--fs-md); cursor: pointer; font-family: inherit; }
#arrMtgModal .am-whenbtn i { color: var(--accent); }
#arrMtgModal .am-whenbtn .am-ph { color: var(--text-faint); }
#arrMtgModal .am-whenbtn:focus-visible, #arrMtgModal .am-whenbtn[aria-expanded="true"] { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
#arrMtgModal .am-quick { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
#arrMtgModal .am-quick button { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 9999px; padding: .3rem .7rem; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; font-family: inherit; }
#arrMtgModal .am-quick button:hover { background: var(--surface-2); }
#arrMtgModal .am-quick button.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.am-pop { position: fixed; z-index: var(--z-popover, 90); background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 1rem; box-shadow: var(--shadow-2); padding: .75rem; display: flex; gap: .75rem; max-width: calc(100vw - 16px); box-sizing: border-box; }
.am-pop[hidden] { display: none; }
.am-cal { width: 15.5rem; flex: 0 0 auto; }
.am-calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.am-calhead b { font-size: var(--fs-md); }
.am-calhead button { width: 30px; height: 30px; border: 0; border-radius: 9999px; background: transparent; color: var(--text-2); cursor: pointer; }
.am-calhead button:hover { background: var(--surface-2); }
.am-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.am-grid .am-dow { font-size: var(--fs-2xs); color: var(--text-faint); font-weight: 600; padding: .2rem 0; }
.am-grid button { border: 0; background: transparent; color: var(--text); border-radius: 9999px; aspect-ratio: 1; font-size: var(--fs-sm); cursor: pointer; font-family: inherit; }
.am-grid button:hover:not(:disabled) { background: var(--surface-2); }
.am-grid button.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.am-grid button.sel { background: var(--accent); color: var(--on-accent); }
.am-grid button:disabled { color: var(--text-faint); opacity: .45; cursor: default; }
.am-grid button.out { color: var(--text-faint); }
.am-times { width: 6.2rem; flex: 0 0 auto; display: flex; flex-direction: column; min-height: 0; }
.am-times .am-tlabel { font-size: var(--fs-2xs); color: var(--text-faint); font-weight: 600; text-transform: uppercase; margin-bottom: .3rem; }
.am-tlist { overflow-y: auto; max-height: 15.5rem; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; -webkit-overflow-scrolling: touch; }
.am-tlist button { border: 0; background: transparent; color: var(--text); border-radius: .5rem; padding: .35rem .5rem; font-size: var(--fs-sm); text-align: center; cursor: pointer; font-variant-numeric: tabular-nums; font-family: inherit; }
.am-tlist button:hover { background: var(--surface-2); }
.am-tlist button.sel { background: var(--accent); color: var(--on-accent); }
@media (max-width: 520px) {
  .am-pop { left: 8px !important; right: 8px; flex-direction: column; max-height: 80vh; overflow-y: auto; }
  .am-cal { width: 100%; }
  .am-grid button { aspect-ratio: auto; height: 36px; }
  .am-times { width: 100%; }
  .am-tlist { flex-direction: row; flex-wrap: wrap; max-height: 8.5rem; }
  .am-tlist button { flex: 0 0 calc(25% - 2px); }
  #arrMtgModal .am-person { flex-wrap: wrap; position: relative; padding-right: 2.6rem; }
  #arrMtgModal .am-person .am-x { position: absolute; top: .45rem; right: .4rem; }
  #arrMtgModal .am-person .am-pmain { flex: 1 1 0; }
  #arrMtgModal .am-pside { flex: 1 0 100%; flex-direction: row; align-items: center; margin-left: 42px; }
  #arrMtgModal .am-pside:not(:has(.am-addcrm)) { display: none; }
}

/* Result */
#arrMtgModal .am-done { text-align: center; padding: 1rem .5rem; display: flex; flex-direction: column; gap: .75rem; align-items: center; }
#arrMtgModal .am-done .am-tick { width: 56px; height: 56px; border-radius: 9999px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); font-size: 26px; }
#arrMtgModal .am-done h3 { margin: 0; font-size: var(--fs-xl); font-weight: 600; }
#arrMtgModal .am-done p { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
#arrMtgModal .am-join { width: 100%; display: flex; gap: .5rem; align-items: center; padding: .55rem .65rem; border: 1px solid var(--border-strong); border-radius: .85rem; background: var(--surface-2); text-align: left; }
#arrMtgModal .am-join a { flex: 1 1 auto; min-width: 0; color: var(--accent); font-size: var(--fs-sm); word-break: break-all; text-decoration: none; }
#arrMtgModal .am-warn { width: 100%; text-align: left; padding: .6rem .75rem; border-radius: .85rem; background: var(--warn-soft); color: var(--warn); font-size: var(--fs-xs); }
#arrMtgModal .am-err { padding: .6rem .75rem; border-radius: .85rem; background: var(--danger-soft); color: var(--danger); font-size: var(--fs-sm); }
#arrMtgModal .am-spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: am-spin .7s linear infinite; vertical-align: -2px; margin-right: .4rem; }
@keyframes am-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #arrMtgModal .am-spin { animation-duration: 2s; } }

/* the two menu items start hidden; .menu-item's own display would beat a bare .hidden in some menus */
#arrangeMeetingBtn.hidden, .menu-item[data-act="arrange-meeting"].hidden { display: none !important; }

/* suggestion read from the email by the LLM */
#arrMtgModal .am-sug { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: .6rem; padding: .55rem .7rem; font-size: var(--fs-sm); color: var(--text-2); }
#arrMtgModal .am-sughead { display: flex; gap: .45rem; align-items: baseline; }
#arrMtgModal .am-sughead i { color: var(--accent); }
#arrMtgModal .am-sughead b { color: var(--text); }
#arrMtgModal .am-sugq { margin-top: .3rem; font-style: italic; color: var(--text-muted); font-size: var(--fs-xs); overflow-wrap: anywhere; }
#arrMtgModal .am-sugopts { margin-top: .45rem; }
