/* ART workspace — gap-closure layout: top-aligned two-column grid */

.art-page {
  /* Platform goldwash aliases — no cool navy ART palette */
  --art-bg: var(--page-bg, #080808);
  --art-surface: var(--card-bg, #111111);
  --art-surface-raised: var(--surface-elevated, #161616);
  --art-border: var(--chip-border, rgba(201, 169, 110, 0.28));
  --art-border-soft: var(--line-color, #2f2f2d);
  --art-text-primary: var(--text-primary, #f7f7f4);
  --art-text-secondary: var(--text-secondary, #c8c0b0);
  --art-text-muted: var(--text-muted, #999994);
  --art-gold: var(--brand-gold, #c9a96e);
  --art-gold-bright: var(--btn-primary-bg, #c9a96e);
  --art-gold-muted: color-mix(in srgb, var(--brand-gold, #c9a96e) 72%, #1a1208);
  --art-gold-soft-bg: var(--chip-bg, rgba(201, 169, 110, 0.08));
  --art-danger: #c97b7b;
  --art-input-bg: rgba(0, 0, 0, 0.35);
  --art-input-border: rgba(201, 169, 110, 0.28);

  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 20px 22px 18px;
  min-height: 100%;
  background: var(--section-page-gradient);
  color: var(--art-text-primary);
  --art-sticky-offset: calc(var(--topbar-height, 56px) + 12px);
}

.art-main,
.art-context-sidebar {
  padding-top: 18px;
}

/* Top-level two-column grid — sidebar aligns with back link */
.art-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 350px);
  column-gap: 18px;
  align-items: start;
}

.art-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.art-context-sidebar {
  width: 350px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: start;
  position: sticky;
  top: var(--art-sticky-offset, calc(var(--topbar-height, 56px) + 12px));
}

/* Header block — compact */
.art-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--art-text-primary);
  cursor: pointer;
  font-family: inherit;
}

.art-back-link:hover { color: var(--art-gold); }

.art-page-title {
  margin: 0;
  font-family: var(--oa-font-display, "Cormorant Garamond", Georgia, serif);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--art-gold);
}

.art-page-desc {
  margin: 5px 0 0;
  max-width: none;
  font-size: 12px;
  line-height: 1.4;
  color: var(--art-text-primary);
}

.art-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 7px;
  font-size: 11px;
  color: var(--art-text-muted);
}

.art-meta-item svg {
  width: 12px;
  height: 12px;
}

.art-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.art-meta-sep {
  width: 1px;
  height: 12px;
  background: var(--art-border-soft);
}

.art-divider {
  border: none;
  border-bottom: 1px solid var(--art-border-soft);
  margin: 13px 0 0;
}

.art-stepper {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  width: 100%;
  margin: 13px 0 11px;
}

.art-step {
  display: flex;
  align-items: center;
  gap: 8px;
}

.art-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.art-step-circle.is-active {
  background: var(--brand-gold, #c9a96e);
  color: #1a1208;
}

.art-step-circle.is-complete {
  background: var(--art-gold-muted);
  color: #1a1208;
}

.art-step-circle.is-inactive {
  background: var(--surface-muted, #1a1a1a);
  color: var(--text-muted, #999994);
}

.art-step-label {
  font-size: 11px;
  color: var(--art-text-muted);
  white-space: nowrap;
}

.art-step-label.is-active {
  color: var(--art-text-primary);
  font-weight: 500;
}

.art-step-connector {
  height: 1px;
  background: var(--line-color, #2f2f2d);
  margin: 0 10px;
  min-width: 16px;
}

/* Section labels */
.art-section-label {
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--art-text-primary);
}

.art-recipients-section {
  margin-top: 8px;
}

/* Cards */
.art-card,
.art-rail-card {
  background: var(--art-surface);
  border: 1px solid var(--art-border);
  border-radius: 7px;
}

.request-details-card {
  padding: 12px 14px 13px;
}

.art-rail-card {
  padding: 11px 13px;
}

/* Form — compact density */
.art-form-grid-row,
.request-fields-row {
  display: grid;
  grid-template-columns: 1.1fr 0.95fr 0.95fr;
  gap: 14px;
  row-gap: 8px;
  margin-bottom: 8px;
}

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

.art-field--compact {
  margin-bottom: 8px;
}

.art-field-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--art-text-primary);
  margin-bottom: 4px;
}

.art-field-label .art-req { color: var(--art-danger); }

.art-field-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.art-field-icon {
  position: absolute;
  left: 10px;
  z-index: 1;
  color: var(--art-text-muted);
  pointer-events: none;
  display: inline-flex;
}

.art-field-with-icon .art-select,
.art-field-with-icon .art-input {
  padding-left: 32px;
}

.art-field-icon svg {
  width: 13px;
  height: 13px;
}

.art-input,
.art-select {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  min-height: 38px;
  background: var(--art-input-bg);
  border: 1px solid var(--art-input-border);
  border-radius: 6px;
  color: var(--art-text-primary);
  font-size: 12px;
  font-family: inherit;
  padding: 0 12px;
}

.art-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999994' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.request-description {
  width: 100%;
  box-sizing: border-box;
  min-height: 70px;
  height: 70px;
  max-height: 110px;
  padding: 7px 11px;
  resize: vertical;
  background: var(--art-input-bg);
  border: 1px solid var(--art-input-border);
  border-radius: 6px;
  color: var(--art-text-primary);
  font-size: 12px;
  font-family: inherit;
  line-height: 1.35;
}

.art-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 82px;
  padding: 8px 12px;
  resize: vertical;
  background: var(--art-input-bg);
  border: 1px solid var(--art-input-border);
  border-radius: 6px;
  color: var(--art-text-primary);
  font-size: 12.5px;
  font-family: inherit;
  line-height: 1.35;
}

.art-input:focus,
.art-select:focus,
.art-textarea:focus,
.request-description:focus {
  outline: none;
  border-color: var(--brand-gold, #c9a96e);
  box-shadow: 0 0 0 1px rgba(201, 169, 110, 0.15);
}

.art-char-count {
  text-align: right;
  font-size: 11px;
  color: var(--art-text-muted);
  margin-top: 2px;
}

.art-field-error {
  font-size: 11.5px;
  color: var(--art-danger);
  margin: 2px 0 0;
}

.art-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 14px;
  margin-top: 8px;
  border: none;
  border-radius: 6px;
  background: var(--art-gold-bright);
  color: #1a1208;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.art-ai-btn svg {
  width: 12px;
  height: 12px;
}

.art-field-hint {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--art-text-muted);
  min-height: 1em;
}

/* Recipients */
.art-recipient-tabs {
  display: flex;
  align-items: center;
  min-height: 40px;
  border-bottom: 1px solid var(--art-border-soft);
  margin-bottom: 0;
  padding: 0;
}

.art-recipient-tab {
  padding: 9px 13px;
  border: none;
  background: none;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--art-text-muted);
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.art-recipient-tab.is-active {
  color: var(--art-gold);
  border-bottom-color: var(--art-gold);
}

.art-new-contact-link {
  margin-left: auto;
  padding: 10px 0;
  border: none;
  background: none;
  font-size: 12px;
  color: var(--art-gold);
  cursor: pointer;
  font-family: inherit;
}

.art-recipients-section .art-card {
  padding: 0 12px 10px;
}

.art-recipient-search {
  position: relative;
  margin: 8px 0;
}

.art-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--art-text-muted);
  pointer-events: none;
}

.art-recipient-search input {
  width: 100%;
  height: 33px;
  padding: 0 12px 0 32px;
  background: var(--art-input-bg);
  border: 1px solid var(--art-input-border);
  border-radius: 6px;
  color: var(--art-text-primary);
  font-size: 11px;
}

.art-recipient-search input::placeholder {
  color: var(--art-text-muted);
  opacity: 0.85;
}

.art-recipient-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}

.art-recipient-table th {
  text-align: left;
  padding: 4px 8px;
  font-weight: 600;
  color: var(--art-text-muted);
  border-bottom: 1px solid var(--art-border-soft);
  font-size: 10px;
  text-transform: none;
  letter-spacing: normal;
}

.art-recipient-table td {
  padding: 4px 8px;
  height: 28px;
  min-height: 28px;
  border-bottom: 1px solid var(--art-border-soft);
  color: var(--art-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.art-recipient-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.art-recipient-table tr.is-selected td {
  background: rgba(201, 169, 110, 0.06);
}

.art-recipient-table tr.is-disabled td {
  opacity: 0.55;
}

.art-email-cell {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.art-email-missing-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.art-email-missing {
  color: var(--art-text-muted);
  font-style: italic;
  font-size: 10.5px;
}

.art-email-add-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--art-gold);
  font-size: 10.5px;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.art-email-add-link:hover {
  text-decoration: underline;
}

.art-checkbox {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--art-gold);
  cursor: pointer;
  opacity: 1;
}

.art-checkbox:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.art-empty-cell {
  padding: 12px 8px !important;
  color: var(--art-text-muted);
  font-size: 12px;
}

/* Actions */
.art-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.art-btn-primary {
  height: 39px;
  min-width: 135px;
  padding: 0 22px;
  border: none;
  border-radius: 6px;
  background: var(--art-gold-bright);
  color: #1a1208;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.art-btn-secondary {
  height: 39px;
  min-width: 125px;
  padding: 0 22px;
  border: 1px solid var(--art-border);
  border-radius: 6px;
  background: transparent;
  color: var(--art-text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.art-btn-secondary:hover {
  border-color: rgba(201, 169, 110, 0.45);
}

/* Sidebar */
.art-rail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.art-rail-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--art-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.art-rail-title--conf {
  font-size: 13px;
}

.art-rail-desc {
  margin: 2px 0 6px;
  font-size: 10.8px;
  line-height: 1.3;
  color: var(--art-text-secondary);
}

.art-rail-note {
  margin: 0 0 6px;
  font-size: 10px;
  line-height: 1.3;
  color: var(--art-text-muted);
  font-style: italic;
}

.art-rail-chevron {
  background: none;
  border: none;
  color: var(--art-text-muted);
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.art-guidance-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.art-guidance-list li {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--art-text-secondary);
}

.art-guidance-check {
  color: var(--art-gold);
  flex-shrink: 0;
}

/* Suggested evidence — compact, max 5 visible */
.art-suggestion-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.art-suggestion-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 0;
  font-size: 11px;
  color: var(--art-text-primary);
  border-bottom: 1px solid var(--line-color, #2f2f2d);
}

.art-suggestion-icon svg {
  width: 12px;
  height: 12px;
}

.art-suggestion-text {
  flex: 1;
  min-width: 0;
  line-height: 1.3;
  font-size: 11px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.art-suggestion-add {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--art-border);
  background: var(--art-surface-raised);
  color: var(--art-gold);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.art-suggestion-added {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--art-gold);
  font-weight: 600;
}

.art-suggestion-dup {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--art-text-muted);
  font-style: italic;
}

.art-view-all-link {
  margin-top: 6px;
  padding: 0;
  border: none;
  background: none;
  color: var(--art-gold);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
}

/* Related tools — 3 col + compact granola */
.art-tool-grid--providers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 5px;
}

.art-tool-granola-wrap {
  display: flex;
}

.art-tool-granola-wrap .art-tool-btn {
  width: fit-content;
  min-width: 150px;
  max-width: 210px;
}

.art-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  min-height: 32px;
  padding: 0 7px;
  border: 1px solid var(--art-border);
  border-radius: 6px;
  background: var(--art-surface-raised);
  color: var(--art-text-primary);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.art-tool-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.art-tool-granola-wrap .art-tool-btn {
  width: fit-content;
  min-width: 150px;
  max-width: 205px;
  height: 31px;
  min-height: 31px;
}

.art-tool-btn.is-disconnected { opacity: 0.72; }

/* Attachments */
.art-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 76px;
  border: 1px dashed rgba(201, 169, 110, 0.35);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  text-align: center;
  padding: 10px;
}

.art-dropzone-icon { color: var(--art-text-muted); }

.art-dropzone-text {
  font-size: 10.5px;
  color: var(--art-text-secondary);
  line-height: 1.25;
}

.art-dropzone-hint {
  font-size: 9.5px;
  color: var(--art-text-muted);
}

.art-confidentiality-text {
  margin: 3px 0 0;
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--art-text-secondary);
}

.art-register-section {
  margin-top: 18px;
}

.art-register-head h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.art-register-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--art-border);
  border-radius: 7px;
  background: var(--art-surface);
}

.art-register-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.art-register-table th {
  text-align: left;
  padding: 8px 10px;
  font-weight: 500;
  color: var(--art-text-muted);
  background: var(--art-surface-raised);
  border-bottom: 1px solid var(--art-border);
  font-size: 11px;
}

.art-register-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--art-border-soft);
}

/* Detail, review, misc — retain from prior pass */
.art-review-panel,
.art-detail-panel {
  background: var(--art-surface);
  border: 1px solid var(--art-border);
  border-radius: 7px;
  padding: 16px 18px;
  margin-top: 8px;
}

.art-notice {
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 6px;
  background: var(--art-gold-soft-bg);
  border: 1px solid rgba(201, 169, 110, 0.25);
  font-size: 12px;
}

.art-notice.is-error {
  background: rgba(201, 123, 123, 0.08);
  border-color: rgba(201, 123, 123, 0.3);
  color: var(--art-danger);
}

.art-manual-form { display: grid; gap: 10px; max-width: 480px; }
.art-manual-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.art-empty-inline { margin: 8px 0; font-size: 12px; color: var(--art-text-muted); }

.art-status-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid var(--art-border);
  color: var(--art-text-secondary);
}

.art-status-chip.is-overdue {
  color: var(--art-danger);
  border-color: rgba(201, 123, 123, 0.35);
}

.art-view-link {
  background: none;
  border: none;
  color: var(--art-gold);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.art-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}

.art-modal {
  width: min(420px, 100%);
  background: var(--art-surface);
  border: 1px solid var(--art-border);
  border-radius: 7px;
  padding: 18px;
}

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

/* ART is a full page — ensure shell allows normal document scroll */
.app-shell.is-art-open .workspace,
.app-shell.is-art-open .content {
  overflow: visible;
  pointer-events: auto;
  user-select: auto;
}

/* Cancel duplicate shell content inset — art-page owns horizontal padding */
.app-shell.is-art-open .content {
  padding: 0;
  background: var(--section-page-gradient);
}

/* Hide floating Atlas assistant on ART */
.app-shell.is-art-open .agpt-assistant {
  display: none !important;
}

/* ART active top-bar state */
.audit-tool-toggle.ask-style-toggle.is-art-active {
  background: var(--brand-gold, #c9a96e) !important;
  color: #1a1208 !important;
  border-color: var(--brand-gold, #c9a96e) !important;
}

/* Responsive */
@media (max-width: 1300px) {
  .art-workspace {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  .art-context-sidebar { width: 320px; }
}

@media (max-width: 1100px) {
  .art-workspace {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
  .art-context-sidebar { width: 310px; }
}

@media (max-width: 950px) {
  .art-workspace { grid-template-columns: 1fr; }
  .art-context-sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }
}

/* ── ART shell: compact sidebar, title-case nav, goldwash ── */
.app-shell.is-art-open {
  --app-sidebar-rail: 248px;
}

.app-shell.is-art-open .sidebar {
  padding: 12px 10px;
}

.app-shell.is-art-open .sidebar-tagline {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: none;
}

.app-shell.is-art-open .nav-link,
.app-shell.is-art-open .nav-group-toggle {
  font-family: var(--font-ui, "IBM Plex Sans", "Inter", sans-serif);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  min-height: 32px;
  padding: 6px 10px;
}

.app-shell.is-art-open .nav-link.active {
  background: color-mix(in srgb, var(--brand-gold, #c9a96e) 12%, transparent);
  border-color: color-mix(in srgb, var(--brand-gold, #c9a96e) 35%, var(--line));
  color: var(--brand-gold, #c9a96e);
}

.app-shell.is-art-open .theme-toggle-label {
  display: none;
}

.app-shell.is-art-open .theme-toggle {
  min-width: 0;
  padding: 0 4px;
}

.app-shell.is-art-open .topbar {
  min-height: 52px;
  padding: 8px 16px;
  gap: 12px;
}

.app-shell.is-art-open .topbar-title-text {
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}

@media (max-width: 700px) {
  .art-form-grid-row,
  .request-fields-row,
  .art-manual-form-grid {
    grid-template-columns: 1fr;
  }
  .art-tool-grid--providers {
    grid-template-columns: 1fr 1fr;
  }
}
