/* 🏫 Αίθουσες & υπολογιστές + 🗺️ χάρτης (teacher/rooms.js, teacher/room-map.js) — πρώτα για κινητό: κουμπιά ≥ 44px */
#rooms { margin-bottom: 26px; }
.r-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.r-head h2 { margin: 0; font-size: 21px; }
.r-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.r-card { text-align: left; background: var(--card); border: 2px solid transparent; border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; cursor: pointer;
  display: grid; gap: 4px; font: inherit; color: var(--ink); min-height: 110px; }
.r-card:hover, .r-card:focus-visible { border-color: #d9cff0; }
.r-card .em { font-size: 30px; }
.r-card b { font-size: 17.5px; overflow-wrap: anywhere; }
.r-card .sub { color: var(--muted); font-size: 14.5px; }
.r-empty { text-align: center; max-width: 520px; margin: 0 auto; }
.r-empty .em { font-size: 44px; }
.r-empty p { color: var(--muted); line-height: 1.5; }

/* νέα αίθουσα */
.step { display: grid; grid-template-columns: 50px 1fr 50px; align-items: center; gap: 8px; }
.step .btn { min-height: 50px; padding: 0; font-size: 24px; touch-action: manipulation; }
.step output { text-align: center; font-size: 24px; font-weight: 800; color: var(--brand); }
.rn-prev { display: grid; gap: 5px; max-width: 360px; margin: 2px auto 6px; }
.rn-prev i { display: grid; place-items: center; aspect-ratio: 1.3; max-height: 34px; background: var(--brand-soft); color: var(--brand); border-radius: 6px; font: 700 11px/1 Inter, sans-serif; font-style: normal; }

/* η αίθουσα */
.r-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.r-bar h2 { margin: 0; font-size: 21px; min-width: 0; overflow-wrap: anywhere; }
.r-saved { margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.r-saved.ok { color: var(--ok); }
.r-saved.bad { color: var(--bad); }
/* 🔑 token των συνδέσμων (ισχύει 1 ώρα — teachers/{uid}.linkTok): διακριτικό κουμπί· πάτημα = νέοι σύνδεσμοι */
.r-tok { font: 600 12.5px ui-monospace, Consolas, monospace; color: var(--muted); background: var(--line); border-radius: 999px; padding: 4px 10px; min-height: 30px; border: 0; white-space: nowrap; cursor: pointer; }
.r-tok:hover, .r-tok:focus-visible { color: var(--ink, #222); outline: 2px solid var(--line); }
.btn.icon { min-width: 44px; min-height: 44px; padding: 0 8px; }
.btn.small { min-height: 44px; }
.btn.bad { background: var(--bad); }
.btn.bad-t { color: var(--bad); }
.r-viewbar { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 12px; }
.r-tabs { max-width: 360px; flex: 1 1 260px; margin: 0; }
#r-codes.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
/* ποιος υπολογιστής είναι αυτή η συσκευή */
.r-dev { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; background: var(--ok-soft); border-radius: 14px; padding: 8px 12px; margin-bottom: 12px; font-size: 14.5px; line-height: 1.4; }
.r-dev.warn { background: #fff4e5; }
.r-dev-t { flex: 1 1 240px; }
/* ⚠️ ο ίδιος κωδικός σε πολλούς υπολογιστές (2.69) */
.r-warn { background: #fdecea; border: 2px solid #f4b4ae; color: #7f1d1d; border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; font-size: 14.5px; line-height: 1.4; }
.r-warn ul { list-style: none; margin: 6px 0; padding: 0; }
.r-warn li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.r-warn li > span { flex: 1; overflow-wrap: anywhere; }
.r-warn .hint { margin: 4px 0 0; color: #7f1d1d; }
.pill.wn { background: #fdecea; color: #b71c1c; margin: 0; }
.rm-pc.wn { border-color: #e53935; box-shadow: 0 0 0 3px rgba(229, 57, 53, .25); }
.rm-pc.wn::before { content: '⚠️'; position: absolute; right: 5px; top: 4px; font-size: 14px; line-height: 1; }
.r-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.r-mapwrap { position: relative; }
.r-maphint { margin: 8px 2px 0; font-size: 13.5px; color: var(--muted); }
.r-zoom { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; z-index: 2; }
.r-zoom button { width: 44px; height: 44px; border-radius: 12px; border: 2px solid #d9cff0; background: #fff; color: var(--brand); font-size: 20px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); touch-action: manipulation; }

.rm { position: relative; overflow: hidden; height: min(62vh, 560px); min-height: 300px; background: #fbfaff; border: 2px solid var(--line); border-radius: var(--r);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; }
.rm.dragging { cursor: grabbing; }
.rm-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.rm-front { position: absolute; left: 0; top: 0; height: 34px; display: grid; place-items: center; background: #ede7f6; color: var(--brand); font: 700 14px Inter, sans-serif; border-radius: 10px;
  border: 2px solid #d9cff0; box-sizing: border-box; cursor: grab; touch-action: none; transition: left .12s, top .12s, width .12s, height .12s; }
.rm-front[data-side="left"] span, .rm-front[data-side="right"] span { writing-mode: vertical-rl; }
.rm-front[data-side="left"] span { transform: rotate(180deg); }
.rm-front.lift { z-index: 6; background: var(--brand-soft); border-color: var(--brand); box-shadow: 0 8px 20px rgba(47, 58, 69, .25); cursor: grabbing; }
.rm-front:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.rm-cells i { position: absolute; width: 84px; height: 84px; border: 2px dashed #e1dbee; border-radius: 14px; }
.rm-cells i.tgt { border-color: var(--brand); background: var(--brand-soft); }
.rm-pc { position: absolute; width: 84px; height: 84px; border-radius: 14px; border: 2px solid #d9cff0; background: #fff; box-shadow: 0 3px 10px rgba(47, 58, 69, .12);
  display: grid; place-items: center; align-content: center; gap: 2px; padding: 4px; font: 600 13px/1.15 Inter, sans-serif; color: var(--ink); cursor: pointer; touch-action: none; }
.rm-pc .rm-ic { font-size: 26px; line-height: 1; }
.rm-pc .rm-nm { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-pc.sel { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(94, 53, 177, .25); }
/* 🟢 ενεργός υπολογιστής (js/classroom.js) */
.rm-pc .rm-dot { position: absolute; right: 6px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: #cfd8dc; font-style: normal; }
.rm-pc.on { border-color: #43a047; background: #f1f8e9; }
.rm-pc.on .rm-dot { background: #2e7d32; box-shadow: 0 0 0 3px rgba(67, 160, 71, .25); }
/* ☑️ επιλεγμένος (2.52): ΓΕΜΑΤΟ μωβ φόντο με λευκά γράμματα — και όταν είναι ενεργός (αλλιώς το πράσινο σκέπαζε την επιλογή)·
   η τελεία 🟢 μένει, με λευκό δαχτυλίδι για να φαίνεται πάνω στο μωβ */
.rm-pc.sel, .rm-pc.on.sel { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 3px rgba(94, 53, 177, .3), 0 6px 16px rgba(94, 53, 177, .4); }
.rm-pc.sel .rm-dot { box-shadow: 0 0 0 2px #fff; }
.rm-pc.on.sel .rm-dot { background: #66bb6a; box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(102, 187, 106, .35); }
.r-online { font-size: 14px; font-weight: 700; color: #2e7d32; background: #e8f5e9; border-radius: 999px; padding: 5px 11px; }
.r-online.none { color: var(--muted); background: #f1eff6; }
.r-online:empty { display: none; }
.pc-st { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.pc-st i { width: 10px; height: 10px; border-radius: 50%; background: #cfd8dc; }
.pc-st.on { color: #2e7d32; }
.pc-st.on i { background: #2e7d32; box-shadow: 0 0 0 3px rgba(67, 160, 71, .2); }
.pc-app { font-size: 13.5px; background: #f1f8e9; color: #33691e; border-radius: 8px; padding: 3px 8px; overflow-wrap: anywhere; }
/* 🔒 κλειδωμένος υπολογιστής (2.47) */
.rm-pc.lk::after { content: '🔒'; position: absolute; left: 5px; top: 4px; font-size: 14px; line-height: 1; }
.rm.multi .rm-pc { cursor: copy; }
.rm-pc.lift { z-index: 5; transform: scale(1.08); box-shadow: 0 12px 26px rgba(47, 58, 69, .3); cursor: grabbing; transition: transform .12s; }

/* 🔒 κλείδωμα + 🚀 άνοιγμα (2.47): γραμμή ενεργειών, επιλογή πολλών */
.r-actbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.r-scope { font-size: 14px; color: var(--muted); }
.r-selbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
#r-multi.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.r-lockst { font-size: 14px; font-weight: 700; color: var(--muted); background: #f1eff6; border-radius: 999px; padding: 5px 11px; }
.r-lockst.on { color: #8d4f00; background: #fff4e5; }
.pill.lk { background: #fff4e5; color: #8d4f00; margin: 0; overflow-wrap: anywhere; }
.pill.lk small { font-weight: 600; }
.pc-ck { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; margin: -8px 0 -8px -6px; cursor: pointer; }
.pc-ck input { width: 22px; height: 22px; accent-color: var(--brand); cursor: pointer; }
.pc-multi .pc-names { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.pc-multi .pc-on { font-size: 13.5px; font-weight: 700; color: #2e7d32; }
.lk-quick { margin-bottom: 6px; }
.lk-tree { list-style: none; margin: 0 0 8px; padding: 0; border: 2px solid var(--line); border-radius: 12px; max-height: min(46vh, 420px); overflow: auto; }
.lk-tree > li { border-bottom: 1px solid var(--line); }
.lk-tree > li:last-child { border-bottom: 0; }
.lk-row { display: flex; align-items: center; gap: 4px; padding: 2px 8px 2px 2px; }
.lk-row label, .lk-apps label { display: flex; align-items: center; gap: 8px; flex: 1; min-height: 44px; cursor: pointer; font-size: 15px; }
.lk-tree input { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.lk-exp { width: 40px; min-height: 40px; border: 0; background: none; color: var(--brand); font-size: 18px; cursor: pointer; flex: none; }
span.lk-exp { display: inline-block; }
.lk-n { color: var(--muted); font-size: 13px; white-space: nowrap; }
.lk-apps { list-style: none; margin: 0; padding: 0 8px 6px 44px; }
.lk-apps label { min-height: 40px; font-size: 14.5px; }
.lk-sum { margin: 4px 0 0; font-weight: 700; font-size: 14px; color: #8d4f00; }
.op-lv { margin: 8px 0; }
.op-lv select { width: 100%; min-height: 44px; font: inherit; font-size: 15px; border: 2px solid var(--line); border-radius: 12px; padding: 0 10px; background: #fff; }
.op-link { flex-wrap: nowrap !important; }
.op-link input { flex: 1; min-width: 0; min-height: 44px; font: 13px ui-monospace, Consolas, monospace; border: 2px solid var(--line); border-radius: 12px; padding: 0 10px; }
.op-warn { background: #fff4e5; border-radius: 12px; padding: 8px 10px; font-size: 14px; line-height: 1.45; margin-bottom: 6px; }
.op-warn .btn { margin-top: 6px; }
.hidden { display: none !important; }

/* υπολογιστής: κάρτα (χάρτης) και λίστα */
#r-selcard { margin-top: 12px; }
.pc-card { padding: 14px 16px; }
.pc-top { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.pc-top b { font-size: 16.5px; }
.pc-top .pill { margin: 0; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pc-code { font: 600 14px ui-monospace, SFMono-Regular, Consolas, monospace; background: #f4f1fb; padding: 4px 8px; border-radius: 8px; letter-spacing: .5px; overflow-wrap: anywhere; margin-left: auto; }
.pc-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pc-list li { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px; border: 2px solid transparent; }
.pc-list li.sel { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(94, 53, 177, .18), var(--shadow); }
.pc-list .pc-acts { margin-top: 8px; }
.r-note { margin-top: 16px; }

/* μικρό παράθυρο */
.dlg-back { position: fixed; inset: 0; background: rgba(32, 24, 52, .45); display: grid; place-items: center; padding: 16px; z-index: 30; }
.dlg { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto; }
.dlg h2 { margin: 0 0 10px; font-size: 19px; }
.dlg-body p { margin: 0 0 10px; line-height: 1.45; }
.dlg .inp { margin-bottom: 14px; }
.dlg .links-h { margin: 4px 0 4px; font-weight: 700; font-size: 14px; }
/* 🧹 αφαίρεση όλων (2.70) */
.dlg .links-danger { margin-top: 16px; border: 2px solid #f4b4ae; background: #fdecea; color: #7f1d1d; border-radius: 14px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.dlg .links-danger p { margin: 0 0 8px; }
.dlg .links-danger .links-h { color: #b71c1c; }
.dlg .links-all { display: block; width: 100%; box-sizing: border-box; margin-top: 8px; font: 13px ui-monospace, Consolas, monospace; border: 2px solid #f4b4ae; border-radius: 10px; padding: 8px; background: #fff; color: #7f1d1d; }
.dlg .links { width: 100%; box-sizing: border-box; font: 13px ui-monospace, Consolas, monospace; border: 2px solid var(--line); border-radius: 12px; padding: 10px; resize: vertical; margin-bottom: 10px; white-space: pre; }
.dlg-body .row { gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.dlg-btns { margin-top: 6px; }
/* ψηλά παράθυρα (🔒 / 🚀 με λίστα ομάδων): τα κουμπιά μένουν πάντα ορατά στο κάτω μέρος */
.dlg .dlg-btns { position: sticky; bottom: -1px; background: var(--card, #fff); padding: 8px 0 2px; z-index: 1; }

@media (max-width: 600px) {
  .r-bar .lbl { display: none; }
  .r-tabs { max-width: none; }
  .r-tools .btn { flex: 1 1 auto; }
  .rm { height: 58vh; }
  .pc-code { margin-left: 0; }
}

/* κουμπιά της λίστας: εικονίδιο + λεζάντα */
.pc-list .pc-acts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; max-width: 420px; }
.btn.cap { flex-direction: column; gap: 1px; padding: 4px 2px; min-height: 52px; font-size: 18px; }
.btn.cap small { font-size: 10.5px; font-weight: 600; line-height: 1.1; white-space: nowrap; letter-spacing: -.2px; }
.pc-list li { padding: 10px; }
@media (max-width: 520px) {
  .pc-list .pc-acts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .btn.cap { flex-direction: row; gap: 5px; min-height: 44px; font-size: 16px; }
  .btn.cap small { font-size: 13px; letter-spacing: 0; }
}
