/* Reader page: article shell, properties, tabs, emotion/evaluation summaries, highlights, siblings and emotion groups. Loads first. */

/* Reader page styles. */
.reader-view {
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  padding: 0 0 44px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  overflow-x: hidden;
  overflow-x: clip;
}

.reader-top {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 54px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  padding: 7px 16px;
}

.reader-back {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.reader-back:hover,
.reader-back:focus-visible {
  background: var(--soft);
  outline: none;
}

.reader-top-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.reader-top-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.reader-top-copy strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.25;
}

.reader-author-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 22px 28px 6px;
}

.reader-tabs {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 8px 28px 0;
  border-bottom: 1px solid var(--line);
}

.reader-tab-list {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  min-width: 0;
}

.reader-tab-actions {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 42px;
}

.reader-tab-actions .post-more-button {
  position: static;
}

.reader-tab-actions .post-menu {
  top: 36px;
}

.reader-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 2px;
  font-size: 14px;
  font-weight: 800;
}

.reader-tab:hover,
.reader-tab:focus-visible {
  color: var(--ink);
  outline: none;
}

.reader-properties {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.reader-properties div {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.reader-properties dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.reader-properties dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.reader-properties a {
  color: var(--accent);
  text-decoration: none;
}

.reader-properties a:hover,
.reader-properties a:focus-visible {
  text-decoration: underline;
}

.reader-tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.reader-tab span {
  min-width: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  padding: 1px 7px;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.reader-tab-panel {
  min-width: 0;
  max-width: 100%;
}

.reader-title {
  margin: 0;
  padding: 8px 28px 12px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.28;
  font-weight: 900;
  letter-spacing: 0;
}

.reader-tag-row,
.reader-emotion-summary {
  margin: 0 28px;
}

.reader-tag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 9px;
}

.reader-content + .reader-tag-row {
  margin-top: 16px;
  padding-bottom: 0;
}

.reader-tag-row .app-icon {
  --icon-size: 17px;
  opacity: 0.62;
}

.reader-tag-list,
.reader-emotion-summary-list {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.reader-tag-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: #33434e;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.reader-emotion-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 0 0 14px;
}

.reader-emotion-total {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}

.reader-emotion-summary-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}

.reader-emotion-summary-button strong {
  font-weight: 950;
}

.reader-emotion-summary-button:hover,
.reader-emotion-summary-button:focus-visible,
.reader-emotion-summary-button.is-active {
  border-color: rgba(0, 122, 85, 0.38);
  background: var(--accent-soft);
  color: var(--accent-dark);
  outline: none;
}

.reader-emotion-summary-button.is-captivated {
  color: var(--captivated);
}

.reader-emotion-summary-button.is-cool {
  color: #007a55;
}

.reader-emotion-summary-button.is-bored {
  color: #5b6470;
}

.reader-emotion-summary-button.is-repelled {
  color: #a84f10;
}

.reader-emotion-summary-button.is-intolerable {
  color: #b4232f;
}

.reader-emotion-summary-button.is-eval-translation-noise {
  color: #d9383a;
}
.reader-emotion-summary-button.is-eval-logical-leap {
  color: #f59e0b;
}
.reader-emotion-summary-button.is-eval-hollow-content {
  color: #eab308;
}
.reader-emotion-summary-button.is-eval-deep-dive-target {
  color: #3b82f6;
}

.reader-emotion-summary-button.is-active.is-eval-translation-noise {
  border-color: rgba(217, 56, 58, 0.38);
  background: hsla(0, 85%, 95%, 1);
  color: #b4232f;
}
.reader-emotion-summary-button.is-active.is-eval-logical-leap {
  border-color: rgba(245, 158, 11, 0.38);
  background: hsla(45, 85%, 95%, 1);
  color: #a84f10;
}
.reader-emotion-summary-button.is-active.is-eval-hollow-content {
  border-color: rgba(234, 179, 8, 0.38);
  background: hsla(50, 85%, 95%, 1);
  color: #a87610;
}
.reader-emotion-summary-button.is-active.is-eval-deep-dive-target {
  border-color: rgba(0, 122, 85, 0.38);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.reader-emotion-summary-button.is-zero,
.reader-emotion-summary-button:disabled {
  border-color: var(--line);
  background: #ffffff;
  color: rgba(83, 100, 113, 0.52);
}

.reader-emotion-summary-button:disabled {
  cursor: default;
}

.reader-view .feed-attachments {
  padding: 0 28px;
  margin: 0 0 16px;
}

.reader-content {
  position: relative;
  min-width: 0;
  max-width: 100%;
  padding: 8px 28px 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.78;
  white-space: normal;
  overflow-wrap: anywhere;
}

.reader-emotion-highlight {
  position: relative;
  border-radius: 5px;
  padding: 1px 3px;
  color: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.reader-emotion-highlight.is-captivated {
  background: rgba(253, 243, 215, 0.95);
  box-shadow: inset 0 -2px 0 rgba(154, 116, 17, 0.35);
}

.reader-emotion-highlight.is-cool {
  background: rgba(232, 245, 253, 0.95);
  box-shadow: inset 0 -2px 0 rgba(26, 120, 184, 0.32);
}

.reader-emotion-highlight.is-bored {
  background: rgba(241, 243, 245, 0.98);
  box-shadow: inset 0 -2px 0 rgba(91, 100, 112, 0.26);
}

.reader-emotion-highlight.is-repelled {
  background: rgba(255, 240, 229, 0.95);
  box-shadow: inset 0 -2px 0 rgba(168, 79, 16, 0.3);
}

.reader-emotion-highlight.is-intolerable {
  background: rgba(255, 232, 235, 0.95);
  box-shadow: inset 0 -2px 0 rgba(180, 35, 47, 0.32);
}

.reader-emotion-highlight-note {
  float: right;
  max-width: min(240px, 42%);
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  margin: 2px 0 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--muted);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}

.native-emotion-toolbar {
  position: fixed;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  max-width: min(94vw, 520px);
  border: 1px solid rgba(15, 20, 25, 0.12);
  border-radius: 8px;
  background: #0f1419;
  box-shadow: 0 12px 34px rgba(15, 20, 25, 0.22);
  color: #ffffff;
  padding: 6px;
  transform-origin: left top;
}

.native-emotion-toolbar[hidden] {
  display: none;
}

.native-emotion-toolbar.is-collapsed {
  max-width: 38px;
  border-radius: 999px;
  padding: 3px;
}

.native-emotion-toolbar.is-collapsed .native-emotion-actions {
  display: none;
}

.native-emotion-handle {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.66);
  padding: 0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}

.native-emotion-handle:hover,
.native-emotion-handle:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  outline: none;
}

.native-emotion-handle:active {
  cursor: grabbing;
}

.native-emotion-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  transform-origin: left top;
}

.native-emotion-actions button {
  min-height: 28px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.native-emotion-actions button:not(:disabled):hover,
.native-emotion-actions button:not(:disabled):focus-visible {
  background: var(--accent);
  color: #ffffff;
  outline: none;
}

.native-emotion-actions button:disabled {
  cursor: default;
  opacity: 0.58;
}

.native-emotion-actions [data-native-emotion-status] {
  min-width: 44px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.native-emotion-actions [data-native-emotion-status][data-tone="error"] {
  color: #ff8a8a;
}

.native-emotion-actions [data-native-emotion-status][data-tone="success"] {
  color: #68d391;
}

.reader-edit-form {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 8px 28px 0;
}

.reader-title-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 4px 0 12px;
  font-size: 30px;
  line-height: 1.28;
  font-weight: 900;
  letter-spacing: 0;
  outline: none;
}

.reader-title-input:focus {
  border-bottom-color: var(--line-strong);
}

.reader-mode-tabs {
  margin: 0;
}

.reader-body-editor {
  min-height: 420px;
  padding: 8px 0 20px;
  font-size: 17px;
  line-height: 1.72;
}

.reader-edit-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.reader-edit-save-row,
.reader-version-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
}

.reader-version-title-input {
  width: min(260px, 52vw);
}

.reader-siblings {
  display: grid;
  gap: 28px;
  padding: 22px 28px 0;
}

.reader-siblings-head {
  display: grid;
  gap: 7px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.reader-siblings-head span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
  text-transform: uppercase;
}

.reader-siblings-head h1 {
  margin: 0;
  color: var(--ink);
  line-height: 1.28;
  letter-spacing: 0;
}

.reader-siblings-head h1 {
  font-size: 24px;
}

.reader-siblings-head p,
.reader-sibling-empty p,
.reader-sibling-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.reader-sibling-list {
  display: grid;
  gap: 10px;
}

.reader-sibling-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 13px 14px;
}

.reader-sibling-card.is-current {
  background: #f8fbfd;
}

.reader-sibling-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.reader-sibling-meta span:first-child,
.reader-sibling-meta strong {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  padding: 2px 7px;
  font-size: 11px;
}

.reader-sibling-meta strong {
  border-color: var(--accent-soft);
  color: var(--accent);
}

.reader-sibling-title {
  justify-self: start;
  max-width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
  text-align: left;
}

.reader-sibling-title:not(:disabled):hover,
.reader-sibling-title:not(:disabled):focus-visible {
  color: var(--accent);
  outline: none;
}

.reader-sibling-title:disabled {
  cursor: default;
}

.reader-sibling-card p {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: #384955;
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.reader-sibling-actions {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 12px;
}

.reader-sibling-actions span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reader-sibling-actions .app-icon {
  --icon-size: 14px;
}

.reader-sibling-empty {
  display: grid;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 20px;
  color: var(--ink);
}

.reader-emotions {
  display: grid;
  gap: 20px;
  padding: 22px 28px 0;
}

.reader-emotion-groups {
  display: grid;
  gap: 12px;
}

.reader-emotion-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: visible;
}

.reader-emotion-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfd;
  padding: 12px 14px;
}

.reader-emotion-group > header span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.reader-emotion-group > header h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}

.reader-emotion-group > header strong {
  min-width: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  padding: 3px 9px;
  font-size: 12px;
  text-align: center;
}

.reader-emotion-list {
  display: grid;
}

.reader-emotion-card {
  position: relative;
  display: grid;
  gap: 9px;
  padding: 13px 54px 13px 14px;
}

.reader-emotion-card + .reader-emotion-card {
  border-top: 1px solid var(--line);
}

.reader-emotion-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.reader-emotion-meta strong {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  padding: 2px 7px;
  font-size: 11px;
  text-transform: uppercase;
}

.reader-emotion-card blockquote {
  margin: 0;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  padding-left: 10px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.56;
}

.reader-emotion-card p,
.reader-emotion-context {
  margin: 0;
  color: #384955;
  font-size: 13px;
  line-height: 1.55;
}

.reader-emotion-context {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.reader-emotion-actions {
  display: flex;
  justify-content: flex-end;
}

.reader-emotion-actions button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 850;
}

.reader-emotion-actions button:hover,
.reader-emotion-actions button:focus-visible {
  border-color: var(--accent);
  color: var(--accent-dark);
  outline: none;
}

.reader-emotion-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
