* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 32px 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: linear-gradient(180deg, #f3f0e4 0%, #e7e0c8 100%);
  font-family: Georgia, 'Times New Roman', serif;
  color: #3a3320;
}

.card {
  width: 100%;
  max-width: 860px;
  background: #fffdf5;
  border: 1.5px solid #b8862c;
  border-radius: 14px;
  padding: 28px 32px 32px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

h1 { margin: 0 0 6px; color: #4a6b2a; font-size: 28px; }
h2 { margin: 26px 0 8px; color: #4a6b2a; font-size: 19px; }

.hint { margin: 0 0 20px; color: #8a7a4a; font-size: 14px; line-height: 1.5; }
.hint.tight { margin: 0 0 10px; }
.hint b { color: #6a5a2a; }

fieldset {
  border: 1.5px solid #d8cfa8;
  border-radius: 10px;
  padding: 12px 14px 14px;
  margin: 0 0 16px;
}
legend { padding: 0 6px; color: #4a6b2a; font-weight: 700; font-size: 14px; }

.radio { display: flex; align-items: flex-start; gap: 9px; padding: 5px 0; font-size: 14px; cursor: pointer; line-height: 1.4; }
.radio input { margin-top: 3px; flex: none; }
.radio.standalone { margin: 0 0 16px; }

.row { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 16px; }
.fld { flex: 1 1 200px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #6a5a2a; }
.fld.small { flex: 0 0 90px; }
.fld input, .fld select {
  font-family: Georgia, serif; font-size: 15px; padding: 8px 10px;
  border: 1.5px solid #d8cfa8; border-radius: 8px; background: #fff; color: #3a3320;
}
.fld input:focus, .fld select:focus { outline: none; border-color: #5a8835; }

/* --- сетка-конструктор --- */
.grid-wrap { overflow-x: auto; padding-bottom: 4px; }

table.rz {
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 100%;
}
table.rz th, table.rz td { border: 1.2px solid #cfc4a0; padding: 0; }
table.rz th {
  background: #e8dcb4; color: #4a6b2a; font-size: 13px; font-weight: 700;
  padding: 6px 4px; white-space: nowrap;
}
table.rz th.t-col, table.rz td.t-col { width: 92px; }
table.rz td input {
  width: 100%; border: none; background: transparent; font-family: Georgia, serif;
  font-size: 14px; color: #3a3320; padding: 9px 6px; text-align: center;
}
table.rz td input:focus { outline: 2px solid #5a8835; outline-offset: -2px; background: #f4f8ea; }
table.rz td.t-col input { font-size: 13px; color: #8a7a4a; }
table.rz.icons td input { font-size: 16px; padding: 16px 6px; }
table.rz tr td:first-child input::placeholder { color: #bdb08a; }

/* --- банк предметов --- */
.tabs { display: flex; gap: 8px; margin: 0 0 10px; }
.tab {
  font-family: Georgia, serif; font-size: 13px; padding: 7px 14px; cursor: pointer;
  border: 1.5px solid #d8cfa8; border-radius: 999px; background: #fffdf5; color: #6a5a2a;
}
.tab.active { background: #c8d8a4; border-color: #5a8835; color: #3a5520; font-weight: 700; }

.bank { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.bank button {
  font-family: Georgia, serif; font-size: 14px; padding: 7px 12px; cursor: pointer;
  border: 1.5px solid #d8cfa8; border-radius: 9px; background: #fff; color: #3a3320;
}
.bank button:hover { border-color: #5a8835; background: #f4f8ea; }
.bank button .e { margin-right: 5px; }

/* --- кнопки --- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.actions button {
  font-family: Georgia, serif; font-size: 15px; padding: 11px 20px; cursor: pointer;
  border: 1.5px solid #d8cfa8; border-radius: 10px; background: #fffdf5; color: #4a6b2a; font-weight: 700;
}
.actions button:hover { border-color: #5a8835; background: #f4f8ea; }
.actions button.primary { background: #c8d8a4; border-color: #5a8835; color: #3a5520; }
.actions button.primary:hover { background: #d6e4b6; }

.note {
  margin: 12px 0 0; padding: 10px 12px; font-size: 13px; line-height: 1.5;
  background: #f4f8ea; border: 1.5px solid #a8c880; border-radius: 8px; color: #3a5520;
  word-break: break-all;
}

@media (max-width: 620px) {
  .card { padding: 20px 16px 24px; }
  h1 { font-size: 23px; }
  table.rz th, table.rz td input { font-size: 13px; }
  table.rz th.t-col, table.rz td.t-col { width: 68px; }
}
