
:root {
      --bg: #f5f7fb;
      --bg-soft: #eef3fb;
      --surface: rgba(255, 255, 255, 0.92);
      --surface-solid: #ffffff;
      --surface-muted: #f8fafc;
      --border: #d8dde8;
      --border-soft: #e7ebf3;
      --text-main: #111827;
      --text-muted: #6b7280;
      --text-soft: #94a3b8;
      --primary: #2563eb;
      --primary-strong: #1d4ed8;
      --primary-soft: #e9f0ff;
      --danger-soft: #fef2f2;
      --danger: #b91c1c;
      --success-soft: #dcfce7;
      --success: #15803d;
      --warning-soft: #fef3c7;
      --warning: #b45309;
      --shadow-card: 0 18px 40px rgba(15, 23, 42, 0.08);
      --shadow-float: 0 24px 60px rgba(15, 23, 42, 0.16);
      --radius-xl: 24px;
      --radius-lg: 18px;
      --radius-md: 14px;
      --radius-sm: 12px;
      --container-width: 980px;
      --transition-fast: 160ms ease;
      --app-background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.12), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 42%, #f3f5fa 100%);
    }

    * {
      box-sizing: border-box;
    }

    *::before,
    *::after {
      box-sizing: border-box;
    }

    [hidden] {
      display: none !important;
    }

    html,
    body {
      min-height: 100%;
    }

body {
      margin: 0;
      font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color: var(--text-main);
      background: var(--app-background);
    }

    body.page-drag-over::after {
      content: "Перетащите файл для создания протокола";
      position: fixed;
      inset: 16px;
      z-index: 1390;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 2px dashed #8fb0f0;
      border-radius: 22px;
      background: rgba(235, 243, 255, 0.64);
      color: #1d4ed8;
      font-size: 16px;
      font-weight: 600;
      letter-spacing: 0.01em;
      pointer-events: none;
      backdrop-filter: blur(2px);
    }

    button,
    input,
    textarea,
    select {
      font: inherit;
    }

    a {
      color: inherit;
    }

    .test-banner {
      position: sticky;
      top: 0;
      z-index: 1100;
      background: #fef3c7;
      color: #92400e;
      font-size: 13px;
      padding: 7px 12px;
      text-align: center;
      border-bottom: 1px solid #fde68a;
      backdrop-filter: blur(8px);
    }

    .app-header {
      position: sticky;
      top: 36px;
      z-index: 1000;
      padding: 18px 24px 0;
    }

    .app-header-inner {
      max-width: var(--container-width);
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 14px 18px;
      border: 1px solid rgba(255, 255, 255, 0.72);
      border-radius: 22px;
      background: rgba(255, 255, 255, 0.72);
      box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
      backdrop-filter: blur(20px);
    }

    .brand {
      display: inline-flex;
      align-items: center;
      gap: 14px;
      min-width: 0;
    }

    .brand-mark {
      position: relative;
      width: 42px;
      height: 42px;
      flex: 0 0 42px;
      border-radius: 15px;
      background:
        radial-gradient(circle at 28% 28%, rgba(255, 255, 255, 0.75), transparent 36%),
        linear-gradient(135deg, #60a5fa 0%, #2563eb 45%, #7c3aed 100%);
      box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.38),
        0 12px 26px rgba(37, 99, 235, 0.26);
      overflow: hidden;
    }

    .brand-mark::after {
      content: "";
      position: absolute;
      inset: 8px;
      border-radius: 11px;
      border: 1px solid rgba(255, 255, 255, 0.26);
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03));
    }

    .brand-copy {
      min-width: 0;
    }

    .brand-title {
      font-size: 15px;
      font-weight: 700;
      letter-spacing: 0.01em;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .brand-subtitle {
      margin-top: 2px;
      font-size: 12px;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .header-actions {
      position: relative;
      flex: 0 0 auto;
    }

    .icon {
      width: 18px;
      height: 18px;
      display: inline-block;
      flex: 0 0 18px;
      color: currentColor;
    }

    .icon svg {
      width: 100%;
      height: 100%;
      display: block;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.9;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .user-menu-btn {
      border: 1px solid var(--border-soft);
      background: rgba(255, 255, 255, 0.88);
      color: var(--text-main);
      border-radius: 999px;
      padding: 6px 10px 6px 6px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        border-color var(--transition-fast),
        background var(--transition-fast);
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    }

    .user-menu-btn:hover {
      transform: translateY(-1px);
      border-color: #c9d3e2;
      box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
      background: rgba(255, 255, 255, 0.96);
    }

    .user-avatar {
      width: 36px;
      height: 36px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #60a5fa, #2563eb 55%, #7c3aed);
      color: #fff;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.04em;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
      user-select: none;
    }

    .user-menu-text {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      min-width: 0;
    }

    .user-menu-name {
      max-width: 180px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.2;
    }

    .user-menu-role {
      font-size: 11px;
      color: var(--text-muted);
      line-height: 1.2;
    }

    .user-menu-chevron {
      color: var(--text-muted);
      transition: transform var(--transition-fast);
    }

    .user-menu-btn.is-open .user-menu-chevron {
      transform: rotate(180deg);
    }

    .account-dropdown {
      position: absolute;
      top: calc(100% + 12px);
      right: 0;
      width: 320px;
      max-width: calc(100vw - 24px);
      background: rgba(255, 255, 255, 0.96);
      border: 1px solid var(--border);
      border-radius: 20px;
      box-shadow: var(--shadow-float);
      backdrop-filter: blur(18px);
      padding: 14px;
    }

    .account-user-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px;
      border-radius: 16px;
      background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
      border: 1px solid #edf2fa;
      margin-bottom: 12px;
    }

    .account-user-avatar {
      width: 42px;
      height: 42px;
      border-radius: 14px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #60a5fa, #7c3aed);
      color: #fff;
      font-size: 14px;
      font-weight: 700;
      letter-spacing: 0.04em;
      flex: 0 0 42px;
    }

    .account-user-copy {
      min-width: 0;
    }

    .account-user-name {
      font-size: 14px;
      font-weight: 700;
      line-height: 1.3;
      word-break: break-word;
    }

    .account-user-login {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 3px;
      word-break: break-word;
    }

    .menu-actions {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .menu-action {
      width: 100%;
      border: 1px solid transparent;
      background: var(--surface-muted);
      color: var(--text-main);
      border-radius: 14px;
      padding: 12px 13px;
      display: flex;
      align-items: center;
      gap: 10px;
      text-decoration: none;
      cursor: pointer;
      transition:
        transform var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast);
    }

    .menu-action:hover {
      transform: translateY(-1px);
      background: #f1f5fb;
      border-color: #e4ebf5;
    }

    .menu-action-primary {
      background: #eff6ff;
      color: var(--primary-strong);
    }

    .menu-action-primary:hover {
      background: #e8f0ff;
      border-color: #dbe7ff;
    }

    .menu-action-danger {
      background: var(--danger-soft);
      color: var(--danger);
    }

    .menu-action-danger:hover {
      background: #fee7e7;
      border-color: #fecaca;
    }

    .menu-action-label {
      flex: 1 1 auto;
      text-align: left;
      font-size: 14px;
      font-weight: 600;
    }

    .menu-action-arrow {
      color: var(--text-soft);
    }

    .account-version {
      margin-top: 10px;
      padding: 4px 2px 0;
      font-size: 11px;
      line-height: 1.4;
      color: var(--text-soft);
      text-align: left;
    }

    .app-main {
      max-width: var(--container-width);
      margin: 0 auto;
      padding: 42px 24px 70px;
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    .hero {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      padding-top: 18px;
    }

    .hero-title {
      margin: 0 0 10px;
      font-size: clamp(30px, 4vw, 40px);
      line-height: 1.05;
      font-weight: 700;
      letter-spacing: -0.03em;
      max-width: 720px;
    }

    .hero-subtitle {
      margin: 0;
      max-width: 620px;
      font-size: 15px;
      line-height: 1.6;
      color: var(--text-muted);
    }

    .hero-actions {
      margin-top: 28px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
    }

    .cta-btn {
      border: none;
      border-radius: 999px;
      padding: 14px 22px;
      background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 55%, #6366f1 100%);
      color: #fff;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      font-size: 15px;
      font-weight: 700;
      box-shadow: 0 16px 32px rgba(37, 99, 235, 0.28);
      transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
    }

    .cta-btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 18px 36px rgba(37, 99, 235, 0.34);
    }

    .cta-btn:disabled {
      cursor: not-allowed;
      opacity: 0.7;
      transform: none;
      box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
    }

    .hero-hint {
      font-size: 13px;
      color: var(--text-muted);
    }

    .content-stack {
      width: 100%;
      max-width: 900px;
      margin-top: 36px;
      display: flex;
      flex-direction: column;
      gap: 18px;
    }

    .card {
      background: var(--surface);
      border: 1px solid rgba(255, 255, 255, 0.72);
      border-radius: var(--radius-xl);
      box-shadow: var(--shadow-card);
      backdrop-filter: blur(18px);
    }

    .history-card {
      overflow: hidden;
    }

    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 18px 20px 14px;
      border-bottom: 1px solid var(--border-soft);
    }

    .card-title {
      font-size: 15px;
      font-weight: 700;
    }

    .card-meta {
      font-size: 12px;
      color: var(--text-muted);
      white-space: nowrap;
    }

    .history-list {
      list-style: none;
      margin: 0;
      padding: 6px 12px 12px;
    }

    .history-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 14px 12px;
      border-radius: 16px;
      cursor: pointer;
      transition: background var(--transition-fast), transform var(--transition-fast);
    }

    .history-item:hover {
      background: #f8fbff;
      transform: translateY(-1px);
    }

    .history-item + .history-item {
      border-top: 1px solid #edf2f8;
    }

    .history-item-main {
      min-width: 0;
      flex: 1 1 auto;
    }

    .history-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--text-main);
      word-break: break-word;
    }

    .history-sub {
      margin-top: 4px;
      font-size: 12px;
      color: var(--text-muted);
    }

    .history-empty,
    .history-loading,
    .history-error {
      padding: 18px 16px 20px;
      font-size: 13px;
      color: var(--text-muted);
    }

    .status-pill {
      flex: 0 0 auto;
      border-radius: 999px;
      padding: 6px 10px;
      white-space: nowrap;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-transform: lowercase;
    }

    .status-ready {
      background: var(--success-soft);
      color: var(--success);
    }

    .status-processing {
      background: var(--warning-soft);
      color: var(--warning);
    }

    .status-failed {
      background: #fee2e2;
      color: #b91c1c;
    }

    .status-draft {
      background: #e5e7eb;
      color: #4b5563;
    }

    .modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 1400;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      background: rgba(15, 23, 42, 0.34);
      backdrop-filter: blur(8px);
    }

    .modal-card {
      width: 100%;
      max-width: 440px;
      max-height: calc(100vh - 48px);
      overflow-y: auto;
      -ms-overflow-style: none;
      scrollbar-width: none;
      background: rgba(255, 255, 255, 0.98);
      border: 1px solid rgba(255, 255, 255, 0.72);
      border-radius: 24px;
      box-shadow: var(--shadow-float);
      padding: 22px;
      transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    }

    .modal-card.is-drag-over {
      border-color: #9bb7f2;
      background: #f8fbff;
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), var(--shadow-float);
    }

    .modal-title {
      margin: 0 0 6px;
      font-size: 22px;
      font-weight: 700;
      letter-spacing: -0.02em;
    }

    .modal-subtitle {
      margin: 0 0 18px;
      font-size: 14px;
      line-height: 1.5;
      color: var(--text-muted);
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-bottom: 14px;
    }

    .field-label {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-main);
    }

    .field-input,
    .field-textarea,
    .field-select {
      width: 100%;
      border: 1px solid #d7deea;
      border-radius: 14px;
      background: #fff;
      padding: 12px 14px;
      color: var(--text-main);
      outline: none;
      transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    }

    .field-input:focus,
    .field-textarea:focus,
    .field-select:focus {
      border-color: #b8caf8;
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
    }

    .field-textarea {
      min-height: 108px;
      resize: vertical;
    }

    .field-hint {
      font-size: 12px;
      line-height: 1.5;
      color: var(--text-muted);
    }

    .participant-picker {
      position: relative;
    }

    .participant-suggestions {
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      right: 0;
      z-index: 20;
      display: flex;
      flex-direction: column;
      gap: 6px;
      padding: 8px;
      border: 1px solid #d7deea;
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.98);
      box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
      backdrop-filter: blur(12px);
    }

    .participant-option {
      width: 100%;
      text-align: left;
      border: 1px solid transparent;
      border-radius: 12px;
      background: #f8fbff;
      padding: 11px 12px;
      cursor: pointer;
      display: block;
      transition: background var(--transition-fast), border-color var(--transition-fast);
    }

    .participant-option:hover {
      background: #f2f7ff;
      border-color: #c9d7f3;
    }

    .participant-option-name {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-main);
    }

    .participant-option-add {
      background: #eef4ff;
      border-color: #d7e3f8;
      color: var(--primary-strong);
    }

    .participant-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
      max-height: 128px;
      overflow-y: auto;
      padding-right: 2px;
      -ms-overflow-style: none;
      scrollbar-width: none;
    }

    .modal-card::-webkit-scrollbar,
    .participant-tags::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    .participant-tag {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      border-radius: 999px;
      background: #eef4ff;
      color: var(--primary-strong);
      font-size: 13px;
      font-weight: 600;
    }

    .participant-tag-remove {
      border: none;
      background: transparent;
      color: inherit;
      cursor: pointer;
      padding: 0;
      line-height: 1;
      font-size: 16px;
    }

    .file-field {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
      border: 1px dashed #d7deea;
      border-radius: 14px;
      padding: 10px;
      background: #fcfdff;
      transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
    }

    .file-field input[type="file"] {
      position: absolute;
      width: 1px;
      height: 1px;
      opacity: 0;
      pointer-events: none;
    }

    .file-trigger {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      border: 1px solid var(--border-soft);
      border-radius: 14px;
      padding: 11px 14px;
      background: #f8fbff;
      color: var(--text-main);
      cursor: pointer;
      transition: background var(--transition-fast), border-color var(--transition-fast);
    }

    .file-trigger:hover {
      background: #f2f7ff;
      border-color: #d7e3f8;
    }

    .file-name {
      min-width: 0;
      font-size: 13px;
      color: var(--text-muted);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .progress-text {
      margin-top: 10px;
      font-size: 13px;
      color: var(--text-muted);
      min-height: 18px;
    }

    .modal-actions {
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      margin-top: 18px;
    }

    .btn-secondary,
    .btn-primary {
      border: none;
      border-radius: 14px;
      padding: 11px 16px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 600;
      transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    }

    .btn-secondary {
      background: #eef2f7;
      color: var(--text-main);
    }

    .btn-secondary:hover {
      transform: translateY(-1px);
      background: #e7edf5;
    }

    .btn-primary {
      background: var(--primary);
      color: #fff;
      box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
    }

    .btn-primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
    }

    .btn-primary:disabled {
      cursor: not-allowed;
      opacity: 0.72;
      transform: none;
      box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
    }

    .settings-modal {
      width: min(980px, calc(100vw - 24px));
      min-height: 620px;
      max-height: calc(100vh - 40px);
      overflow: hidden;
      display: grid;
      grid-template-columns: 250px minmax(0, 1fr);
      background: rgba(255, 255, 255, 0.98);
      border: 1px solid rgba(255, 255, 255, 0.75);
      border-radius: 28px;
      box-shadow: var(--shadow-float);
    }

    .settings-sidebar {
      display: flex;
      flex-direction: column;
      padding: 16px 12px 14px;
      border-right: 1px solid var(--border-soft);
      background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.12), transparent 36%),
        linear-gradient(180deg, #fbfcff 0%, #f7f9fd 100%);
    }

    .settings-sidebar-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
      padding: 4px 4px 10px;
    }

    .settings-sidebar-title {
      font-size: 14px;
      font-weight: 700;
    }

    .icon-button {
      width: 40px;
      height: 40px;
      border: none;
      border-radius: 14px;
      background: transparent;
      color: var(--text-muted);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background var(--transition-fast), color var(--transition-fast);
    }

    .icon-button:hover {
      background: #eef2f7;
      color: var(--text-main);
    }

    .settings-nav {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .settings-nav-item {
      width: 100%;
      border: none;
      background: transparent;
      color: var(--text-main);
      text-align: left;
      border-radius: 16px;
      padding: 12px 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
    }

    .settings-nav-item:hover {
      background: #eef3fb;
      transform: translateX(1px);
    }

    .settings-nav-item.active {
      background: var(--primary-soft);
      color: var(--primary-strong);
      font-weight: 700;
    }

    .settings-content {
      min-width: 0;
      display: flex;
      flex-direction: column;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 251, 255, 0.98) 100%);
    }

    .settings-content-header {
      padding: 26px 28px 0;
    }

    .settings-title {
      margin: 0;
      font-size: 30px;
      font-weight: 700;
      letter-spacing: -0.03em;
    }

    .settings-subtitle {
      margin: 8px 0 0;
      font-size: 14px;
      line-height: 1.6;
      color: var(--text-muted);
      max-width: 620px;
    }

    .settings-panel-wrap {
      min-height: 0;
      overflow: auto;
      padding: 12px 28px 18px;
    }

    .settings-panel {
      display: none;
      padding-top: 8px;
    }

    .settings-panel.active {
      display: block;
    }

    .settings-section {
      background: rgba(255, 255, 255, 0.8);
      border: 1px solid var(--border-soft);
      border-radius: 22px;
      padding: 6px 20px;
    }

    .settings-row {
      display: grid;
      grid-template-columns: 220px minmax(0, 1fr);
      align-items: center;
      gap: 18px;
      padding: 18px 0;
      border-top: 1px solid #edf1f7;
    }

    .settings-row:first-child {
      border-top: none;
    }

    .settings-row-label {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .settings-row-title {
      font-size: 15px;
      font-weight: 600;
    }

    .settings-row-note {
      font-size: 12px;
      line-height: 1.5;
      color: var(--text-muted);
    }

    .settings-row-control {
      min-width: 0;
      display: flex;
      justify-content: flex-end;
    }

    .settings-row-control .field-input,
    .settings-row-control .field-select {
      max-width: 340px;
    }

    .settings-footer {
      margin-top: auto;
      padding: 16px 28px 24px;
      border-top: 1px solid var(--border-soft);
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      background: rgba(255, 255, 255, 0.8);
    }

    @media (max-width: 900px) {
      .app-header {
        top: 36px;
        padding-left: 14px;
        padding-right: 14px;
      }

      .app-main {
        padding-left: 14px;
        padding-right: 14px;
      }

      .settings-modal {
        grid-template-columns: 1fr;
        min-height: auto;
        max-height: calc(100vh - 20px);
      }

      .settings-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-soft);
      }

      .settings-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .settings-row {
        grid-template-columns: 1fr;
        gap: 10px;
      }

      .settings-row-control {
        justify-content: stretch;
      }

      .settings-row-control .field-input,
      .settings-row-control .field-select {
        max-width: 100%;
      }
    }

    @media (max-width: 700px) {
      .app-header {
        top: 34px;
      }

      .app-header-inner {
        padding: 12px 14px;
        border-radius: 18px;
      }

      .brand-title {
        max-width: 180px;
      }

      .brand-subtitle,
      .user-menu-role {
        display: none;
      }

      .user-menu-name {
        max-width: 92px;
      }

      .account-dropdown {
        right: -2px;
        width: min(320px, calc(100vw - 28px));
      }

      .hero-title {
        font-size: 30px;
      }

      .card-header {
        padding-left: 16px;
        padding-right: 16px;
      }

      .history-list {
        padding-left: 10px;
        padding-right: 10px;
      }

      .history-item {
        padding-left: 10px;
        padding-right: 10px;
      }

      .modal-card {
        padding: 18px;
        border-radius: 22px;
      }

      .modal-actions,
      .settings-footer {
        flex-direction: column-reverse;
      }

      .btn-secondary,
      .btn-primary {
        width: 100%;
      }

      .settings-content-header,
      .settings-panel-wrap,
      .settings-footer {
        padding-left: 18px;
        padding-right: 18px;
      }

      .settings-nav {
        grid-template-columns: 1fr;
      }
    }


    /*LOGIN*/

    .login-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.login-header {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding-bottom: 20px;
}

.login-header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(20px);
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-layout {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 420px);
  gap: 28px;
  align-items: center;
}

.login-hero {
  padding: 8px 12px;
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(14px);
}

.login-hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(32px, 4.2vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 700;
  max-width: 560px;
}

.login-hero p {
  margin: 0;
  max-width: 520px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
}

.login-points {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-point {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  font-size: 14px;
}

.login-point-badge {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
  color: var(--primary-strong);
  border: 1px solid #dbe7ff;
  font-size: 13px;
  font-weight: 700;
}

.login-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  box-shadow: var(--shadow-float);
  backdrop-filter: blur(18px);
  padding: 26px;
}

.login-card-top {
  margin-bottom: 20px;
}

.login-card-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.login-card-subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

.field-input-wrap {
  position: relative;
}

.login-card .field-input {
  padding: 13px 14px;
}

.login-card .field-input:hover {
  background: #fcfdff;
}

.login-actions {
  margin-top: 18px;
}

.login-card .btn-primary {
  width: 100%;
  border-radius: 16px;
  padding: 14px 18px;
}

.error {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.login-footer-note {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
}

@media (max-width: 900px) {
  .login-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 420px;
  }

  .login-hero {
    padding: 0;
  }

  .login-hero h1 {
    font-size: 32px;
  }

  .login-hero p {
    font-size: 15px;
  }
}

@media (max-width: 640px) {
  .login-shell {
    padding: 14px;
  }

  .login-header {
    padding-bottom: 16px;
  }

  .login-header-inner {
    width: 100%;
    border-radius: 18px;
    padding: 12px 14px;
  }

  .brand-title {
    font-size: 14px;
  }

  .brand-subtitle {
    font-size: 11px;
  }

  .login-card {
    padding: 20px;
    border-radius: 24px;
  }

  .login-card-title {
    font-size: 22px;
  }

  .login-kicker {
    font-size: 12px;
  }
}

/* =========================================================
   Admin page
========================================================= */
    .admin-main {
  align-items: stretch;
}

.admin-hero {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 8px;
  margin-bottom: 26px;
}

.admin-hero-copy {
  min-width: 0;
}

.admin-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.admin-subtitle {
  margin: 10px 0 0;
  max-width: 720px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.admin-hero-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metric-card {
  padding: 18px;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.metric-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eff6ff;
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.metric-value {
  margin-top: 16px;
  font-size: 34px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.metric-note {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.admin-primary,
.admin-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.admin-panel {
  overflow: hidden;
}

.admin-panel .card-header {
  align-items: flex-start;
}

.admin-panel-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.admin-btn-small {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.system-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.health-item {
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
  border-radius: 18px;
  padding: 16px;
}

.health-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.health-item-value {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.health-item-value.is-ok {
  color: var(--success);
}

.health-item-note {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.admin-table-wrap {
  width: 100%;
  overflow-x: visible;
  padding: 0 18px 18px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  text-align: left;
  border-top: 1px solid #edf2f8;
  font-size: 13px;
  vertical-align: middle;
  word-break: break-word;
  white-space: normal;
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
}

.admin-table .admin-col-auth,
.admin-table .admin-col-login,
.admin-table .admin-col-role,
.admin-table .admin-col-status,
.admin-table .admin-col-actions {
  white-space: nowrap;
}

.admin-table .admin-col-role {
  width: 220px;
}

.admin-table .admin-col-actions {
  width: 230px;
}

.admin-table .admin-col-status {
  width: 130px;
}

.admin-table tbody tr:hover {
  background: #f8fbff;
}

.table-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef2f7;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.table-tag-ai {
  background: #eff6ff;
  color: var(--primary-strong);
}

.table-tag-regex {
  background: #f5f3ff;
  color: #6d28d9;
}

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 18px 18px;
}

.audit-card {
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96) 0%, rgba(248,250,255,0.96) 100%);
  padding: 16px;
}

.audit-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.audit-card-title {
  font-size: 14px;
  font-weight: 700;
}

.audit-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.audit-col {
  min-width: 0;
}

.audit-col-title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.audit-box {
  min-height: 92px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-main);
  word-break: break-word;
}

.admin-settings-block {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0 18px 6px;
}

.admin-users-layout {
  display: grid;
  gap: 18px;
  padding: 0 18px 18px;
}

.admin-users-create-block,
.admin-users-list-block {
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 255, 0.96) 100%);
}

.admin-users-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 0;
}

.admin-users-block-title {
  font-size: 15px;
}

.admin-users-form {
  padding: 16px 18px 18px;
}

.admin-users-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--text-main);
  font-size: 13px;
}

.admin-inline-check input {
  width: 16px;
  height: 16px;
}

.admin-users-form-actions,
.admin-users-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-users-form-actions {
  margin-top: 18px;
}

.admin-inline-status {
  min-height: 20px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.admin-inline-status[data-tone="success"] {
  color: var(--success);
}

.admin-inline-status[data-tone="danger"] {
  color: var(--danger);
}

.admin-users-table-wrap {
  padding-top: 10px;
}

.admin-users-empty {
  color: var(--text-muted);
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-user-actions .btn-secondary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.admin-role-toggle {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eef2f7;
  padding: 3px;
  border: 1px solid #dde3ee;
  gap: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.admin-role-option {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.admin-role-option:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.admin-role-option:hover {
  color: var(--text-main);
}

.admin-role-option:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.admin-role-option.is-active {
  background: var(--primary-soft);
  color: var(--primary-strong);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
}

.admin-role-toggle[data-loading="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.admin-role-toggle.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.admin-user-modal-dialog {
  max-width: 520px;
}

.admin-user-password-form .admin-modal-body {
  display: grid;
  gap: 10px;
}

.admin-user-password-status {
  margin-top: 4px;
}

.rules-toolbar {
  padding: 0 18px 14px;
}

.rule-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 18px 18px;
}

.rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
  border-radius: 18px;
  padding: 14px;
}

.rule-main {
  min-width: 0;
}

.rule-title {
  font-size: 14px;
  font-weight: 700;
  word-break: break-word;
}

.rule-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rule-actions {
  flex: 0 0 auto;
}

.test-lab {
  padding: 0 18px 18px;
}

.test-lab-actions {
  display: flex;
  gap: 10px;
  margin: 6px 0 16px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 52px;
  height: 32px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #dbe4f0;
  transition: background var(--transition-fast);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  transition: transform var(--transition-fast);
}

.switch input:checked + .switch-ui {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 55%, #6366f1 100%);
}

.switch input:checked + .switch-ui::after {
  transform: translateX(20px);
}

@media (max-width: 1100px) {
  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .admin-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-hero-actions {
    width: 100%;
    flex-direction: column-reverse;
  }

  .admin-hero-actions .btn-secondary,
  .admin-hero-actions .btn-primary {
    width: 100%;
  }

  .system-health-grid,
  .audit-compare {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .metric-card {
    padding: 16px;
  }

  .metric-value {
    font-size: 30px;
  }

  .admin-table-wrap,
  .audit-list,
  .rules-toolbar,
  .rule-list,
  .test-lab,
  .admin-users-layout,
  .admin-settings-block {
    padding-left: 14px;
    padding-right: 14px;
  }

  .test-lab-actions {
    flex-direction: column;
  }

  .test-lab-actions .btn-secondary,
  .test-lab-actions .btn-primary {
    width: 100%;
  }

  .rule-item {
    align-items: flex-start;
  }

  .admin-users-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-users-form-actions,
  .admin-users-list-head,
  .admin-users-block-head {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-user-actions .btn-secondary {
    width: 100%;
  }
}
    .admin-main {
  align-items: stretch;
}

.admin-page-head {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  margin-bottom: 24px;
}

.admin-page-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.admin-page-subtitle {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.admin-page-actions {
  flex: 0 0 auto;
}

.admin-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-card {
  overflow: hidden;
}

.admin-card-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.admin-card-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-settings-block {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0 20px 8px;
}

.dictionary-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px 16px;
}

.dictionary-toolbar-left {
  flex: 1 1 auto;
  min-width: 0;
}

.dictionary-toolbar-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dictionary-toolbar-right input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dictionary-file-btn {
  margin: 0;
}

.dictionary-summary {
  padding: 0 20px 12px;
}

.dictionary-summary-text {
  font-size: 12px;
  color: var(--text-muted);
}

.dictionary-table-wrap {
  padding: 0 20px 20px;
}

.dictionary-table {
  width: 100%;
  border-collapse: collapse;
}

.dictionary-table th,
.dictionary-table td {
  text-align: left;
  padding: 14px 12px;
  border-top: 1px solid #edf1f7;
  vertical-align: middle;
}

.dictionary-table th {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.dictionary-value,
.dictionary-replace {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.dictionary-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef2f7;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
}

.dictionary-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.dictionary-status.is-active {
  background: var(--success-soft);
  color: var(--success);
}

.dictionary-status.is-disabled {
  background: #e5e7eb;
  color: #4b5563;
}

.dictionary-actions-col {
  width: 260px;
}

.dictionary-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-action-btn {
  border: 1px solid var(--border-soft);
  background: #f8fbff;
  color: var(--text-main);
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.table-action-btn:hover {
  background: #f2f7ff;
  border-color: #d7e3f8;
  transform: translateY(-1px);
}

.table-action-btn.danger {
  background: #fff;
}

.table-action-btn.danger:hover {
  background: #fff4f4;
  border-color: #fecaca;
  color: var(--danger);
}

.dictionary-empty {
  padding: 18px 12px 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-flex;
  width: 52px;
  height: 32px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-ui {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #dbe4f0;
  transition: background var(--transition-fast);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
  transition: transform var(--transition-fast);
}

.switch input:checked + .switch-ui {
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 55%, #6366f1 100%);
}

.switch input:checked + .switch-ui::after {
  transform: translateX(20px);
}

@media (max-width: 900px) {
  .admin-page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-page-actions {
    width: 100%;
  }

  .admin-page-actions .btn-primary {
    width: 100%;
  }

  .dictionary-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .dictionary-toolbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .dictionary-toolbar-right > * {
    flex: 1 1 auto;
  }

  .dictionary-row-actions {
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .dictionary-table,
  .dictionary-table thead,
  .dictionary-table tbody,
  .dictionary-table tr,
  .dictionary-table th,
  .dictionary-table td {
    display: block;
    width: 100%;
  }

  .dictionary-table thead {
    display: none;
  }

  .dictionary-table tr {
    border-top: 1px solid #edf1f7;
    padding: 12px 0;
  }

  .dictionary-table td {
    border-top: none;
    padding: 6px 0;
  }

  .dictionary-actions-col {
    width: auto;
  }

  .admin-settings-block,
  .dictionary-toolbar,
  .dictionary-summary,
  .dictionary-table-wrap {
    padding-left: 18px;
    padding-right: 18px;
  }
}
.admin-card-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dictionary-preview {
  padding: 0 18px 18px;
}

.dictionary-preview-head {
  margin-bottom: 12px;
}

.dictionary-preview-title {
  font-size: 13px;
  font-weight: 700;
}

.dictionary-preview-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.dictionary-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dictionary-preview-item,
.dictionary-preview-more,
.dictionary-preview-empty {
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
}

.dictionary-preview-more,
.dictionary-preview-empty {
  color: var(--text-muted);
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.admin-modal.is-open {
  display: block;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
}

.admin-modal-dialog {
  position: relative;
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  border: 1px solid var(--border-soft);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.admin-modal-header,
.admin-modal-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.admin-modal-header {
  border-bottom: 1px solid #edf2f8;
}

.admin-modal-footer {
  border-top: 1px solid #edf2f8;
  align-items: center;
}

.admin-modal-body {
  padding: 20px;
  overflow: auto;
  max-height: calc(100vh - 220px);
}

.admin-modal-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.admin-modal-subtitle {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.admin-modal-status {
  font-size: 13px;
  color: var(--text-muted);
}

.admin-modal-actions {
  display: flex;
  gap: 10px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: #fff;
  color: var(--text-main);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  background: #f8fbff;
}

.dictionary-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.dictionary-editor-block {
  min-width: 0;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.field-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.field-textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: #fff;
  padding: 14px 16px;
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-main);
  resize: vertical;
  box-sizing: border-box;
  outline: none;
}

.field-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.dictionary-editor-textarea {
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.dictionary-test-input {
  min-height: 140px;
}

.dictionary-test-actions {
  display: flex;
  gap: 10px;
  margin: 12px 0 14px;
}

.dictionary-test-result-wrap {
  min-width: 0;
}

.dictionary-test-result-label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.dictionary-test-result {
  min-height: 140px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  transition: transform var(--transition-fast);
}

.switch input:checked + .switch-ui {
  background: var(--primary);
}

.switch input:checked + .switch-ui::after {
  transform: translateX(20px);
}

@media (max-width: 900px) {
  .dictionary-editor-grid {
    grid-template-columns: 1fr;
  }

  .admin-modal-dialog {
    width: calc(100vw - 20px);
    margin: 10px auto;
    max-height: calc(100vh - 20px);
    border-radius: 20px;
  }

  .admin-modal-body {
    max-height: calc(100vh - 200px);
  }
}

/* =========================================================
   Shared admin + meeting shell
========================================================= */
    .admin-page, .meeting-page {
      --bg: #f5f7fb;
      --bg-soft: #eef3fb;
      --surface: rgba(255, 255, 255, 0.92);
      --surface-solid: #ffffff;
      --surface-muted: #f8fafc;
      --border: #d8dde8;
      --border-soft: #e7ebf3;
      --text-main: #111827;
      --text-muted: #6b7280;
      --text-soft: #94a3b8;
      --primary: #2563eb;
      --primary-strong: #1d4ed8;
      --primary-soft: #e9f0ff;
      --success-soft: #dcfce7;
      --success: #15803d;
      --warning-soft: #fef3c7;
      --warning: #b45309;
      --danger-soft: #fef2f2;
      --danger: #b91c1c;
      --shadow-card: 0 18px 40px rgba(15, 23, 42, 0.08);
      --shadow-float: 0 24px 60px rgba(15, 23, 42, 0.16);
      --radius-xl: 24px;
      --radius-lg: 18px;
      --radius-md: 14px;
      --radius-sm: 12px;
      --transition-fast: 160ms ease;
    }

    .admin-page *, .meeting-page * {
      box-sizing: border-box;
    }

    .admin-page *::before, .meeting-page *::before, .admin-page *::after, .meeting-page *::after {
      box-sizing: border-box;
    }

    .admin-page, .meeting-page, .admin-page, .meeting-page {
      min-height: 100%;
    }

    .admin-page, .meeting-page {
      margin: 0;
      font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color: var(--text-main);
      background: var(--app-background);
    }

    .admin-page button, .meeting-page button, .admin-page input, .meeting-page input, .admin-page textarea, .meeting-page textarea, .admin-page select, .meeting-page select, .admin-page a, .meeting-page a {
      font: inherit;
      color: inherit;
    }

    .admin-page a, .meeting-page a {
      text-decoration: none;
    }

    .admin-page [hidden], .meeting-page [hidden] {
      display: none !important;
    }

    .admin-page .app-header, .meeting-page .app-header {
      position: sticky;
      top: 0;
      z-index: 1000;
      padding: 18px 24px 0;
    }

    .admin-page .app-header-inner, .meeting-page .app-header-inner {
      max-width: var(--container-width);
      margin: 0 auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 14px 18px;
      border: 1px solid rgba(255, 255, 255, 0.72);
      border-radius: 22px;
      background: rgba(255, 255, 255, 0.72);
      box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
      backdrop-filter: blur(20px);
    }

    .admin-page .header-left, .meeting-page .header-left {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
      flex: 1 1 auto;
    }

    .admin-page .header-back, .meeting-page .header-back {
      width: 42px;
      height: 42px;
      border: 1px solid var(--border-soft);
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.9);
      color: var(--text-main);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast);
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
      flex: 0 0 42px;
    }

    .admin-page .header-back:hover, .meeting-page .header-back:hover {
      transform: translateY(-1px);
      border-color: #c9d3e2;
      box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
      background: rgba(255, 255, 255, 0.96);
    }

    .admin-page .brand, .meeting-page .brand {
      display: inline-flex;
      align-items: center;
      gap: 14px;
      min-width: 0;
    }

    .admin-page .brand-mark, .meeting-page .brand-mark {
      position: relative;
      width: 42px;
      height: 42px;
      flex: 0 0 42px;
      border-radius: 15px;
      background:
        radial-gradient(circle at 28% 28%, rgba(255, 255, 255, 0.75), transparent 36%),
        linear-gradient(135deg, #60a5fa 0%, #2563eb 45%, #7c3aed 100%);
      box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.38),
        0 12px 26px rgba(37, 99, 235, 0.26);
      overflow: hidden;
    }

    .admin-page .brand-mark::after, .meeting-page .brand-mark::after {
      content: "";
      position: absolute;
      inset: 8px;
      border-radius: 11px;
      border: 1px solid rgba(255, 255, 255, 0.26);
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03));
    }

    .admin-page .brand-copy, .meeting-page .brand-copy {
      min-width: 0;
    }

    .admin-page .brand-title, .meeting-page .brand-title {
      font-size: 15px;
      font-weight: 700;
      letter-spacing: 0.01em;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .admin-page .brand-subtitle, .meeting-page .brand-subtitle {
      margin-top: 2px;
      font-size: 12px;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .admin-page .header-user, .meeting-page .header-user {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      gap: 10px;
      border: 1px solid var(--border-soft);
      background: rgba(255, 255, 255, 0.88);
      border-radius: 999px;
      padding: 6px 12px 6px 6px;
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
      min-width: 0;
    }

    .admin-page .user-avatar, .meeting-page .user-avatar {
      width: 36px;
      height: 36px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(135deg, #60a5fa, #2563eb 55%, #7c3aed);
      color: #fff;
      font-size: 13px;
      font-weight: 700;
      letter-spacing: 0.04em;
      flex: 0 0 36px;
    }

    .admin-page .user-copy, .meeting-page .user-copy {
      min-width: 0;
    }

    .admin-page .user-name, .meeting-page .user-name {
      max-width: 180px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.2;
    }

    .admin-page .user-role, .meeting-page .user-role {
      font-size: 11px;
      color: var(--text-muted);
      line-height: 1.2;
    }

    .admin-page .icon, .meeting-page .icon {
      width: 18px;
      height: 18px;
      display: inline-block;
      flex: 0 0 18px;
      color: currentColor;
    }

    .admin-page .icon svg, .meeting-page .icon svg {
      width: 100%;
      height: 100%;
      display: block;
      fill: none;
      stroke: currentColor;
      stroke-width: 1.9;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .admin-page .app-main, .meeting-page .app-main {
      max-width: var(--container-width);
      margin: 0 auto;
      padding: 30px 24px 70px;
    }

    .admin-page .page-grid, .meeting-page .page-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 320px;
      gap: 20px;
      align-items: start;
    }

    .admin-page .card, .meeting-page .card {
      background: var(--surface);
      border: 1px solid rgba(255, 255, 255, 0.72);
      border-radius: var(--radius-xl);
      box-shadow: var(--shadow-card);
      backdrop-filter: blur(18px);
    }

    .admin-page .meeting-card, .meeting-page .meeting-card {
      padding: 22px;
      display: flex;
      flex-direction: column;
      gap: 20px;
    }

    .admin-page .meeting-topbar, .meeting-page .meeting-topbar {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 18px;
      flex-wrap: wrap;
    }

    .admin-page .meeting-topbar-main, .meeting-page .meeting-topbar-main {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 12px;
      min-width: 0;
      flex: 1 1 520px;
    }

    .admin-page .meeting-kicker, .meeting-page .meeting-kicker {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.72);
      border: 1px solid rgba(255, 255, 255, 0.9);
      color: var(--primary-strong);
      font-size: 13px;
      font-weight: 600;
      box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    }

    .admin-page .meeting-title, .meeting-page .meeting-title {
      margin: 0;
      font-size: clamp(28px, 4vw, 36px);
      line-height: 1.15;
      font-weight: 700;
      letter-spacing: -0.03em;
      max-width: 100%;
      word-break: break-word;
      overflow-wrap: anywhere;
    }

    .admin-page .meeting-meta, .meeting-page .meeting-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      width: 100%;
      align-items: flex-start;
    }

    .admin-page .meta-chip, .meeting-page .meta-chip {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-height: 34px;
      padding: 8px 12px;
      border-radius: 999px;
      background: #f8fbff;
      border: 1px solid #e6edf8;
      color: var(--text-muted);
      font-size: 13px;
      white-space: nowrap;
    }

    .admin-page .meeting-topbar-side, .meeting-page .meeting-topbar-side {
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-width: min(100%, 320px);
      flex: 0 1 320px;
    }

    .admin-page .status-card, .meeting-page .status-card {
      padding: 14px;
      border-radius: 18px;
      border: 1px solid #e6edf8;
      background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .admin-page .status-head, .meeting-page .status-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .admin-page .status-badge, .meeting-page .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 7px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.02em;
      text-transform: lowercase;
    }

    .admin-page .status-badge.is-processing, .meeting-page .status-badge.is-processing {
      background: var(--warning-soft);
      color: var(--warning);
    }

    .admin-page .status-badge.is-ready, .meeting-page .status-badge.is-ready {
      background: var(--success-soft);
      color: var(--success);
    }

    .admin-page .status-badge.is-failed, .meeting-page .status-badge.is-failed {
      background: var(--danger-soft);
      color: var(--danger);
    }

    .admin-page .status-percent, .meeting-page .status-percent {
      font-size: 13px;
      color: var(--text-muted);
      white-space: nowrap;
      font-weight: 600;
    }

    .admin-page .status-message, .meeting-page .status-message {
      font-size: 14px;
      color: var(--text-main);
      font-weight: 600;
      line-height: 1.45;
    }

    .admin-page .status-progress, .meeting-page .status-progress {
      height: 10px;
      border-radius: 999px;
      background: #e5e7eb;
      overflow: hidden;
    }

    .admin-page .status-progress-bar, .meeting-page .status-progress-bar {
      height: 100%;
      width: 0%;
      border-radius: 999px;
      background: linear-gradient(90deg, #60a5fa, #2563eb, #6366f1);
      transition: width .25s ease;
    }

    .admin-page .player-card, .meeting-page .player-card {
      border: 1px solid #e8eef7;
      border-radius: 20px;
      background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
      padding: 16px;
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      gap: 14px;
      align-items: center;
    }

    .admin-page .play-btn, .meeting-page .play-btn {
      width: 50px;
      height: 50px;
      border: none;
      border-radius: 999px;
      background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 55%, #6366f1 100%);
      color: #fff;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
      transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    }

    .admin-page .play-btn:hover, .meeting-page .play-btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 18px 36px rgba(37, 99, 235, 0.28);
    }

    .admin-page .play-btn:disabled, .meeting-page .play-btn:disabled {
      cursor: wait;
      opacity: 0.8;
      transform: none;
      box-shadow: 0 12px 26px rgba(37, 99, 235, 0.16);
    }

    .admin-page .player-main, .meeting-page .player-main {
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .admin-page .player-title, .meeting-page .player-title {
      font-size: 13px;
      color: var(--text-muted);
      font-weight: 600;
    }

    .admin-page .player-status, .meeting-page .player-status {
      font-size: 13px;
      color: var(--text-muted);
      min-height: 18px;
    }

    .admin-page .timeline, .meeting-page .timeline {
      min-width: 0;
    }

    .admin-page .bar, .meeting-page .bar {
      height: 8px;
      background: #e5e7eb;
      border-radius: 999px;
      position: relative;
      overflow: hidden;
    }

    .admin-page .prog, .meeting-page .prog {
      height: 8px;
      background: linear-gradient(90deg, #60a5fa, #2563eb, #6366f1);
      border-radius: 999px;
      width: 0%;
    }

    .admin-page .mark, .meeting-page .mark {
      position: absolute;
      top: 1px;
      height: 6px;
      border-radius: 999px;
      background: rgba(96, 165, 250, 0.45);
      cursor: pointer;
      transition: background var(--transition-fast), opacity var(--transition-fast);
    }

    .admin-page .mark:hover, .meeting-page .mark:hover {
      background: rgba(59, 130, 246, 0.72);
    }

    .admin-page .mark.active, .meeting-page .mark.active {
      background: rgba(37, 99, 235, 0.96);
      opacity: 1;
    }

    .admin-page .time, .meeting-page .time {
      margin-top: 6px;
      font-size: 12px;
      color: var(--text-muted);
      display: flex;
      justify-content: space-between;
      gap: 12px;
    }

    .admin-page .content-grid, .meeting-page .content-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 18px;
    }

    .admin-page .section-card, .meeting-page .section-card, .admin-page .transcript-card, .meeting-page .transcript-card, .admin-page .side-card, .meeting-page .side-card {
      border: 1px solid #e8eef7;
      border-radius: 20px;
      background: rgba(255, 255, 255, 0.76);
      overflow: hidden;
    }

    .admin-page .block-head, .meeting-page .block-head {
      padding: 16px 18px 12px;
      border-bottom: 1px solid #edf2f8;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .admin-page .block-title, .meeting-page .block-title {
      font-size: 15px;
      font-weight: 700;
    }

    .admin-page .block-note, .meeting-page .block-note {
      font-size: 12px;
      color: var(--text-muted);
    }

    .admin-page .sections, .meeting-page .sections, .admin-page .tasks, .meeting-page .tasks {
      list-style: none;
      margin: 0;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .admin-page .sections .item, .meeting-page .sections .item {
      border-radius: 16px;
      background: #f6f9ff;
      border: 1px solid #e5edf9;
      padding: 14px;
      cursor: pointer;
      transition:
        transform var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast),
        box-shadow var(--transition-fast);
    }

    .admin-page .sections .item:hover, .meeting-page .sections .item:hover {
      transform: translateY(-1px);
      background: #eff5ff;
      border-color: #dce8ff;
      box-shadow: 0 10px 24px rgba(37, 99, 235, 0.06);
    }

    .admin-page .sections .item.active, .meeting-page .sections .item.active {
      background: var(--primary-soft);
      border-color: #cfe0ff;
      box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.06);
    }

    .admin-page .section-title, .meeting-page .section-title {
      font-size: 14px;
      font-weight: 700;
      line-height: 1.4;
    }

    .admin-page .sec-body, .meeting-page .sec-body {
      font-size: 13px;
      color: #475569;
      line-height: 1.55;
      margin-top: 4px;
      word-break: break-word;
    }

    .admin-page .section-range, .meeting-page .section-range {
      margin-top: 8px;
      font-size: 12px;
      color: var(--text-muted);
    }

    .admin-page .transcript, .meeting-page .transcript {
      max-height: 860px;
      overflow: auto;
      background: linear-gradient(180deg, rgba(249, 250, 251, 0.88), rgba(245, 247, 251, 0.88));
    }

    .admin-page .transcript-filter, .meeting-page .transcript-filter {
      display: grid;
      gap: 10px;
      padding: 10px 12px 12px;
      border-top: 1px solid #edf2f8;
      border-bottom: 1px solid #edf2f8;
      background: #fbfdff;
    }

    .admin-page .transcript-filter-top, .meeting-page .transcript-filter-top {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
    }

    .admin-page .transcript-filter-summary, .meeting-page .transcript-filter-summary {
      font-size: 12px;
      color: #475569;
      font-weight: 600;
    }

    .admin-page .transcript-filter-actions, .meeting-page .transcript-filter-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .admin-page .transcript-filter-btn, .meeting-page .transcript-filter-btn {
      padding: 6px 10px;
      font-size: 12px;
      border-radius: 999px;
    }

    .admin-page .transcript-filter-search, .meeting-page .transcript-filter-search {
      width: 100%;
      box-sizing: border-box;
      border: 1px solid #d6deea;
      border-radius: 10px;
      background: #fff;
      color: var(--text-main);
      padding: 9px 12px;
      font-size: 13px;
    }

    .admin-page .transcript-filter-search:focus, .meeting-page .transcript-filter-search:focus {
      outline: none;
      border-color: #93c5fd;
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
    }

    .admin-page .transcript-filter-list, .meeting-page .transcript-filter-list {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .admin-page .speaker-filter-chip, .meeting-page .speaker-filter-chip {
      border: 1px solid #d6deea;
      border-radius: 999px;
      background: #fff;
      color: var(--text-main);
      padding: 6px 10px;
      font-size: 12px;
      line-height: 1.2;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    }

    .admin-page .speaker-filter-chip:hover, .meeting-page .speaker-filter-chip:hover,
    .admin-page .speaker-filter-chip:focus, .meeting-page .speaker-filter-chip:focus {
      border-color: #93c5fd;
      outline: none;
    }

    .admin-page .speaker-filter-chip[data-active="true"], .meeting-page .speaker-filter-chip[data-active="true"] {
      background: #1d4ed8;
      border-color: #1d4ed8;
      color: #fff;
    }

    .admin-page .speaker-filter-chip-count, .meeting-page .speaker-filter-chip-count {
      min-width: 18px;
      height: 18px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      font-weight: 700;
      background: rgba(15, 23, 42, 0.08);
      color: #334155;
      padding: 0 4px;
    }

    .admin-page .speaker-filter-chip[data-active="true"] .speaker-filter-chip-count, .meeting-page .speaker-filter-chip[data-active="true"] .speaker-filter-chip-count {
      background: rgba(255, 255, 255, 0.22);
      color: #fff;
    }

    .admin-page .transcript-filter-empty, .meeting-page .transcript-filter-empty {
      font-size: 12px;
      color: #64748b;
      padding: 2px 2px 0;
    }

    .admin-page .row, .meeting-page .row {
      display: grid;
      grid-template-columns: 64px 1fr;
      gap: 12px;
      padding: 14px 18px;
      border-bottom: 1px solid #edf0f7;
      cursor: pointer;
      transition: background var(--transition-fast);
    }

    .admin-page .row:hover, .meeting-page .row:hover {
      background: #eef5ff;
    }

    .admin-page .row.active, .meeting-page .row.active {
      background: #e0edff;
    }

    .admin-page .ts, .meeting-page .ts {
      font-size: 12px;
      color: var(--text-muted);
      font-variant-numeric: tabular-nums;
      padding-top: 2px;
    }

    .admin-page .row-main, .meeting-page .row-main {
      min-width: 0;
      line-height: 1.6;
      font-size: 14px;
      color: var(--text-main);
      word-break: break-word;
    }

    .admin-page .speaker, .meeting-page .speaker {
      font-weight: 700;
      margin-right: 6px;
    }

    .admin-page .speaker-line, .meeting-page .speaker-line {
      display: flex;
      align-items: baseline;
      gap: 0;
      flex-wrap: wrap;
    }

    .admin-page .speaker-dropdown, .meeting-page .speaker-dropdown {
      position: relative;
      display: inline-block;
      margin-right: 4px;
    }

    .admin-page .speaker-trigger, .meeting-page .speaker-trigger {
      border: 1px solid transparent;
      border-radius: 8px;
      background-color: transparent;
      color: var(--text-main);
      padding: 2px 22px 2px 8px;
      font-weight: 700;
      font-size: 14px;
      line-height: 1.35;
      margin: -2px 0;
      background-image:
        linear-gradient(45deg, transparent 50%, currentColor 50%),
        linear-gradient(135deg, currentColor 50%, transparent 50%);
      background-position:
        calc(100% - 13px) calc(50% - 1px),
        calc(100% - 8px) calc(50% - 1px);
      background-size: 5px 5px, 5px 5px;
      background-repeat: no-repeat;
      cursor: pointer;
      white-space: nowrap;
      transition:
        color var(--transition-fast),
        background-color var(--transition-fast),
        border-color var(--transition-fast);
    }

    .admin-page .speaker-trigger:hover, .meeting-page .speaker-trigger:hover,
    .admin-page .speaker-trigger:focus, .meeting-page .speaker-trigger:focus,
    .admin-page .speaker-dropdown.is-open .speaker-trigger, .meeting-page .speaker-dropdown.is-open .speaker-trigger {
      color: #1d4ed8;
      background-color: #eef5ff;
      border-color: #bfdbfe;
      outline: none;
    }

    .admin-page .speaker-menu, .meeting-page .speaker-menu {
      position: absolute;
      top: 0;
      left: 0;
      z-index: 2000;
      width: min(320px, calc(100vw - 64px));
      padding: 10px;
      border: 1px solid #dbe4f0;
      border-radius: 14px;
      background: #fff;
      box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
      display: none;
    }

    .admin-page .speaker-dropdown.is-open .speaker-menu, .meeting-page .speaker-dropdown.is-open .speaker-menu,
    .admin-page .speaker-menu.is-open, .meeting-page .speaker-menu.is-open {
      display: block;
    }

    .admin-page .speaker-menu-list, .meeting-page .speaker-menu-list {
      display: flex;
      flex-direction: column;
      gap: 4px;
      max-height: 240px;
      overflow: auto;
      padding-bottom: 10px;
      border-bottom: 1px solid #edf2f8;
      margin-bottom: 10px;
    }

    .admin-page .speaker-option, .meeting-page .speaker-option {
      width: 100%;
      border: 0;
      border-radius: 10px;
      background: transparent;
      color: var(--text-main);
      text-align: left;
      padding: 9px 10px;
      font: inherit;
      cursor: pointer;
      transition: background-color var(--transition-fast), color var(--transition-fast);
    }

    .admin-page .speaker-option:hover, .meeting-page .speaker-option:hover,
    .admin-page .speaker-option:focus, .meeting-page .speaker-option:focus {
      background: #f3f7ff;
      color: #1d4ed8;
      outline: none;
    }

    .admin-page .speaker-option.is-active, .meeting-page .speaker-option.is-active {
      background: #e8f0ff;
      color: #1d4ed8;
      font-weight: 600;
    }

    .admin-page .speaker-create-form, .meeting-page .speaker-create-form {
      display: grid;
      gap: 8px;
    }

    .admin-page .speaker-create-input, .meeting-page .speaker-create-input {
      width: 100%;
      box-sizing: border-box;
      border: 1px solid #d6deea;
      border-radius: 10px;
      background: #fff;
      color: var(--text-main);
      padding: 10px 12px;
      font: inherit;
    }

    .admin-page .speaker-create-input:focus, .meeting-page .speaker-create-input:focus {
      outline: none;
      border-color: #93c5fd;
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
    }

    .admin-page .speaker-create-btn, .meeting-page .speaker-create-btn {
      width: 100%;
      box-sizing: border-box;
      border: 0;
      border-radius: 10px;
      background: #1d4ed8;
      color: #fff;
      padding: 10px 12px;
      font: inherit;
      font-weight: 600;
      cursor: pointer;
      transition: background-color var(--transition-fast), opacity var(--transition-fast);
    }

    .admin-page .speaker-create-btn:hover, .meeting-page .speaker-create-btn:hover,
    .admin-page .speaker-create-btn:focus, .meeting-page .speaker-create-btn:focus {
      background: #1e40af;
      outline: none;
    }

    .admin-page .speaker-create-btn:disabled, .meeting-page .speaker-create-btn:disabled {
      opacity: 0.7;
      cursor: default;
    }

    .admin-page .side-card, .meeting-page .side-card {
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 0;
    }

    .admin-page .side-actions, .meeting-page .side-actions {
      padding: 12px;
      border-bottom: 1px solid #edf2f8;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .admin-page .tasks-composer, .meeting-page .tasks-composer {
      padding: 12px;
      border-bottom: 1px solid #edf2f8;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .admin-page .task-input, .meeting-page .task-input {
      min-height: 88px;
      resize: vertical;
      margin: 0;
    }

    .admin-page .task-add-btn, .meeting-page .task-add-btn {
      width: 100%;
    }

    .admin-page .task-compose-form[hidden], .meeting-page .task-compose-form[hidden] {
      display: none !important;
    }

    .admin-page .task-compose-form, .meeting-page .task-compose-form {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .admin-page .task-inline-status, .meeting-page .task-inline-status {
      min-height: 18px;
      font-size: 13px;
      color: var(--text-muted);
    }

    .admin-page .task-inline-status[data-tone="success"], .meeting-page .task-inline-status[data-tone="success"] {
      color: #15803d;
    }

    .admin-page .task-inline-status[data-tone="danger"], .meeting-page .task-inline-status[data-tone="danger"] {
      color: #b91c1c;
    }

    .admin-page .side-btn, .meeting-page .side-btn {
      min-height: 44px;
      border-radius: 14px;
      padding: 11px 14px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      cursor: pointer;
      transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast);
      font-size: 14px;
      font-weight: 600;
      width: 100%;
    }

    .admin-page .side-btn-secondary, .meeting-page .side-btn-secondary {
      border: 1px solid var(--border-soft);
      background: #f8fbff;
      color: var(--text-main);
    }

    .admin-page .side-btn-secondary:hover, .meeting-page .side-btn-secondary:hover {
      transform: translateY(-1px);
      background: #f2f7ff;
      border-color: #d7e3f8;
    }

    .admin-page .side-btn-primary, .meeting-page .side-btn-primary {
      border: none;
      background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 55%, #6366f1 100%);
      color: #fff;
      box-shadow: 0 16px 32px rgba(37, 99, 235, 0.22);
    }

    .admin-page .side-btn-primary:hover, .meeting-page .side-btn-primary:hover {
      transform: translateY(-1px);
      box-shadow: 0 18px 36px rgba(37, 99, 235, 0.28);
    }

    .admin-page .side-btn[hidden], .meeting-page .side-btn[hidden] {
      display: none !important;
    }

    .admin-page .tasks .item, .meeting-page .tasks .item {
      border-radius: 14px;
      padding: 12px 14px;
      background: #f8fbff;
      border: 1px solid #e8eef7;
      display: flex;
      align-items: flex-start;
      gap: 10px;
      font-size: 14px;
      line-height: 1.5;
      color: var(--text-main);
    }

    .admin-page .task-main, .meeting-page .task-main {
      min-width: 0;
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .admin-page .task-text, .meeting-page .task-text {
      white-space: pre-wrap;
      word-break: break-word;
    }

    .admin-page .task-view, .meeting-page .task-view {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      justify-content: space-between;
    }

    .admin-page .task-view .task-text, .meeting-page .task-view .task-text {
      flex: 1;
      min-width: 0;
    }

    .admin-page .task-view-actions, .meeting-page .task-view-actions {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex: 0 0 auto;
    }

    .admin-page .task-edit-btn, .meeting-page .task-edit-btn {
      width: 28px;
      height: 28px;
      border: 1px solid #dbe4f0;
      border-radius: 10px;
      background: #fff;
      color: #6b7280;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 28px;
      cursor: pointer;
      transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    }

    .admin-page .task-edit-btn:hover, .meeting-page .task-edit-btn:hover {
      background: #f4f8ff;
      border-color: #cddcf7;
      color: #2563eb;
    }

    .admin-page .task-edit-btn svg, .meeting-page .task-edit-btn svg {
      width: 14px;
      height: 14px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .admin-page .task-delete-btn, .meeting-page .task-delete-btn {
      width: 28px;
      height: 28px;
      border: 1px solid #dbe4f0;
      border-radius: 10px;
      background: #fff;
      color: #6b7280;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 28px;
      cursor: pointer;
      transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    }

    .admin-page .task-delete-btn:hover, .meeting-page .task-delete-btn:hover {
      background: #fff4f4;
      border-color: #f1c5c5;
      color: #b42318;
    }

    .admin-page .task-delete-btn svg, .meeting-page .task-delete-btn svg {
      width: 14px;
      height: 14px;
      stroke: currentColor;
      fill: none;
      stroke-width: 2;
      stroke-linecap: round;
      stroke-linejoin: round;
    }

    .admin-page .task-editor, .meeting-page .task-editor {
      width: 100%;
      min-height: 78px;
      border: 1px solid #d6e0ef;
      border-radius: 12px;
      padding: 10px 12px;
      background: #fff;
      color: var(--text-main);
      resize: vertical;
      font: inherit;
      line-height: 1.5;
    }

    .admin-page .task-editor:focus, .meeting-page .task-editor:focus {
      outline: none;
      border-color: rgba(37, 99, 235, 0.48);
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    }

    .admin-page .task-actions-row, .meeting-page .task-actions-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .admin-page .task-edit-panel[hidden], .meeting-page .task-edit-panel[hidden] {
      display: none !important;
    }

    .admin-page .task-item.is-editing .task-view, .meeting-page .task-item.is-editing .task-view {
      display: none;
    }

    .admin-page .task-dot, .meeting-page .task-dot {
      width: 8px;
      height: 8px;
      border-radius: 999px;
      background: linear-gradient(135deg, #60a5fa, #2563eb);
      margin-top: 8px;
      flex: 0 0 8px;
    }

    .admin-page .empty-state, .meeting-page .empty-state {
      padding: 20px 18px 22px;
      color: var(--text-muted);
      font-size: 14px;
      line-height: 1.5;
    }

    .admin-page [data-loading="true"], .meeting-page [data-loading="true"] {
      position: relative;
      min-height: 96px;
    }

    .admin-page [data-loading="true"]::after, .meeting-page [data-loading="true"]::after {
      content: attr(data-loading-message);
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 16px;
      text-align: center;
      font-size: 13px;
      font-weight: 600;
      color: var(--text-muted);
      background: rgba(255, 255, 255, 0.82);
      backdrop-filter: blur(2px);
    }

    .admin-page .skeleton, .meeting-page .skeleton {
      background: linear-gradient(90deg, #e5e7eb, #f3f4f6, #e5e7eb);
      background-size: 200% 100%;
      animation: sload 1.4s infinite;
      border-radius: 8px;
      color: transparent !important;
    }

    @keyframes sload {
      0% { background-position: 0%; }
      100% { background-position: 200%; }
    }

    @media (max-width: 1080px) {.admin-page .page-grid, .meeting-page .page-grid {
        grid-template-columns: 1fr;
      }
}

    @media (max-width: 760px) {.admin-page .app-header, .meeting-page .app-header {
        padding-left: 14px;
        padding-right: 14px;
      }

      .admin-page .app-main, .meeting-page .app-main {
        padding-left: 14px;
        padding-right: 14px;
      }

      .admin-page .app-header-inner, .meeting-page .app-header-inner {
        padding: 12px 14px;
        border-radius: 18px;
      }

      .admin-page .brand-title, .meeting-page .brand-title {
        max-width: 180px;
      }

      .admin-page .brand-subtitle, .meeting-page .brand-subtitle, .admin-page .user-role, .meeting-page .user-role {
        display: none;
      }

      .admin-page .user-name, .meeting-page .user-name {
        max-width: 92px;
      }

      .admin-page .meeting-card, .meeting-page .meeting-card {
        padding: 16px;
      }

      .admin-page .meeting-topbar, .meeting-page .meeting-topbar {
        gap: 14px;
      }

      .admin-page .meeting-topbar-side, .meeting-page .meeting-topbar-side {
        min-width: 100%;
      }

      .admin-page .player-card, .meeting-page .player-card {
        grid-template-columns: 1fr;
      }

      .admin-page .play-btn, .meeting-page .play-btn {
        width: 46px;
        height: 46px;
      }

      .admin-page .row, .meeting-page .row {
        grid-template-columns: 54px 1fr;
        padding: 12px 14px;
      }

      .admin-page .block-head, .meeting-page .block-head {
        padding-left: 14px;
        padding-right: 14px;
      }

      .admin-page .sections, .meeting-page .sections, .admin-page .tasks, .meeting-page .tasks, .admin-page .side-actions, .meeting-page .side-actions {
        padding: 10px;
      }
}

/* =========================================================
   Meeting page extras
========================================================= */
.meeting-error {
  padding: 18px 6px 4px;
}

.meeting-error-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.meeting-error-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #fef2f2;
  color: #b91c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fecaca;
}

.meeting-error-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.meeting-error-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

.meeting-error-message {
  padding: 14px 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #fee2e2;
  color: #7f1d1d;
  line-height: 1.55;
}

.meeting-error-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meeting-error-actions .side-btn {
  width: auto;
}

.meeting-skeleton-card {
  height: 84px;
}

.meeting-skeleton-row {
  height: 58px;
}

.meeting-skeleton-task {
  height: 48px;
}

.meeting-skeleton-line {
  display: block;
  border-radius: 999px;
}

.meeting-skeleton-title-line {
  width: min(620px, 82%);
  height: 34px;
}

.meeting-skeleton-title-subline {
  margin-top: 10px;
  width: min(420px, 58%);
  height: 24px;
}

.meeting-skeleton-chip {
  display: inline-flex;
  width: 132px;
  height: 34px;
  border-radius: 999px;
}

.meeting-skeleton-panel {
  cursor: default;
}

.meeting-skeleton-panel-title {
  width: 52%;
  height: 16px;
}

.meeting-skeleton-panel-body {
  width: 100%;
  height: 12px;
  margin-top: 10px;
}

.meeting-skeleton-panel-meta {
  width: 30%;
  height: 12px;
  margin-top: 14px;
}

.meeting-skeleton-transcript-row {
  cursor: default;
}

.meeting-skeleton-timestamp {
  width: 40px;
  height: 12px;
  margin-top: 3px;
}

.meeting-skeleton-transcript-line {
  width: 100%;
  height: 14px;
}

.meeting-skeleton-task-row {
  align-items: center;
}

.meeting-skeleton-dot {
  display: inline-flex;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 10px;
}

.meeting-skeleton-task-line {
  width: 76%;
  height: 14px;
}

.meeting-loading-indicator {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(215, 227, 248, 0.95);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(10px);
}

.meeting-loading-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid #dbeafe;
  border-top-color: #2563eb;
  border-radius: 999px;
  animation: spin .75s linear infinite;
  flex: 0 0 20px;
}

.meeting-loading-copy {
  min-width: 0;
}

.meeting-loading-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.meeting-loading-message {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* =========================================================
   Legacy upload page
========================================================= */
.legacy-upload-page {
  margin: 0;
  padding: 0;
  font-family: system-ui, sans-serif;
  background: radial-gradient(circle at 50% 15%, #eef2ff 0%, #f5f7fb 70%);
}

.legacy-upload-page .container {
  max-width: 70%;
  margin: 0 auto;
  padding: 40px 0 60px;
}

.legacy-upload-page h2 {
  text-align: center;
  font-size: 26px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 28px;
}

.legacy-upload-page #uploadForm {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.legacy-upload-page button {
  padding: 12px 22px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius-lg);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  transition: 0.15s ease;
}

.legacy-upload-page button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.42);
}

.legacy-upload-page input[type="file"] {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid #d8dde8;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}

.legacy-upload-page .columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 30px;
}

.legacy-upload-page .col {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
  padding: 22px;
  border: 1px solid #e6e9f3;
}

.legacy-upload-page .col h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-main);
}

.legacy-upload-page #preview {
  text-align: center;
  margin-top: 25px;
}

.legacy-upload-page .preview-box {
  display: inline-block;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}

.legacy-upload-page .spinner {
  width: 38px;
  height: 38px;
  border: 4px solid #d4d8e6;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}

.legacy-upload-page #status {
  text-align: center;
  color: var(--text-muted);
  margin-top: 10px;
}

.legacy-upload-page #loader {
  display: none;
  margin-top: 20px;
  text-align: center;
}

.legacy-upload-file-info {
  text-align: center;
  color: #555;
}

.legacy-upload-video {
  border-radius: 12px;
}

.legacy-upload-audio {
  width: 360px;
}

.legacy-upload-download-wrap {
  text-align: center;
  margin-top: 20px;
}

.legacy-upload-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: var(--radius-lg);
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.legacy-upload-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.42);
}

@media (max-width: 900px) {
  .legacy-upload-page .container {
    max-width: calc(100% - 32px);
  }

  .legacy-upload-page .columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .legacy-upload-page #uploadForm {
    flex-direction: column;
    align-items: stretch;
  }

  .meeting-loading-indicator {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }

  .legacy-upload-audio,
  .legacy-upload-video {
    width: 100%;
    max-width: 100%;
  }
}

/* =========================================================
   Shared component tweaks
========================================================= */
.menu-action-admin-link {
  max-width: 340px;
}

/* =========================================================
   Admin monitoring
========================================================= */
.admin-monitoring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.admin-monitor-card {
  border: 1px solid var(--border-soft);
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
  border-radius: 16px;
  padding: 16px;
}

.admin-monitor-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.admin-monitor-value {
  margin-top: 10px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.admin-monitor-value.is-ok {
  color: var(--success);
}

.admin-monitor-value.is-error {
  color: var(--danger);
}

.admin-events-list {
  display: flex;
  flex-direction: column;
  padding: 0 18px 18px;
}

.admin-events-empty {
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.admin-event-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf2f8;
}

.admin-event-item:last-child {
  border-bottom: none;
}

.admin-event-level {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
  background: #eef2f7;
  color: #475569;
}

.admin-event-danger .admin-event-level {
  background: var(--danger-soft);
  color: var(--danger);
}

.admin-event-warning .admin-event-level {
  background: var(--warning-soft);
  color: var(--warning);
}

.admin-event-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-event-message {
  font-size: 13px;
}

.admin-event-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.admin-event-time {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-muted);
}

/* =========================================================
   Admin sidebar navigation
========================================================= */
.admin-layout-shell {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 80px);
  padding: 0 24px 40px;
}

.admin-sidebar {
  position: fixed;
  top: 104px;
  left: calc(50% - (var(--container-width) / 2) - 286px);
  width: 262px;
  z-index: 30;
}

.admin-sidebar-card {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}

.admin-sidebar-nav {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(54px, auto);
  gap: 12px;
}

.admin-sidebar-link {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  border: 1px solid #e0e7f5;
  background: rgba(248, 250, 255, 0.86);
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
}

.admin-sidebar-link:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.admin-sidebar-link.is-active {
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.2), rgba(59, 130, 246, 0.08));
  border-color: rgba(37, 99, 235, 0.6);
  color: var(--primary-strong);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.2);
}

.admin-sidebar-link .icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.admin-sidebar-link .icon svg {
  width: 18px;
  height: 18px;
}

.admin-content {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 28px 0 28px;
  min-width: 0;
}

@media (max-width: 1320px) {
  .admin-layout-shell {
    padding: 0 16px 32px;
  }

  .admin-sidebar {
    position: static;
    top: auto;
    left: auto;
    width: 100%;
    padding: 16px 0;
  }

  .admin-sidebar-card {
    position: static;
    gap: 14px;
  }

  .admin-sidebar-nav {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .admin-content {
    padding: 20px 0;
  }
}
