:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18241f;
  background: #e8e4da;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: #e8e4da;
}

.editor-header {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 24px;
  align-items: center;
  min-height: 92px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: #173b31;
  color: #fff;
}

.editor-brand {
  display: block;
  width: 150px;
  height: 64px;
}

.editor-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.editor-title {
  display: grid;
  gap: 3px;
}

.editor-title span {
  color: #f1d56f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.editor-title strong {
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 400;
}

.editor-exit {
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

button.editor-exit {
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.editor-logout-form {
  margin: 0;
}

.login-main {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 92px);
  padding: 32px 18px;
}

.login-card {
  width: min(100%, 520px);
  padding: clamp(28px, 5vw, 52px);
  border-radius: 24px;
  background: #f7f3e9;
  box-shadow: 0 24px 70px rgba(24, 36, 31, 0.14);
}

.login-card h1 {
  margin: 0 0 14px;
  font-family: Georgia, serif;
  font-size: clamp(38px, 7vw, 58px);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.login-card > p {
  margin: 0 0 28px;
  color: rgba(24, 36, 31, 0.7);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 750;
}

.login-form input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(24, 36, 31, 0.24);
  border-radius: 10px;
  background: #fff;
  color: #18241f;
  font: inherit;
}

.login-form button {
  min-height: 50px;
  border: 0;
  border-radius: 10px;
  background: #173b31;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.login-error {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(161, 59, 47, 0.1);
  color: #8b2f25;
  font-size: 13px;
  font-weight: 750;
}

.editor-main {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: calc(100vh - 92px);
}

.editor-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 340px) 1fr auto auto;
  gap: 24px;
  align-items: end;
  padding: 18px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(24, 36, 31, 0.14);
  background: #f7f3e9;
}

.editor-toolbar label {
  display: grid;
  gap: 7px;
}

.editor-toolbar label span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.editor-toolbar select,
.editor-toolbar button {
  min-height: 44px;
  border: 1px solid rgba(24, 36, 31, 0.22);
  border-radius: 10px;
  background: #fff;
  color: #18241f;
  font: inherit;
}

.editor-toolbar select {
  padding: 0 14px;
}

.editor-toolbar button {
  padding: 0 16px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.editor-toolbar button.primary {
  border-color: #173b31;
  background: #173b31;
  color: #fff;
}

.editor-toolbar button:disabled {
  cursor: wait;
  opacity: 0.48;
}

#editor-status {
  align-self: center;
  margin: 0;
  color: rgba(24, 36, 31, 0.68);
  font-size: 13px;
}

#editor-status[data-state="success"] {
  color: #24684f;
  font-weight: 750;
}

#editor-status[data-state="error"] {
  color: #a13b2f;
  font-weight: 750;
}

.editor-actions {
  display: flex;
  gap: 10px;
}

.viewport-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(24, 36, 31, 0.08);
}

.viewport-switch button {
  min-height: 38px;
  border-color: transparent;
  background: transparent;
}

.viewport-switch button[aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 4px 14px rgba(24, 36, 31, 0.08);
}

.editor-workspace {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  padding: 18px clamp(12px, 2vw, 28px) 28px;
}

.editor-hint {
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding: 0 4px 14px;
  font-size: 13px;
}

.editor-hint span {
  color: rgba(24, 36, 31, 0.66);
}

#editor-frame {
  width: 100%;
  height: max(760px, calc(100vh - 255px));
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(24, 36, 31, 0.16);
  transition: width 220ms ease;
}

.editor-workspace[data-viewport="mobile"] #editor-frame {
  width: 390px;
  max-width: 100%;
  height: 844px;
  margin: 0 auto;
}

@media (max-width: 840px) {
  .editor-header {
    grid-template-columns: 1fr auto;
  }

  .editor-brand {
    width: 120px;
  }

  .editor-title {
    display: none;
  }

  .editor-toolbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .editor-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .viewport-switch {
    width: max-content;
  }

  .editor-hint {
    display: grid;
    gap: 4px;
  }

  #editor-frame {
    height: 72vh;
    border-radius: 12px;
  }
}
