/* Text tools — RapidTables-clean (light controls, no heavy dark bars) */
.text-desk,
.notepad-desk,
.pdf-desk {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 12px;
}

.text-file-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.btn-file,
.btn-update {
  background: #e8e8e8;
  color: #222;
  border: 1px solid #bbb;
  border-radius: 3px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn-file:hover,
.btn-update:hover { background: #ddd; }

/* Light toolbar — replaces dark grey bar user disliked */
.text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  padding: 4px;
}
.text-toolbar button {
  border: 1px solid transparent;
  background: transparent;
  color: #333;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 2px;
  cursor: pointer;
}
.text-toolbar button:hover {
  background: #fff;
  border-color: #bbb;
}
.text-toolbar .sep {
  width: 1px;
  background: #ccc;
  margin: 4px 6px;
  align-self: stretch;
}

.text-area,
#text-input {
  width: 100%;
  min-height: 200px;
  border: 1px solid #bbb;
  border-radius: 0 0 3px 3px;
  padding: 10px;
  font-size: 14px;
  font-family: Consolas, "Courier New", monospace;
  resize: vertical;
  background: #fff;
  color: #111;
}

.text-live {
  margin: 10px 0 8px;
  font-size: 14px;
  color: #333;
  line-height: 1.6;
}
.text-live b {
  display: inline-block;
  min-width: 1.4em;
  padding: 2px 7px;
  margin-right: 2px;
  background: #555;
  color: #fff;
  border-radius: 3px;
  font-size: 13px;
  text-align: center;
}

.text-opts-box {
  background: #f3f3f3;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 10px;
  margin-top: 6px;
}
.text-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin: 10px 0;
  font-size: 13px;
}
.text-opts label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  font-weight: 600;
  color: #333;
}
.kw-tog { display: inline-flex; gap: 4px; }
.kw-tog button {
  border: 1px solid #999;
  background: #fff;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 2px;
  color: #333;
}
.kw-tog button.on {
  background: #555;
  color: #fff;
  border-color: #444;
}

.freq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  margin-top: 6px;
}
.freq-table th,
.freq-table td {
  border: 1px solid #ccc;
  padding: 5px 8px;
  text-align: left;
}
.freq-table th { background: #eee; }
.freq-table td:nth-child(2),
.freq-table td:nth-child(3),
.freq-table th:nth-child(2),
.freq-table th:nth-child(3) {
  text-align: right;
  width: 64px;
}

.text-actions,
.text-case-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.btn-case {
  background: #ff6b1a;
  color: #fff !important;
  border: 1px solid #1b5e20;
  border-radius: 3px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.btn-case:hover { background: #256628; }

/* Notepad — ruled notebook paper */
.notepad-desk {
  padding: 0;
  overflow: hidden;
  background: #fff;
}
.notepad-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 8px 12px;
  border-bottom: 1px solid #ddd;
  background: #fafafa;
  font-size: 13px;
}
.notepad-menu button {
  border: 0;
  background: transparent;
  font-weight: 700;
  color: #333;
  cursor: pointer;
  padding: 2px 0;
}
.notepad-menu button:hover { color: #ff6b1a; }
.notepad-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  border-bottom: 1px solid #ddd;
  background: #f5f5f5;
}
.notepad-bar button {
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 3px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
}
.notepad-bar button:hover { background: #eee; }
#notepad-area {
  width: 100%;
  min-height: 380px;
  border: 0;
  padding: 8px 16px 14px 48px;
  font-size: 15px;
  line-height: 28px;
  resize: vertical;
  color: #1a237e;
  font-family: "Segoe UI", "Comic Sans MS", Arial, sans-serif;
  background-color: #fffef5;
  background-image:
    linear-gradient(#c5cae9 1px, transparent 1px),
    linear-gradient(90deg, transparent 39px, #ef9a9a 39px, #ef9a9a 41px, transparent 41px);
  background-size: 100% 28px, 100% 100%;
  background-attachment: local;
  background-position: 0 0, 0 0;
}
#notepad-area::placeholder { color: #9fa8da; }
.notepad-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  background: #f0f0f0;
  border-top: 1px solid #ddd;
  font-size: 12px;
  color: #333;
}

/* PDF — continuous page stack */
.pdf-drop {
  border: 2px dashed #888;
  border-radius: 4px;
  min-height: 280px;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 28px 16px;
}
.pdf-drop.hidden,
#pdf-viewer.hidden { display: none !important; }
.pdf-drop h3 { margin: 0; font-size: 16px; color: #333; }
.pdf-drop .or { color: #666; font-size: 13px; }
.pdf-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pdf-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: #f0f0f0;
  color: #333;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 3px 3px 0 0;
  font-size: 13px;
}
.pdf-toolbar button,
.pdf-toolbar select {
  border: 1px solid #bbb;
  background: #fff;
  color: #333;
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pdf-toolbar button:hover { background: #eee; }
#pdf-pages {
  background: #e5e5e5;
  min-height: 320px;
  overflow: auto;
  text-align: center;
  padding: 16px 12px 28px;
  border: 1px solid #ccc;
  border-top: 0;
  border-radius: 0 0 3px 3px;
}
.pdf-page-wrap {
  margin: 0 auto 18px;
  display: inline-block;
  max-width: 100%;
}
.pdf-page-wrap canvas {
  max-width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: block;
}
.pdf-page-label {
  font-size: 12px;
  color: #555;
  margin-top: 6px;
  font-weight: 600;
}

.text-hub-list {
  columns: 2;
  column-gap: 28px;
  margin: 0;
  padding-left: 20px;
}
.text-hub-list li { margin: 0 0 8px; break-inside: avoid; }

/* Soft see-also on text desks only — not global green bricks */
.rt-page .see-also {
  background: #f7f7f7 !important;
  border: 1px solid #ddd !important;
  padding: 12px !important;
}
.rt-page .see-also a {
  background: #fff !important;
  color: #ff6b1a !important;
  border: 1px solid #c5d0dc !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
.rt-page .see-also a:hover {
  background: #eef5ff !important;
  color: #0d47a1 !important;
}

.side-box a { text-decoration: none !important; }
.side-box a:hover { text-decoration: underline !important; }

@media (max-width: 576px) {
  .text-hub-list { columns: 1; }
}
