/* Shared components used across the marketing site, the workspace and the builders. */

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 8px; padding: 8px 15px; font: 600 13.5px var(--font); line-height: 1.2; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn-primary { background: var(--primary-solid); color: var(--text-on-primary); border-color: var(--primary-solid); }
.btn-primary:hover { background: var(--primary-solid-hover); border-color: var(--primary-solid-hover); color: var(--text-on-primary); }
.btn-primary:disabled, .btn-primary.is-disabled { background: var(--primary-disabled); border-color: var(--primary-disabled); cursor: default; }
.btn-secondary { background: var(--surface); color: var(--primary); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--tint); color: var(--primary); }
.btn-quiet { background: var(--surface); color: var(--ink-2); border-color: var(--border); }
.btn-quiet:hover { border-color: var(--accent); color: var(--ink-2); }
.btn-danger { background: var(--danger-solid); color: var(--text-on-primary); border-color: var(--danger-solid); }
.btn-danger:hover { background: var(--danger-solid-hover); border-color: var(--danger-solid-hover); color: var(--text-on-primary); }
.btn-danger:disabled, .btn-danger:disabled:hover { background: var(--danger-solid); border-color: var(--danger-solid); opacity: 0.45; cursor: not-allowed; }
.btn-danger-outline { background: var(--surface); color: var(--danger); border-color: var(--danger-border); }
.btn-lg { font-size: 16px; padding: 14px 26px; border-radius: 10px; }
.btn-md { font-size: 14px; padding: 10px 16px; border-radius: 9px; }
.btn-sm { font-size: 12.5px; padding: 5px 11px; border-radius: 7px; }
.btn-xs { font-size: 12px; padding: 4px 9px; border-radius: 6px; }
.btn-block { width: 100%; }
.link-btn { border: 0; background: transparent; padding: 0; font: 600 13px var(--font); color: var(--primary); cursor: pointer; text-decoration: none; }
.link-btn:hover { color: var(--primary-hover); }
.link-btn.danger { color: var(--danger); }
.link-btn.quiet { color: var(--ink-2); }
.icon-btn { border: 0; background: transparent; color: var(--subtle); font-size: 20px; line-height: 1; padding: 2px 4px; cursor: pointer; }
.icon-btn:hover { color: var(--ink); }
form.inline { display: inline; }
form.button_to { display: inline-flex; margin: 0; }

/* Pills and badges */
.pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.pill-blue { background: var(--accent-soft); color: var(--primary); }
.pill-green { background: var(--success-soft); color: var(--success-ink); }
.pill-amber { background: var(--warn-soft); color: var(--warn-ink); }
.pill-red { background: var(--danger-soft); color: var(--danger-ink); }
.pill-gray { background: var(--surface-2); color: var(--subtle); }
.pill-slate { background: var(--surface-2); color: var(--ink-2); }
.pill-navy { background: var(--ink-solid); color: var(--on-navy); font-size: 10.5px; padding: 2px 8px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; display: inline-block; }

/* Cards and surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.card-pad { padding: 20px 22px; }
.card-pad-lg { padding: 24px; }
.card-tint { background: var(--tint); }
.card-dashed { border: 1px dashed var(--border-strong); border-radius: 14px; }
.card-link { text-align: left; cursor: pointer; color: var(--ink); font-family: var(--font); display: flex; flex-direction: column; text-decoration: none; }
.card-link:hover { border-color: var(--accent); color: var(--ink); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--divider); }
.card-foot { padding: 12px 20px; font-size: 12.5px; color: var(--muted); background: var(--tint-2); }
.divided > * + * { border-top: 1px solid var(--row); }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 48px 24px; }
.empty-state .amp { font-size: 56px; }

/* Notices */
.notice { display: flex; gap: 10px; align-items: center; border-radius: 10px; padding: 10px 14px; font-size: 13px; border: 1px solid var(--border); background: var(--tint); }
.notice-amber { border-color: var(--warn-border); background: var(--warn-bg); color: var(--warn-text); }
.notice-red { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-text); }
.notice-blue { border-color: var(--border-strong); background: var(--tint); color: var(--ink); }

/* Data tables built from CSS grid rows; each table sets --cols and --minw. */
.table { border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; background: var(--surface); }
.table-head, .table-row { display: grid; grid-template-columns: var(--cols); min-width: var(--minw, 0); align-items: center; }
.table-head { font-family: var(--mono); font-size: 11px; color: var(--subtle); letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--divider); background: var(--tint-2); }
.table-head > * { padding: 12px; }
.table-head > :first-child, .table-row > :first-child { padding-left: 20px; }
.table-head > :last-child, .table-row > :last-child { padding-right: 20px; }
.table-row { border-bottom: 1px solid var(--row); font-size: 14px; color: var(--ink); background: var(--surface); text-decoration: none; }
.table-row:last-child { border-bottom: 0; }
.table-row > * { padding: 13px 12px; min-width: 0; }
a.table-row:hover, .table-row.is-link:hover { background: var(--tint-2); color: var(--ink); cursor: pointer; }
.table-empty { padding: 28px; text-align: center; font-size: 13.5px; color: var(--muted); }

/* Avatars */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink-solid); color: var(--on-navy); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; }
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar-md { width: 28px; height: 28px; font-size: 11px; }
.avatar-external { background: var(--on-navy-faint); }
.avatar-you { background: var(--accent-solid); }
.tile { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; }
.tile-abbr { width: 36px; height: 36px; border-radius: 9px; background: var(--tint); border: 1px solid var(--border); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; font-weight: 500; flex: none; }
.platform-logo { background: #ffffff; overflow: hidden; }
.platform-logo img { width: 64%; height: 64%; object-fit: contain; }
.platform-logo img + .platform-logo-abbr { display: none; }

/* Segmented controls (filters, environment switches) */
.seg { display: inline-flex; gap: 3px; padding: 3px; background: var(--tint); border: 1px solid var(--border); border-radius: 9px; flex-wrap: wrap; }
.seg-item { border: 0; border-radius: 6px; padding: 6px 12px; font: 600 12.5px var(--font); cursor: pointer; background: transparent; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.seg-item:hover { color: var(--ink); }
.seg-item.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-small); }
.seg-lg { gap: 4px; padding: 4px; border-radius: 10px; }
.seg-lg .seg-item { padding: 7px 12px; font-size: 13px; border-radius: 7px; }

/* Underline tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--divider); overflow-x: auto; scrollbar-width: none; }
.tab { flex: none; white-space: nowrap; border: 0; background: transparent; padding: 10px 14px; margin-bottom: -1px; font: 600 14px var(--font); color: var(--muted); border-bottom: 2px solid transparent; text-decoration: none; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--primary); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input, .select, .textarea { border: 1px solid var(--border-strong); border-radius: 8px; padding: 11px 13px; font: 400 14.5px var(--font); color: var(--ink); outline: none; background: var(--surface); width: 100%; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.input-sm, .select-sm { padding: 7px 10px; font-size: 13.5px; }
.select-xs { padding: 6px 8px; font-size: 13px; width: auto; border-color: var(--border); }
/* Every dropdown looks the same in every browser and theme: the browser's own arrow (crowded against the edge on a Mac,
   dark on a dark page) is replaced by a chevron drawn in the theme's colour, with room for it on the right. */
.select { appearance: none; -webkit-appearance: none; background-color: var(--surface); cursor: pointer; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.select-sm { padding-right: 30px; }
.select-xs { padding-right: 26px; background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; }
.select:disabled { cursor: not-allowed; opacity: 0.6; }
.input-mono { font-family: var(--mono); font-size: 14px; }
.textarea { resize: vertical; line-height: 1.5; }
.is-invalid, .is-invalid:focus { border-color: var(--danger); }
.field-error { font-size: 12.5px; color: var(--danger); line-height: 1.45; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.search { border: 1px solid var(--border); background: var(--tint-2); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; outline: none; color: var(--ink); }
.search:focus { border-color: var(--accent); }

/* Radio-card options and checkboxes */
.option { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-family: var(--font); color: var(--ink); width: 100%; }
.option:hover { border-color: var(--accent); }
.option.is-selected { border-color: var(--accent); background: var(--tint); }
.option-title { font-size: 14px; font-weight: 600; }
.option-copy { font-size: 13px; color: var(--muted); line-height: 1.45; }
.radio { width: 16px; height: 16px; flex: none; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; }
.radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.is-selected .radio, .radio.is-on { border-color: var(--accent); }
.is-selected .radio::after, .radio.is-on::after { background: var(--accent); }
.check { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text-on-primary); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; flex: none; }
.check.is-on { border-color: var(--accent-solid); background: var(--accent-solid); }
.check.is-on::after { content: "✓"; }
.check-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left; font: 500 13.5px var(--font); color: var(--ink); }
.check-btn:disabled { color: var(--faint); cursor: default; }
.sr-only-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

/* Toggle switch */
.switch { width: 36px; height: 20px; border-radius: 999px; border: 0; background: var(--border-strong); position: relative; cursor: pointer; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #ffffff; box-shadow: var(--shadow-small); transition: left 0.15s; }
.switch.is-on { background: var(--accent-solid); }
.switch.is-on::after { left: 18px; }

/* Progress bars */
.bar { height: 6px; border-radius: 999px; background: var(--divider); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: flex-start; justify-content: center; z-index: 40; padding: 24px; overflow-y: auto; }
.modal { position: relative; overflow: hidden; background: var(--surface); border-radius: 16px; padding: 28px; width: 100%; max-width: var(--modal-w, 480px); margin: auto 0; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-modal); }
.modal-backdrop[hidden] { display: none; }
.modal-title { font-size: 20px; font-weight: 600; }
.modal-sub { font-size: 13.5px; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Drawer (right side panel) */
.drawer-scrim { position: fixed; inset: 0; background: var(--scrim-light); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); z-index: 31; box-shadow: -12px 0 40px rgba(4, 14, 40, 0.18); display: flex; flex-direction: column; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: var(--on-navy); border-radius: 10px; padding: 11px 18px; font-size: 14px; z-index: 50; box-shadow: 0 10px 28px rgba(4, 14, 40, 0.35); display: flex; gap: 10px; align-items: center; max-width: calc(100vw - 48px); transition: opacity 0.3s; }
.toast::before { content: "✓"; color: var(--on-navy-ok); }
.toast.toast-alert::before { content: "!"; color: var(--on-navy-warn); font-weight: 700; }
.toast.is-leaving { opacity: 0; }

/* Status dot + label line */
.status { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }

/* A small menu that opens under its button (the app page's "⋯" and its More tabs). */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; display: flex; flex-direction: column; padding: 6px;
             background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-pop); }
.tabs-more { align-self: stretch; display: flex; align-items: flex-end; }
.tabs-more .menu-list { left: 0; right: auto; }
.menu-item { padding: 8px 10px; border-radius: 7px; font-size: 14px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.menu-item:hover, .menu-item.is-active { background: var(--tint-2); }
.menu-item.is-disabled { color: var(--subtle); cursor: not-allowed; }
.tabs-more > summary.tab { display: inline-flex; }
