/* Kết quả xổ số (#/ket-qua): tinhtienso /result, research/ui screens 01, 02, 20, 26 and tts-dom.json
   "result-desktop" (1366 wide) / "result-mobile" (375 wide). The page uses the system font, numbers are
   Arial bold. Shell, buttons, modals and toasts: ../styles.css (UI-GUIDE.md). */

/* the page background (#f4f6fa) runs down to the bottom like the site's main.result-page */
#view:has(> .view-ket-qua) { display: flex; flex-direction: column; }
.view-ket-qua {
  flex: 1 1 auto;
  padding: 2px 24px 28px;
  background: #f4f6fa;
  color: #23334e;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.5;
}
.view-ket-qua button { font-family: inherit; }

/* ---------------------------------------------------------- white cards (controls, Dò số) */
.result-card { background: #fff; border: .8px solid #e4e9f0; border-radius: 8px; }

/* ---------------------------------------------------------- date + region pills */
.result-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
.result-date-group { display: flex; align-items: center; }
.result-date-control {
  display: flex; align-items: stretch; height: 34px; overflow: hidden;
  border: .8px solid #e4e9f0; border-radius: 7px; background: #fff;
}
.result-date-control button {
  flex: none; width: 30px; padding: 0; border: 0; background: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; color: #64748b; font-size: 10px;
}
.result-date-control button:first-child { border-radius: 6px 0 0 6px; }
.result-date-control button:hover:not(:disabled) { background: #f4f6fa; }
.result-date-control button:disabled { opacity: .35; cursor: default; }
.result-date-control input {
  width: 141px; min-width: 0; padding: 5px 8px; border: 0; outline: 0; background: #fff;
  color: #23334e; font: 600 12px/1.5 var(--font-sans);
}
.result-date-control:focus-within { border-color: #a9c8e6; }
.result-quick { display: flex; gap: 4px; margin-left: 9px; }
.result-quick button {
  height: 34px; padding: 6px 10px; border: .8px solid transparent; border-radius: 6px; background: transparent;
  color: #64748b; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; cursor: pointer;
}
.result-quick button:hover { color: #146db1; }
.result-quick button.is-selected { background: #eff5fa; border-color: #d5e5f1; color: #146db1; font-weight: 600; }
.result-region-picker { margin-left: auto; display: flex; gap: 3px; padding: 2px; border-radius: 6px; background: #f4f6fa; }
.result-region-picker button {
  height: 30px; padding: 5px 10px; border: 0; border-radius: 5px; background: transparent;
  color: #64748b; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; cursor: pointer;
}
.result-region-picker button:hover { color: #22356b; }
.result-region-picker button.is-selected { background: #22356b; color: #fff; font-weight: 600; }

/* ---------------------------------------------------------- Dò số */
.result-lookup { margin-top: 14px; padding: 10px 12px 9.4px; }
.result-lookup-row { display: flex; align-items: center; }
.result-lookup-label {
  flex: none; display: inline-flex; align-items: center; gap: 6px; margin: 0;
  color: #22356b; font-weight: 600; line-height: 18px; white-space: nowrap;
}
.result-lookup-label .ic { font-size: 12px; color: #146db1; }
.result-lookup-label-muted { margin-left: 16px; color: #64748b; font-weight: 400; }
.result-input {
  height: 34px; padding: 6px 9px; border: .8px solid #e4e9f0; border-radius: 6px; background: #fff;
  color: #23334e; font: 400 12px/1.5 var(--font-sans); outline: 0;
}
.result-input::placeholder { color: #64748b; opacity: 1; } /* "Ví dụ: 001234": as dark as the "Tỉnh / đài" label */
.result-input:focus { border-color: #a9c8e6; box-shadow: 0 0 0 3px rgba(20, 109, 177, .12); }
.result-input:disabled { background: #fff; color: #a3adbb; }
#result-lookup-number { width: 155px; margin-left: 9px; }
.result-select { width: 220px; margin-left: 9px; padding-right: 6px; cursor: pointer; }
.result-select:disabled { cursor: default; }
.result-lookup-submit {
  flex: none; margin-left: 16px; height: 34px; padding: 6px 13px;
  border: .8px solid #146db1; border-radius: 6px; background: #146db1; color: #fff;
  font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap; cursor: pointer;
}
.result-lookup-submit:hover:not(:disabled) { background: #105d98; border-color: #105d98; }
.result-lookup-submit:disabled { opacity: .45; cursor: default; }
.result-lookup-help { margin: 9px 0 0; font-size: 11px; line-height: 16.5px; color: #64748b; }
.result-lookup-result:empty { display: none; }
.result-lookup-result {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 12px; margin-top: 8px; padding: 8px 10px;
  border: .8px solid #deebf9; border-radius: 6px; background: #f4f8fd; color: #23334e; font-size: 12px; line-height: 18px;
}
.result-lookup-result.is-miss { background: #f8fafc; border-color: #e4e9f0; color: #526078; }
.result-lookup-result ul { flex: 1 1 100%; order: 2; margin: 0; padding: 0 0 0 16px; }
.result-lookup-title { flex: 1 1 auto; }
.result-lookup-result mark, .result-hit-num mark { background: #ffe58a; color: inherit; padding: 0 1px; border-radius: 2px; }
.result-hit-num { font-family: Arial, Helvetica, sans-serif; font-weight: 700; }
.result-lookup-clear {
  flex: none; margin-left: auto; padding: 0; border: 0; background: none; cursor: pointer;
  color: #146db1; font-size: 11px; line-height: 18px;
}
.result-lookup-clear:hover { text-decoration: underline; }

/* ---------------------------------------------------------- "Thứ ba · 06/10/2026" … "Cập nhật 09:10:15" */
.result-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 10px; color: #64748b; }
.result-date-summary { margin: 0; font-size: 12px; line-height: 18px; white-space: nowrap; }
.result-date-summary .sep { margin: 0 6px; }
.result-update-status { font-size: 11px; line-height: 17px; white-space: nowrap; }
.result-edit-actions { display: flex; gap: 6px; }

/* ---------------------------------------------------------- region cards */
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.result-grid.is-single, .result-grid.is-state { grid-template-columns: minmax(0, 1fr); }
.result-grid.is-state > .state { background: #fff; border: .8px solid #e4e9f0; border-radius: 10px; }
.result-region { min-width: 0; background: #fff; border: .8px solid #e4e9f0; border-radius: 10px; overflow: hidden; }
.result-region-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8.2px 9.2px 8.2px 10.2px; border-bottom: .8px solid #e4e9f0;
  user-select: none; -webkit-user-select: none; /* a double click here opens the manual entry (no text selection) */
}
.result-region-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.result-region-code {
  flex: none; width: 26px; height: 26px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
  background: #eff5fa; color: #146db1; font-size: 10px; font-weight: 700; line-height: 1;
}
.result-region-south .result-region-code { background: #fef7d5; color: #22356b; }
.result-region-middle .result-region-code { background: #f4f6fa; color: #22356b; }
.result-region-head h2 { margin: 0; font-size: 14px; line-height: 21px; font-weight: 700; color: #22356b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-region-status { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 10px; line-height: 15px; color: #64748b; white-space: nowrap; }
.result-dot { width: 5px; height: 5px; border-radius: 50%; background: #b7c0cc; }
.result-region-status.is-available { color: #146db1; }
.result-region-status.is-available .result-dot { background: #146db1; }
.result-region-status.is-pending .result-dot { background: #f6c23e; }
.result-region-status.is-edit .result-dot { background: #4e73df; }

/* result tables */
.result-table { width: 100%; border-collapse: collapse; table-layout: fixed; color: #23334e; font-size: 12px; }
.result-col-prize { width: 39px; }
.result-table th, .result-table td { border: 0; border-top: .8px solid #edf0f5; text-align: center; vertical-align: middle; }
.result-table thead th {
  padding: 6px; border-top: 0; background: #f4f6fa;
  font-size: 11px; font-weight: 600; line-height: 18px; color: #23334e;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.result-table thead th:first-child { color: #64748b; }
.result-table tbody th { padding: 6px 4px; background: #f8f9fc; color: #64748b; font-size: 11px; font-weight: 500; line-height: 14px; }
.result-table abbr { text-decoration: none; cursor: default; }
.result-table td { padding: 6px; background: #fff; }
.result-table-north td { padding: 6px 7px; }
.result-table tr.is-alt td { background: #f8f9fc; }
.result-table tr.result-row-db th, .result-table tr.result-row-db td { background: #fcf4f4; }
.result-table tr.result-row-db th { color: #b91e23; font-weight: 700; }
.result-nums { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 5px; }
.result-stack { display: flex; flex-direction: column; gap: 3.8px; }
.result-num {
  display: block; min-width: 0; font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: 700; line-height: 1.3;
  color: #23334e; white-space: nowrap;
}
.result-table-north .result-num { font-size: 17px; }
.result-table-north .result-row-db .result-num { font-size: 24px; color: #b91e23; }
.result-table-north .result-row-g7 .result-num { font-size: 18px; color: #b91e23; }
.result-table-south .result-row-g8 .result-num, .result-table-south .result-row-db .result-num { font-size: 18px; color: #b91e23; }
.result-hit { padding: 0 3px; border-radius: 4px; background: #ffe58a; box-shadow: 0 0 0 1px #f2c94c; }
.result-table .result-num.result-pending { font-family: var(--font-sans); font-size: 16px; font-weight: 400; color: #8792a5; }

/* manual entry */
.result-edit-input {
  display: block; width: 100%; min-width: 0; height: 28px; padding: 2px 3px; margin: 0;
  border: .8px solid #d1d3e2; border-radius: 5px; background: #fff; text-align: center;
  color: #23334e; font: 700 14px/1 Arial, Helvetica, sans-serif;
}
.result-edit-input::placeholder { color: #c3c8d4; font-weight: 400; }
.result-edit-input:focus { outline: 0; border-color: #4e73df; box-shadow: 0 0 0 2px rgba(78, 115, 223, .2); }
.result-edit-input.invalid { border-color: #e74a3b; background: #fdecea; }
.result-region.is-edit .result-stack { gap: 3px; }

/* "Chưa có kết quả" */
.result-empty { display: flex; flex-direction: column; align-items: center; padding: 58px 16px; text-align: center; }
.result-empty-icon {
  width: 32px; height: 32px; margin-bottom: 14px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  background: #f4f6fa; color: #64748b; font-size: 13px;
}
.result-empty strong { font-size: 12px; line-height: 18px; font-weight: 700; color: #23334e; }
.result-empty-sub { margin-top: 4px; font-size: 11px; line-height: 16px; color: #64748b; }

/* ---------------------------------------------------------- legend (right under the cards) */
.result-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 13px; }
.result-legend { margin-left: auto; display: flex; align-items: center; color: #64748b; font-size: 10px; line-height: 15px; white-space: nowrap; }
.result-legend-special { padding: 2px 4px; border-radius: 3px; background: #fcf4f4; color: #b91e23; font-size: 9px; font-weight: 700; line-height: 14px; }
.result-legend-special + .result-legend-text { margin-left: 7px; }
.result-legend-divider { width: 1px; height: 11px; margin: 0 12px 0 11px; background: #e4e9f0; }
.result-legend .result-pending { margin-right: 6px; font-size: 16px; line-height: 24px; }

/* ---------------------------------------------------------- tablet (phone shell, desktop layout: screen 26) */
@media (max-width: 991.98px) {
  .view-ket-qua { padding: 2px 24px 24px; }
}

/* ---------------------------------------------------------- phone (screen 20, "result-mobile") */
@media (max-width: 767.98px) {
  .view-ket-qua { margin-top: -2px; padding: 0 14px 24px; }
  .result-controls { display: block; padding: 12px; }
  .result-date-group { display: block; }
  .result-date-control { height: 44px; }
  .result-date-control button { width: 42px; }
  .result-date-control input { flex: 1 1 auto; width: auto; padding: 7px 9px; font-size: 16px; }
  .result-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 9px 0 0; }
  .result-quick button { height: 42px; padding: 8px 12px; border-color: #e4e9f0; }
  .result-quick button.is-selected { border-color: #d5e5f1; }
  .result-region-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; margin: 8px 0 0; padding: 3px; }
  .result-region-picker button { height: 40px; padding: 7px 6px; overflow: hidden; text-overflow: ellipsis; }
  .result-lookup-row { display: grid; grid-template-columns: 65px minmax(0, 1fr); gap: 10px 9px; align-items: center; }
  .result-lookup-row > * { margin: 0 !important; }
  #result-lookup-number, .result-select { width: 100%; height: 42px; font-size: 16px; }
  .result-lookup-submit { grid-column: 1 / -1; height: 42px; }
  .result-summary { margin: 16px 0 12px; }
  .result-update-status { font-size: 10px; line-height: 15px; }
  .result-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .result-region-head { padding: 13.6px 11.2px 13.6px 12.2px; }
  .result-region-code { width: 29px; height: 29px; }
  .result-table thead th { padding: 8px 6px; line-height: 20px; }
  .result-table tbody th { padding: 9px 4px; }
  .result-table td { padding: 9px 6px; }
  .result-table-north td { padding: 11px 7px; }
  .result-nums { gap: 9px 5px; }
  .result-stack { gap: 7.2px; }
  .result-num { font-size: 17px; line-height: 1.34; }
  .result-table-north .result-num { font-size: 18px; }
  .result-table-north .result-row-db .result-num { font-size: 27px; }
  .result-table-north .result-row-g7 .result-num, .result-table-south .result-row-g8 .result-num { font-size: 20px; }
  .result-table-south .result-row-db .result-num { font-size: 19px; }
  .result-table .result-num.result-pending { font-size: 16px; }
  .result-edit-input { height: 34px; font-size: 16px; }
  .result-foot { flex-direction: column-reverse; margin-top: 14px; }
  .result-legend { margin: 0 auto; }
}
