/*
 * DOM/CSS port of the local Jitsi fork's app-ui components. Original files and
 * checksums: docs/ui-kit-source/. See docs/ui-kit-adaptation.md for the mapping.
 * This file owns shared controls; feature styles own placement, not variants.
 */
button { -webkit-user-select: none; user-select: none; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; opacity: .4; }
button:focus-visible, a:focus-visible, summary:focus-visible,
input[type="checkbox"]:focus-visible, input[type="range"]:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
::selection { color: var(--foreground); background: var(--selection); }
mark { color: var(--warning); background: var(--warning-bg); }

/* Button: source sizes 32/36/44; softer, narrower geometry requested for Meetvo. */
.btn, .icon-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--foreground);
  background: var(--input);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn svg, .icon-btn svg { width: 16px; height: 16px; }
.btn:hover:enabled, .icon-btn:hover:enabled { background: var(--hover); }
.btn:active:enabled, .icon-btn:active:enabled { transform: none; background: var(--secondary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn.primary:hover:enabled { background: var(--primary); filter: brightness(.92); }
.btn.primary:active:enabled { filter: brightness(.86); }
.btn.soft { background: var(--secondary); border-color: transparent; color: var(--foreground); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { background: var(--hangup); border-color: var(--hangup); color: var(--hangup-foreground); }
.btn.danger:hover:enabled { background: var(--hangup-hover); border-color: var(--hangup-hover); }
.btn:disabled, .icon-btn:disabled { filter: none; transform: none; }
.btn.sm, .meeting-row .btn { height: 32px; min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 44px; min-height: 44px; padding: 0 16px; border-radius: 14px; font-size: 15px; }
.icon-btn { width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; border-color: transparent; background: transparent; color: var(--muted-foreground); }
.icon-btn:hover:enabled { color: var(--foreground); }
.icon-btn svg { width: 18px; height: 18px; }
.text-button { border-radius: 8px; font-weight: 500; }

/* Input/Field: input.tsx + field.tsx — a soft outer focus, one border. */
.field { display: flex; flex-direction: column; min-width: 0; margin-bottom: 20px; }
.field > span, .small-label { font-size: 13px; line-height: 20px; font-weight: 500; margin-bottom: 8px; color: var(--foreground); }
.field input, .field textarea {
  width: 100%; min-width: 0; min-height: 36px; padding: 7px 12px;
  border: 1px solid var(--input-border); border-radius: 8px;
  color: var(--foreground); background: var(--input);
  font-size: 14px; line-height: 20px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 84px; padding-block: 10px; line-height: 22px; resize: vertical; }
.field small { margin-top: 8px; color: var(--muted-foreground); font-size: 13px; line-height: 20px; }
.field :is(input,textarea):focus-visible {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px var(--focus);
}
.field :is(input,textarea):disabled,
.field :is(input,textarea):read-only { background: var(--sunken); color: var(--body); }
.field :is(input,textarea):disabled { cursor: not-allowed; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field :is(input,textarea)::placeholder { color: var(--muted-foreground); opacity: 1; }
.search, .archive-search > div, .chat-compose form, .light-compose form {
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within, .archive-search > div:focus-within {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px var(--focus);
}
.chat-compose form:focus-within, .light-compose form:focus-within {
  border-color: var(--border-strong);
  box-shadow: none;
}
.search input:focus, .archive-search input:focus,
.chat-compose input:focus, .light-compose input:focus { outline: none; box-shadow: none; }

/* Tabs: tabs.tsx — 40 px, 2 px underline, rounded keyboard focus inside scroll area. */
.tabs, .meeting-filters {
  display: flex; align-items: stretch; gap: 24px;
  padding: 0; border: 0; border-radius: 0; background: transparent;
  box-shadow: inset 0 -1px 0 var(--border);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.tabs button, .detail-tabs button, .meeting-filters button {
  position: relative; display: inline-flex; flex: 0 0 auto;
  align-items: center; justify-content: center; gap: 6px;
  height: 40px; min-height: 40px; padding: 0;
  border: 0; border-bottom: 2px solid transparent; border-radius: 4px 4px 0 0;
  color: var(--muted-foreground); background: transparent; box-shadow: none;
  font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap;
}
.tabs button:hover:enabled, .meeting-filters button:hover:enabled { color: var(--foreground); }
.tabs button.active, .meeting-filters button.active { color: var(--foreground); background: transparent; border-bottom-color: var(--foreground); box-shadow: none; }
.tabs button.active:after, .meeting-filters button.active:after { content: none; }
.tabs button:focus-visible, .meeting-filters button:focus-visible { outline-offset: -2px; }
.detail-tabs button svg { display: none; }

/* Badge/Avatar/Switch: direct dimensions and neutral variants from app-ui. */
.chip { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; height: 22px; min-height: 22px; padding: 0 8px; border: 0; border-radius: 6px; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; background: var(--secondary); color: var(--body); }
.chip svg { width: 13px; height: 13px; }
.chip.muted, .chip.purple { background: var(--secondary); color: var(--body); }
.chip.green { background: var(--success-bg); color: var(--success); }
.chip.amber { background: var(--warning-bg); color: var(--warning); }
.chip.red { background: var(--danger-bg); color: var(--danger); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; overflow: hidden; border: 0; border-radius: 50%; background: var(--secondary); color: var(--body); font-size: 12px; font-weight: 600; letter-spacing: 0; user-select: none; }
.avatar.online:after { content: none; }
.toggle { position: relative; flex-shrink: 0; width: 36px; min-width: 36px; height: 20px; min-height: 20px; padding: 0; border-radius: 8px; background: transparent; }
.toggle:before { content: ""; position: absolute; left: 0; top: 0; width: 36px; height: 20px; border-radius: 20px; background: var(--switch-off); transition: background-color .15s; }
.toggle:after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: var(--knob); transition: transform .15s; }
.toggle.on:before { background: var(--primary); }
.toggle.on:after { transform: translateX(16px); }

/* EmptyState/IconTile: page.tsx. Keep copy in one group; no independent centring. */
.empty-state { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 24px; border: 0; border-radius: 0; background: transparent; text-align: left; }
.empty-state-copy { display: flex; min-width: 0; flex: 1 1 280px; flex-direction: column; gap: 4px; }
.empty-state .empty-icon { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; flex-shrink: 0; margin: 0; border-radius: 8px; background: var(--secondary); color: var(--body); }
.empty-state .empty-icon svg { width: 18px; height: 18px; margin: 0; }
.empty-state h2 { margin: 0; color: var(--foreground); font-size: 15px; line-height: 22px; font-weight: 600; letter-spacing: 0; }
.empty-state p { margin: 0; max-width: 72ch; color: var(--muted-foreground); font-size: 13px; line-height: 20px; }
.empty-state > .btn { margin: 0; }
.empty-state.processing-card, .empty-state.locked-card { min-height: 0; }
.empty, .processing-card:not(.empty-state), .locked-card:not(.empty-state) {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 48px 24px; border: 0; border-radius: 0; background: transparent;
  text-align: center; color: var(--muted-foreground); font-size: 14px; line-height: 22px;
}
.empty h2, .processing-card:not(.empty-state) h2, .locked-card:not(.empty-state) h2 { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; letter-spacing: 0; }
.empty p, .processing-card:not(.empty-state) p, .locked-card:not(.empty-state) p { width: 100%; max-width: 460px; margin: 0 auto; font-size: 13px; line-height: 20px; }
.empty > svg, .processing-card:not(.empty-state) > svg, .locked-card:not(.empty-state) > svg { width: 24px; height: 24px; margin: 0 0 8px; }
.empty .empty-icon, .processing-icon { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 0 8px; border-radius: 8px; background: var(--secondary); color: var(--body); }
.empty .empty-icon svg, .processing-icon svg { width: 18px; height: 18px; margin: 0; }
.empty .btn, .processing-card:not(.empty-state) .btn, .locked-card:not(.empty-state) .btn { margin-top: 8px; }

/* Chat shares the input shell; the archived conversation is a flat reading surface. */
.chat-compose form, .light-compose form { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--input-border); border-radius: 20px; background: var(--sunken); }
.chat-compose input, .light-compose input { flex: 1; width: 100%; min-width: 0; min-height: 32px; padding: 6px 12px; border: 0; border-radius: 0; color: var(--foreground); background: transparent; font-size: 14px; line-height: 22px; }
.chat-compose input::placeholder, .light-compose input::placeholder { color: var(--muted-foreground); }
.chat-compose button, .light-compose button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--primary); color: var(--primary-foreground); }
.detail-chat { min-height: 0; max-width: 840px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.detail-chat .chat-message .avatar { width: 28px; height: 28px; font-size: 11px; }
.detail-chat .chat-message .message-body { flex: 0 1 auto; max-width: min(85%, 68ch); }
.detail-chat .chat-message header { gap: 16px; font-size: 13px; font-weight: 500; }
.detail-chat .chat-message time { font-size: 12px; }
.detail-chat .chat-message p { width: fit-content; max-width: 100%; padding: 6px 12px; border: 0; border-radius: 16px; font-size: 14px; line-height: 22px; }
.chat-readonly { display: flex; align-items: center; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted-foreground); font-size: 13px; line-height: 20px; }
.chat-readonly svg { width: 16px; height: 16px; }
span.message-reaction { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 24px; border-radius: 6px; cursor: default; }

@media (max-width: 760px) {
  .btn, .icon-btn { min-height: 44px; height: 44px; }
  .icon-btn { min-width: 44px; width: 44px; }
  .meeting-row .btn { min-height: 44px; height: 44px; }
  .tabs, .meeting-filters { gap: 24px; }
  .meeting-filters { display: none; }
  .tabs button, .meeting-filters button { min-height: 44px; height: 44px; }
  .field input, .field textarea { min-height: 44px; font-size: 16px; }
  .toggle { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
  .toggle:before { left: 4px; top: 12px; }
  .toggle:after { left: 6px; top: 14px; }
  .empty-state { padding: 24px 0; align-items: flex-start; }
  .empty-state-copy { flex-basis: 220px; }
  .empty-state > .btn { margin-left: 52px; }
  .detail-chat { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .icon-btn, .field :is(input,textarea), .toggle:before, .toggle:after { transition: none; }
}
