/* ==========================================================================
   theDiff — App chrome components. One section per UI area; every color
   references a token from index.css (playbook §3 — no hard-coded hex).
   Layout: viewport-filling grid → titlebar / mode-tabs+toolbar / main / status.
   ========================================================================== */

/* ---------- App shell grid ---------- */

.shell {
  display: grid;
  grid-template-rows: 44px 40px 1fr 26px;
  height: 100vh;
  height: 100dvh;
}

/* ---------- Title bar ---------- */

.titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--titlebar-bg);
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.titlebar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-1);
  text-decoration: none;
  flex-shrink: 0;
}

.titlebar .brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.titlebar .brand b {
  color: var(--accent-ink);
  font-weight: 800;
}

.tb-spacer {
  flex: 1;
}

.tb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.tb-icon-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-1);
  border-color: var(--border);
}

/* ---------- Mode tabs + toolbar row ---------- */

.mode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--toolbar-bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.mode-row::-webkit-scrollbar {
  display: none;
}

.mode-tabs {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.mode-tab:hover {
  background: var(--bg-elevated);
  color: var(--text-1);
}

.mode-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast-text);
}

.toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

/* Per-mode toolbar — only the active mode's toolbar is visible */
.mode-toolbar {
  display: none;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.mode-toolbar::-webkit-scrollbar {
  display: none;
}

.mode-toolbar.active {
  display: flex;
}

.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-2);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.tb-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.tb-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tb-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast-text);
}

.tb-btn.primary:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast-text);
}

.tb-caret {
  font-size: 0.62rem;
  opacity: 0.65;
  margin-left: -1px;
}

/* ---------- Main area / views ---------- */

.main-view {
  display: none;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  height: 100%;
}

.main-view.active {
  display: flex;
}

/* Text/File diff share the same Monaco diff-editor host */
.diff-editor-host {
  position: relative;
  flex: 1;
  min-height: 0;
}

#diffEditorContainer {
  position: absolute;
  inset: 0;
}

.pane-headers {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--pane-header-bg);
  flex-shrink: 0;
}

.pane-header {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pane-header.original {
  border-right: 1px solid var(--border);
}

.pane-header .ph-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pane-header.original .ph-dot { background: var(--remove); }
.pane-header.changed .ph-dot { background: var(--add); }

/* Welcome / empty-state cover for the active view */
.view-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  overflow: auto;
  background: var(--editor-bg);
}

.view-cover.active {
  display: block;
}

.welcome {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px;
}

.welcome .hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 4px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.welcome h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0 0 8px;
  color: var(--text-1);
}

.welcome .w-sub {
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0 0 22px;
}

.w-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.w-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-1);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.12s;
}

.w-action:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.w-action i {
  font-size: 1.15rem;
  color: var(--accent-ink);
  width: 22px;
  text-align: center;
}

.w-action .wa-note {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 2px;
}

/* ---------- Drop zones (File / Image modes) ---------- */

.drop-pair {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 0;
  padding: 12px;
}

.drop-zone {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--panel-bg);
  color: var(--text-2);
  padding: 20px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--text-1);
}

.drop-zone i {
  font-size: 1.8rem;
  color: var(--accent-ink);
}

.drop-zone .dz-hint {
  font-size: 0.72rem;
  color: var(--text-3);
}

.drop-zone.filled {
  border-style: solid;
  cursor: default;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
}

.dz-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.dz-file-info .dz-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: var(--text-1);
  font-size: 0.8rem;
}

.dz-file-info .dz-meta {
  font-size: 0.7rem;
  color: var(--text-3);
  flex-shrink: 0;
}

.dz-preview {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

/* ---------- JSON diff tree ---------- */

.json-diff-view {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.jd-tree-pane {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 10px 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
}

.jd-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.jd-row.added   { background: var(--add-dim); }
.jd-row.removed { background: var(--remove-dim); }
.jd-row.changed { background: var(--change-dim); }

.jd-details {
  display: block;
}

.jd-details > summary {
  list-style: none;
  cursor: pointer;
}

.jd-details > summary::-webkit-details-marker {
  display: none;
}

.jd-details > summary::before {
  content: "▸";
  display: inline-block;
  width: 12px;
  color: var(--text-3);
  transition: transform 0.12s ease;
}

.jd-details[open] > summary::before {
  transform: rotate(90deg);
}

.jd-children {
  padding-left: 18px;
  border-left: 1px solid var(--border-subtle);
  margin-left: 5px;
}

.jd-key { color: var(--accent-ink); flex-shrink: 0; }
.jd-punct { color: var(--text-3); }
.jd-val-str { color: var(--add); }
.jd-val-num { color: var(--change); }
.jd-val-bool, .jd-val-null { color: var(--text-2); font-style: italic; }

.jd-old {
  color: var(--remove);
  text-decoration: line-through;
  opacity: 0.75;
  margin-right: 6px;
}

.jd-toggle {
  display: inline-flex;
  width: 14px;
  flex-shrink: 0;
  cursor: pointer;
  color: var(--text-3);
  text-align: center;
  user-select: none;
}

.jd-input-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.jd-input {
  flex: 1;
  resize: none;
  border: none;
  background: var(--editor-bg);
  color: var(--text-1);
  padding: 10px;
  font-family: inherit;
  font-size: 0.8rem;
}

.jd-input-bottom {
  border-top: 1px solid var(--border);
}

.jd-input.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: var(--accent-dim);
}

.jd-upload-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-2);
  cursor: pointer;
  opacity: 0.85;
  z-index: 2;
}

.jd-upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  opacity: 1;
}

.jd-parse-error {
  margin: 14px;
  padding: 12px 14px;
  border: 1px solid var(--danger);
  background: var(--danger-dim);
  border-radius: 8px;
  color: var(--text-1);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* ---------- Image diff ---------- */

.image-diff-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.id-modebar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--toolbar-bg);
  flex-shrink: 0;
}

.id-canvas-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    conic-gradient(var(--bg-elevated) 90deg, transparent 90deg 180deg,
      var(--bg-elevated) 180deg 270deg, transparent 270deg) 0 0/16px 16px;
  padding: 16px;
}

.id-slider-box {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
}

.id-slider-box img {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.id-slider-box .id-top {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.id-slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  cursor: ew-resize;
  box-shadow: 0 0 0 3px var(--bg-overlay);
}

.id-slider-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--shadow-md);
}

.id-canvas-wrap canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.id-size-note {
  padding: 6px 12px;
  font-size: 0.72rem;
  color: var(--warning);
  background: var(--warning-dim);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* ---------- Status bar ---------- */

.statusbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  background: var(--statusbar-bg);
  color: var(--statusbar-text);
  font-size: 0.72rem;
  user-select: none;
  overflow: hidden;
}

.sb-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  padding: 0 7px;
  border: none;
  background: transparent;
  color: inherit;
  font-size: inherit;
  white-space: nowrap;
  cursor: default;
}

.sb-item.sb-click {
  cursor: pointer;
}

.sb-item.sb-click:hover {
  background: rgba(255, 255, 255, 0.14);
}

.sb-add { color: #d7ffe4; }
.sb-remove { color: #ffe1e6; }
.sb-change { color: #fff3d6; }

.sb-spacer {
  flex: 1;
}

.sb-muted {
  opacity: 0.8;
}

/* ---------- Menus (context menu + dropdowns) ---------- */

.menu {
  position: fixed;
  z-index: 1500;
  min-width: 190px;
  max-width: 320px;
  max-height: 70vh;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  padding: 4px;
  display: none;
}

.menu.open {
  display: block;
}

.menu .menu-label {
  padding: 5px 10px 3px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}

.menu .menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-1);
  font-size: 0.8rem;
  padding: 6px 10px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

.menu .menu-item:hover {
  background: var(--accent-dim);
  color: var(--accent-ink);
}

.menu .menu-item.danger:hover {
  background: var(--danger-dim);
  color: var(--danger);
}

.menu .menu-item i {
  width: 15px;
  text-align: center;
  font-size: 0.82rem;
}

.menu .menu-item .mi-check {
  margin-left: auto;
  color: var(--accent-ink);
  visibility: hidden;
}

.menu .menu-item.checked .mi-check {
  visibility: visible;
}

.menu .menu-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 6px;
}

/* ---------- Modals ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1600;
  background: var(--bg-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.app-modal {
  width: min(560px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.app-modal.wide {
  width: min(760px, 94vw);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 0.95rem;
}

.modal-body {
  padding: 14px 16px;
  overflow: auto;
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.55;
}

.modal-body h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-1);
  margin: 18px 0 8px;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-1);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast-text);
}

.btn.accent:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast-text);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.modal-hint {
  margin: 0 0 12px;
  color: var(--text-2);
}

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
  margin-bottom: 6px;
}

.url-input-group {
  display: flex;
  gap: 8px;
}

.url-input-group select,
.url-input-group input[type="text"] {
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--editor-bg);
  color: var(--text-1);
  padding: 0 10px;
  font-size: 0.85rem;
  font-family: inherit;
}

.url-input-group select { flex: 0 0 auto; }
.url-input-group input[type="text"] { flex: 1; min-width: 0; }

.field-warning {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--danger-dim);
  color: var(--danger);
  font-size: 0.78rem;
  line-height: 1.4;
}

.about-feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin: 10px 0;
  padding: 0;
}

.about-feature-list li {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.78rem;
}

.about-feature-list li i {
  color: var(--accent-ink);
  margin-right: 7px;
}

.faq-q {
  font-weight: 700;
  color: var(--text-1);
  margin: 12px 0 3px;
}

/* ---------- Toasts ---------- */

.toast-stack {
  position: fixed;
  right: 14px;
  bottom: 34px;
  z-index: 1700;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(380px, calc(100vw - 28px));
}

.toast {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 9px;
  box-shadow: var(--shadow-lg);
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--text-1);
  max-height: 260px;
  overflow-y: auto;
  overflow-wrap: anywhere;
  animation: toast-in 0.22s ease;
}

.toast > span {
  flex: 1 1 180px;
}

.toast-action {
  flex-shrink: 0;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent-ink);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.toast-action:hover {
  background: var(--accent);
  color: var(--accent-contrast-text);
}

@keyframes toast-in {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.danger  { border-left-color: var(--danger); }

.toast .toast-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  margin-left: auto;
}

/* ---------- Busy overlay ---------- */

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 1650;
  background: var(--bg-overlay);
  display: none;
  align-items: center;
  justify-content: center;
}

.busy-overlay.active {
  display: flex;
}

.busy-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 22px 30px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-1);
}

.busy-card .spinner-ring {
  width: 34px;
  height: 34px;
  margin: 0 auto 10px;
  border: 3px solid var(--accent-dim);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: busy-spin 0.9s linear infinite;
}

@keyframes busy-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Narrow screens (tablet/phone) — every rule here exists because of a
   specific real-device bug found (and fixed) on theEdito; see
   docs/BUILD_PLAN.md §6 for the full list this section implements.
   ========================================================================== */

@media (max-width: 760px) {
  .shell {
    grid-template-rows: 44px 40px 1fr 26px;
  }

  .titlebar .brand span.brand-word {
    display: none; /* keep just the mark on very narrow titlebars */
  }

  /* Icon-only mode tabs: at phone widths the 4 full-text tabs alone consumed
     ~90% of the row (measured ~347 of 390px), squeezing the active mode's
     own toolbar to 0 width — every toolbar button was still there, just
     invisible without a horizontal scroll (the exact bug being fixed, just
     one level up). Title/aria-label carry the name now that the text is gone. */
  .mode-tab .tab-label {
    display: none;
  }

  .mode-tab {
    padding: 0 9px;
  }

  .pane-headers .pane-header .ph-label {
    display: none; /* keep the colored dot, drop the "ORIGINAL"/"CHANGED" text label */
  }

  .drop-pair {
    flex-direction: column;
  }

  .welcome {
    padding: 26px 16px;
  }

  .w-actions {
    grid-template-columns: 1fr;
  }

  /* iOS Safari auto-zooms the page in when a focused input's font-size is
     under 16px — every text input/textarea gets bumped to the safe minimum.
     (First mobile pass missed the JSON panes specifically — they're
     <textarea>, not <input>, and the selector list didn't cover that.) */
  .menu .menu-filter,
  input[type="text"],
  input[type="url"],
  textarea,
  textarea.jd-input {
    font-size: 16px;
  }

  .about-feature-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .tb-btn .tbl-label {
    display: none; /* icon-only on the narrowest screens */
  }

  .tb-btn .tb-caret {
    display: none; /* the dropdown behavior is discoverable from the icon + tap; the caret only cost width here */
  }

  .mode-toolbar,
  .mode-row {
    gap: 4px;
  }

  .tb-btn {
    padding: 0 8px;
  }

  .modal-foot {
    flex-wrap: wrap;
  }

  .modal-foot .btn {
    flex: 1 1 auto;
  }
}