.portal-language-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--portal-accent, #17324d), transparent 68%);
  border-radius: 9px;
  background: color-mix(in srgb, var(--portal-surface, #f4f1ea), #fff 45%);
  box-shadow: 0 4px 14px rgba(16, 24, 32, .08);
}

.portal-language-switch button {
  min-height: 34px;
  padding: 5px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #17324d;
  font: 700 12px/1.25 Inter, "Segoe UI", Cairo, sans-serif;
  cursor: pointer;
}

.portal-language-switch button.active {
  background: var(--portal-accent, #17324d);
  color: var(--portal-action-text, #f4f1ea);
}

.portal-language-switch-settings {
  width: 100%;
  margin-top: 10px;
}

.portal-digit-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.portal-digit-switch button {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 68px;
  padding: 9px 7px;
  border: 1px solid color-mix(in srgb, var(--portal-accent, #17324d), transparent 68%);
  border-radius: 10px;
  background: color-mix(in srgb, var(--portal-surface, #f4f1ea), #fff 45%);
  color: var(--portal-ink, #101820);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.portal-digit-switch button b {
  font: 800 21px/1 Inter, "Segoe UI", Cairo, sans-serif;
  letter-spacing: .02em;
}

.portal-digit-switch button span {
  font: 700 11px/1.35 Inter, "Segoe UI", Cairo, sans-serif;
}

.portal-digit-switch button small {
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor, transparent 88%);
  font: 700 9px/1.2 Inter, "Segoe UI", Cairo, sans-serif;
}

.portal-digit-switch button:is(:hover, :focus-visible) {
  border-color: var(--portal-accent, #17324d);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-accent, #17324d), transparent 82%);
}

.portal-digit-switch button.active {
  border-color: var(--portal-accent, #17324d);
  background: var(--portal-accent, #17324d);
  color: var(--portal-action-text, #f4f1ea);
}

body.portal-lang-en {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body.portal-lang-en :is(.sidebar, .content, .topbar, dialog, .auth-shell) {
  text-align: left;
}

body.portal-lang-en :is(input, textarea, select):not([dir="ltr"]) {
  text-align: left;
}

body.portal-lang-en .nav-item,
body.portal-lang-en .sidebar-appearance-entry,
body.portal-lang-en .surface-title,
body.portal-lang-en .dialog-head,
body.portal-lang-en .workspace-settings-hero {
  text-align: left;
}

@media (min-width: 921px) {
  html body.portal-lang-en[data-dashboard-theme] .portal {
    direction: ltr !important;
  }

  html body.portal-lang-en[data-dashboard-theme] .workspace,
  html body.portal-lang-en[data-dashboard-theme] .topbar > * {
    direction: ltr;
  }
}

@media (max-width: 920px) {
  html body.portal-lang-en[data-dashboard-theme] .portal,
  html body.portal-lang-en[data-dashboard-theme] .topbar {
    direction: ltr !important;
  }

  html body.portal-lang-en[data-dashboard-theme] .sidebar {
    inset: 0 auto 0 0 !important;
    transform: translateX(-105%);
  }

  html body.portal-lang-en[data-dashboard-theme] .portal.menu-open .sidebar {
    transform: translateX(0);
  }
}
/* A consistent localized file picker prevents browser-owned English copy
   such as "No file chosen" from leaking into the Arabic interface. */
.portal-file-native {
  position: absolute !important;
  inline-size: 1px !important;
  block-size: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.portal-file-control {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-inline-size: 0;
  margin-block-start: .4rem;
}

.portal-file-button {
  flex: 0 0 auto;
  min-block-size: 2.35rem;
  padding: .45rem .85rem;
  border: 1px solid color-mix(in srgb, var(--accent, #173a58) 40%, transparent);
  border-radius: .65rem;
  background: var(--accent, #173a58);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.portal-file-name {
  min-inline-size: 0;
  overflow: hidden;
  color: var(--muted, #667085);
  font-size: .84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-file-button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent, #173a58) 30%, transparent);
  outline-offset: 2px;
}

.portal-temporal-control {
  position: relative;
  display: block;
  min-inline-size: 0;
  inline-size: 100%;
}

.portal-temporal-control > input {
  inline-size: 100%;
}

.portal-temporal-placeholder {
  display: none;
  position: absolute;
  inset-inline: .8rem 2.65rem;
  inset-block-start: 50%;
  overflow: hidden;
  color: var(--muted, #667085);
  font-size: .86rem;
  line-height: 1;
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translateY(-50%);
  white-space: nowrap;
}

body.portal-lang-ar .portal-temporal-control:not(.has-value):not(:focus-within) .portal-temporal-placeholder {
  display: block;
}

body.portal-lang-ar .portal-temporal-control:not(.has-value):not(:focus-within) input::-webkit-datetime-edit {
  opacity: 0;
}
