:root {
  font:
    15px/1.5 Arial,
    Helvetica,
    sans-serif;
  color: #24272b;
  background: #f6f7f4;
  --accent: #245b4c;
  --line: #d9dcd9;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid #b5beb7;
  border-radius: 6px;
  background: #fff;
  color: #24272b;
  transition: background 0.15s;
}
button:hover:enabled {
  background: #edf2ed;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button.primary:hover:enabled {
  background: #184437;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #397c68;
  outline-offset: 3px;
}
::selection {
  background: #c7ded5;
  color: #142b24;
}
input {
  width: 100%;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid #aab5ac;
  border-radius: 5px;
  caret-color: var(--accent);
  color: #24272b;
}
label {
  display: block;
  margin: 20px 0 7px;
  font-size: 13px;
  font-weight: 600;
}
.top {
  height: 82px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(28px, calc((100vw - 1240px) / 2));
  background: #fff;
  gap: 16px;
}
.brand {
  text-decoration: none;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand span {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  border-left: 1px solid var(--line);
  padding-left: 16px;
  color: #59625a;
}
.top nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
}
.top nav a {
  text-decoration: none;
}
.top nav button {
  font-size: 13px;
}
main {
  max-width: 1240px;
  margin: auto;
  padding: 46px 28px 65px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 500;
  margin-bottom: 12px;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin-bottom: 12px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
p {
  color: #59625a;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 16px;
}
.page-heading p {
  margin: 0;
}
.count {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #59625a;
}
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 42px;
}
.content {
  min-width: 0;
}
.upload-section {
  margin-bottom: 40px;
}
.dropzone {
  margin: 0;
  border: 1px dashed #8f9e92;
  border-radius: 8px;
  min-height: 178px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  font-weight: 400;
  cursor: pointer;
  position: relative;
  padding: 18px;
}
.dropzone svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #245b4c;
  stroke-width: 1.4;
  margin-bottom: 8px;
}
.dropzone strong {
  font-size: 15px;
  font-weight: 500;
}
.dropzone span {
  font-size: 13px;
  color: #59625a;
}
.dropzone:focus-within,
.dropzone.dragover {
  outline: 3px solid #397c68;
  outline-offset: 3px;
  background: #ecf3ec;
}
.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  padding: 0;
}
.upload-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
}
.upload-footer > span {
  font-size: 12px;
  color: #59625a;
  max-width: 65%;
}
.upload-footer button {
  white-space: nowrap;
}
.help {
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 0 0;
  max-width: 70ch;
}
progress {
  width: 100%;
  margin-top: 14px;
  accent-color: #245b4c;
}
.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-heading h2 {
  margin-bottom: 6px;
}
.section-heading p {
  font-size: 13px;
  margin: 0;
}
.section-heading button {
  white-space: nowrap;
}
.page-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.page-row {
  display: grid;
  grid-template-columns: 26px 52px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 14px 0;
  background: #f6f7f4;
  min-width: 0;
}
.page-row.dragging {
  opacity: 0.4;
}
.page-row .number {
  font-size: 13px;
  color: #59625a;
  font-variant-numeric: tabular-nums;
}
.page-row img {
  width: 52px;
  height: 69px;
  object-fit: contain;
  background: #e4e7e2;
}
.page-label {
  overflow: hidden;
}
.page-label strong {
  display: block;
  font-weight: 500;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.page-label small {
  font-size: 12px;
  color: #59625a;
}
.page-actions {
  display: flex;
  gap: 5px;
}
.page-actions button {
  width: 36px;
  min-height: 40px;
  padding: 7px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
}
.page-actions svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.page-actions button:hover:enabled {
  background: #e5eae3;
}
.settings {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}
.settings h2 {
  margin-bottom: 24px;
}
.settings label:first-child {
  margin-top: 0;
}
.color-field {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid #aab5ac;
  border-radius: 5px;
  background: #fff;
  padding: 6px 10px;
}
.color-field input {
  border: 0;
  border-radius: 3px;
  width: 34px;
  height: 34px;
  padding: 0;
  cursor: pointer;
}
.color-field output {
  font-size: 13px;
}
.color-preview {
  margin-top: 18px;
  background: #e9e9e7;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 126px;
  border-radius: 5px;
}
.color-preview div {
  height: 85px;
  width: 60px;
  background: #fff;
  box-shadow: 2px 4px 8px #0002;
}
.color-preview div + div {
  border-left: 1px solid #bbb;
}
.settings button {
  width: 100%;
  margin-top: 20px;
}
.storage-note {
  margin-top: 35px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.storage-note p {
  font-size: 12px;
  line-height: 1.7;
}
.storage-note h3 {
  margin-bottom: 8px;
}
.no-pages {
  padding: 28px 15px;
  background: #edf0e9;
  text-align: center;
}
.no-pages h3 {
  margin-bottom: 6px;
}
.no-pages p {
  margin: 0;
  font-size: 13px;
}
details {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
summary {
  cursor: pointer;
  font-size: 13px;
  color: #59625a;
  min-height: 35px;
}
.archive-list {
  list-style: none;
  padding: 0;
}
.archive-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.archive-list button {
  font-size: 12px;
}
.login {
  max-width: 390px;
  margin: 55px auto;
}
.login h1 {
  font-size: 36px;
  line-height: 1.15;
  margin-bottom: 20px;
}
.login p {
  font-size: 14px;
}
.login form button {
  width: 100%;
  margin-top: 24px;
}
.message {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(90vw, 650px);
  padding: 14px 22px;
  border-radius: 7px;
  background: #24272b;
  color: #fff;
  z-index: 90;
  margin: 0;
  font-size: 14px;
  box-shadow: 0 8px 20px #0002;
}
.message.error {
  background: #8a2926;
}
.notice {
  padding: 10px 14px;
  background: #e4eddf;
  color: #304b2a;
  font-size: 13px;
  margin: 12px 0;
}
.bottom {
  font-size: 12px;
  color: #59625a;
  max-width: 1240px;
  margin: auto;
  padding: 0 28px 24px;
}
dialog {
  border: 0;
  border-radius: 12px;
  padding: 28px;
  max-width: min(90vw, 440px);
  box-shadow: 0 12px 45px #0003;
}
dialog::backdrop {
  background: #0006;
}
dialog h2 {
  font-size: 22px;
}
dialog p {
  font-size: 14px;
}
dialog form {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
@media (max-width: 900px) {
  .editor-layout {
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 24px;
  }
  .settings {
    padding-left: 20px;
  }
  .page-row {
    gap: 9px;
  }
  .top {
    padding: 0 24px;
  }
}
@media (max-width: 700px) {
  .top {
    height: auto;
    min-height: 72px;
    padding: 14px 18px;
    gap: 16px;
    flex-wrap: wrap;
  }
  .brand span {
    display: none;
  }
  .top nav {
    gap: 13px;
  }
  .top nav button {
    padding: 7px 9px;
  }
  main {
    padding: 30px 18px 50px;
  }
  .editor-layout {
    display: flex;
    flex-direction: column;
    gap: 34px;
  }
  .settings {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 26px 0 0;
  }
  .page-heading {
    align-items: flex-start;
    margin-bottom: 28px;
  }
  .page-heading h1 {
    font-size: 28px;
  }
  .page-heading p {
    font-size: 13px;
    max-width: 27ch;
  }
  .count {
    white-space: nowrap;
    padding-top: 6px;
  }
  .section-heading {
    flex-wrap: wrap;
  }
  .page-row {
    grid-template-columns: 18px 42px minmax(0, 1fr) auto;
    gap: 9px;
  }
  .page-row img {
    width: 42px;
    height: 58px;
  }
  .page-actions {
    gap: 0;
  }
  .page-actions button {
    width: 32px;
  }
  .page-label strong {
    font-size: 13px;
  }
  .upload-footer {
    align-items: flex-start;
  }
  .upload-footer > span {
    max-width: 55%;
    line-height: 1.6;
  }
  .upload-footer button {
    font-size: 13px;
    padding: 9px 11px;
  }
  .dropzone {
    min-height: 165px;
  }
  .login {
    margin: 35px auto;
  }
  .login h1 {
    font-size: 32px;
  }
  .color-preview {
    height: 155px;
  }
  .bottom {
    padding-left: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
