/* Chrome only. Sheet coordinates are assigned in JavaScript by design + populate. */
html, body { height: 100%; margin: 0; }
body { background: #cfc6b8; color: #1c1915; }
button, [role="button"], select { cursor: pointer; }
#pdf {
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #cfc6b8;
  color: #1c1915;
  color-scheme: light;
  font-family: "Liberation Sans", Helvetica, Arial, sans-serif;
}
.bar {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: #241f1b;
  color: #f3efe7;
  box-sizing: border-box;
}
.title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}
.brand { display: flex; flex-direction: column; justify-content: center; min-height: 44px; padding-right: 4px; }
.brand-name { font-family: "Liberation Serif", "Times New Roman", Times, serif; font-size: 22px; line-height: 1; }
.brand-sub { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #b7aea2; margin-top: 3px; }
.sheet-select {
  flex: 1 1 240px;
  max-width: 440px;
  height: 44px;
  min-width: 0;
  margin: 0;
  padding: 0 12px;
  background: #fffdf8;
  color: #1c1915;
  border: 1px solid #fffdf8;
  border-radius: 0;
  font: 14px "Liberation Sans", Helvetica, Arial, sans-serif;
}
.seg { display: flex; gap: 6px; flex: 0 0 auto; }
.bar button {
  height: 44px;
  padding: 0 14px;
  margin: 0;
  border-radius: 0;
  font: 13px "Liberation Sans", Helvetica, Arial, sans-serif;
  letter-spacing: 0.02em;
  box-sizing: border-box;
}
.bar button.ghost { background: transparent; color: #f3efe7; border: 1px solid #5c554c; }
.bar button.paper { background: #fffdf8; color: #1c1915; border: 1px solid #fffdf8; }
.bar button.accent { background: #8f3d2b; color: #fffaf6; border: 1px solid #8f3d2b; }
.bar button:disabled { opacity: 0.6; }
.status { flex: 1 1 160px; min-width: 140px; font-size: 12px; color: #b7aea2; line-height: 1.4; }
.records {
  flex: 0 0 auto;
  background: #f7f1e8;
  border-bottom: 1px solid #e4dcd0;
  max-height: 48px;
  overflow: auto;
}
.records.open { max-height: 36vh; }
.records-toggle {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  color: #1c1915;
  font: 13px "Liberation Sans", Helvetica, Arial, sans-serif;
  text-align: left;
}
.records-list { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.records-list p { margin: 0; color: #5e584f; font-size: 13px; line-height: 1.45; }
.records-list article { background: #fffdf8; border: 1px solid #e4dcd0; padding: 10px 12px; }
.record-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
.record-head strong { font-family: "Liberation Serif", "Times New Roman", Times, serif; font-weight: 600; font-size: 15px; }
.record-head span { font-family: "Liberation Mono", "Courier New", monospace; font-size: 12px; color: #6e675e; }
.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 4px 16px;
  font-family: "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
}
.record-grid div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-grid span { color: #6e675e; }
.desk { flex: 1; min-height: 0; overflow: auto; background: #cfc6b8; }
.stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 28px 14px 56px;
  box-sizing: border-box;
  min-width: 100%;
  width: max-content;
}
.sheet {
  position: relative;
  background: #fffdf8;
  color: #1c1915;
  box-shadow: 0 1px 2px rgba(36, 31, 27, 0.08), 0 16px 40px rgba(36, 31, 27, 0.16);
  flex-shrink: 0;
  overflow: hidden;
}
.sheet-head, .sheet-foot {
  position: absolute;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Liberation Sans", Helvetica, Arial, sans-serif;
  color: #6e675e;
}
.sheet-rule { position: absolute; height: 1px; background: #1c1915; }
.sheet-body { position: absolute; }
input::placeholder, textarea::placeholder { color: #a3998c; }

.zoom-read { min-width: 52px; text-align: center; font-family: "Liberation Mono", "Courier New", monospace; font-size: 13px; color: #f3efe7; }

@font-face { font-family: "Liberation Serif"; src: url("fonts/LiberationSerif-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Liberation Serif"; src: url("fonts/LiberationSerif-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Liberation Serif"; src: url("fonts/LiberationSerif-Italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Liberation Serif"; src: url("fonts/LiberationSerif-BoldItalic.woff") format("woff"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Liberation Sans"; src: url("fonts/LiberationSans-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Liberation Sans"; src: url("fonts/LiberationSans-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Liberation Sans"; src: url("fonts/LiberationSans-Italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Liberation Sans"; src: url("fonts/LiberationSans-BoldItalic.woff") format("woff"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Liberation Mono"; src: url("fonts/LiberationMono-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Liberation Mono"; src: url("fonts/LiberationMono-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Liberation Mono"; src: url("fonts/LiberationMono-Italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Liberation Mono"; src: url("fonts/LiberationMono-BoldItalic.woff") format("woff"); font-weight: 700; font-style: italic; font-display: swap; }

.files-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 240px;
  max-width: 320px;
  max-height: 50vh;
  overflow: auto;
  background: #fffdf8;
  color: #1c1915;
  border: 1px solid #241f1b;
  box-shadow: 0 12px 28px rgba(36, 31, 27, 0.18);
}
.files-menu button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: auto;
  min-height: 44px;
  padding: 8px 12px;
  background: transparent;
  color: #1c1915;
  border: none;
  border-bottom: 1px solid #e4dcd0;
  text-align: left;
  font: 13px "Liberation Sans", Helvetica, Arial, sans-serif;
}
.files-menu strong { font-weight: 650; }
.files-menu span { color: #6e675e; font-size: 11px; }

.ribbon { background: #1c1814; }
.ribbon-tabs { display: flex; gap: 2px; padding: 0 8px; overflow-x: auto; }
.bar button.tab {
  height: 34px;
  padding: 0 14px;
  background: transparent;
  color: #b7aea2;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
}
.bar button.tab.on { color: #fffdf8; border-bottom-color: #c4654a; background: #2a241f; }
.ribbon-panel { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 6px 8px 4px; background: #2a241f; }
.ribbon-panel[hidden] { display: none; }
.ribbon-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; overflow-x: auto; }
.rib-select { display: inline-flex; flex-direction: column; gap: 2px; color: #f3efe7; font: 11px "Liberation Sans", Helvetica, Arial, sans-serif; }
.rib-select select { height: 26px; max-width: 180px; border: 1px solid #5c554c; background: #1c1814; color: #f3efe7; font: 12px "Liberation Sans", Helvetica, Arial, sans-serif; }
.bar button.rib {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 58px;
  height: 46px;
  padding: 3px 8px;
  background: transparent;
  color: #f3efe7;
  border: 1px solid transparent;
  font-size: 10px;
  letter-spacing: 0.01em;
}
.bar button.rib svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bar button.rib .cap { line-height: 1.1; }
.bar button.rib.on,
.bar button.rib[aria-pressed="true"] { background: #fffdf8; color: #1c1915; border-color: #fffdf8; }
.bar button.rib:hover { border-color: #5c554c; }
.id-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 2px 12px 8px;
  background: #2a241f;
  color: #f3efe7;
  font-family: "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.3;
}
.id-strip .kind {
  font-family: "Liberation Sans", Helvetica, Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c4654a;
}
.id-strip .name { color: #b7aea2; }
.id-strip .guid { word-break: break-all; }
.editing .is-selected { outline: 1.5px solid #8f3d2b; outline-offset: 1px; }
.sheet.is-selected { outline-offset: -3px; }

.stage { flex: 1; min-height: 0; min-width: 0; display: flex; }
.pages-scroller {
  flex: 0 0 140px;
  width: 140px;
  overflow: auto;
  box-sizing: border-box;
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px 18px;
  background: #241f1b;
  color: #f3efe7;
}
.pages-scroller.open { display: flex; }
.pages-scroller[hidden] { display: none; }
.page-thumb {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 4px;
  background: transparent;
  color: #f3efe7;
  border: 1px solid transparent;
  font: 11px "Liberation Sans", Helvetica, Arial, sans-serif;
  text-align: left;
}
.page-thumb.on { border-color: #fffdf8; }
.page-thumb-frame { position: relative; overflow: hidden; background: #fffdf8; pointer-events: auto; text-align: left; }
.page-copy { position: absolute; left: 0; top: 0; text-align: left; }
.records { display: none; }
