:root {
  --mesh-header: #1f2a56;
  --mesh-header-2: #26327a;
  --accent: #2f6feb;
  --accent-dark: #245bc4;
  --bg: #eceef2;
  --card: #ffffff;
  --border: #e2e5ec;
  --text: #1b1f2a;
  --muted: #6b7280;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 28, 52, .08), 0 1px 2px rgba(20, 28, 52, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* header */
.header { background: linear-gradient(90deg, var(--mesh-header), var(--mesh-header-2)); color: #fff; }
.header__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 20px;
  height: 56px;
}
.logo {
  background: rgba(255, 255, 255, .14);
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 6px 10px;
}
.header__nav { display: flex; gap: 20px; align-items: center; flex: 1; }
.header__nav a { color: rgba(255, 255, 255, .82); font-weight: 500; }
.header__nav a:hover { color: #fff; text-decoration: none; }
.header__nav a.active { color: #fff; }
.header__right { display: flex; gap: 16px; align-items: center; }
.header__right a { color: rgba(255, 255, 255, .82); font-weight: 500; }
.header__right a:hover { color: #fff; text-decoration: none; }
.header__logout { color: #fff !important; }

/* layout */
.container { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head h1 { font-size: 20px; margin: 0; }

/* cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card--table { padding: 0; overflow-x: auto; }

/* blocks grid */
.blocks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.block { scroll-margin-top: 80px; }
.block__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.block__head h2 { font-size: 16px; margin: 0 0 12px; }

.result {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 22px 16px;
  text-align: center;
  margin: 12px 0 14px;
  background: #f8f9fb;
}
.result .value { font-size: 22px; font-weight: 700; color: var(--mesh-header); word-break: break-word; }
.result .empty { color: var(--muted); }

/* dropdown list */
.list-dd > summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
}
.list-dd > summary::-webkit-details-marker { display: none; }
.list-dd[open] > summary { margin-bottom: 8px; }
.list-dd ol { margin: 0; padding-left: 22px; max-height: 220px; overflow: auto; }
.list-dd li { padding: 2px 0; }

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); text-decoration: none; }
.btn--primary:disabled { background: #a9bde8; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn--ghost:hover { color: var(--text); text-decoration: none; }
.btn--danger { background: #fff; color: #c0392b; border: 1px solid #f0c9c4; }
.btn--sm { padding: 6px 10px; font-size: 12px; }

/* forms */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=number], input[type=password], textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
}
textarea { min-height: 180px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 500; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-actions form { display: inline; }

/* bits */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.flash.error { background: #fdecea; color: #b71c1c; }
.flash.ok { background: #e7f5ec; color: #1b5e20; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.pill.on { background: #e7f5ec; color: #1b5e20; }
.pill.off { background: #f1f1f4; color: #6b7280; }

.hint { color: var(--muted); font-size: 12px; }
.linkbox {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: #f4f5f8;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}
.banner {
  background: #eaf1fd;
  border: 1px solid #cfe0fb;
  color: #1c3d73;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

/* main-page placeholder */
.placeholder {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.placeholder__card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 56px 48px;
  max-width: 560px;
}
.placeholder__badge {
  display: inline-block;
  background: var(--mesh-header);
  color: #fff;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 10px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.placeholder__text { font-size: 20px; font-weight: 600; color: var(--text); margin: 0; }

/* single-tile room mode */
.tile {
  max-width: 720px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 40px;
  text-align: center;
  scroll-margin-top: 80px;
}
.tile__progress {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.tile__title { font-size: 28px; margin: 0 0 16px; }
.tile__result {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 48px 20px;
  margin: 20px 0 28px;
  background: #f8f9fb;
}
.tile__result .value { font-size: 40px; font-weight: 800; color: var(--mesh-header); word-break: break-word; }
.tile__result .empty { color: var(--muted); font-size: 18px; }
.tile__pick { margin-bottom: 24px; }
.btn--lg { padding: 14px 32px; font-size: 17px; border-radius: 10px; }
.tile__nav { display: flex; justify-content: space-between; align-items: center; }

/* link-form: display mode + attach list */
.radio-row { display: flex; flex-direction: column; gap: 8px; }
.radio { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.attach-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 14px;
  max-height: 340px;
  overflow: auto;
}
.attach-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.attach-row:last-child { border-bottom: 0; }
.attach-pos { width: 64px; padding: 6px 8px; flex: none; }
