:root {
  --app-font-scale: 1;
  --pdf-panel-width: 520px;
  --bg: #f4ecdf;
  --bg-soft: #fbf7f0;
  --panel: rgba(255, 250, 243, 0.88);
  --panel-strong: #fff9f1;
  --line: rgba(76, 70, 55, 0.15);
  --text: #2f2a22;
  --muted: #6e6557;
  --accent: #c86447;
  --accent-strong: #a94c2f;
  --accent-soft: rgba(200, 100, 71, 0.12);
  --olive: #6a7d61;
  --teal: #3a6f72;
  --danger: #a64a40;
  --shadow: 0 18px 44px rgba(61, 49, 28, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-heading: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-body: "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  font-size: calc(16px * var(--app-font-scale));
}

body {
  background:
    radial-gradient(circle at top left, rgba(90, 134, 118, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(200, 100, 71, 0.16), transparent 30%),
    linear-gradient(180deg, #f7efe3 0%, #f0e7d9 100%);
  color: var(--text);
  font-family: var(--font-body);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 18px 20px 28px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 0.9fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: start;
}

.login-copy,
.login-form,
.login-projects {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.login-copy h1 {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
}

.login-status {
  margin-left: 0;
  text-align: left;
  white-space: normal;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 251, 244, 0.93), rgba(250, 241, 228, 0.86)),
    linear-gradient(90deg, rgba(200, 100, 71, 0.06), rgba(58, 111, 114, 0.05));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto auto 0 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.editor-header h2,
.empty-state h2,
.section-heading h2,
.section-heading h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
}

.save-status {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
  white-space: nowrap;
}

.storage-status {
  margin: 0;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.font-size-controls {
  display: flex;
  align-items: center;
}

.font-size-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  margin-bottom: 16px;
}

.top-tab {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 800;
}

.top-tab.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff9f1;
  box-shadow: 0 12px 28px rgba(169, 76, 47, 0.24);
}

.top-tab-panel {
  display: none;
}

.top-tab-panel.is-active {
  display: block;
}

.embedded-tab-frame {
  width: 100%;
  min-height: 82vh;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 24px;
}

.workspace.is-sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.is-sidebar-collapsed .sidebar {
  display: none;
}

.card {
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.sidebar,
.editor {
  min-height: 72vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-section {
  padding: 22px 22px 0;
}

.sidebar-section:last-child {
  padding-bottom: 22px;
}

.library-list-wrap {
  flex: 1;
  min-height: 260px;
  overflow: hidden;
}

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

.section-heading-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-heading h2 {
  font-size: 1.35rem;
}

.section-heading h3 {
  font-size: 1.18rem;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(58, 111, 114, 0.12);
  color: var(--teal);
  font-size: 0.86rem;
  font-weight: 700;
}

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

.field-grow {
  flex: 1;
}

.field-label,
.field-label-row {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.field-hint,
.section-helper {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

input[type="text"],
input[type="search"],
input[type="password"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  padding: 12px 14px;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

input[type="color"] {
  inline-size: 100%;
  block-size: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 4px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(58, 111, 114, 0.4);
  box-shadow: 0 0 0 4px rgba(58, 111, 114, 0.08);
  outline: none;
}

select {
  appearance: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff9f1;
  box-shadow: 0 12px 28px rgba(169, 76, 47, 0.24);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  border: 1px solid rgba(76, 70, 55, 0.12);
}

.btn-danger {
  background: rgba(166, 74, 64, 0.12);
  color: var(--danger);
}

.btn-ghost,
.text-button {
  background: transparent;
  color: var(--teal);
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.86rem;
}

.btn-icon {
  min-width: 38px;
  padding-inline: 0;
  font-size: 1rem;
}

.text-button {
  border: 0;
  padding: 0;
  font-weight: 700;
}

.study-library {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  overflow: auto;
  padding-right: 6px;
}

.library-card {
  padding: 16px 16px 14px;
  border: 1px solid rgba(76, 70, 55, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(252, 247, 240, 0.86)),
    linear-gradient(135deg, rgba(58, 111, 114, 0.04), transparent 35%);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.library-card:hover {
  transform: translateY(-1px);
  border-color: rgba(58, 111, 114, 0.18);
}

.library-card.is-selected {
  border-color: rgba(58, 111, 114, 0.38);
  box-shadow: 0 10px 30px rgba(58, 111, 114, 0.12);
}

.library-card button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
}

.library-card-title {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.18rem;
  line-height: 1.2;
}

.library-card-meta,
.library-card-updated,
.attachment-meta,
.empty-copy,
.bibtex-summary,
.section-helper,
.field-hint {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.library-card-updated {
  margin-top: 12px;
  font-size: 0.82rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-row-scrollable {
  max-height: 112px;
  overflow: auto;
  padding-right: 4px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.tag-chip .tag-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.tag-chip.is-filter-active,
.tag-chip.is-selected {
  box-shadow: inset 0 0 0 1px rgba(47, 42, 34, 0.12);
}

.tag-chip-button {
  border: 0;
}

.tag-chip-button.framework-chip.is-filter-active,
.tag-chip-button.framework-chip.is-selected {
  border: 4px solid currentColor;
  outline: 4px solid rgba(255, 255, 255, 0.98);
  outline-offset: 1px;
  box-shadow:
    0 0 0 2px rgba(47, 42, 34, 0.12),
    0 14px 28px rgba(47, 42, 34, 0.16);
  font-weight: 800;
  transform: translateY(-1px) scale(1.02);
}

.framework-filter-groups,
.framework-selector {
  display: grid;
  gap: 10px;
}

.framework-filter-group,
.framework-card {
  padding: 12px;
  border: 1px solid rgba(76, 70, 55, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.64);
}

.framework-group-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 800;
}

.framework-chip {
  justify-content: flex-start;
  width: fit-content;
  text-align: left;
}

.framework-chip-label {
  white-space: nowrap;
}

.library-card-frameworks {
  margin: 8px 0 0;
}

.library-card-status {
  margin: 8px 0 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(106, 125, 97, 0.16);
  color: var(--olive);
  font-size: 0.82rem;
  font-weight: 800;
}

.tag-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tag-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(76, 70, 55, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.tag-list-item input[type="text"] {
  margin: 0;
}

.create-tag-form {
  display: flex;
  align-items: end;
  gap: 12px;
}

.color-field {
  width: 86px;
}

.session-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(76, 70, 55, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.project-list-item.is-selected {
  border-color: rgba(58, 111, 114, 0.24);
  box-shadow: 0 12px 28px rgba(58, 111, 114, 0.1);
}

.project-list-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.create-project-form,
.create-framework-group-form {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
}

.project-framework-builder {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.framework-builder-card {
  padding: 14px;
  border: 1px solid rgba(76, 70, 55, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.framework-builder-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.framework-builder-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.framework-builder-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.framework-builder-option input,
.framework-builder-add-option input {
  margin: 0;
}

.framework-builder-add-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.editor {
  padding: 28px 30px;
}

.hidden {
  display: none !important;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 60vh;
  text-align: center;
  gap: 12px;
}

.empty-state p {
  margin: 0;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.6;
}

.study-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  font-size: 0.92rem;
}

.study-form .field-label,
.study-form .field-hint,
.study-form .section-helper,
.study-form .attachment-meta,
.study-form .bibtex-summary {
  font-size: 0.84rem;
}

.study-form input[type="text"],
.study-form textarea {
  font-size: 0.92rem;
}

.study-form .btn {
  font-size: 0.9rem;
}

.library-reopen-btn {
  margin-bottom: 18px;
}

.browser-content-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  gap: 20px;
  min-height: 72vh;
}

.browser-list-panel,
.browser-detail-panel {
  min-width: 0;
  border: 1px solid rgba(76, 70, 55, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
}

.browser-list-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.browser-list-panel .section-heading {
  padding: 20px 20px 0;
  margin-bottom: 12px;
}

.browser-detail-panel {
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: 22px;
}

.browser-detail-panel .empty-state {
  min-height: 100%;
}

.browser-detail-panel .study-form {
  min-height: 100%;
}

.browser-title-table-wrap {
  flex: 1;
  overflow: auto;
  padding: 0 0 4px;
}

.browser-title-list {
  display: flex;
  flex-direction: column;
}

.browser-title-empty {
  padding: 18px 20px 20px;
}

.browser-title-row {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(76, 70, 55, 0.08);
  background: transparent;
  color: var(--text);
  padding: 16px 20px;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.browser-title-row:first-child {
  border-top: 0;
}

.browser-title-row:hover {
  background: rgba(200, 100, 71, 0.06);
}

.browser-title-row.is-selected {
  background:
    linear-gradient(90deg, rgba(200, 100, 71, 0.14), rgba(200, 100, 71, 0.04)),
    rgba(255, 255, 255, 0.86);
  box-shadow: inset 4px 0 0 var(--accent);
}

.browser-title-text {
  display: block;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.editor-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.editor-content.has-pdf-preview {
  grid-template-columns: minmax(0, 1fr) 14px minmax(320px, var(--pdf-panel-width));
  align-items: stretch;
}

.editor-main {
  min-width: 0;
}

.editor-content.has-pdf-preview .editor-main,
.editor-content.has-pdf-preview .pdf-preview-panel {
  min-height: 0;
}

.editor-content.has-pdf-preview .editor-main {
  max-height: clamp(560px, calc(100vh - 220px), 1400px);
  overflow: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.editor-content.has-pdf-preview .pdf-preview-panel {
  align-self: start;
}

.editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.editor-header h2 {
  margin-top: 6px;
  font-size: clamp(1.55rem, 2.8vw, 2.2rem);
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

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

.field-span-2 {
  grid-column: 1 / -1;
}

.attachment-section {
  padding-top: 18px;
  border-top: 1px solid rgba(76, 70, 55, 0.08);
}

.attachment-section-top {
  padding-top: 0;
  border-top: 0;
}

.pdf-resize-handle {
  position: relative;
  width: 14px;
  min-height: 72vh;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(58, 111, 114, 0.1), rgba(200, 100, 71, 0.12));
  cursor: col-resize;
  touch-action: none;
}

.pdf-resize-handle::before {
  content: "";
  position: absolute;
  inset: 18px 4px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(58, 111, 114, 0.65) 0 6px,
      rgba(58, 111, 114, 0.1) 6px 12px
    );
  opacity: 0.8;
}

.pdf-resize-handle:focus-visible,
.pdf-resize-handle.is-active {
  outline: 3px solid rgba(58, 111, 114, 0.26);
  outline-offset: 2px;
  box-shadow: 0 12px 24px rgba(58, 111, 114, 0.16);
}

.pdf-preview-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 72vh;
  padding: 18px;
  border: 1px solid rgba(76, 70, 55, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  overflow: hidden;
}

.pdf-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.pdf-preview-header h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.24rem;
}

.pdf-preview-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 560px;
  border: 1px solid rgba(76, 70, 55, 0.08);
  border-radius: 18px;
  background: #ffffff;
}

.attachment-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-label.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-body {
  color: var(--text);
  line-height: 1.65;
  white-space: pre-wrap;
}

.detail-body-mono {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(76, 70, 55, 0.08);
  border-radius: 16px;
  padding: 14px;
}

.matrix-section {
  margin-top: 24px;
  padding: 24px;
}

.matrix-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.matrix-header h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin: 0;
}

.matrix-header .section-helper {
  margin: 8px 0 0;
  max-width: 700px;
}

.matrix-table-wrap {
  overflow: auto;
  border: 1px solid rgba(76, 70, 55, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.matrix-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.matrix-table th,
.matrix-table td {
  border: 1px solid rgba(76, 70, 55, 0.08);
  padding: 10px 12px;
  font-size: 0.92rem;
  text-align: center;
  vertical-align: middle;
}

.matrix-table thead th {
  background: rgba(244, 236, 223, 0.95);
  font-weight: 800;
}

.matrix-table th.matrix-reference,
.matrix-table td.matrix-reference {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 280px;
  max-width: 280px;
  background: rgba(255, 250, 243, 0.98);
  text-align: left;
}

.matrix-table thead .matrix-reference {
  z-index: 2;
}

.matrix-table .matrix-group-header {
  font-family: var(--font-heading);
  font-size: 1rem;
}

.matrix-table .matrix-mark {
  font-weight: 800;
}

.matrix-table .matrix-empty {
  text-align: left;
  color: var(--muted);
}

.embedded-page {
  background:
    radial-gradient(circle at top left, rgba(90, 134, 118, 0.12), transparent 28%),
    linear-gradient(180deg, #f7efe3 0%, #f0e7d9 100%);
}

.embedded-page .page-shell {
  max-width: none;
  margin: 0;
  padding: 0;
}

.embedded-page .hero {
  display: none;
}

.embedded-page .workspace {
  padding: 0 0 12px;
}

.status-toast {
  color: var(--teal);
}

body.is-resizing-pdf-panel,
body.is-resizing-pdf-panel * {
  cursor: col-resize !important;
  user-select: none !important;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero,
.card,
.library-card,
.tag-list-item {
  animation: rise-in 0.28s ease;
}

@media (max-width: 1120px) {
  .login-card {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .library-list-wrap {
    max-height: 420px;
  }

  .matrix-header {
    flex-direction: column;
  }

  .browser-content-grid {
    grid-template-columns: 1fr;
  }

  .browser-list-panel {
    max-height: 420px;
  }
}

@media (max-width: 820px) {
  .page-shell {
    padding: 14px 12px 24px;
  }

  .login-screen {
    padding: 16px 12px 24px;
  }

  .hero {
    padding: 10px 12px;
  }

  .hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .save-status {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }

  .editor {
    padding: 22px 18px;
  }

  .editor-content.has-pdf-preview {
    grid-template-columns: 1fr;
  }

  .editor-content.has-pdf-preview .editor-main,
  .editor-content.has-pdf-preview .pdf-preview-panel {
    max-height: none;
  }

  .pdf-resize-handle {
    display: none !important;
  }

  .editor-header {
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .create-tag-form {
    flex-direction: column;
    align-items: stretch;
  }

  .create-project-form,
  .create-framework-group-form {
    flex-direction: column;
    align-items: stretch;
  }

  .color-field {
    width: 100%;
  }

  .tag-list-item {
    grid-template-columns: 1fr;
  }

  .project-list-item,
  .framework-builder-header,
  .framework-builder-option,
  .framework-builder-add-option {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .matrix-section {
    padding: 18px;
  }

  .matrix-table th.matrix-reference,
  .matrix-table td.matrix-reference {
    min-width: 220px;
    max-width: 220px;
  }
}
