:root {
  --bg: #f8f1e5;
  --bg-deep: #ebdcc4;
  --paper: rgba(255, 250, 242, 0.94);
  --paper-strong: #fff7ed;
  --ink: #1f2840;
  --muted: #685f6b;
  --line: rgba(64, 49, 36, 0.18);
  --line-strong: rgba(136, 106, 72, 0.38);
  --primary: #c35633;
  --primary-dark: #8f311f;
  --accent: #1e7c6e;
  --accent-soft: #e5f4ef;
  --gold: #c99b3c;
  --danger: #a1324d;
  --shadow: 0 24px 60px rgba(53, 39, 25, 0.12);
  --shadow-soft: 0 14px 30px rgba(53, 39, 25, 0.08);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --sans: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
  --serif: "Baskerville", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 12%, rgba(195, 86, 51, 0.24), transparent 24%),
    radial-gradient(circle at 88% 10%, rgba(30, 124, 110, 0.18), transparent 20%),
    linear-gradient(125deg, rgba(255, 255, 255, 0.35), transparent 34%),
    repeating-linear-gradient(180deg, rgba(31, 40, 64, 0.03) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, var(--bg), var(--bg-deep) 58%, #f7efe4 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 18px;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

button:hover {
  transform: translateY(-2px) rotate(-0.3deg);
}

input,
select,
textarea {
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.82rem 0.95rem;
  border: 2px solid rgba(118, 92, 68, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 251, 247, 0.98);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

select,
option,
optgroup {
  font-size: 1rem;
  line-height: 1.25;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.responsive-select-trigger,
.responsive-select-menu {
  display: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(195, 86, 51, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 0 0 4px rgba(195, 86, 51, 0.08);
}

textarea {
  resize: vertical;
}

a {
  color: inherit;
}

.shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 2rem 1.2rem 3.4rem;
  position: relative;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 1.5rem;
  align-items: stretch;
  padding: 1.7rem;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 250, 242, 0.98), rgba(242, 230, 213, 0.94)),
    radial-gradient(circle at top right, rgba(201, 155, 60, 0.17), transparent 28%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='rgba(111,83,57,0.08)' stroke-width='1.3'%3E%3Cpath d='M16 28h72v100H16z'/%3E%3Cpath d='M102 18h46v126h-46z'/%3E%3Cpath d='M30 42h44M30 56h44M30 70h44M114 42h22M114 56h22M114 70h22'/%3E%3Cpath d='M94 128c18-8 30-26 34-44'/%3E%3C/g%3E%3C/svg%3E");
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: rise-in 720ms ease both;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero::before {
  width: 220px;
  height: 220px;
  right: -50px;
  top: -70px;
  background: radial-gradient(circle, rgba(195, 86, 51, 0.16), transparent 68%);
}

.hero::after {
  width: 260px;
  height: 260px;
  left: -120px;
  bottom: -150px;
  background: radial-gradient(circle, rgba(30, 124, 110, 0.14), transparent 70%);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 0.45rem;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.64rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0;
  max-width: 11ch;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.2vw, 3.35rem);
  line-height: 0.98;
  font-weight: 700;
  text-wrap: balance;
}

.hero-copy {
  max-width: 52ch;
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.6;
}

.hero-copy-block {
  display: grid;
  align-content: center;
  gap: 0.95rem;
  position: relative;
  z-index: 1;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.45rem 0.8rem;
  border: 2px solid rgba(139, 102, 63, 0.18);
  border-radius: 999px;
  background: rgba(255, 247, 238, 0.92);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.hero-aside {
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.hero-illustration {
  position: relative;
  min-height: 238px;
  border: 2px solid rgba(128, 92, 61, 0.16);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.94), rgba(245, 234, 219, 0.92));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  animation: rise-in 720ms ease both;
}

.hero-illustration::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 26%, rgba(201, 155, 60, 0.12), transparent 24%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 44%);
  pointer-events: none;
}

.hero-illustration-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  right: -16px;
  top: -18px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(201, 155, 60, 0.18), transparent 70%);
  filter: blur(10px);
  animation: drift-glow 7s ease-in-out infinite;
}

.hero-asset {
  position: absolute;
  object-fit: contain;
  transform-origin: center;
  filter: drop-shadow(0 18px 20px rgba(53, 39, 25, 0.12));
}

.hero-asset-books {
  left: 14px;
  bottom: 18px;
  width: min(64%, 280px);
  animation: soft-float 6.2s ease-in-out infinite;
}

.hero-asset-mug {
  right: 16px;
  bottom: 12px;
  width: min(34%, 128px);
  animation: soft-float 5.4s ease-in-out infinite reverse;
}

.hero-actions {
  display: grid;
  gap: 0.8rem;
  justify-items: stretch;
}

.primary,
.ghost,
.danger,
.import-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1.1rem;
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.primary {
  border-color: rgba(143, 49, 31, 0.4);
  background: linear-gradient(180deg, #d56b45, var(--primary));
  color: #fff7ef;
}

.ghost,
.import-label {
  border-color: rgba(126, 101, 77, 0.18);
  background: rgba(255, 250, 244, 0.88);
  color: var(--ink);
}

.danger {
  border-color: rgba(161, 50, 77, 0.18);
  background: rgba(161, 50, 77, 0.12);
  color: var(--danger);
}

.primary:hover,
.ghost:hover,
.danger:hover,
.import-label:hover {
  box-shadow: 0 18px 30px rgba(53, 39, 25, 0.12);
}

.primary:disabled,
.ghost:disabled,
.danger:disabled,
.import-label:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.small {
  min-height: 34px;
  padding: 0.54rem 0.82rem;
  border-radius: 14px;
}

#import-input {
  display: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.4rem 0;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.2rem;
}

.summary-card,
.panel,
.status-card,
.metric-card,
.entity-card,
.timeline-item,
.inline-card,
.settings-panel {
  position: relative;
  border: 2px solid rgba(132, 103, 76, 0.14);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.summary-card::before,
.panel::before,
.status-card::before,
.metric-card::before,
.entity-card::before,
.timeline-item::before,
.inline-card::before,
.settings-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--gold), var(--accent));
  opacity: 0.78;
}

.summary-card,
.status-card,
.panel,
.metric-card,
.entity-card,
.timeline-item,
.inline-card {
  animation: rise-in 520ms ease both;
}

.summary-card {
  padding: 1.25rem 1.35rem;
}

.status-card {
  padding: 1rem 1.15rem;
}

.status-card[data-level="ok"] {
  border-color: rgba(64, 116, 72, 0.15);
}

.status-card[data-level="warning"] {
  border-color: rgba(178, 129, 46, 0.22);
}

.status-card[data-level="error"] {
  border-color: rgba(142, 35, 48, 0.2);
}

.status-card p {
  margin: 0;
}

.status-title {
  margin-top: 0.24rem;
  font-family: var(--serif);
  font-size: 1.08rem;
}

.status-copy {
  margin-top: 0.35rem;
  color: var(--muted);
  line-height: 1.45;
}

.status-meta {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.summary-card strong {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--serif);
  font-size: 1.9rem;
}

.summary-card span {
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1rem;
  border: 2px solid rgba(132, 103, 76, 0.16);
  background: rgba(255, 248, 239, 0.94);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
  font-weight: 700;
}

.tab-icon {
  display: none;
}

.tab.active {
  border-color: rgba(31, 40, 64, 0.2);
  background: linear-gradient(180deg, #2b3b59, var(--ink));
  color: #fff8f0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(380px, 1.1fr);
  gap: 1rem;
}

.manuscript-page,
.entity-page {
  display: block;
}

.manuscript-card,
.entity-card.is-clickable,
.timeline-item.is-clickable {
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.manuscript-card:hover,
.entity-card.is-clickable:hover,
.timeline-item.is-clickable:hover {
  transform: translateY(-5px) rotate(-0.35deg);
  border-color: rgba(195, 86, 51, 0.28);
  box-shadow: 0 24px 38px rgba(53, 39, 25, 0.14);
}

.entity-card.is-selected {
  border-color: rgba(195, 86, 51, 0.34);
  box-shadow:
    inset 0 0 0 2px rgba(195, 86, 51, 0.1),
    0 20px 32px rgba(53, 39, 25, 0.1);
  background: linear-gradient(180deg, rgba(255, 248, 239, 1), rgba(250, 240, 229, 0.98));
}

.manuscript-card.positive {
  border-color: rgba(30, 124, 110, 0.34);
  background: linear-gradient(180deg, rgba(235, 249, 244, 0.98), rgba(250, 255, 252, 0.95));
}

.manuscript-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1rem 0 1.2rem;
}

.statistics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.statistics-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
  margin-top: 0.9rem;
}

.statistics-detail-header {
  margin-top: 0.9rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  margin-top: 0;
  color: var(--ink);
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
}

.checkbox-row span {
  color: inherit;
}

.statistics-detail-header h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.18rem;
}

.statistics-detail-header p {
  margin: 0.22rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.statistics-feedback {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.statistics-version-groups {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.8rem;
}

.statistics-version-group {
  padding: 0.9rem 1rem;
  border: 1px solid rgba(87, 58, 39, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 249, 241, 0.72);
}

.statistics-version-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.statistics-version-heading strong {
  font-family: var(--serif);
  font-size: 1rem;
}

.statistics-version-heading span {
  color: var(--muted);
  font-size: 0.84rem;
}

.statistics-version-group ul {
  margin-top: 0.6rem;
}

.metric-card {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(249, 241, 230, 0.96));
}

.metric-card strong {
  display: block;
  margin-top: 0.28rem;
  font-family: var(--serif);
  font-size: 1.42rem;
}

.metric-card span {
  color: var(--muted);
}

.statistics-card-link {
  width: 100%;
  color: var(--ink);
  text-align: left;
}

.statistics-card-link:hover {
  border-color: rgba(195, 86, 51, 0.34);
  box-shadow: 0 18px 34px rgba(53, 39, 25, 0.14);
}

.statistics-card-link:focus-visible {
  outline: 3px solid rgba(30, 124, 110, 0.35);
  outline-offset: 3px;
}

.panel {
  padding: 1.45rem;
}

.panel-heading,
.subsection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.panel-heading h2,
.subsection h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.56rem;
}

.list-toolbar {
  margin-top: 0.8rem;
}

.list-toolbar input {
  margin-top: 0;
}

.card-list,
.timeline-list,
.stack {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

#publishers-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 360px));
}

#publishers-list > .empty-state {
  grid-column: 1 / -1;
}

#correspondences-list {
  grid-template-columns: repeat(auto-fill, minmax(280px, 360px));
}

#correspondences-list > .empty-state {
  grid-column: 1 / -1;
}

.manuscript-upcoming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 360px));
  gap: 0.9rem;
  margin-top: 1rem;
}

.manuscript-upcoming-grid > .empty-state {
  grid-column: 1 / -1;
}

.manuscript-publisher-prospect {
  position: relative;
}

.manuscript-publisher-prospect.is-priority {
  border-color: rgba(205, 151, 42, 0.5);
  box-shadow: 0 12px 28px rgba(205, 151, 42, 0.14);
}

.manuscript-publisher-prospect-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.manuscript-publisher-prospect-heading h3 {
  min-width: 0;
}

.manuscript-publisher-prospect-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.35rem;
}

.publisher-prospect-action {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(87, 58, 39, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  box-shadow: none;
}

.entity-card .publisher-prospect-action {
  margin-top: 0;
}

.publisher-priority-toggle:hover,
.publisher-priority-toggle.is-active {
  border-color: #d3a331;
  background: #fff3c4;
  color: #a66f00;
}

.publisher-exclude-button {
  border-color: rgba(177, 50, 50, 0.28);
  background: #fff0f0;
  color: #b13232;
}

.publisher-exclude-button:hover {
  border-color: #b13232;
  background: #b13232;
  color: #fff;
}

.manuscript-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.manuscript-card-meta {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.manuscript-card-response.is-positive {
  color: var(--accent);
  font-weight: 700;
}

.entity-card,
.timeline-item,
.inline-card {
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.98), rgba(248, 239, 228, 0.95));
}

.entity-card {
  padding: 1rem;
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.98), rgba(248, 239, 228, 0.95));
}

.entity-card.publisher-paused,
.entity-card.publisher-paused a,
.entity-card.publisher-paused h3,
.entity-card.publisher-paused p {
  color: #8d8177;
}

.entity-card.publisher-paused {
  background: linear-gradient(180deg, rgba(242, 238, 232, 0.98), rgba(248, 244, 239, 0.94));
  border-color: rgba(121, 102, 86, 0.2);
}

.entity-card button {
  margin-top: 0.9rem;
}

.entity-card h3,
.timeline-item h3 {
  margin: 0 0 0.3rem;
  font-family: var(--serif);
  font-size: 1.08rem;
}

.entity-card p,
.timeline-item p,
.entity-card ul {
  margin: 0.25rem 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.9rem;
}

.entity-card .publisher-card-inactivity {
  color: var(--ink);
  font-weight: 700;
}

.entity-card ul {
  padding-left: 1.2rem;
}

.entity-form,
.field-row,
.inline-card {
  display: grid;
  gap: 0.95rem;
}

.correspondence-targets,
.correspondence-targets-selection,
.correspondence-targets-links,
.correspondence-form-body {
  display: grid;
  gap: 0.95rem;
}

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

.correspondence-targets-actions {
  align-items: center;
}

.correspondence-targets-links {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
}

.correspondence-link-button {
  width: 100%;
  justify-content: flex-start;
}

.subsection {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(87, 58, 39, 0.08);
}

.inline-card {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  padding: 0.95rem;
}

.version-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 360px));
  gap: 0.85rem;
  margin-top: 1rem;
}

.version-card {
  min-width: 0;
  overflow: hidden;
  border: 2px solid rgba(132, 103, 76, 0.14);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.98), rgba(248, 239, 228, 0.95));
  box-shadow: var(--shadow-soft);
}

.version-card.is-editing {
  grid-column: 1 / -1;
  border-color: rgba(195, 86, 51, 0.28);
}

.version-card-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.26rem 0.75rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.version-card-summary:hover {
  transform: none;
  background: rgba(195, 86, 51, 0.055);
}

.version-card-number {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 700;
}

.version-card-date,
.version-card-pages,
.version-card-notes {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.version-card-pages {
  grid-column: 1;
}

.version-card-notes {
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.version-card-edit-hint {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  color: var(--primary-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.version-card-editor {
  display: grid;
  grid-template-columns: 0.7fr 1fr 0.8fr;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.95rem 1rem 1rem;
  border-top: 1px solid rgba(87, 58, 39, 0.1);
  background: rgba(255, 252, 248, 0.72);
}

.version-card-editor[hidden] {
  display: none;
}

.version-card-editor > *,
.version-card-editor label {
  min-width: 0;
}

.version-card-editor .wide,
.version-card-editor .row-actions {
  grid-column: 1 / -1;
}

.version-card-editor .row-actions {
  justify-content: flex-end;
}

.inline-card.row-confirmed {
  border-color: rgba(30, 124, 110, 0.28);
  box-shadow: inset 0 0 0 2px rgba(30, 124, 110, 0.08);
}

.event-card {
  min-width: 0;
  overflow: hidden;
  border: 2px solid rgba(132, 103, 76, 0.14);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 250, 243, 0.98), rgba(248, 239, 228, 0.95));
  box-shadow: var(--shadow-soft);
}

.event-card.is-editing {
  grid-column: 1 / -1;
  border-color: rgba(195, 86, 51, 0.28);
}

.event-card-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 0.75rem;
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.event-card-summary:hover {
  transform: none;
  background: rgba(195, 86, 51, 0.055);
}

.event-card-type {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
}

.event-card-date,
.event-card-notes {
  grid-column: 1 / -1;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 0.8rem;
  line-height: 1.3;
}

.event-card-edit-hint {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  color: var(--primary-dark);
  font-size: 0.74rem;
  font-weight: 800;
}

.event-card-editor {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 1.7fr auto;
  align-items: end;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.85rem 0.95rem 0.95rem;
  border-top: 1px solid rgba(87, 58, 39, 0.1);
  background: rgba(255, 252, 248, 0.72);
}

.event-card-editor[hidden] {
  display: none;
}

.event-card-editor > *,
.event-card-editor label {
  min-width: 0;
}

#correspondence-events {
  grid-template-columns: repeat(auto-fill, minmax(260px, 360px));
}

.template-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
  margin-top: 1rem;
}

.correspondence-email-template-version-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.correspondence-email-template-body-field,
.correspondence-email-template-version-row .wide {
  grid-column: 1 / -1;
}

.correspondence-email-template-version-row .row-actions {
  justify-content: flex-end;
  grid-column: 1 / -1;
}

.wide {
  grid-column: auto;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.inline-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.form-actions-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: flex-end;
}

.form-actions-split {
  align-items: center;
  justify-content: space-between;
}

.publisher-form-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

#delete-publisher-button {
  justify-self: flex-start;
}

.action-pill {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  box-shadow: 0 10px 18px rgba(68, 38, 21, 0.12);
}

.action-pill span {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.action-pill-save {
  background: #3f7e4f;
  color: #f7fff5;
}

.action-pill-delete {
  background: #8e2330;
  color: #fff4f5;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.row-action-pill {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 50%;
  box-shadow: 0 8px 16px rgba(68, 38, 21, 0.1);
}

.row-action-pill span {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
}

.row-action-pill-save {
  background: #3f7e4f;
  color: #f7fff5;
}

.row-action-pill-delete {
  background: #8e2330;
  color: #fff4f5;
}

.timeline-item {
  padding: 1rem 1.1rem;
}

.timeline-item small,
.meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.empty-state {
  padding: 1rem 1.1rem;
  border: 2px dashed rgba(129, 99, 71, 0.22);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(255, 250, 243, 0.82);
}

.submission-link {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.submission-link:hover {
  transform: none;
}

.summary-table-wrapper {
  margin-top: 1rem;
  overflow-x: auto;
  border: 2px solid rgba(132, 103, 76, 0.14);
  border-radius: var(--radius-md);
  background: var(--paper-strong);
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.summary-table th,
.summary-table td {
  padding: 0.85rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid rgba(87, 58, 39, 0.08);
  vertical-align: top;
  font-size: 0.9rem;
}

.summary-table th {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  background: rgba(248, 236, 221, 0.92);
}

.summary-table td {
  color: var(--muted);
}

.summary-table tbody tr:last-child td {
  border-bottom: 0;
}

.hidden {
  display: none;
}

.settings-fab {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: linear-gradient(180deg, #293a58, var(--ink));
  color: #fff8f2;
  box-shadow: 0 20px 42px rgba(31, 40, 64, 0.24);
}

.settings-fab span[aria-hidden="true"] {
  font-size: 1.2rem;
  line-height: 1;
}

.google-drive-fab {
  position: fixed;
  left: 1.2rem;
  bottom: 1.2rem;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 20px;
  color: #fff;
  box-shadow: 0 20px 42px rgba(31, 40, 64, 0.22);
}

.google-drive-fab.is-disconnected { background: linear-gradient(180deg, #7c8798, #536174); }
.google-drive-fab.is-connected { background: linear-gradient(180deg, #2f9c85, #206d60); }
.google-drive-fab.is-busy { background: linear-gradient(180deg, #d08a41, #a95e2f); }
.google-drive-fab.is-unavailable { background: linear-gradient(180deg, #a86158, #803f39); }
.google-drive-fab-icon { font-size: 1.2rem; line-height: 1; }
.google-drive-fab-badge {
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-left: -0.36rem;
  margin-top: -1.05rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #263550;
  font-size: 0.68rem;
  font-weight: 900;
}

.google-drive-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(35, 22, 15, 0.52);
  backdrop-filter: blur(7px);
}

.google-drive-dialog-overlay.hidden,
.google-drive-dialog-overlay[hidden] {
  display: none;
}

.google-drive-dialog {
  position: relative;
  width: min(100%, 600px);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: clamp(1.35rem, 4vw, 2rem);
  border: 1px solid rgba(30, 124, 110, 0.24);
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0, rgba(30, 124, 110, 0.12), transparent 28%),
    #fffaf4;
  box-shadow: 0 28px 90px rgba(42, 27, 19, 0.32);
}

.google-drive-dialog h2 {
  margin: 0;
  padding-right: 2rem;
  font-family: var(--serif);
  font-size: clamp(1.65rem, 4vw, 2.2rem);
}

.google-drive-dialog-close {
  position: absolute;
  top: 0.85rem;
  right: 0.95rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.8rem;
}

.google-drive-dialog-intro {
  margin: 0.55rem 0 1.1rem;
  color: var(--muted);
  line-height: 1.55;
}

.google-drive-file-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(30, 124, 110, 0.18);
  border-radius: 17px;
  background: rgba(229, 244, 239, 0.68);
}

.google-drive-file-icon {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  border-radius: 14px;
  background: #1e7c6e;
  color: #fff;
  font-size: 1.35rem;
}

.google-drive-file-card div {
  display: grid;
  gap: 0.25rem;
}

.google-drive-file-card span:last-child {
  color: var(--muted);
  font-size: 0.84rem;
}

.google-drive-date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.google-drive-date-grid > div {
  display: grid;
  gap: 0.3rem;
  padding: 0.85rem;
  border: 1px solid rgba(67, 105, 154, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.google-drive-date-grid span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.google-drive-date-grid strong {
  font-size: 0.88rem;
}

.google-drive-dialog-warning {
  margin: 0.9rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(169, 94, 47, 0.28);
  border-left: 5px solid #a95e2f;
  border-radius: 13px;
  background: #fff0df;
  color: #75401f;
  line-height: 1.5;
}

.google-drive-dialog-message {
  min-height: 1.35rem;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.google-drive-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.settings-drive-card {
  padding: 1rem;
  border: 1px solid rgba(195, 86, 51, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 244, 0.78);
}

.settings-drive-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.settings-drive-heading p { margin: 0.35rem 0 0; }
.google-drive-status-pill {
  flex: 0 0 auto;
  padding: 0.35rem 0.62rem;
  border-radius: 999px;
  background: #ece8e2;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.google-drive-status-pill.is-connected { background: #dcefe8; color: #206d60; }
.google-drive-status-pill.is-busy { background: #f8e6cf; color: #8a572c; }
.google-drive-status-pill.is-unavailable { background: #f3deda; color: #913c32; }

@media (max-width: 680px) {
  .settings-drive-heading { flex-direction: column; }
  .google-drive-date-grid { grid-template-columns: 1fr; }
  .google-drive-dialog-actions { display: grid; }
  .google-drive-dialog-actions button { width: 100%; }
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: block;
  overflow-y: auto;
  padding: 2rem 1.2rem 3.4rem;
  background: rgba(35, 22, 15, 0.32);
  backdrop-filter: blur(6px);
}

.settings-overlay[hidden],
.settings-overlay.hidden {
  display: none;
}

.settings-panel {
  width: 100%;
  max-width: 1380px;
  min-height: calc(100vh - 5.4rem);
  margin: 0 auto;
  padding: 1.45rem;
  border-radius: var(--radius-xl);
  background: rgba(255, 250, 244, 0.98);
}

.settings-panel > .panel-heading {
  position: sticky;
  top: -2rem;
  z-index: 3;
  margin: -1.45rem -1.45rem 0;
  padding: 1.45rem;
  border-bottom: 1px solid rgba(87, 58, 39, 0.1);
  background: rgba(255, 250, 244, 0.96);
  backdrop-filter: blur(8px);
}

.settings-form {
  gap: 1.15rem;
  margin-top: 1.15rem;
}

.settings-section {
  --section-color: 87, 58, 39;
  position: relative;
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  overflow: hidden;
  border: 1px solid rgba(var(--section-color), 0.24);
  border-left: 7px solid rgb(var(--section-color));
  border-radius: var(--radius-md);
  background: rgba(var(--section-color), 0.065);
}

.settings-section::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  top: -92px;
  right: -62px;
  border-radius: 50%;
  background: rgba(var(--section-color), 0.08);
  pointer-events: none;
}

.settings-section-profile { --section-color: 177, 75, 48; }
.settings-section-account { --section-color: 172, 126, 35; }
.settings-section-drive { --section-color: 47, 126, 112; }
.settings-section-backup { --section-color: 67, 105, 154; }
.settings-section-responses { --section-color: 128, 83, 146; }
.settings-section-legal { --section-color: 91, 98, 112; }

.settings-section-heading {
  position: relative;
  z-index: 1;
}

.settings-section-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.settings-section-heading p:last-child {
  max-width: 72ch;
  margin: 0.35rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.settings-section-kicker {
  margin: 0 0 0.28rem;
  color: rgb(var(--section-color));
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.settings-response-field {
  max-width: 440px;
}

.settings-response-field .inline-note {
  display: block;
  margin-top: 0.55rem;
}

.settings-backup-status {
  border-color: rgba(var(--section-color), 0.24);
  background: rgba(255, 255, 255, 0.52);
}

.settings-actions {
  align-items: center;
  justify-content: flex-start;
}

.settings-billing-status:empty {
  display: none;
}

.settings-save-actions {
  justify-content: flex-end;
}

.settings-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.settings-legal-links a {
  padding: 0.68rem 0.88rem;
  border: 1px solid rgba(var(--section-color), 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: rgb(var(--section-color));
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.settings-legal-links a:hover {
  background: rgba(255, 255, 255, 0.92);
  text-decoration: underline;
}

.feedback-toast {
  position: fixed;
  left: 50%;
  bottom: 1.35rem;
  z-index: 50;
  min-width: min(92vw, 320px);
  max-width: min(92vw, 460px);
  padding: 0.9rem 1.1rem;
  border: 2px solid rgba(30, 124, 110, 0.18);
  border-radius: 999px;
  background: rgba(246, 255, 251, 0.98);
  color: #225046;
  box-shadow: 0 20px 38px rgba(36, 84, 76, 0.16);
  transform: translate(-50%, 0);
  text-align: center;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes soft-float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-7px);
  }
}

@keyframes drift-glow {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(5px, -10px, 0);
  }
}

@media (max-width: 980px) {
  .hero,
  .split-layout,
  .summary-grid,
  .status-strip,
  .template-workspace {
    grid-template-columns: 1fr;
  }

  .manuscript-metrics {
    grid-template-columns: 1fr;
  }

  .statistics-grid,
  .statistics-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  body {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
  }

  body:not([data-active-view="dashboard"]) .hero {
    display: none;
  }

  select[data-responsive-enhanced="true"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
  }

  .responsive-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
    min-height: 2.75rem;
    margin-top: 0.45rem;
    padding: 0.62rem 0.78rem;
    border: 2px solid rgba(118, 92, 68, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(255, 251, 247, 0.98);
    color: var(--ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    line-height: 1.2;
    text-align: left;
  }

  .responsive-select-trigger:hover {
    transform: none;
  }

  .responsive-select-trigger:focus-visible {
    outline: none;
    border-color: rgba(195, 86, 51, 0.42);
    box-shadow: 0 0 0 4px rgba(195, 86, 51, 0.08);
  }

  .responsive-select-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .responsive-select-chevron {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 1rem;
  }

  .responsive-select-menu {
    position: fixed;
    z-index: 1100;
    display: grid;
    align-content: start;
    overflow-y: auto;
    padding: 0.3rem;
    border: 1px solid rgba(87, 58, 39, 0.18);
    border-radius: 14px;
    background: rgba(255, 250, 244, 0.99);
    box-shadow: 0 18px 42px rgba(31, 40, 64, 0.22);
    overscroll-behavior: contain;
  }

  .responsive-select-menu[hidden] {
    display: none;
  }

  .responsive-select-option {
    width: 100%;
    min-height: 2.35rem;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font-size: 0.82rem;
    line-height: 1.25;
    text-align: left;
  }

  .responsive-select-option:hover,
  .responsive-select-option:focus-visible {
    outline: none;
    transform: none;
    background: rgba(195, 86, 51, 0.1);
  }

  .responsive-select-option[aria-selected="true"] {
    background: rgba(31, 40, 64, 0.09);
    color: var(--primary-dark);
    font-weight: 800;
  }

  .responsive-select-option:disabled {
    color: rgba(104, 95, 107, 0.55);
  }

  .shell {
    padding: 1rem 0.75rem 1.5rem;
  }

  .tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    min-height: calc(4.5rem + env(safe-area-inset-bottom));
    margin: 0;
    padding: 0.42rem 0.18rem calc(0.38rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(87, 58, 39, 0.16);
    background: rgba(255, 250, 244, 0.97);
    box-shadow: 0 -12px 32px rgba(53, 39, 25, 0.13);
    backdrop-filter: blur(14px);
  }

  .tab {
    display: flex;
    min-width: 0;
    min-height: 3.55rem;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.34rem 0.08rem;
    border: 0;
    border-radius: 14px;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
    font-size: 0.56rem;
    line-height: 1.05;
  }

  .tab:hover {
    transform: none;
  }

  .tab.active {
    border: 0;
    background: rgba(31, 40, 64, 0.09);
    color: var(--ink);
  }

  .tab-icon {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .tab.active .tab-icon {
    color: var(--primary);
    stroke-width: 2.2;
  }

  .tab-label {
    display: block;
    max-width: 100%;
    text-align: center;
  }

  .tab[data-view="correspondences"] .tab-label {
    font-size: 0.49rem;
    overflow-wrap: anywhere;
  }

  #view-statistics .statistics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.65rem;
  }

  #view-statistics .metric-card {
    min-width: 0;
    padding: 0.62rem 0.68rem;
    border-width: 1px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(53, 39, 25, 0.07);
  }

  #view-statistics .metric-card::before {
    height: 3px;
  }

  #view-statistics .metric-card strong {
    margin-top: 0.12rem;
    font-size: 1.08rem;
    line-height: 1.1;
  }

  #view-statistics .metric-card span {
    display: block;
    overflow-wrap: anywhere;
    font-size: 0.7rem;
    line-height: 1.25;
  }

  #view-manuscripts .manuscript-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 0.5rem;
    margin-top: 0.65rem;
  }

  #view-manuscripts .manuscript-card {
    min-width: 0;
    padding: 0.68rem 0.72rem;
    border-width: 1px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(53, 39, 25, 0.07);
  }

  #view-manuscripts .manuscript-card::before {
    height: 3px;
  }

  #view-manuscripts .manuscript-card h3 {
    margin-bottom: 0.18rem;
    overflow-wrap: anywhere;
    font-size: 0.98rem;
    line-height: 1.12;
  }

  #view-manuscripts .manuscript-card p {
    margin: 0.12rem 0;
    font-size: 0.7rem;
    line-height: 1.25;
  }

  #view-manuscripts .manuscript-card-author {
    opacity: 0.82;
  }

  #view-manuscripts .manuscript-card-meta {
    gap: 0.18rem;
    margin-top: 0.32rem;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(87, 58, 39, 0.08);
    font-size: 0.66rem;
    line-height: 1.22;
  }

  #publishers-list {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 0.5rem;
    margin-top: 0.65rem;
  }

  #publishers-list .publisher-card {
    min-width: 0;
    padding: 0.65rem 0.7rem;
    border-width: 1px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(53, 39, 25, 0.07);
  }

  #publishers-list .publisher-card::before {
    height: 3px;
  }

  #publishers-list .publisher-card h3 {
    margin-bottom: 0.18rem;
    overflow-wrap: anywhere;
    font-size: 0.92rem;
    line-height: 1.12;
  }

  #publishers-list .publisher-card p,
  #publishers-list .publisher-card a {
    margin: 0.14rem 0;
    overflow-wrap: anywhere;
    font-size: 0.66rem;
    line-height: 1.22;
  }

  .correspondences-list-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 0.7rem;
  }

  .correspondences-list-heading > div:first-child {
    width: 100%;
  }

  .correspondences-list-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
  }

  .correspondences-list-actions button {
    width: 100%;
    min-width: 0;
    min-height: 3rem;
    padding: 0.58rem 0.45rem;
    overflow-wrap: anywhere;
    font-size: 0.72rem;
    line-height: 1.15;
  }

  #correspondences-list {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 0.5rem;
    margin-top: 0.65rem;
  }

  #correspondences-list .correspondence-card {
    min-width: 0;
    padding: 0.65rem 0.7rem;
    border-width: 1px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(53, 39, 25, 0.07);
  }

  #correspondences-list .correspondence-card::before {
    height: 3px;
  }

  #correspondences-list .correspondence-card h3 {
    margin-bottom: 0.18rem;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
    line-height: 1.12;
  }

  #correspondences-list .correspondence-card p,
  #correspondences-list .correspondence-card li {
    margin: 0.14rem 0;
    overflow-wrap: anywhere;
    font-size: 0.64rem;
    line-height: 1.22;
  }

  #correspondences-list .correspondence-card ul {
    margin: 0.3rem 0 0;
    padding-left: 0.85rem;
  }

  #correspondences-list .correspondence-card-publisher,
  #correspondences-list .correspondence-card-feedback {
    display: none;
  }

  #correspondences-list .correspondence-card-notes {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #correspondences-list .correspondence-card li:nth-child(n + 2) {
    display: none;
  }

  #correspondences-detail-page,
  #correspondences-detail-page .panel,
  #correspondence-form,
  #correspondence-form .subsection,
  #correspondence-targets-selection,
  #correspondence-targets-links,
  #correspondence-form-body,
  #correspondence-events,
  #correspondences-templates-page,
  #correspondences-templates-page .panel,
  #correspondence-email-template-form,
  #correspondence-email-template-versions {
    min-width: 0;
    max-width: 100%;
  }

  #correspondences-detail-page .panel-heading,
  #correspondences-detail-page .subsection-heading,
  #correspondences-templates-page .panel-heading,
  #correspondences-templates-page .subsection-heading {
    flex-wrap: wrap;
  }

  #correspondences-detail-page .panel-heading > div,
  #correspondences-detail-page .subsection-heading > *,
  #correspondences-templates-page .panel-heading > div,
  #correspondences-templates-page .subsection-heading > *,
  #correspondence-form label,
  #correspondence-form input,
  #correspondence-form textarea,
  #correspondence-email-template-form label,
  #correspondence-email-template-form input,
  #correspondence-email-template-form textarea {
    min-width: 0;
    max-width: 100%;
  }

  #correspondences-detail-page h2,
  #correspondences-detail-page h3,
  #correspondences-detail-page p,
  #correspondences-detail-page label,
  #correspondences-templates-page h2,
  #correspondences-templates-page h3,
  #correspondences-templates-page p,
  #correspondences-templates-page label {
    overflow-wrap: anywhere;
  }

  #correspondences-detail-page .panel {
    padding: 0.85rem;
    border-radius: 20px;
  }

  #correspondences-detail-page .panel-heading {
    align-items: flex-start;
    gap: 0.55rem;
  }

  #correspondences-detail-page .panel-heading h2 {
    font-size: 1.28rem;
    line-height: 1.05;
  }

  #correspondences-detail-page .panel-kicker {
    margin-bottom: 0.25rem;
    font-size: 0.56rem;
  }

  #correspondences-detail-page .panel-heading button,
  #correspondences-detail-page .subsection-heading button,
  #correspondence-form .form-actions button {
    padding: 0.55rem 0.7rem;
    border-width: 1px;
    border-radius: 12px;
    font-size: 0.72rem;
    line-height: 1.15;
  }

  #correspondence-form,
  #correspondence-form-body,
  #correspondence-targets,
  #correspondence-targets-selection,
  #correspondence-targets-links {
    gap: 0.6rem;
  }

  #correspondence-form label {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  #correspondence-form input,
  #correspondence-form textarea,
  #correspondence-form .responsive-select-trigger {
    margin-top: 0.28rem;
    padding: 0.58rem 0.68rem;
    border-width: 1px;
    border-radius: 11px;
    font-size: 0.78rem;
    line-height: 1.25;
  }

  #correspondence-form .responsive-select-trigger {
    min-height: 2.35rem;
  }

  #correspondence-form textarea {
    min-height: 4.8rem;
  }

  #correspondence-form .subsection {
    margin-top: 0.55rem;
    padding-top: 0.65rem;
  }

  #correspondence-form .subsection-heading {
    gap: 0.5rem;
  }

  #correspondence-form .subsection h3 {
    font-size: 1rem;
    line-height: 1.1;
  }

  #correspondence-targets-links .correspondence-link-button,
  #edit-correspondence-targets-button,
  #validate-correspondence-targets-button,
  #correspondence-form-body > .form-actions button {
    max-width: 100%;
    white-space: normal;
  }

  #correspondence-email-template-versions .correspondence-email-template-version-row {
    min-width: 0;
    gap: 0.6rem;
    padding: 0.7rem;
    border-width: 1px;
    border-radius: 14px;
  }

  #correspondence-email-template-versions .correspondence-email-template-version-row > * {
    min-width: 0;
    max-width: 100%;
  }

  #correspondence-events {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 0.5rem;
    margin-top: 0.65rem;
  }

  #correspondence-events .event-card {
    min-width: 0;
    border-width: 1px;
    border-radius: 13px;
    box-shadow: 0 8px 18px rgba(53, 39, 25, 0.07);
  }

  #correspondence-events .event-card-summary {
    gap: 0.16rem 0.4rem;
    padding: 0.58rem 0.62rem;
  }

  #correspondence-events .event-card-type {
    font-size: 0.84rem;
    line-height: 1.1;
  }

  #correspondence-events .event-card-date,
  #correspondence-events .event-card-notes,
  #correspondence-events .event-card-edit-hint {
    font-size: 0.62rem;
    line-height: 1.2;
  }

  #correspondence-events .event-card-notes {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #correspondence-events .event-card-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.65rem;
  }

  #correspondence-events .event-card-editor .wide,
  #correspondence-events .event-card-editor .row-actions {
    grid-column: 1 / -1;
  }

  #correspondence-events .event-card-editor .row-actions {
    justify-content: flex-end;
  }

  #publishers-detail-page,
  #publishers-detail-page .panel,
  #publisher-form,
  #publisher-form .subsection,
  #publisher-submissions,
  #publisher-submissions .summary-table-wrapper {
    min-width: 0;
    max-width: 100%;
  }

  #publishers-detail-page .panel-heading,
  #publishers-detail-page .subsection-heading,
  #publisher-form .form-actions-split {
    flex-wrap: wrap;
  }

  #publishers-detail-page .panel-heading > div,
  #publishers-detail-page .subsection-heading > *,
  #publisher-form .field-row > *,
  #publisher-form label,
  #publisher-form input,
  #publisher-form textarea {
    min-width: 0;
    max-width: 100%;
  }

  #publishers-detail-page h2,
  #publishers-detail-page h3,
  #publishers-detail-page p,
  #publishers-detail-page label,
  #publishers-detail-page td,
  #publishers-detail-page th {
    overflow-wrap: anywhere;
  }

  #publisher-form .checkbox-row {
    align-items: flex-start;
  }

  #publisher-submissions .summary-table-wrapper {
    overflow: hidden;
    border-width: 1px;
  }

  #publisher-submissions .summary-table,
  #publisher-submissions .summary-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #publisher-submissions .summary-table thead {
    display: none;
  }

  #publisher-submissions .summary-table tbody {
    display: grid;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  #publisher-submissions .summary-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem 0.65rem;
    min-width: 0;
    padding: 0.62rem;
    border: 1px solid rgba(87, 58, 39, 0.1);
    border-radius: 12px;
    background: rgba(255, 250, 243, 0.84);
  }

  #publisher-submissions .summary-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    font-size: 0.7rem;
    line-height: 1.25;
  }

  #publisher-submissions .summary-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.08rem;
    color: var(--primary-dark);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  #publisher-submissions .summary-table td:last-child {
    grid-column: 1 / -1;
  }

  #manuscripts-detail-page,
  #manuscripts-detail-page .panel,
  #manuscript-form,
  #manuscript-form .subsection,
  #manuscript-correspondences-summary,
  #manuscript-version-dispatch,
  #manuscript-version-dispatch .summary-table-wrapper {
    min-width: 0;
    max-width: 100%;
  }

  #manuscripts-detail-page .panel-heading,
  #manuscripts-detail-page .subsection-heading {
    flex-wrap: wrap;
  }

  #manuscripts-detail-page .panel-heading > div,
  #manuscripts-detail-page .subsection-heading > * {
    min-width: 0;
  }

  #manuscripts-detail-page h2,
  #manuscripts-detail-page h3,
  #manuscripts-detail-page p,
  #manuscripts-detail-page td,
  #manuscripts-detail-page th {
    overflow-wrap: anywhere;
  }

  #manuscripts-detail-page .manuscript-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0.7rem 0 0.8rem;
  }

  #manuscripts-detail-page .metric-card {
    min-width: 0;
    padding: 0.62rem 0.68rem;
    border-width: 1px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(53, 39, 25, 0.07);
  }

  #manuscripts-detail-page .metric-card::before {
    height: 3px;
  }

  #manuscripts-detail-page .metric-card strong {
    margin-top: 0.12rem;
    overflow-wrap: anywhere;
    font-size: 1.02rem;
    line-height: 1.1;
  }

  #manuscripts-detail-page .metric-card span {
    display: block;
    overflow-wrap: anywhere;
    font-size: 0.68rem;
    line-height: 1.22;
  }

  #manuscripts-detail-page .version-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 0.5rem;
    margin-top: 0.65rem;
  }

  #manuscripts-detail-page .version-card {
    border-width: 1px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(53, 39, 25, 0.07);
  }

  #manuscripts-detail-page .version-card-summary {
    gap: 0.18rem 0.45rem;
    padding: 0.64rem 0.68rem;
  }

  #manuscripts-detail-page .version-card-number {
    font-size: 0.94rem;
    line-height: 1.1;
  }

  #manuscripts-detail-page .version-card-date,
  #manuscripts-detail-page .version-card-pages,
  #manuscripts-detail-page .version-card-notes,
  #manuscripts-detail-page .version-card-edit-hint {
    font-size: 0.64rem;
    line-height: 1.2;
  }

  #manuscripts-detail-page .version-card-notes {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #manuscripts-detail-page .version-card-editor {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    padding: 0.7rem;
  }

  #manuscripts-detail-page .version-card-editor .wide,
  #manuscripts-detail-page .version-card-editor .row-actions {
    grid-column: 1;
  }

  #manuscripts-detail-page .manuscript-upcoming-grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 0.5rem;
    margin-top: 0.65rem;
  }

  #manuscripts-detail-page .manuscript-upcoming-grid .entity-card {
    min-width: 0;
    padding: 0.65rem 0.7rem;
    border-width: 1px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(53, 39, 25, 0.07);
  }

  #manuscripts-detail-page .manuscript-upcoming-grid .entity-card::before {
    height: 3px;
  }

  #manuscripts-detail-page .manuscript-upcoming-grid .entity-card h3 {
    margin-bottom: 0.18rem;
    overflow-wrap: anywhere;
    font-size: 0.92rem;
    line-height: 1.12;
  }

  #manuscripts-detail-page .manuscript-upcoming-grid .entity-card p {
    margin: 0.14rem 0;
    overflow-wrap: anywhere;
    font-size: 0.66rem;
    line-height: 1.22;
  }

  #manuscript-version-dispatch .summary-table-wrapper {
    overflow: hidden;
    border-width: 1px;
  }

  #manuscript-version-dispatch .summary-table,
  #manuscript-version-dispatch .summary-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #manuscript-version-dispatch .summary-table thead {
    display: none;
  }

  #manuscript-version-dispatch .summary-table tbody {
    display: grid;
    gap: 0.5rem;
    padding: 0.5rem;
  }

  #manuscript-version-dispatch .summary-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.42rem 0.65rem;
    min-width: 0;
    padding: 0.62rem;
    border: 1px solid rgba(87, 58, 39, 0.1);
    border-radius: 12px;
    background: rgba(255, 250, 243, 0.84);
  }

  #manuscript-version-dispatch .summary-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    font-size: 0.7rem;
    line-height: 1.25;
  }

  #manuscript-version-dispatch .summary-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.08rem;
    color: var(--primary-dark);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  #manuscript-version-dispatch .summary-table td:last-child {
    grid-column: 1 / -1;
  }

  .hero,
  .panel {
    padding: 1.1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-copy {
    font-size: 0.9rem;
  }

  .settings-fab {
    right: 0.85rem;
    bottom: calc(5.25rem + env(safe-area-inset-bottom));
  }

  .google-drive-fab {
    left: 0.85rem;
    bottom: calc(5.25rem + env(safe-area-inset-bottom));
  }

  .feedback-toast {
    bottom: calc(5.25rem + env(safe-area-inset-bottom));
  }

  .settings-overlay {
    padding: 1rem 0.75rem 2rem;
  }

  .settings-panel {
    min-height: calc(100vh - 3rem);
    padding: 1.1rem;
  }

  .settings-panel > .panel-heading {
    top: -1rem;
    margin: -1.1rem -1.1rem 0;
    padding: 1.1rem;
  }

  .field-row,
  .inline-card,
  .event-row,
  .correspondence-targets-links {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
  }

  .hero-illustration {
    min-height: 180px;
  }

  .hero-asset-books {
    width: min(60%, 220px);
  }

  .hero-asset-mug {
    width: min(30%, 104px);
  }
}

@media (min-width: 600px) and (max-width: 980px) {
  #view-statistics .statistics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #view-manuscripts .manuscript-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #publishers-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #correspondences-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #correspondence-events {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #manuscripts-detail-page .manuscript-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #manuscripts-detail-page .version-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #manuscripts-detail-page .manuscript-upcoming-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .tab-label {
    display: none;
  }

  .tab::after {
    content: attr(data-compact-label);
    display: block;
    max-width: 100%;
    font-size: 0.54rem;
    line-height: 1;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.access-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(48, 30, 24, 0.68);
  backdrop-filter: blur(7px);
}

.access-overlay.hidden { display: none; }

.access-modal {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px solid rgba(195, 86, 51, 0.24);
  border-radius: 26px;
  background: #fffaf6;
  box-shadow: 0 24px 80px rgba(45, 26, 20, 0.3);
}

.access-close {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  border: 0;
  background: transparent;
  color: #6f4c40;
  font-size: 1.8rem;
  cursor: pointer;
}

.access-price { display: flex; align-items: baseline; gap: 0.4rem; margin: 1.2rem 0; }
.access-price strong { color: #b24c2e; font-size: 2.35rem; }
.access-benefits { display: grid; gap: 0.65rem; padding-left: 1.25rem; }
.access-auth-fields { display: grid; gap: 0.8rem; margin-top: 1.3rem; }
.access-auth-fields label { display: grid; gap: 0.35rem; }
.access-modal > .primary { width: 100%; margin-top: 1.3rem; }

.settings-access-card { display: grid; gap: 1rem; }
.settings-access-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.settings-access-summary > div, .settings-offer-note {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem;
  border: 1px solid rgba(195, 86, 51, 0.16);
  border-radius: 14px;
  background: rgba(255, 250, 246, 0.72);
}
.settings-access-label { color: #805e52; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.settings-quota-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
.settings-quota-item { display: grid; gap: 0.35rem; }
.settings-quota-heading { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.86rem; }
.settings-quota-track { height: 7px; overflow: hidden; border-radius: 99px; background: rgba(178, 76, 46, 0.12); }
.settings-quota-fill { height: 100%; border-radius: inherit; background: #b24c2e; }
.settings-offer-note span { color: #755449; font-size: 0.88rem; }

@media (max-width: 680px) {
  .settings-access-summary, .settings-quota-list { grid-template-columns: 1fr; }
  .settings-field-grid { grid-template-columns: 1fr; }
  .settings-section { padding: 1rem; }
  .settings-save-actions .primary { width: 100%; }
  .settings-legal-links { display: grid; }
  .settings-legal-links a { text-align: center; }
}

/* Installation: prominent settings entry and occasional, non-modal reminder. */
.install-card { margin-top: 1.15rem; }
.install-button {
  display: flex; align-items: center; gap: 1rem; width: 100%; padding: 1.2rem;
  text-align: left; color: #fffaf4; border: 1px solid #a94325; border-radius: 20px;
  background: linear-gradient(120deg, #923e28, #b95230);
  box-shadow: 0 8px 22px rgba(146, 62, 40, .18);
}
.install-button img { flex-shrink: 0; border-radius: 16px; }
.install-button strong { display: block; font-size: 1.2rem; margin-bottom: .35rem; }
.install-button span span { display: block; font-size: .9rem; font-weight: 400; }
.install-button .install-arrow { margin-left: auto; font-size: 1.8rem; }
.install-button:disabled { cursor: default; opacity: .8; }
.install-reminder-option { display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.install-reminder-option input { width: auto; accent-color: #a94325; }
.install-reminder-option[hidden], .install-reminder[hidden] { display: none; }
.install-reminder {
  position: fixed; bottom: 5.5rem; right: 1rem; z-index: 25;
  display: flex; align-items: flex-start; gap: .8rem;
  width: min(440px, calc(100vw - 2rem)); box-sizing: border-box;
  padding: 1rem; border: 1px solid #e1c2af; border-radius: 20px;
  background: #fffaf4; color: #573a27; box-shadow: 0 12px 40px #573a2730;
}
.install-reminder img { border-radius: 12px; }
.install-reminder p { margin: .4rem 0 .8rem; font-size: .9rem; }
.install-reminder-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
@media (max-width: 540px) {
  .install-button { padding: .9rem; gap: .75rem; }
  .install-button img { width: 56px; height: 56px; }
  .install-button .install-arrow { display: none; }
}
