/* Survey module — matches the look of mazhdrakovi.com (css/styles.css is loaded first). */
[hidden] { display: none !important; }

:root {
  --text: #a65947;
  --link: #803a2a;
  --accent: #f26c4f;
  --accent-dark: #bf573f;
  --frame: #f1e6da;
  --line: #e8cfc0;
  --soft: #fff4f0;
  --muted: #b98676;
  --ok: #3d7a4f;
  --err: #b3261e;
  --warn: #9a6400;
}

* { box-sizing: border-box; }
body { margin: 0; background-color: #fff; color: var(--text); font: 13px Arial, Helvetica, sans-serif; }

/* ---- site frame (same images as the main site) ---- */
.page { width: 100%; max-width: 700px; margin: 0 auto; background: #fff; min-height: 100vh; display: flex; flex-direction: column; }
.hd { display: flex; justify-content: space-between; height: 43px; background-repeat: repeat-x; }
.hd img { display: block; }
.mn { display: flex; align-items: stretch; height: 23px; }
.mn img { display: block; flex: 0 0 auto; }
.mn .menu { flex: 1; background: var(--frame); text-align: center; line-height: 23px; white-space: nowrap; overflow-x: auto; }
.tt { display: flex; align-items: center; height: 32px; background-repeat: repeat-x; }
.tt img { display: block; flex: 0 0 auto; align-self: flex-start; }
.tt .title { flex: 1; margin: 0 0 0 10px; }
.bd { flex: 1; background-repeat: repeat-y, repeat-y; background-position: left top, right top; padding: 0 31px; }
.content { padding: 20px 15px 24px 20px; }
.ft { display: flex; justify-content: space-between; height: 34px; background-repeat: repeat-x; }
.ft img { display: block; }

/* ---- typography ---- */
p, td, th, label, li, input, select, textarea, button { font-family: Arial, Helvetica, sans-serif; }
h2 { font-size: 13px; font-style: italic; font-weight: bold; color: var(--accent-dark); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h3 { font-size: 13px; font-style: italic; color: var(--accent-dark); margin: 20px 0 6px; }
.lead { margin-top: 0; }
.num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-style: normal; }
a { color: var(--link); }
a:hover { color: var(--accent); }

section { border-top: 1px solid var(--line); padding: 14px 0 6px; }
section.private { background: var(--soft); margin: 0 -15px 0 -20px; padding: 14px 15px 6px 20px; }
.badge { font-size: 11px; font-weight: normal; font-style: normal; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; }

/* ---- forms ---- */
label { display: block; margin: 0 0 10px; font-weight: bold; font-size: 12px; color: var(--text); }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; }
label.check input { margin-top: 2px; }
.hint { font-weight: normal; color: var(--muted); font-size: 11px; }
.req { color: var(--accent); }
input, select, textarea {
  display: block; width: 100%; margin-top: 3px; padding: 5px 7px; font-size: 12px; font-weight: normal;
  color: var(--link); border: 1px solid #d9b9aa; border-radius: 3px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; display: inline-block; margin: 0; }
input[type=file] { padding: 4px; background: var(--soft); }
textarea { resize: vertical; }
.grid2, .grid3 { display: grid; gap: 0 12px; }
.grid2 { grid-template-columns: 1fr 1fr; }
.grid3 { grid-template-columns: 1fr 1fr 1fr; }
.radios { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.narrow { max-width: 360px; }
.hp { position: absolute; left: -9999px; }

.btn { display: inline-block; background: var(--accent-dark); color: #fff !important; border: 1px solid var(--accent-dark); border-radius: 3px; padding: 5px 14px; font-size: 12px; font-weight: bold; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--link); border-color: var(--link); }
.btn.light { background: #fff; color: var(--link) !important; border-color: #d9b9aa; }
.btn.light:hover { border-color: var(--accent); color: var(--accent) !important; }
.btn.big { font-size: 13px; padding: 8px 22px; margin-top: 8px; }
.btn.danger { background: #fff; color: var(--err) !important; border-color: var(--err); }
.btn.small { padding: 2px 8px; font-size: 11px; white-space: nowrap; }
button.link { background: none; border: 0; color: var(--link); text-decoration: underline; cursor: pointer; font-size: 12px; }

.alert { padding: 8px 12px; border-radius: 3px; border: 1px solid; font-size: 12px; }
.alert.ok { color: var(--ok); background: #eef7f0; }
.alert.err { color: var(--err); background: #fdeeee; }
.alert.warn { color: var(--warn); background: #fff7e6; }
.alert.privacy { color: var(--text); background: var(--soft); border-color: var(--line); }

/* ---- search & relatives ---- */
.search-box, .namecell { position: relative; }
.suggest {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 3px 0; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 3px; box-shadow: 0 4px 12px rgba(128, 58, 42, .15);
  max-height: 260px; overflow-y: auto; min-width: 240px;
}
.suggest li { padding: 5px 10px; cursor: pointer; font-size: 12px; color: var(--link); list-style: none; }
.suggest li:hover, .suggest li.on { background: #fbe9e1; }
.chosen { display: flex; gap: 10px; align-items: center; background: var(--soft); border: 1px solid var(--line); border-radius: 3px; padding: 6px 10px; margin-bottom: 8px; font-weight: bold; color: var(--link); }
.chosen::before { content: "\2713"; color: var(--ok); }

table.rel { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
table.rel th { text-align: left; font-size: 11px; color: var(--muted); padding: 0 3px; }
table.rel td { padding: 2px 3px; vertical-align: top; }
table.rel td:nth-child(1) { width: 27%; }
table.rel td:nth-child(3) { width: 13%; }
table.rel td:nth-child(4) { width: 20%; }
table.rel input, table.rel select { margin: 0; padding: 4px 6px; }
table.rel input.linked { border-color: #9cc7a8; background: #f3faf5; }
.del { background: none; border: 0; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 4px; }
.del:hover { color: var(--err); }
.preview { max-width: 140px; max-height: 140px; border: 1px solid var(--line); margin-bottom: 8px; }

/* ---- admin ---- */
.adminnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; }
.adminnav a { padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: bold; font-family: Tahoma, Arial, sans-serif; color: var(--accent); border: 1px solid var(--line); }
.adminnav a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filters input { flex: 1 1 200px; margin: 0; }
.filters select { flex: 0 1 200px; margin: 0; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; background: var(--frame); padding: 5px 6px; font-size: 12px; color: var(--accent-dark); }
table.list td { padding: 5px 6px; border-bottom: 1px solid #f0e2da; vertical-align: top; font-size: 12px; }
table.list .empty { text-align: center; color: var(--muted); padding: 20px; }
table.kv { border-collapse: collapse; width: 100%; }
table.kv th { text-align: left; width: 150px; color: var(--muted); padding: 4px 8px 4px 0; vertical-align: top; font-size: 12px; }
table.kv td { padding: 4px 0; }
.tag { display: inline-block; font-size: 10px; padding: 0 6px; border-radius: 8px; background: #eee; color: #666; }
.tag.warn { background: #fff1d6; color: var(--warn); }
.tag.st-new { background: #fde2d8; color: var(--accent-dark); }
.tag.st-reviewed { background: #e3eefc; color: #1f4f8f; }
.tag.st-added { background: #e1f4e7; color: var(--ok); }
.view-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.view-head .photo { width: 140px; height: 140px; object-fit: cover; border: 1px solid var(--line); }
.view-head .name, h2.name { font-size: 15px; font-style: normal; color: var(--accent); margin: 0 0 6px; }
.view-head p { margin: 2px 0; }
.files li { margin: 3px 0; }
form.danger { margin-top: 18px; }
.stats { background: var(--frame); padding: 8px 12px; }

/* tree approval */
.inline { display: flex; gap: 6px; align-items: center; }
.inline input { margin: 0; }
.tree-step { background: var(--frame); padding: 12px 14px 2px; margin: 8px 0 14px; }
.tree-write { border: 1px solid var(--line); padding: 14px; }
input.ern { font-family: Consolas, monospace; font-size: 14px; letter-spacing: 1px; }
.thumb { width: 40px; height: 40px; object-fit: cover; vertical-align: middle; margin-left: 6px; }
.bio-preview { border-left: 3px solid var(--line); padding: 2px 10px; margin: 6px 0 10px; }
details summary { cursor: pointer; color: var(--link); margin-bottom: 6px; }

@media (max-width: 640px) {
  .hd-sign, .tt-end, .ft-end { display: none; }
  .hd img:first-child { max-width: 100%; height: auto; }
  .bd { padding: 0 6px; background-image: none !important; }
  .content { padding: 14px 8px 20px; }
  section.private { margin: 0 -8px; padding: 14px 8px 6px; }
  .mn .menu { font-size: 11px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  table.rel thead { display: none; }
  table.rel, table.rel tbody, table.rel tr, table.rel td { display: block; width: 100% !important; }
  table.rel tr { position: relative; border: 1px solid var(--line); padding: 4px 30px 4px 4px; margin-bottom: 6px; }
  table.rel td:last-child { position: absolute; top: 2px; right: 0; width: auto !important; }
  table.kv th { width: 110px; }
}

@media print {
  .hd, .mn, .tt, .ft, .noprint { display: none; }
  .bd { background: none !important; padding: 0; }
}
