:root {
  --evn-blue: #0054a5;
  --evn-red: #e30613;
  --app-bg: #e8edf2;
  --panel: #ffffff;
  --text: #1a2332;
  --muted: #5a6a7a;
  --border: #c8d2dc;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--app-bg);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: none;
  width: 100%;
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.tabs {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.tab {
  border: none;
  background: transparent;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.tab.active {
  background: var(--evn-blue);
  color: #fff;
}

.btn-save {
  border: 1px solid var(--evn-blue);
  background: var(--panel);
  color: var(--evn-blue);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-export {
  border: none;
  background: var(--evn-red);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-export:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-msg {
  background: #fde8ea;
  color: #a10010;
  border: 1px solid #f5b5bb;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 0 16px;
  font-size: 0.9rem;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: stretch;
}

.editor {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px 18px;
  width: 100%;
  max-height: none;
  overflow: visible;
  order: 2;
}

.preview-pane {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  overflow: auto;
  width: 100%;
  order: 1;
  height: 52vh;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

.preview-scale {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: auto;
}

.edit-form > h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  position: sticky;
  top: 0;
  background: var(--panel);
  padding-bottom: 8px;
  z-index: 2;
}

.layer-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}

.layer-card summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #f3f6f9;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.layer-card summary::-webkit-details-marker {
  display: none;
}

.layer-card summary::after {
  content: "+";
  font-weight: 700;
  color: var(--muted);
}

.layer-card[open] summary::after {
  content: "−";
}

.layer-card .fields {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.field input,
.field textarea,
.field select {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.field-color {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 8px;
  align-items: center;
}

.field-color input[type="color"] {
  width: 40px;
  height: 34px;
  padding: 2px;
  cursor: pointer;
}

.preview-hint {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.banner {
  box-sizing: content-box;
  margin: 16px;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 4px 24px rgba(0, 40, 80, 0.18);
  transform-origin: top center;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #ffffff;
  border-style: solid;
  border-color: #0a2744;
  overflow: visible;
}

.banner-inner {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.banner-1 {
  width: 920px;
  height: 270px;
}

.banner-2 {
  width: 796px;
  height: 493px;
}

.banner-2 .banner-inner {
  background: var(--evn-blue);
  background-image: none;
}

.banner-2 .layer-logo {
  background: #fff;
  border-radius: 50%;
  padding: 6px;
  box-sizing: border-box;
}

.banner-1 .banner-inner {
  background: var(--evn-blue);
  background-image: none;
}

.b1-left {
  position: absolute;
  left: 0;
  top: 0;
  width: 200px;
  height: 100%;
  background: #fff;
  z-index: 0;
}

.b1-right {
  position: absolute;
  left: 200px;
  top: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
  background: var(--evn-blue);
  z-index: 0;
}

.layer {
  position: absolute;
  z-index: 2;
  margin: 0;
  line-height: 1.25;
  white-space: pre-wrap;
  word-break: break-word;
}

.layer-logo {
  object-fit: contain;
  display: block;
  z-index: 3;
}

.layer-text {
  font-weight: 700;
}

.b1-stars,
.b2-stars {
  z-index: 1;
  pointer-events: none;
  height: auto;
  object-fit: contain;
}

.field-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.field-check input[type="checkbox"] {
  width: auto;
  margin: 0;
}

@media (max-width: 1100px) {
  .banner-1 {
    transform: scale(0.75);
    margin-bottom: calc(270px * -0.25);
  }

  .banner-2 {
    transform: scale(0.7);
    margin-bottom: calc(493px * -0.3);
  }
}

@media (max-width: 720px) {
  .banner-1 {
    transform: scale(0.48);
    margin-bottom: calc(270px * -0.52);
  }

  .banner-2 {
    transform: scale(0.45);
    margin-bottom: calc(493px * -0.55);
  }
}
