/* static/style.css */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #ddd;
}

.app {
  display: grid;
  grid-template-columns: 1fr 8.5in;
  gap: 20px;
  padding: 20px;
}

.editor {
  background: white;
  padding: 16px;
  border-radius: 8px;
}

.preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page {
  width: 8.5in;
  height: 11in;
  background: white;
  box-shadow: 0 0 10px #777;
  position: relative;
  padding: 0.35in;
  box-sizing: border-box;
}

.print-header {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 12px;
}

.header-field {
  min-width: 180px;
  font-size: 14px;
}

.header-field strong::after {
  content: ":";
}

.fill-line {
  display: inline-block;
  border-bottom: 1px solid #000;
  width: 120px;
  height: 16px;
  margin-left: 6px;
}

.black-divider {
  height: 8px;
  background: #000;
  position: relative;
}

.body-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: 15px;
}

.column {
  padding: 0 18px;
}

.item-row {
  margin: 4px 0;
}

.child-list {
  margin-left: 22px;
}

.editor-item {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 5px 0;
}

.editor-item input {
  flex: 1;
}

.menu button {
  margin-left: 3px;
}

.hidden {
  opacity: 0.35;
}

.save {
  margin-top: 20px;
  width: 100%;
  padding: 10px;
}

.form-manager {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}

.form-manager select {
  flex: 1;
}

.edit-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.editor-item {
  position: relative;
}

.item-menu-button {
  width: 28px;
}

.context-menu {
  position: absolute;
  right: 0;
  top: 28px;
  background: white;
  border: 1px solid #999;
  box-shadow: 0 4px 10px #999;
  z-index: 10;
  min-width: 130px;
}

.context-menu button {
  display: block;
  width: 100%;
  border: 0;
  background: white;
  padding: 8px;
  text-align: left;
}

.context-menu button:hover {
  background: #eee;
}

.center-line {
  position: absolute;
  top: calc(0.35in + 40px);
  bottom: 0.35in;
  left: 50%;
  width: 2px;
  background: #000;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 9999;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  width: min(420px, 100%);
  background: white;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 10px 30px #333;
}

.modal-box h3 {
  margin-top: 0;
}

.modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  margin-top: 10px;
  font-size: 16px;
}

.modal-input.hidden {
  display: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.modal-actions button {
  padding: 8px 14px;
}

@media print {
  body {
    background: white;
  }

  .editor,
  .preview-wrap h2 {
    display: none;
  }

  .app {
    display: block;
    padding: 0;
  }

  .page {
    box-shadow: none;
    width: 8.5in;
    height: 11in;
  }
}