/* UZOR UI contract: Telegram Web A's Roboto, served from our own origin. */
@font-face {
  font-family: "Uzor Roboto";
  src: url("/fonts/roboto/Roboto-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Ordinary tables share RNP geometry/selection without gaining write access. */
.ui-table-scroll { max-width: 100%; min-width: 0; overflow: auto; scrollbar-gutter: stable; }
.ui-table-managed { border-collapse: separate !important; border-spacing: 0 !important; }
.ui-table-managed :is(th,td) { box-sizing: border-box; overflow-wrap: anywhere; }
.ui-table-managed :is(input,select,textarea,button) { box-sizing: border-box; min-width: 0 !important; max-width: 100% !important; }
.ui-table-managed button { overflow: hidden; text-overflow: ellipsis; }
.ui-table-managed .ui-sticky-first { position: sticky !important; left: 0; z-index: 1; background-color: var(--surface, #fff); }
.ui-table-managed thead th { position: sticky; top: 0; z-index: 2; }
.ui-table-managed thead .ui-sticky-first { z-index: 3; }
.ui-table-managed tfoot :is(th,td) { position: sticky; bottom: 0; z-index: 2; background-color: #eef4f6; }
.ui-table-managed tfoot .ui-sticky-first { z-index: 3; }
.ui-col-resizer, .ui-row-resizer { opacity: 0; transition: opacity 120ms ease, background-color 120ms ease; }
.ui-table-managed:hover .ui-col-resizer, .ui-table-managed:hover .ui-row-resizer, .ui-table-managed:focus-within .ui-col-resizer, .ui-table-managed:focus-within .ui-row-resizer { opacity: 1; }
.ui-col-resizer { position: absolute; top: 0; bottom: 0; right: 0; width: 7px; z-index: 8; cursor: col-resize; touch-action: none; border-right: 1px solid #2688eb55; }
.ui-row-resizer { position: absolute; bottom: 0; left: 0; right: 0; height: 7px; z-index: 8; cursor: row-resize; touch-action: none; border-bottom: 1px solid #2688eb55; }
.ui-col-resizer:hover, .ui-row-resizer:hover { opacity: 1; background: #2688eb66; }
.ui-table-managed .ui-cell-selected { outline: 2px solid #2688eb; outline-offset: -2px; background-image: linear-gradient(#2688eb18,#2688eb18); }
.ui-table-cell-content { display: contents; }
.ui-table-managed .ui-sized-row > :is(th,td) { height: inherit !important; min-height: 0 !important; padding-block: 0 !important; overflow: hidden; }
.ui-sized-row > :is(th,td) > .ui-table-cell-content { position: absolute; display: block; inset: 0; overflow: hidden; padding: 3px 5px; box-sizing: border-box; }
.ui-table-dragging { user-select: none; }
dialog { max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
dialog :is(input,select,textarea) { max-width: 100%; min-width: 0; box-sizing: border-box; }
dialog :is(h1,h2,h3,p,label,small) { overflow-wrap: anywhere; }
@font-face {
  font-family: "Uzor Roboto";
  src: url("/fonts/roboto/Roboto-Italic-Variable.ttf") format("truetype");
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --ui-font: "Uzor Roboto", Roboto, "Segoe UI", Arial, sans-serif;
  --page-title-font: var(--ui-font);
  --ui-feedback-color: #2688eb;
}
html, body, body * { font-family: var(--ui-font) !important; }

/* Important declarations in a named layer beat legacy unlayered !important
   controls (including selectors with IDs), without a specificity arms race. */
@layer uzor-feedback {
/* Do not change geometry or replace the semantic selected/active-tab state. */
:is(button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"], summary, .file-button, .template-download, a.block-tab, a[class*="button"]) {
  transition: filter 120ms ease, outline-color 120ms ease !important;
  transform: none !important;
  -webkit-tap-highlight-color: rgba(38, 136, 235, .25);
}
@media (hover: hover) {
  :is(button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"], summary, .file-button, .template-download, a.block-tab, a[class*="button"]):not(:disabled):not([aria-disabled="true"]):hover {
    filter: brightness(.94) !important;
    outline: 2px solid rgba(38, 136, 235, .5) !important;
    outline-offset: 2px !important;
  }
}
:is(button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"], summary, .file-button, .template-download, a.block-tab, a[class*="button"]):focus-visible {
  outline: 3px solid var(--ui-feedback-color) !important;
  outline-offset: 3px !important;
}
:is(button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"], summary, .file-button, .template-download, a.block-tab, a[class*="button"]):not(:disabled):not([aria-disabled="true"]):active,
[data-ui-feedback="pressed"] {
  filter: brightness(.84) !important;
  outline: 3px solid var(--ui-feedback-color) !important;
  outline-offset: 2px !important;
}
body :is(button:disabled, input[type="submit"]:disabled, [aria-disabled="true"]) { cursor: not-allowed; }
[data-ui-feedback="pending"], [aria-busy="true"] {
  outline: 2px solid var(--ui-feedback-color) !important;
  outline-offset: 2px !important;
  animation: ui-pending 1.1s ease-in-out infinite !important;
  cursor: progress !important;
}
[data-ui-feedback="response"], .ui-data-updated {
  outline: 2px solid var(--ui-feedback-color) !important;
  outline-offset: -2px !important;
  animation: ui-updated 950ms ease-out !important;
}
[data-ui-feedback="error"] {
  outline: 3px solid #c03935 !important;
  outline-offset: 2px !important;
}
.ui-request-feedback {
  position: fixed; z-index: 2147483647;
  inset: auto; margin: 0;
  right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 9px;
  max-width: min(360px, calc(100vw - 32px)); padding: 11px 14px;
  border: 1px solid #bfd8ee; border-radius: 10px;
  background: #edf6ff; color: #174974;
  font-size: 13px; line-height: 1.4; overflow-wrap: anywhere;
  box-shadow: 0 4px 20px #14273924; pointer-events: none;
}
.ui-request-feedback[hidden] { display: none !important; }
.ui-request-feedback[data-state="pending"]::before {
  content: ""; flex: 0 0 14px; width: 14px; height: 14px;
  border: 2px solid #a9ccef; border-top-color: #2688eb; border-radius: 50%;
  animation: ui-spin 750ms linear infinite;
}
.ui-request-feedback[data-state="error"] { background: #fff1f0; color: #9e2825; border-color: #e3aaa7; }
@keyframes ui-spin { to { rotate: 360deg; } }
@keyframes ui-pending { 50% { outline-color: #86b9ec; } }
@keyframes ui-updated { from { outline-color: #2688eb; } to { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) {
  body * { transition-duration: 0s !important; }
  [data-ui-feedback], .ui-data-updated, .ui-request-feedback::before { animation: none !important; }
}
}
