/* =========================================================
   LuxNote AI
   Dashboard, Projects, and Report Page Layouts
   ========================================================= */

/* =========================================================
   SHARED UTILITIES
   ========================================================= */

.is-hidden {
  display: none !important;
}

.subpage-shell {
  width: calc(100% - (var(--page-gap) * 2));
  max-width: 1440px;
  margin: 18px auto;
}

.subpage-panel,
.report-panel {
  min-height: 0;
}

/* =========================================================
   DASHBOARD LAYOUT
   ========================================================= */

.dashboard-shell {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-areas: "form results" !important;
  gap: 18px !important;
  align-items: stretch !important;
  width: calc(100% - (var(--page-gap) * 2));
  max-width: 1440px;
  margin-inline: auto;
}

.dashboard-shell .form-panel {
  grid-area: form !important;
}

.dashboard-shell .results-panel {
  grid-area: results !important;
}

.dashboard-shell .form-panel,
.dashboard-shell .results-panel {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 20px;
  align-self: stretch;
}

.dashboard-shell .results-panel {
  display: flex !important;
  flex-direction: column;
}

.dashboard-shell .results-panel.is-hidden {
  display: flex !important;
}

.dashboard-shell .section-heading {
  margin-bottom: 14px;
}

.dashboard-shell textarea {
  min-height: 205px;
}

/* Placeholder Quick Result state */

.results-panel.is-hidden #generation-status,
.results-panel.is-hidden .quick-result-meta,
.results-panel.is-hidden .quick-summary-card,
.results-panel.is-hidden .quick-actions-card,
.results-panel.is-hidden .report-actions {
  opacity: 0.48;
}

.results-panel.is-hidden .quick-summary-card,
.results-panel.is-hidden .quick-actions-card {
  display: block;
}

/* Quick Result content */

.quick-result-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: 8px;
  margin-bottom: 10px;
}

.quick-summary-card,
.quick-actions-card {
  margin-bottom: 8px;
}

.quick-summary-card {
  min-height: 112px;
}

.quick-actions-card {
  min-height: 126px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.report-actions .primary-link,
.report-actions .secondary-link {
  flex: 1 1 180px;
}

/* =========================================================
   HERO
   ========================================================= */

.compact-hero {
  display: grid !important;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr) !important;
  grid-template-rows: minmax(110px, auto) 34px !important;
  grid-template-areas:
    "logo headline"
    "create open" !important;

  align-items: center !important;
  justify-items: center !important;

  column-gap: 48px !important;
  row-gap: 14px !important;

  min-height: 210px !important;
  max-height: 260px !important;
  padding: 22px 44px !important;

  overflow: hidden !important;
  text-align: left;
}

.compact-hero::before,
.compact-hero::after,
.compact-hero .hero-logo-cell::before,
.compact-hero .hero-logo-cell::after,
.compact-hero .hero-headline-cell::before,
.compact-hero .hero-headline-cell::after {
  display: none !important;
  content: none !important;
}

.compact-hero .hero-logo-cell {
  grid-area: logo !important;
  display: grid !important;
  width: 100%;
  min-width: 0;
  min-height: 100px;
  padding: 0 !important;
  place-items: center;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.compact-hero .hero-brand-logo {
  display: block !important;
  width: min(100%, 620px) !important;
  max-width: 620px !important;
  max-height: 155px !important;
  object-fit: contain !important;
  object-position: center !important;
  background: transparent !important;
  border: 0 !important;
}

.compact-hero .hero-headline-cell {
  grid-area: headline !important;
  width: 100%;
  max-width: 640px;
  min-width: 0;
  padding: 0 !important;
  justify-self: start !important;
  text-align: left !important;
}

.compact-hero .hero-headline-cell .eyebrow {
  margin: 0 0 8px !important;
  font-size: 0.64rem !important;
  letter-spacing: 0.24em !important;
  text-align: left !important;
}

.compact-hero .hero-headline-cell h1 {
  width: 100% !important;
  max-width: 640px !important;
  margin: 0 !important;
  font-size: clamp(1.8rem, 2.35vw, 2.7rem) !important;
  line-height: 1.06 !important;
  text-align: left !important;
  text-wrap: balance;
}

.compact-hero .hero-button-left {
  grid-area: create !important;
}

.compact-hero .hero-button-right {
  grid-area: open !important;
}

.compact-hero .hero-button-left,
.compact-hero .hero-button-right {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: min(100%, 300px) !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 5px 16px !important;

  justify-self: center !important;

  border-radius: 8px !important;

  font-size: 0.74rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: 0.08em !important;
  text-align: center !important;

  overflow: hidden;
  position: relative;

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.compact-hero .hero-button-left:hover,
.compact-hero .hero-button-right:hover {
  transform: translateY(-1px);
}

/* Remove obsolete decorative ambient light */

.ambient-light-one {
  display: none !important;
}

/* =========================================================
   PROJECTS PAGE
   ========================================================= */

.project-folder-grid {
  display: grid;
  gap: 8px;
}

.project-folder-card {
  overflow: hidden;
  border: 1px solid rgba(82, 66, 61, 0.16);
  border-radius: 10px;
  background: rgba(255, 253, 250, 0.94);
  box-shadow: 0 7px 16px rgba(82, 66, 61, 0.055);
}

.project-folder-card > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  cursor: pointer;
  list-style: none;
}

.project-folder-card > summary::-webkit-details-marker {
  display: none;
}

.project-folder-card > summary:focus-visible {
  outline: 3px solid rgba(167, 124, 120, 0.18);
  outline-offset: -3px;
}

.project-cover-thumb {
  display: grid;
  width: 42px;
  height: 32px;
  flex: 0 0 auto;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(82, 66, 61, 0.16);
  border-radius: 9px;
  color: var(--warm-brown, #6a4943);
  background: var(--surface-soft, #f8f2ed);
}

.project-cover-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-cover-thumb.no-cover {
  font-size: 0.64rem;
}

.folder-mark {
  display: grid;
  width: 28px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(82, 66, 61, 0.18);
  border-radius: 9px;
  color: var(--warm-brown, #6a4943);
  background: var(--surface-soft, #f8f2ed);
}

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

.folder-copy strong,
.folder-copy small {
  display: block;
}

.folder-copy strong {
  color: var(--text, #391214);
  overflow-wrap: anywhere;
}

.folder-copy small {
  margin-top: 2px;
  color: var(--muted-text, #887d77);
  font-size: 0.62rem;
  line-height: 1.28;
}

.folder-arrow {
  color: var(--muted-text, #887d77);
  font-size: 0.96rem;
  transition: transform 0.2s ease;
}

.project-folder-card[open] .folder-arrow {
  transform: rotate(90deg);
}

.project-note-list {
  display: grid;
  gap: 3px;
  padding: 0 8px 8px;
}

.project-note-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;

  padding: 0;

  border: 1px solid rgba(82, 66, 61, 0.14);
  border-radius: 9px;

  color: var(--body-text, #52423d);
  background: rgba(255, 253, 250, 0.9);

  text-decoration: none;

  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.project-note-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  color: inherit;
  text-decoration: none;
}

.project-note-row:hover {
  border-color: rgba(167, 124, 120, 0.34);
  background: #fffdf9;
  box-shadow: 0 6px 14px rgba(82, 66, 61, 0.07);
  transform: translateY(-1px);
}

.project-note-row:focus-visible {
  outline: 3px solid rgba(167, 124, 120, 0.18);
  outline-offset: 2px;
}

.project-note-row strong,
.project-note-row small {
  display: block;
}

.project-note-row strong {
  color: var(--text, #391214);
  font-size: 0.76rem;
  line-height: 1.25;
  text-transform: capitalize;
}

.project-note-row small {
  margin-top: 2px;
  color: var(--muted-text, #887d77);
  font-size: 0.58rem;
  line-height: 1.25;
}

.note-priority {
  flex: 0 0 auto;
  padding: 1px 5px;
  border: 1px solid rgba(82, 66, 61, 0.14);
  border-radius: 4px;
  color: var(--sienna, #4a2325);
  background: var(--surface-soft, #f8f2ed);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.records-message {
  padding: 14px;
  border-radius: 12px;
  color: var(--body-text, #52423d);
  background: rgba(255, 253, 250, 0.9);
}

/* =========================================================
   REPORT PAGE
   ========================================================= */

.report-panel {
  max-width: 1240px;
  margin-inline: auto;
  padding: 22px !important;
  color: var(--body-text, #52423d) !important;
  background: #fffdf9 !important;
}

.report-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

#report-project-name {
  margin: 4px 0 6px !important;
  color: var(--raspberry, #2a1716) !important;
  -webkit-text-fill-color: var(--raspberry, #2a1716) !important;
  font-size: clamp(1.55rem, 3vw, 2.45rem) !important;
  line-height: 1.05 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
}

#report-client {
  margin: 0 !important;
  color: var(--warm-brown, #6a4943) !important;
  font-size: 0.82rem !important;
}

/* Report toolbar */

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.report-toolbar .secondary-button,
.report-toolbar .secondary-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  min-height: 32px !important;
  padding: 6px 11px !important;

  border: 1px solid rgba(82, 66, 61, 0.28) !important;
  border-radius: 9px !important;

  color: #fffdfc !important;
  -webkit-text-fill-color: #fffdfc !important;

  background: linear-gradient(180deg, #74514b, #5b3c37) !important;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 5px 12px rgba(82, 66, 61, 0.12) !important;

  font-size: 0.68rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

.report-toolbar .secondary-button:hover,
.report-toolbar .secondary-link:hover {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: linear-gradient(180deg, #8a625b, #6a4943) !important;
  border-color: var(--muted-rose, #a77c78) !important;
  transform: translateY(-1px);
}

/* Cover photo */

.report-cover-card {
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 14px;
}

.report-cover-card img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}

/* Report summary cards */

.report-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.report-summary-strip .summary-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  min-height: 0;
  width: auto;
  max-width: 100%;
  padding: 5px 7px;

  background: rgba(255, 250, 246, 0.78) !important;
  border: 1px solid rgba(82, 66, 61, 0.16) !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}

.report-summary-strip .summary-label {
  display: inline;
  margin: 0;

  color: var(--moon-rock, #887d77) !important;
  font-size: 0.54rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.report-summary-strip strong {
  display: inline;
  min-width: 0;

  color: var(--raspberry, #2a1716) !important;
  -webkit-text-fill-color: var(--raspberry, #2a1716) !important;
  font-size: 0.68rem;
  line-height: 1.2;
  overflow-wrap: break-word;
}

/* Report content cards */

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

.report-wide {
  grid-column: 1 / -1;
}

.report-grid .result-card {
  min-width: 0;
  padding: 14px;
  color: var(--body-text, #52423d) !important;
  background: #fffdf9 !important;
  border: 1px solid rgba(82, 66, 61, 0.16) !important;
  box-shadow: 0 7px 16px rgba(82, 66, 61, 0.055) !important;
}

.report-grid .card-kicker {
  color: var(--moon-rock, #887d77) !important;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.report-grid h2,
.report-grid .result-card h2 {
  margin: 4px 0 9px;
  color: var(--sienna, #4a2325) !important;
  -webkit-text-fill-color: var(--sienna, #4a2325) !important;
  font-size: 1.12rem;
  line-height: 1.18;
  text-shadow: none !important;
}

.report-grid p,
.report-grid li,
.report-grid pre {
  color: var(--body-text, #52423d) !important;
  font-size: 0.82rem;
  line-height: 1.48;
}

.report-grid ol {
  margin: 0;
  padding-left: 1.35rem;
}

.report-grid li + li {
  margin-top: 5px;
}

#report-draft {
  margin: 0;
  padding: 12px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-family: inherit;
  background: var(--surface-soft, #f8f2ed);
  border: 1px solid rgba(82, 66, 61, 0.14);
  border-radius: 10px;
}

#report-notes,
.original-notes {
  margin-bottom: 0;
  white-space: pre-wrap;
}

/* Key phrase tags */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  padding: 3px 7px;
  border: 1px solid rgba(82, 66, 61, 0.16);
  border-radius: 999px;
  color: var(--sienna, #4a2325);
  background: var(--surface-soft, #f8f2ed);
  font-size: 0.66rem;
}

/* Simplified report page background */

body:has(.report-panel) {
  background-image:
    linear-gradient(
      145deg,
      #fbf7f2 0%,
      #f7f1eb 56%,
      #f0e5dd 100%
    ) !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
  .compact-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 28px !important;
    padding: 20px 28px !important;
  }

  .compact-hero .hero-brand-logo {
    width: min(100%, 540px) !important;
    max-height: 128px !important;
  }

  .compact-hero .hero-headline-cell h1 {
    font-size: clamp(1.35rem, 2.4vw, 2rem) !important;
  }

  .compact-hero .hero-button-left,
  .compact-hero .hero-button-right {
    width: min(100%, 280px) !important;
  }
}

@media (max-width: 950px) {
  .dashboard-shell {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "form"
      "results" !important;
  }

  .report-heading {
    display: grid;
    align-items: start;
  }

  .report-summary-strip {
    gap: 7px;
  }
}

@media (max-width: 820px) {
  .compact-hero {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    grid-template-areas:
      "logo"
      "headline"
      "create"
      "open" !important;

    row-gap: 10px !important;
    min-height: auto !important;
    max-height: none !important;
    padding: 18px 22px !important;
    text-align: center !important;
  }

  .compact-hero .hero-headline-cell {
    max-width: 560px;
    justify-self: center !important;
    text-align: center !important;
  }

  .compact-hero .hero-brand-logo {
    width: min(100%, 460px) !important;
    max-height: 112px !important;
  }

  .compact-hero .hero-headline-cell .eyebrow {
    margin: 4px 0 5px !important;
    text-align: center !important;
  }

  .compact-hero .hero-headline-cell h1 {
    max-width: 560px !important;
    font-size: clamp(1.35rem, 5vw, 2rem) !important;
    text-align: center !important;
  }

  .compact-hero .hero-button-left,
  .compact-hero .hero-button-right {
    width: min(100%, 340px) !important;
  }
}

@media (max-width: 680px) {
  .dashboard-shell .form-panel,
  .dashboard-shell .results-panel {
    padding: 20px;
  }

  .quick-result-meta,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .report-wide {
    grid-column: auto;
  }

  .project-folder-card > summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 9px 10px;
  }

  .project-note-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-panel {
    padding: 22px !important;
  }

  .report-toolbar {
    width: 100%;
  }

  .report-toolbar .secondary-button,
  .report-toolbar .secondary-link {
    flex: 1 1 150px;
  }

  #report-project-name {
    font-size: clamp(1.55rem, 8vw, 2.35rem) !important;
  }
}

@media (max-width: 520px) {
  .compact-hero {
    padding: 16px !important;
    border-radius: 16px;
  }

  .compact-hero .hero-brand-logo {
    width: min(100%, 320px) !important;
    max-height: 84px !important;
  }

  .compact-hero .hero-headline-cell .eyebrow {
    font-size: 0.52rem !important;
    letter-spacing: 0.18em !important;
  }

  .compact-hero .hero-headline-cell h1 {
    font-size: clamp(1.2rem, 6.4vw, 1.65rem) !important;
    line-height: 1.06 !important;
  }

  .compact-hero .hero-button-left,
  .compact-hero .hero-button-right {
    width: 100% !important;
    max-width: 320px !important;
    height: 36px !important;
    min-height: 36px !important;
  }

  .project-cover-thumb {
    width: 42px;
    height: 32px;
  }
}

/* =========================================================
   PRINT
   ========================================================= */

@media print {
  body::before,
  body::after,
  .site-header,
  .report-toolbar,
  .ambient-light,
  .page-noise {
    display: none !important;
  }

  body {
    color: #111 !important;
    background: #fff !important;
    background-image: none !important;
  }

  .subpage-shell {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .report-panel,
  .result-card,
  .summary-card {
    color: #111 !important;
    background: #fff !important;
    border-color: #ccc !important;
    box-shadow: none !important;
  }

  #report-project-name,
  .report-grid h2,
  .report-summary-strip strong,
  .report-grid p,
  .report-grid li,
  .report-grid pre {
    color: #111 !important;
    -webkit-text-fill-color: #111 !important;
  }

  .report-grid {
    display: block;
  }

  .report-grid .result-card {
    margin-bottom: 14px;
    break-inside: avoid;
  }

  .report-summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* FINAL ALIGNED HERO */
@media (min-width: 1101px) {
  .hero-shell {
    width: calc(100% - (var(--page-gap) * 2)) !important;
    max-width: 1440px !important;
  }

  .compact-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(130px, auto) 38px !important;
    grid-template-areas:
      "logo headline"
      "create open" !important;

    column-gap: 24px !important;
    row-gap: 18px !important;

    min-height: 250px !important;
    max-height: none !important;
    padding: 24px 0 !important;
  }

  .compact-hero .hero-logo-cell,
  .compact-hero .hero-headline-cell {
    width: 100% !important;
    min-width: 0 !important;
    padding-inline: 28px !important;
  }

  .compact-hero .hero-logo-cell {
    display: grid !important;
    place-items: center !important;
  }

  .compact-hero .hero-brand-logo {
    display: block !important;
    width: min(100%, 510px) !important;
    max-width: 510px !important;
    max-height: 120px !important;
    height: auto !important;
    margin: 0 auto !important;
    transform: none !important;
    object-fit: contain !important;
  }

  .compact-hero .hero-headline-cell {
    max-width: none !important;
    align-self: center !important;
    justify-self: stretch !important;
    text-align: left !important;
  }

  .compact-hero .hero-headline-cell h1 {
    max-width: 560px !important;
    margin-right: auto !important;
    font-size: clamp(1.9rem, 2.45vw, 2.55rem) !important;
    line-height: 1.04 !important;
  }

  .compact-hero .hero-button-left,
  .compact-hero .hero-button-right {
    width: calc(100% - 56px) !important;
    max-width: none !important;
    justify-self: center !important;
  }
}
