/* ============================================
   SUMMARY PREVIEW — a real Minutely summary, rendered the way the app does
   ============================================
   .app-summary is a 1:1 port of the app's summary page CSS
   (main.swift → RightPanelView.renderedPage), with `body` rules moved onto
   the container and the user's saved typography overrides
   (~/.teams-obs-summary-styles.json) applied last, as buildCSSOverrides does.
   Accent #0568a1; mention tints computed like hexLightBg / hexDarkBg. */

.summary-preview {
  padding-top: clamp(16px, 2.5vh, 28px);
  padding-bottom: clamp(16px, 2.5vh, 28px);
  text-align: center;
}
.summary-preview .section-lead { margin-inline: auto; }

.summary-window {
  --sw-bg: #fdfdfc;
  position: relative;
  max-width: 820px;
  margin: var(--space-5) auto 0;
  text-align: left;
  border-radius: 12px;
  background: var(--sw-bg);
  /* Same edge + shadow as the scrolled top nav (.top-nav.is-scrolled .top-nav-shell) */
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Title bar: traffic lights + window title */
.summary-window-bar {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(14, 15, 18, 0.06);
  background: linear-gradient(180deg, #f6f6f4 0%, #efefec 100%);
  font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Helvetica Neue", var(--font-sans);
  color: #6b6b78;
}
.summary-window-dots { display: flex; gap: 7px; }
.summary-window-dots span { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.15); }
.summary-window-dots span:nth-child(1) { background: #ff5f57; }
.summary-window-dots span:nth-child(2) { background: #febc2e; }
.summary-window-dots span:nth-child(3) { background: #28c840; }
.summary-window-title { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* App toolbar row (as in the app's summary panel) */
.summary-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 0;
  font: 400 11.5px/1 -apple-system, BlinkMacSystemFont, "Helvetica Neue", var(--font-sans);
  color: #6e6e7c;
}
.summary-toolbar-item { display: inline-flex; align-items: center; gap: 4px; user-select: none; }
.summary-toolbar-item .material-symbols-outlined { font-size: 14px; }
.summary-copy {
  appearance: none;
  border: 1px solid rgba(14, 15, 18, 0.10);
  background: #fff;
  color: #2a2a36;
  border-radius: 7px;
  padding: 5px 9px;
  font: 500 11.5px/1 -apple-system, BlinkMacSystemFont, "Helvetica Neue", var(--font-sans);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-smooth), border-color var(--dur-fast) var(--ease-smooth);
}
.summary-copy:hover { background: #f4f4f2; border-color: rgba(14, 15, 18, 0.16); }
.summary-copy .material-symbols-outlined { font-size: 14px; }
.summary-copy.is-copied { color: var(--color-success); border-color: rgba(31, 157, 85, 0.35); }

/* Collapsible body. Collapsed: a fixed-height preview with a bottom fade —
   no inner scroll, so the page wheel never gets trapped. Expanded: full height. */
.summary-body {
  position: relative;
  height: 460px;
  overflow: hidden;
  transition: height 700ms var(--ease-out-expo);
}
.summary-scroll {
  height: 100%;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(5, 104, 161, 0.45) transparent;
}
.summary-scroll::-webkit-scrollbar { width: 8px; }
.summary-scroll::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(5, 104, 161, 0.42);
  background-clip: padding-box;
  border: 2px solid transparent;
}
.summary-window.is-expanded .summary-scroll { height: auto; overflow: visible; }

.summary-body::before,
.summary-body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 8px;
  pointer-events: none;
  z-index: 1;
  transition: opacity 300ms var(--ease-smooth);
}
.summary-body::before {
  top: 0;
  height: 48px;
  background: linear-gradient(0deg, rgba(253, 253, 252, 0) 0%, var(--sw-bg) 90%);
  opacity: 0;
}
.summary-body::after {
  bottom: 0;
  height: 120px;
  background: linear-gradient(180deg, rgba(253, 253, 252, 0) 0%, var(--sw-bg) 85%);
}
.summary-window.is-expanded .summary-body::before,
.summary-window.is-expanded .summary-body::after { opacity: 0; }

.summary-toggle {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 16px 9px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  backdrop-filter: blur(10px) saturate(160%);
  box-shadow: var(--shadow-md);
  font: 500 0.85rem/1 var(--font-sans);
  color: var(--color-ink);
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-out-expo), box-shadow var(--dur-base) var(--ease-smooth);
}
.summary-toggle:hover { transform: translateX(-50%) translateY(-1px); box-shadow: var(--shadow-lg); }
.summary-toggle .material-symbols-outlined { font-size: 18px; transition: transform 400ms var(--ease-out-expo); }
.summary-window.is-expanded .summary-toggle { position: static; transform: none; margin: 4px auto 18px; display: flex; width: max-content; }
.summary-window.is-expanded .summary-toggle .material-symbols-outlined { transform: rotate(180deg); }

/* Floating "Collapse" pill while reading the expanded summary */
.summary-float {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface-translucent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  box-shadow: var(--shadow-md);
  font: 500 0.85rem/1 var(--font-sans);
  color: var(--color-ink);
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 300ms var(--ease-smooth), transform 400ms var(--ease-out-expo);
}
.summary-float .material-symbols-outlined { font-size: 18px; }
.summary-float.is-shown { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.summary-float:hover { box-shadow: var(--shadow-lg); }

/* ---------- App summary CSS (scoped port) ---------- */
.app-summary {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: 12.5px;
  line-height: 1.4;
  padding: 20px 24px;
  color: #111120;
  background: #fdfdfc;
  margin: 0;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: normal;
}
.app-summary * { box-sizing: border-box; }
.app-summary h1, .app-summary h2, .app-summary h3,
.app-summary h4, .app-summary h5, .app-summary h6 { font-weight: 700; line-height: 1.2; color: #0d0d14; margin: 0 0 .2em; text-wrap: initial; }
.app-summary h1 { font-size: 1.7em; letter-spacing: -.03em; margin-top: .2em; }
.app-summary h2 { font-size: 1.32em; letter-spacing: -.02em; margin-top: .9em; margin-bottom: .55em; }
.app-summary h3 { font-size: 1.1em; letter-spacing: -.01em; margin-top: .65em; font-weight: 600; color: #22224a; margin-bottom: .45em; }
.app-summary h4, .app-summary h5, .app-summary h6 { font-size: .95em; margin-top: .55em; font-weight: 600; color: #44446a; }
.app-summary p { margin: 0 0 .35em; }
.app-summary a { color: #3B5BDB; text-decoration: none; }
.app-summary a:hover { text-decoration: underline; color: #2f4dc7; }
.app-summary strong { font-weight: 700; }
.app-summary em { font-style: italic; }
.app-summary del { color: #8888a8; }
.app-summary p > strong:only-child { display: block; font-size: .7em; text-transform: uppercase; letter-spacing: .09em; color: #5a5a7a; margin: .5em 0 .1em; font-weight: 700; }
.app-summary ul, .app-summary ol { padding-left: 1.5em; margin: 0 0 .5em; list-style: revert; display: block; }
.app-summary li { margin: .15em 0; }
.app-summary li > p { margin: .1em 0; }
.app-summary blockquote { margin: 0 0 .5em; padding: .4em .9em; border-left: 3px solid #c4c8e8; color: #44446a; background: #f7f7fc; border-radius: 0 6px 6px 0; }
.app-summary code { font-family: 'SF Mono', ui-monospace, 'Cascadia Code', monospace; font-size: .855em; background: #ebebef; padding: 2px 5px; border-radius: 5px; color: #48485a; }
.app-summary pre { background: #f4f4f8; border: 1px solid #e0e0ee; border-radius: 10px; padding: 12px 16px; overflow-x: auto; margin: 0 0 .5em; }
.app-summary pre code { background: none; padding: 0; border-radius: 0; color: #1a1a2e; font-size: .88em; }
.app-summary table { border-collapse: separate; border-spacing: 2px; width: 100%; margin: 0 0 1em; font-size: .93em; table-layout: fixed; background: #fdfdfc; border-radius: 8px; }
.app-summary th, .app-summary td { padding: 6px 12px; text-align: left; white-space: normal; overflow-wrap: anywhere; border: none; }
.app-summary th { position: relative; background: rgb(239, 239, 238); font-weight: 800; color: #111120; border-radius: 4px; }
.app-summary td { background: rgb(243, 243, 242); color: #111120; }
.app-summary tr:nth-child(even) td { background: rgb(243, 243, 242); }
.app-summary td:first-child { font-weight: 600; }
.app-summary .col-resizer { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 2; user-select: none; }
.app-summary .col-resizer:hover, .app-summary .col-resizer.dragging { background: rgba(90, 90, 200, .25); border-radius: 3px; }
.app-summary hr { border: none; border-top: 1px solid #e4e4ef; margin: .65em 0; }
.app-summary img { max-width: 100%; height: auto; border-radius: 6px; }
.app-summary .mention { display: inline; background: #deebf2; color: #0568a1; border-radius: 5px; padding: 1px 6px; font-size: .87em; font-weight: 700; white-space: nowrap; }

/* User's saved typography overrides (as buildCSSOverrides emits them) */
.app-summary h1 { font-family: Inter, Georgia, serif; font-size: 1.7em; font-weight: 400; letter-spacing: -.03em; color: #0d0d14; }
.app-summary h2 { font-family: Inter, Georgia, serif; font-size: 1.32em; font-weight: 500; letter-spacing: -.02em; color: #0d0d14; }
.app-summary h3 { font-family: 'Source Serif 4', Georgia, serif; font-size: 1.1em; font-weight: 600; letter-spacing: -.01em; color: #22224a; }
.app-summary h4, .app-summary h5, .app-summary h6 { font-family: 'Source Serif 4', Georgia, serif; font-size: .95em; font-weight: 600; color: #44446a; }
.app-summary { font-size: 12.5px; font-weight: 400; color: #111120; }
.app-summary a { color: #3B5BDB; }
.app-summary th { font-weight: 800; color: #111120; }
.app-summary td { color: #111120; }
.app-summary code { font-size: .855em; color: #48485a; }
.app-summary blockquote { color: #44446a; }

/* v8 — smoother reading on the landing page: Inter throughout, larger size,
   airier rhythm and softer ink, so the preview reads like a finished doc
   rather than a dense note. */
.app-summary {
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.45;
  color: #2a2d38;
  padding: 18px 24px;
  letter-spacing: -0.003em;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
}
.app-summary h1, .app-summary h2, .app-summary h3,
.app-summary h4, .app-summary h5, .app-summary h6 { font-family: var(--font-sans); color: #14151c; line-height: 1.25; }
.app-summary h1 { font-size: 1.45em; font-weight: 600; letter-spacing: -.025em; margin-bottom: .3em; }
.app-summary h2 { font-size: 1.15em; font-weight: 600; letter-spacing: -.015em; margin-top: .9em; margin-bottom: .35em; }
.app-summary h3 { font-size: 1.02em; font-weight: 600; letter-spacing: -.005em; color: #2b2d55; margin-top: .7em; margin-bottom: .25em; }
.app-summary h4, .app-summary h5, .app-summary h6 { font-size: .95em; font-weight: 600; color: #4a4c70; }
.app-summary p { margin: 0 0 .35em; }
.app-summary ul, .app-summary ol { margin: 0 0 .45em; padding-left: 1.3em; }
.app-summary li { margin: .12em 0; }
.app-summary li::marker { color: #9a9cc0; }
.app-summary strong { font-weight: 600; color: #14151c; }
.app-summary p > strong:only-child { font-size: .68em; letter-spacing: .1em; color: #7a7c98; margin: .6em 0 .15em; font-weight: 600; }
.app-summary table { font-size: .9em; border-spacing: 0; border: 1px solid #ececf1; border-radius: 10px; overflow: hidden; }
.app-summary th, .app-summary td { padding: 6px 10px; border-radius: 0; color: #2a2d38; }
.app-summary th { background: #f6f6f8; font-weight: 600; color: #14151c; }
.app-summary td, .app-summary tr:nth-child(even) td { background: #fff; border-top: 1px solid #f0f0f4; }
.app-summary td:first-child { font-weight: 500; color: #14151c; }
.app-summary hr { margin: .7em 0; border-top-color: #ececf1; }
.app-summary .mention { font-weight: 600; padding: 1px 7px; }

/* No dark variant on purpose: in the app the saved typography overrides also
   pin their colors in dark mode (buildCSSOverrides), so the panel as the user
   sees it is the light one. The preview always shows that light panel. */

@media (max-width: 720px) {
  .summary-window { border-radius: 10px; }
  .summary-window-title { font-size: 11px; }
  .summary-toolbar-item span:not(.material-symbols-outlined) { display: none; }
  .summary-body { height: 420px; }
  .app-summary { padding: 16px 14px; }
  .app-summary table { table-layout: auto; }
  .summary-table-scroll { overflow-x: auto; margin: 0 0 1em; }
  .summary-table-scroll table { min-width: 520px; margin: 0; }
}
