@import url("https://fonts.googleapis.com/css2?family=Marcellus&family=Manrope:wght@400;500;600&display=swap");
:root {
  --bg: #faf7f2;
  --ink: #493737;
  --muted: #89776d;
  --line: #e2d8cd;
  --rose: #96716f;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 13px;
  line-height: 1.7;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3 {
  font-family: "Marcellus", Georgia, serif;
  font-weight: 400;
  line-height: 1.25;
}
h1 {
  font-size: 29px;
  margin: 5px 0;
}
h2 {
  font-size: 25px;
}
h3 {
  font-size: 20px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--rose);
  margin: 0 0 10px;
}
button {
  border: 0;
  background: transparent;
  color: inherit;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 4px;
}
.primary,
.secondary,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  font-size: 11px;
  letter-spacing: 0.02em;
  transition: background 0.2s;
}
.primary {
  background: var(--ink);
  color: white;
}
.primary:hover {
  background: #785954;
}
.secondary {
  border: 1px solid #cdbdae;
  background: #fffdf9;
}
.secondary:hover {
  background: #eee5da;
}
.danger {
  border: 1px solid #d4aaa7;
  color: #9a4b44;
  background: #fff9f7;
}
.primary:disabled,
.secondary:disabled {
  opacity: 0.5;
  cursor: wait;
}
label {
  display: block;
  font-size: 11px;
  color: #79685d;
  margin: 0 0 17px;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1px solid #d9cdbf;
  background: #fffdfa;
  color: var(--ink);
  border-radius: 0;
  padding: 11px 12px;
  min-height: 44px;
  font-size: 13px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 1px solid var(--rose);
  border-color: var(--rose);
}
textarea {
  min-height: 90px;
  resize: vertical;
}
.login-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 35px 20px;
  background: #f2e9df;
}
.login-brand img {
  width: 130px;
  height: 100px;
  object-fit: contain;
  display: block;
  margin-bottom: 25px;
}
.login-card {
  background: #fffdf9;
  border: 1px solid var(--line);
  padding: 38px;
  width: min(440px, 100%);
}
.login-card h1 {
  font-size: 31px;
}
.login-card > p:not(.eyebrow) {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 25px;
}
.login-card form {
  margin-top: 27px;
}
.login-card .primary {
  width: 100%;
}
.back-site,
.text-button {
  font-size: 11px;
  display: block;
  margin-top: 18px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.text-button {
  padding: 0;
}
.back-site {
  color: var(--muted);
}
#auth-status {
  font-size: 12px;
  color: #855b50;
}
code {
  display: block;
  word-break: break-all;
  border: 1px solid var(--line);
  padding: 15px;
  margin: 20px 0;
  font-size: 12px;
}
#recovery-box .secondary {
  width: 100%;
  margin-top: 15px;
}
[hidden] {
  display: none !important;
}
aside {
  position: fixed;
  inset: 0 auto 0 0;
  width: 230px;
  background: #f0e7dd;
  border-right: 1px solid var(--line);
  padding: 35px 22px;
  display: flex;
  flex-direction: column;
}
.sidebar-brand img {
  display: block;
  width: 120px;
  height: 90px;
  object-fit: contain;
  margin: 0 auto 30px;
}
.sidebar-caption {
  font-size: 8px;
  letter-spacing: 0.18em;
  color: #9c8674;
  padding: 0 14px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
nav button {
  text-align: left;
  font-size: 12px;
  padding: 13px 14px;
  border-left: 2px solid transparent;
}
nav button.active {
  background: #fff9f0;
  border-left-color: var(--rose);
}
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 11px;
  padding: 25px 14px 0;
}
.sidebar-bottom button {
  text-align: left;
  padding: 0;
  color: #9a645d;
}
main {
  margin-left: 230px;
  padding: 0 38px 30px;
  max-width: 1550px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 28px 0 23px;
  position: sticky;
  top: 0;
  background: #faf7f2f5;
  backdrop-filter: blur(12px);
  z-index: 4;
  border-bottom: 1px solid var(--line);
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: end;
}
#save-state {
  font-size: 9px;
  color: var(--muted);
  display: block;
  width: 100%;
  text-align: right;
}
#app-status {
  margin: 17px 0;
  font-size: 12px;
  min-height: 20px;
}
#app-status.error {
  color: #9d3c33;
}
#app-status.success {
  color: #466949;
}
#editor {
  padding-top: 8px;
}
.intro {
  max-width: 700px;
  color: var(--muted);
  margin: 0 0 28px;
  font-size: 13px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}
.stat {
  background: #efe6dc;
  padding: 25px;
}
.stat strong {
  display: block;
  font:
    36px "Marcellus",
    serif;
}
.stat span {
  font-size: 11px;
  color: #8c7568;
}
.panel {
  border: 1px solid var(--line);
  padding: 25px;
  background: #fffdf8;
  margin-bottom: 22px;
}
.panel h2:first-child,
.panel h3:first-child {
  margin-top: 0;
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}
.quick-actions button {
  padding: 25px;
  background: #fffdf8;
  border: 1px solid var(--line);
  text-align: left;
  font:
    18px "Marcellus",
    serif;
}
.quick-actions small {
  display: block;
  font:
    11px "Manrope",
    sans-serif;
  color: #9a887a;
  margin-top: 10px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.edit-card {
  border: 1px solid var(--line);
  background: #fffdf8;
  padding: 23px;
}
.edit-card h3 {
  margin: 0 0 20px;
}
.card-photo {
  display: block;
  width: 100%;
  height: 230px;
  object-fit: cover;
  background: #efe5d9;
  margin-bottom: 12px;
}
.photo-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.photo-actions button {
  font-size: 10px;
  padding: 8px 12px;
  min-height: 38px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.checkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}
.checkbox input {
  width: 17px;
  min-height: 17px;
  margin: 0;
  accent-color: var(--rose);
}
.card-footer {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.card-footer button {
  font-size: 10px;
  padding: 9px 12px;
}
.muted {
  font-size: 11px;
  color: var(--muted);
}
.empty {
  text-align: center;
  padding: 40px;
  border: 1px dashed var(--line);
}
details {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: #fffdf8;
}
summary {
  cursor: pointer;
  font-family: "Marcellus", serif;
  font-size: 20px;
  padding: 22px;
}
.details-content {
  padding: 0 24px 12px;
}
.details-content label {
  margin-bottom: 22px;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}
.color-grid input {
  height: 54px;
  padding: 5px;
}
footer {
  padding: 30px 0;
  font-size: 10px;
  color: #9b897b;
}
.library-grid,
#media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.library-grid img,
#media-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #e9dfd3;
}
.media-item {
  border: 1px solid var(--line);
  padding: 8px;
  background: #fffdf8;
  text-align: left;
  overflow: hidden;
}
.media-item span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 9px;
  margin-top: 7px;
}
dialog {
  border: 1px solid #cbb9a9;
  background: #faf7f2;
  padding: 30px;
  width: min(880px, 94vw);
  max-height: 90dvh;
  overflow: auto;
  color: var(--ink);
}
dialog::backdrop {
  background: #30201db3;
  backdrop-filter: blur(3px);
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-heading h2 {
  margin: 0;
}
#media-grid {
  margin-top: 20px;
}
#upload-status {
  font-size: 12px;
}
.section-subheading {
  margin: 40px 0 22px;
}
.inline-image {
  max-width: 230px;
  max-height: 140px;
  object-fit: contain;
  background: #eee4d8;
  padding: 12px;
  display: block;
  margin-bottom: 15px;
}
.backup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cms-preview-banner {
  padding: 12px;
  background: #493737;
  color: white;
  text-align: center;
  font-size: 12px;
}
@media (max-width: 1100px) {
  aside {
    width: 190px;
    padding: 28px 15px;
  }
  main {
    margin-left: 190px;
    padding: 0 24px 25px;
  }
  .header-actions {
    max-width: 360px;
  }
  .header-actions button {
    font-size: 10px;
    padding: 10px 12px;
  }
  .edit-grid {
    gap: 15px;
  }
  .edit-card {
    padding: 18px;
  }
}
@media (max-width: 760px) {
  aside {
    position: static;
    width: 100%;
    padding: 14px 18px 0;
    border-right: 0;
  }
  .sidebar-brand img {
    width: 84px;
    height: 62px;
    margin: 0;
  }
  .sidebar-caption {
    display: none;
  }
  nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0;
    margin-top: 12px;
  }
  nav button {
    font-size: 11px;
    white-space: nowrap;
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 12px;
  }
  nav button.active {
    border-bottom-color: var(--rose);
    border-left: 0;
  }
  .sidebar-bottom {
    position: absolute;
    top: 32px;
    right: 18px;
    flex-direction: row;
    padding: 0;
    margin: 0;
    font-size: 10px;
    gap: 18px;
  }
  main {
    margin-left: 0;
    padding: 0 18px 24px;
  }
  header {
    position: static;
    display: block;
    padding-top: 22px;
  }
  header h1 {
    font-size: 27px;
  }
  .header-actions {
    max-width: none;
    justify-content: start;
    margin-top: 16px;
  }
  #save-state {
    text-align: left;
  }
  #app-status {
    margin: 15px 0;
  }
  .edit-grid {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 18px 12px;
  }
  .stat strong {
    font-size: 29px;
  }
  .stat span {
    font-size: 9px;
  }
  .quick-actions {
    grid-template-columns: 1fr;
  }
  .quick-actions button {
    padding: 20px;
  }
  .library-grid,
  #media-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .panel {
    padding: 20px;
  }
  .row {
    gap: 12px;
  }
  .color-grid {
    grid-template-columns: 1fr 1fr;
  }
  dialog {
    padding: 20px;
  }
  .login-card {
    padding: 28px;
  }
  .login-card h1 {
    font-size: 27px;
  }
  .card-photo {
    height: 290px;
  }
  .details-content {
    padding: 0 18px 10px;
  }
  summary {
    font-size: 18px;
    padding: 18px;
  }
}

@media (max-width: 760px) {
  .sidebar-bottom {
    position: static;
    margin-top: 12px;
    flex-direction: row;
    overflow-x: auto;
    padding: 0 0 12px;
    gap: 18px;
    white-space: nowrap;
    font-size: 10px;
  }
  .sidebar-brand img {
    margin-bottom: 0;
  }
}
