:root {
  --ink: #252f35;
  --muted: #627078;
  --paper: #fffdf8;
  --line: #dedfd8;
  --accent: #245e57;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: #f1f2ee;
  font:
    16px/1.6 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
header {
  padding: 25px 36px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}
.mark {
  font:
    44px Georgia,
    serif;
  color: var(--accent);
}
h1 {
  font:
    26px/1.15 Georgia,
    serif;
  margin: 0;
}
header p {
  font-size: 13px;
  color: var(--muted);
  margin: 5px 0 0;
}
.local,
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--muted);
  font-weight: 700;
}
.toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 18px 36px;
  background: #e9ede7;
  border-bottom: 1px solid var(--line);
}
label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  font-weight: 650;
  gap: 5px;
}
select,
input,
button {
  font: 14px inherit;
  font-family: inherit;
  border: 1px solid #c4cec4;
  border-radius: 5px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 11px;
  min-height: 38px;
}
input {
  width: 75px;
}
button {
  cursor: pointer;
}
button:hover {
  background: #e1eae3;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid #82b9a8;
  outline-offset: 2px;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.primary:hover {
  background: #174940;
}
main {
  max-width: 1720px;
  padding: 25px 36px 40px;
  margin: auto;
}
.heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
h2 {
  font:
    28px/1.3 Georgia,
    serif;
  margin: 0 0 18px;
}
h3 {
  font:
    21px Georgia,
    serif;
  margin: 0;
}
.eyebrow {
  margin: 0 0 8px;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
  align-items: start;
}
.reading {
  min-width: 0;
}
.amud {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 7px;
  margin-bottom: 24px;
  overflow: hidden;
}
.amud-head {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: #f9f8f0;
}
.edition {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0;
}
.column-heads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--muted);
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
}
.column-heads span:last-child {
  text-align: right;
}
.segment {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.segment:last-child {
  border-bottom: 0;
}
.segment.selected {
  background: #edf3ec;
  box-shadow: inset 3px 0 var(--accent);
}
.segment-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.ref {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.en,
.he,
.comment-body {
  font:
    18px/1.65 Georgia,
    "Times New Roman",
    serif;
}
.he {
  font-size: 23px;
  text-align: right;
}
.he[dir="rtl"] {
  unicode-bidi: isolate;
}
.actions {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.actions button {
  font-size: 11px;
  padding: 4px 7px;
  min-height: 27px;
}
.empty-note {
  font: 13px/1.5 sans-serif;
  color: var(--muted);
  background: #f2f2ea;
  padding: 12px;
  border-radius: 3px;
}
.notice {
  font-size: 13px;
  border-left: 3px solid #bd9d58;
  background: #fbf5e6;
  padding: 12px 15px;
  margin: 0 0 18px;
}
#status {
  font-size: 13px;
  color: var(--muted);
}
aside {
  position: sticky;
  top: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 20px;
  background: var(--paper);
  max-height: calc(100vh - 36px);
  overflow: auto;
}
aside h2 {
  font-size: 23px;
  overflow-wrap: anywhere;
}
.comment-group {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 20px;
}
.comment-group h3 {
  font-size: 20px;
  margin-bottom: 10px;
}
.comment {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.comment-body {
  font-size: 21px;
  text-align: right;
}
.link-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-weight: 700;
}
.details {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.details summary {
  cursor: pointer;
  margin: 8px 0;
}
.details p {
  margin: 5px 0;
}
a {
  color: var(--accent);
}
footer {
  font-size: 11px;
  color: var(--muted);
  margin-top: 26px;
}
.amud-switch {
  display: flex;
  gap: 8px;
  margin: 15px 0;
}
.amud-switch .active {
  background: var(--accent);
  color: white;
}
.vilna-columns {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) 340px;
  gap: 24px;
  margin-top: 20px;
}
.daf-scroll {
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 15px;
}
#daf-root {
  margin: auto;
}
.vilna-columns .english-list {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 16px;
}
.v-segment {
  cursor: pointer;
}
.v-segment:hover,
.v-comment:hover {
  background: #e6eddc;
}
.v-anchor {
  font: 10px sans-serif !important;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}
.english-list .en {
  font-size: 17px;
}
.english-list article {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
body.vilna-mode .workspace {
  grid-template-columns: minmax(0, 1fr);
}
body.vilna-mode aside {
  position: relative;
  max-height: none;
}
body.vilna-mode #commentary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
body.vilna-mode aside > h2 {
  margin-bottom: 5px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1150px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  aside {
    position: relative;
    max-height: none;
  }
  .vilna-columns {
    display: block;
  }
  .english-list {
    margin-top: 20px;
  }
  .local {
    display: none;
  }
}
@media (max-width: 650px) {
  header,
  .toolbar {
    padding: 18px;
  }
  main {
    padding: 20px 12px;
  }
  .pair {
    gap: 14px;
  }
  .en {
    font-size: 15px;
  }
  .he {
    font-size: 20px;
  }
  .segment {
    padding: 15px 12px;
  }
  .segment-top {
    align-items: start;
    flex-direction: column;
  }
  .heading {
    display: block;
  }
  .column-heads {
    padding: 10px 12px;
  }
  body.vilna-mode #commentary {
    display: block;
  }
  .daf-scroll {
    max-width: 100%;
  }
}

.facsimile-toolbar {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.facsimile-toolbar .active {
  background: var(--accent);
  color: white;
}
.facsimile-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 22px;
  margin-top: 16px;
  align-items: start;
}
.source-surface {
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 10px;
}
#source-pdf {
  width: 100%;
  height: 82vh;
  border: 0;
  background: #ddd;
}
#source-image-viewport {
  width: 100%;
  height: 82vh;
  overflow: auto;
  background: #ddd;
}
#source-image {
  display: block;
  max-width: none;
  height: auto;
  margin: 0 auto;
}
.source-study {
  height: 82vh;
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 12px;
  scroll-behavior: smooth;
}
.source-study .en {
  font-size: 16px;
}
.source-study .he {
  font-size: 20px;
  margin-top: 14px;
}
.source-study .segment {
  padding: 14px 6px;
}
.source-study .segment-top {
  flex-direction: column;
  align-items: start;
}
.source-attribution {
  font-size: 12px;
  margin: 16px 0;
  color: var(--muted);
}
body.facsimile-mode .workspace {
  grid-template-columns: minmax(0, 1fr);
}
body.facsimile-mode aside {
  position: relative;
  max-height: none;
  margin-top: 18px;
}
#source-file-links {
  font-size: 12px;
  align-self: center;
}
@media (max-width: 900px) {
  .facsimile-columns {
    grid-template-columns: 1fr;
  }
  .source-study {
    height: 65vh;
  }
  #source-pdf,
  #source-image-viewport {
    height: 75vh;
  }
}

.wagshal-viewport {
  height: 82vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #d6ddd8;
}
#wagshal-canvas {
  position: relative;
  width: 100%;
  line-height: 0;
}
#wagshal-image {
  width: 100%;
  height: auto;
  display: block;
}
#wagshal-words {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.layout-word {
  min-height: 0;
  line-height: 0;
  position: absolute;
  padding: 0;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid #247daf80;
  border-radius: 0;
  background: #247daf0d;
  pointer-events: auto;
  cursor: pointer;
}
.layout-word:hover,
.layout-word:focus-visible {
  background: #137dcc55;
  outline: 2px solid #137dcc;
}
.layout-word.selected {
  background: #ffba0055;
  border-bottom: 2px solid #d59300;
}
.subtle-links .layout-word:not(.selected):not(:hover) {
  background: transparent;
  border: 0;
}
#wagshal-study .he {
  font-size: 23px;
  line-height: 1.6;
}
#wagshal-study .en {
  font-size: 18px;
  line-height: 1.65;
}

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

.layout-word.uncertain {
  background: #e99a0010;
  border-bottom: 1px dashed #a66b00;
}

#wagshal-canvas {
  background: #fff;
}
.live-word {
  display: block;
  line-height: 1;
  user-select: text;
  cursor: text;
  text-align: right;
  overflow: visible;
}
.live-word .live-text {
  display: inline-block;
  white-space: pre;
  width: max-content;
  line-height: 1;
  font-family: "Times New Roman", serif;
  color: #151515;
  transform-origin: right top;
  user-select: text;
}
.live-word.rashi .live-text,
.live-word.tosafot .live-text {
  color: #303030;
}
.live-word.heading .live-text {
  font-weight: bold;
}
.live-word.uncertain .live-text {
  color: #b47700;
}
.live-word:hover {
  cursor: pointer;
}

#wagshal-view input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  margin-right: 6px;
}
#wagshal-display {
  max-width: 210px;
}
#wagshal-view > .actions {
  margin-bottom: 14px;
}

.gemara-line {
  position: absolute;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  pointer-events: auto;
  z-index: 0;
}
.gemara-line:hover,
.gemara-line:focus-visible {
  background: #e8c67135;
  outline: 1px solid #a58226;
}
.live-word {
  z-index: 1;
}
.gemara-line.line-active {
  background: #ffd66a35;
  outline: 1px solid #caa23c;
}
.live-word.line-active {
  background: #ffd66a50;
  border-bottom: 2px solid #b28b23;
}
.subtle-links .layout-word.line-active {
  background: #ffd66a50;
  border-bottom: 2px solid #b28b23;
}
.smart-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.smart-header h3 {
  margin: 0;
  font-size: 21px;
}
.smart-header button {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 13px;
}
.smart-options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 12px 0 18px;
}
.smart-options label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.smart-options input[type="checkbox"] {
  margin: 0;
}
.smart-excerpt {
  font-size: 22px;
  line-height: 1.6;
  padding: 12px;
  border-right: 3px solid #b28b23;
  background: #ffdc8130;
}
.smart-scope {
  font-size: 14px;
  line-height: 1.5;
  color: #5d6468;
}
.smart-default {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 6px;
}
.smart-passage {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.smart-passage h4 {
  font-size: 17px;
  margin: 0 0 12px;
}
.smart-commentary {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.smart-commentary .comment-body {
  font-size: 21px;
  line-height: 1.65;
}
