.tkm-consult {
  direction: rtl;
  text-align: right;
  margin: 8px 0 28px;
  padding: 18px 16px 8px;
  border: 1px solid #e6eee9;
  border-radius: 8px;
  background: #fbfdfc;
  font-family: inherit;
}
.tkm-title {
  margin: 0 0 6px;
  color: #2f9e5f;
  font-size: 18px;
  font-weight: 600;
}
.tkm-hint,
.tkm-sub {
  margin: 0 0 14px;
  color: #888;
  font-size: 13px;
  line-height: 1.7;
}
.tkm-row {
  margin: 0 0 18px;
}
.tkm-row-half {
  max-width: 220px;
}
.tkm-label {
  display: block;
  margin: 0 0 8px;
  color: #2f9e5f;
  font-size: 15px;
  font-weight: 600;
}
.tkm-req {
  color: #e07a3d;
  font-weight: 700;
}
.tkm-consult .tkm-input.field,
.tkm-consult select.tkm-input,
.tkm-consult textarea.tkm-input {
  width: 100% !important;
  height: auto !important;
  min-height: 38px;
  line-height: 1.5 !important;
  padding: 8px 10px !important;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  font-size: 14px;
  box-sizing: border-box;
}
.tkm-textarea {
  min-height: 96px !important;
  resize: vertical;
}
.tkm-checks,
.tkm-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 8px;
}
.tkm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #e2e8e4;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  font-weight: 400;
}
.tkm-check input {
  margin: 0;
  accent-color: #2f9e5f;
}
.tkm-check:has(input:checked) {
  border-color: #5ac17f;
  background: #f1faf4;
}
.tkm-repeat-row {
  display: grid;
  grid-template-columns: 1fr 120px 36px;
  gap: 8px;
  margin: 0 0 8px;
  align-items: center;
}
.tkm-doc-row {
  grid-template-columns: 1.05fr 1.45fr .78fr 36px;
}
.tkm-doc-row .tkm-file {
  min-height: 34px;
  padding: 0 7px;
  border: 1px solid #48a96b;
  border-radius: 5px;
  background: #eaf8ef;
  color: #237d49;
  transition: background .15s ease, border-color .15s ease;
}
.tkm-doc-row .tkm-file:hover {
  background: #dff3e6;
  border-color: #2f9658;
}
.tkm-doc-row .tkm-file-label {
  font-size: 11px;
  color: #237d49;
}
.tkm-doc-row .tkm-file.has-file {
  border-color: #2f9658;
  background: #e2f5e8;
}
.tkm-age {
  max-width: 120px;
}
.tkm-remove {
  width: 36px;
  height: 36px;
  border: 1px solid #e3e3e3;
  background: #fff;
  color: #999;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.tkm-remove:hover {
  color: #c0392b;
  border-color: #c0392b;
}
.tkm-file {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px dashed #b7d7c3;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}
.tkm-file input[type="file"] {
  display: none;
}
.tkm-file-label {
  font-size: 12px;
  color: #2f9e5f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tkm-file.is-uploading .tkm-file-label {
  color: #888;
}
.tkm-file.has-file {
  border-style: solid;
  border-color: #5ac17f;
}
.tkm-error {
  color: #c0392b;
  font-size: 12px;
  margin: 6px 0 0;
}
.tkm-consult.is-invalid {
  box-shadow: 0 0 0 2px rgba(224, 122, 61, 0.25);
}
@media (max-width: 700px) {
  .tkm-repeat-row,
  .tkm-doc-row {
    grid-template-columns: 1fr 36px;
  }
  .tkm-repeat-row > *,
  .tkm-doc-row > * {
    grid-column: 1;
  }
  .tkm-repeat-row .tkm-remove,
  .tkm-doc-row .tkm-remove {
    grid-column: 2;
    grid-row: 1;
  }
}

/* Ticketa fields that are intentionally removed by the integration. */
.tkm-force-hidden { display: none !important; }

/* The native Ticketa subject remains enabled/validated but is visually hidden. */
.tkm-native-subject-hidden { display: none !important; }

.tkm-medical-popup{position:fixed;inset:0;background:rgba(15,35,25,.55);backdrop-filter:blur(3px);z-index:99999;display:flex;align-items:center;justify-content:center;direction:rtl;padding:20px}
.tkm-medical-popup[hidden]{display:none}
.tkm-popup-box{background:linear-gradient(180deg,#ffffff,#f8fcfa);max-width:560px;width:100%;padding:32px 36px;border-radius:24px;box-shadow:0 20px 60px rgba(0,0,0,.25);line-height:2;position:relative;border:1px solid #e2eee6}
.tkm-popup-box:before{content:"🩺";display:block;text-align:center;font-size:38px;margin-bottom:8px}
.tkm-popup-box h3{color:#218c52;text-align:center;font-size:22px;margin:0 0 20px;font-weight:700}
.tkm-popup-box h4{color:#333;font-size:16px;margin:18px 0 5px}
.tkm-popup-box p{color:#555;font-size:14px;margin:0 0 12px}
.tkm-popup-box label{display:flex;align-items:center;gap:8px;background:#f1f8f3;border-radius:12px;padding:12px;font-size:14px;color:#333;margin-top:15px}
.tkm-popup-box input[type=checkbox]{width:18px;height:18px;accent-color:#2f9e5f}
#tkm-popup-close{display:block;margin:24px auto 0;padding:12px 45px;border:0;border-radius:12px;background:#2f9e5f;color:#fff;font-size:15px;cursor:pointer;transition:.2s}
#tkm-popup-close:hover{transform:translateY(-1px)}
#tkm-popup-close:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:600px){.tkm-popup-box{padding:24px 18px;border-radius:18px}}

/* v2.6.15 popup hard override */
html body .tkm-medical-popup {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 20px !important;
    z-index: 2147483647 !important;
}
html body .tkm-medical-popup[hidden] {
    display: none !important;
}
html body .tkm-popup-box {
    margin: 0 auto !important;
    transform: translateZ(0);
    animation: tkmPopupIn .35s ease-out;
}
@keyframes tkmPopupIn {
    from {opacity:0; transform:scale(.92);}
    to {opacity:1; transform:scale(1);}
}


/* v2.6.16: the custom medical form must occupy the full Ticketa form width */
html body form #tkm-consult.tkm-consult {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  clear: both !important;
  float: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
html body form #tkm-consult.tkm-consult .tkm-row {
  width: 100% !important;
  box-sizing: border-box !important;
}
html body .tkm-medical-popup {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  z-index: 2147483647 !important;
}

/* v2.6.22: Medical intake summary for the Ticketa agent/doctor ticket view. */
.tkm-consult-summary-card {
  direction: rtl;
  margin: 0 0 18px;
  background: #fff;
  border: 1px solid #e3ebe7;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  overflow: hidden;
  font-size: 12px;
}
.tkm-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 13px;
  background: #f4faf6;
  border-bottom: 1px solid #e3ebe7;
}
.tkm-summary-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  color: #2c6044;
  font-size: 13px;
}
.tkm-summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2f9e5f;
  color: #fff;
  font-size: 12px;
}
.tkm-summary-status {
  white-space: nowrap;
  border-radius: 12px;
  padding: 3px 7px;
  font-size: 10px;
}
.tkm-summary-status.is-complete { background: #e4f6eb; color: #247847; }
.tkm-summary-status.is-empty { background: #fff3e8; color: #b96a25; }
.tkm-summary-body { padding: 8px 12px 11px; }
.tkm-summary-row {
  display: grid;
  grid-template-columns: 88px minmax(0,1fr);
  gap: 7px;
  padding: 7px 0;
  border-bottom: 1px solid #f0f2f1;
  line-height: 1.7;
}
.tkm-summary-row:last-child { border-bottom: 0; }
.tkm-summary-label { color: #777; font-weight: 600; }
.tkm-summary-value { color: #333; overflow-wrap: anywhere; }
.tkm-summary-section-title {
  margin: 11px 0 3px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e7eee9;
  color: #2c6044;
  font-weight: 700;
}
.tkm-summary-empty {
  padding: 14px 13px;
  color: #8a5a2b;
  background: #fffaf4;
  line-height: 1.9;
}
.tkm-summary-docs { margin-top: 5px; }
.tkm-summary-doc {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f2f1;
}
.tkm-summary-doc:last-child { border-bottom: 0; }
.tkm-summary-doc-name { min-width: 0; overflow-wrap: anywhere; color: #444; }
.tkm-summary-doc a { flex: 0 0 auto; color: #238c52; text-decoration: none; font-weight: 600; }
.tkm-summary-doc a:hover { text-decoration: underline; }
.tkm-summary-doc-file { color: #888; font-size: 10px; }
.tkm-summary-consent {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e7eee9;
  color: #777;
  font-size: 10px;
}
.tkm-summary-consent strong { color: #2f7c4e; }
@media (max-width: 900px) {
  .tkm-summary-row { grid-template-columns: 78px minmax(0,1fr); }
}


/* v2.6.25: clickable medical-document viewer with image/PDF preview and fullscreen. */
.tkm-summary-doc-open {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 5px 9px;
  border: 1px solid #cfe6d8;
  border-radius: 5px;
  background: #f7fcf9;
  color: #238c52 !important;
  text-decoration: none !important;
  font-weight: 700;
  cursor: pointer;
}
.tkm-summary-doc-open:hover { background: #eaf7ef; }
.tkm-medical-doc-viewer[hidden] { display: none !important; }
.tkm-medical-doc-viewer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483646 !important;
  direction: rtl;
}
.tkm-doc-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 18, 28, .78);
  backdrop-filter: blur(3px);
}
.tkm-doc-viewer-window {
  position: absolute;
  inset: 4vh 4vw;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 18px 60px rgba(0,0,0,.38);
}
.tkm-doc-viewer-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #f5f8fa;
  border-bottom: 1px solid #e2e7ea;
  color: #33434d;
}
.tkm-doc-viewer-actions { display: flex; align-items: center; gap: 6px; }
.tkm-doc-viewer-actions button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 5px;
  background: #e8eef2;
  color: #31414b;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.tkm-doc-viewer-actions button:hover { background: #dce5ea; }
.tkm-doc-viewer-close { font-size: 26px !important; }
.tkm-doc-viewer-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 18px;
  background: #111820;
}
.tkm-doc-viewer-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}
.tkm-doc-viewer-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 60vh;
  border: 0;
  background: #fff;
}
.tkm-doc-viewer-window.is-fullscreen {
  inset: 0 !important;
  border-radius: 0;
}
@media (max-width: 700px) {
  .tkm-doc-viewer-window { inset: 0; border-radius: 0; }
  .tkm-doc-viewer-content { padding: 8px; }
}

/* v2.6.25: medical document preview/lightbox */
.tkm-summary-doc-open{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;min-width:54px;padding:5px 9px;border:1px solid #cfe6d8;border-radius:5px;background:#f7fcf9;color:#238c52!important;text-decoration:none!important;font-weight:700;cursor:pointer}
.tkm-summary-doc-open:hover{background:#eaf7ef}
.tkm-medical-doc-viewer[hidden]{display:none!important}
.tkm-medical-doc-viewer{position:fixed!important;inset:0!important;z-index:2147483646!important;direction:rtl}
.tkm-doc-viewer-backdrop{position:absolute;inset:0;background:rgba(8,18,28,.78);backdrop-filter:blur(3px)}
.tkm-doc-viewer-window{position:absolute;inset:4vh 4vw;display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:#fff;border-radius:9px;box-shadow:0 18px 60px rgba(0,0,0,.38)}
.tkm-doc-viewer-head{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;background:#f5f8fa;border-bottom:1px solid #e2e7ea;color:#33434d}
.tkm-doc-viewer-actions{display:flex;align-items:center;gap:6px}.tkm-doc-viewer-actions button{width:34px;height:34px;border:0;border-radius:5px;background:#e8eef2;color:#31414b;cursor:pointer;font-size:20px;line-height:1}.tkm-doc-viewer-actions button:hover{background:#dce5ea}.tkm-doc-viewer-close{font-size:26px!important}
.tkm-doc-viewer-content{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;overflow:auto;padding:18px;background:#111820}
.tkm-doc-viewer-image{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;cursor:zoom-in}.tkm-doc-viewer-frame{display:block;width:100%;height:100%;min-height:60vh;border:0;background:#fff}.tkm-doc-viewer-window.is-fullscreen{inset:0!important;border-radius:0}
@media(max-width:700px){.tkm-doc-viewer-window{inset:0;border-radius:0}.tkm-doc-viewer-content{padding:8px}}

/* v2.6.26: upload progress feedback */
.tkm-upload-progress {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin-top: 5px;
  direction: ltr;
}
.tkm-upload-progress[hidden] { display: none !important; }
.tkm-upload-progress-bar {
  flex: 1 1 auto;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eee9;
}
.tkm-upload-progress-bar > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #2f9e5f;
  transition: width .15s ease;
}
.tkm-upload-progress-text {
  flex: 0 0 36px;
  text-align: center;
  font-size: 10px;
  color: #2f7c4e;
  direction: ltr;
}
.tkm-file.is-uploading .tkm-file-label { color: #777; }
