/* ── app-panels-forms.css — add/create panels, long-string overflow, generic form scaffolding ── */
/* Auto-split from app.css 2026-05-27 (Phase J.6). Cascade order preserved by
   the <link> sequence in index.html. Edit the file whose concern matches your
   change; do NOT recreate app.css. See _docs/canonical/coding-conventions.md §0. */

/* ── Add / create panels ─────────────────────────────────────────────────── */
.add-panel {
  background: var(--panel-bg);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0;
  overflow: hidden;
}

.add-panel[hidden] { display: none; }

.add-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border-soft);
}

.add-panel-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.add-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  transition: background 120ms, color 120ms;
}

.add-panel-close:hover { background: var(--panel-alt); color: var(--text); }

.add-panel-body {
  padding: 20px 24px;
}

.section,
.note-card,
.workflow-card,
.summary-pill,
.stack-form,
.filter-panel,
.team-card {
  padding: 22px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.section-header h3,
.note-card strong,
.summary-pill strong {
  display: block;
  margin-bottom: 6px;
}

.section-header h3 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.section-header .muted {
  max-width: 64ch;
}

.summary-strip {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.summary-pill {
  background: linear-gradient(180deg, var(--panel-bg), var(--panel-alt));
}

.summary-pill strong {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.1;
}

.workflow-grid,
.card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workflow-card {
  display: grid;
  gap: 8px;
  align-content: start;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.workflow-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.workflow-card span:first-child {
  font-weight: 600;
}

.workflow-card span:last-child {
  color: var(--muted);
  font-size: 0.92rem;
}

.tool-grid,
.details-grid,
.filter-row,
.form-grid,
.grid-three,
.permission-grid {
  display: grid;
  gap: 18px;
}

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

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

.details-grid > div {
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-all;
}

.filter-panel {
  padding: 18px;
}

.filter-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid label,
.form-grid > * {
  min-width: 0;
}

.meta-ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--panel-alt);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 3px 12px;
  margin-bottom: 4px;
}

.grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 0.93rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-bg);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

body[data-color-scheme="dark"] input:not([type="checkbox"]):not([type="color"]):not([type="range"]):not([type="submit"]):not([type="file"]),
body[data-color-scheme="dark"] select,
body[data-color-scheme="dark"] textarea,
body[data-color-scheme="event"] input:not([type="checkbox"]):not([type="color"]):not([type="range"]):not([type="submit"]):not([type="file"]),
body[data-color-scheme="event"] select,
body[data-color-scheme="event"] textarea {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(108, 215, 255, 0.24);
}

/* Native dropdown options always render on an OS-native (light) background;
   force dark text so they're readable in every theme. */
select option {
  color: #111;
  background: #fff;
}

body[data-color-scheme="dark"] input:not([type="checkbox"]):not([type="color"]):focus-visible,
body[data-color-scheme="dark"] select:focus-visible,
body[data-color-scheme="dark"] textarea:focus-visible,
body[data-color-scheme="event"] input:not([type="checkbox"]):not([type="color"]):focus-visible,
body[data-color-scheme="event"] select:focus-visible,
body[data-color-scheme="event"] textarea:focus-visible {
  background: rgba(108, 215, 255, 0.06);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--accent);
  margin: 2px 0 0;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
.nav-button:focus-visible,
.workflow-card:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.permission-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  font-weight: 500;
}

.permission-copy {
  display: grid;
  gap: 4px;
}

.permission-title {
  font-weight: 600;
  color: var(--text);
}

.permission-hint {
  color: var(--muted);
  font-size: 0.89rem;
  line-height: 1.45;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #071017;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.button:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.button-secondary {
  background: var(--panel-bg);
  color: var(--text);
  border-color: var(--border-soft);
  box-shadow: none;
}

.button-ghost {
  background: var(--panel-alt);
  color: var(--text);
  border-color: var(--border-soft);
  box-shadow: none;
}

.button-secondary:hover,
.button-ghost:hover {
  background: var(--panel-bg);
  border-color: var(--border);
}

.button-danger {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
  box-shadow: none;
}

.button-danger:hover {
  opacity: 0.88;
}

.button-warning {
  background: var(--warning);
  color: #ffffff;
  border-color: var(--warning);
  box-shadow: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ── Long-string overflow: hashes, URLs, passwords never burst containers ── */

pre, code {
  overflow-wrap: break-word;
  word-break: break-all;
  white-space: pre-wrap;
  max-width: 100%;
}

/* Any value cell (dd) in a details or form panel */
dd {
  overflow-wrap: break-word;
  word-break: break-all;
  min-width: 0;
}

