:root{
      --bg: #0b1220;
      --panel: rgba(255,255,255,0.06);
      --panel2: rgba(255,255,255,0.08);
      --text: rgba(255,255,255,0.92);
      --muted: rgba(255,255,255,0.65);
      --border: rgba(255,255,255,0.12);
      --shadow: 0 10px 30px rgba(0,0,0,0.35);
      --radius: 18px;
      --radius2: 14px;
      --focus: rgba(120, 180, 255, 0.35);
      --btn: rgba(255,255,255,0.10);
      --btnHover: rgba(255,255,255,0.16);
      --danger: rgba(255,90,90,0.85);
    }

    *{ box-sizing: border-box; }
    html, body { height: 100%; }
    body{
      margin: 0;
      font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
      color: var(--text);
      background:
        radial-gradient(1200px 700px at 10% 10%, rgba(120,180,255,0.18), transparent 60%),
        radial-gradient(900px 700px at 90% 20%, rgba(255,140,220,0.14), transparent 55%),
        radial-gradient(900px 700px at 50% 90%, rgba(110,255,190,0.10), transparent 55%),
        var(--bg);
      line-height: 1.35;
    }

    .wrap{
  width: 75vw;
  height: 80vh;
  margin: 0;
  padding: 28px 18px 40px;

  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
    header{
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 18px;
    }
    header h1{
      font-size: 18px;
      letter-spacing: 0.2px;
      margin: 0;
      font-weight: 700;
    }
    header .hint{
      font-size: 13px;
      color: var(--muted);
      margin: 0;
    }

    .card{
      background: linear-gradient(180deg, var(--panel), transparent 140%);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .grid{
      display: grid;
      grid-template-columns: 1.6fr 1fr 1fr; /* CHANGED: added 3rd column */
      min-height: 520px;
    }

    /* Left: report input */
    .left{
      padding: 18px 18px 18px;
      border-right: 1px solid var(--border);
      background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 70%);
    }
    .label{
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
      gap: 12px;
    }
    .label .title{
      font-size: 13px;
      color: var(--muted);
      font-weight: 600;
      letter-spacing: 0.2px;
    }
    .label .meta{
      font-size: 12px;
      color: rgba(255,255,255,0.55);
    }
    textarea{
      width: 100%;
      height: 820px;
      resize: vertical;
      padding: 14px 14px;
      border-radius: var(--radius2);
      border: 1px solid var(--border);
      background: rgba(0,0,0,0.22);
      color: var(--text);
      outline: none;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
      font-size: 14px;
    }
    textarea::placeholder{ color: rgba(255,255,255,0.35); }
    textarea:focus{
      border-color: rgba(140,190,255,0.35);
      box-shadow: 0 0 0 4px var(--focus), inset 0 1px 0 rgba(255,255,255,0.05);
    }

    /* Right: selection + submit */
    .right{
      padding: 18px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .panel{
      border: 1px solid var(--border);
      border-radius: var(--radius2);
      height: 800px;
      background: rgba(255,255,255,0.04);
      padding: 14px;
    }
    .panel h2{
      margin: 0 0 8px 0;
      font-size: 14px;
      font-weight: 700;
      letter-spacing: 0.2px;
    }
    .panel p{
      margin: 0 0 12px 0;
      font-size: 12.5px;
      color: var(--muted);
    }

    select{
      width: 100%;
      min-height: 500px; /* multi-select list height */
      padding: 10px;
      border-radius: 12px;
      border: 1px solid var(--border);
      background: rgba(0,0,0,0.22);
      color: var(--text);
      outline: none;
      font-size: 14px;
    }
    select:focus{
      border-color: rgba(140,190,255,0.35);
      box-shadow: 0 0 0 4px var(--focus);
    }
    option{ padding: 8px; }

    .chips{
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 10px;
    }
    .chip{
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 7px 10px;
      border-radius: 999px;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.12);
      font-size: 12.5px;
      color: rgba(255,255,255,0.86);
    }
    .chip button{
      border: none;
      background: transparent;
      color: rgba(255,255,255,0.6);
      cursor: pointer;
      padding: 0;
      line-height: 1;
      font-size: 14px;
    }
    .chip button:hover{ color: rgba(255,255,255,0.9); }

    .actions{
      margin-top: auto;
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
    }
    .btn{
      width: 100%;
      padding: 12px 14px;
      border-radius: 14px;
      border: 1px solid var(--border);
      background: var(--btn);
      color: var(--text);
      font-weight: 700;
      letter-spacing: 0.2px;
      cursor: pointer;
      box-shadow: 0 8px 20px rgba(0,0,0,0.18);
    }
    .btn:hover{ background: var(--btnHover); }
    .btn:active{ transform: translateY(1px); }
    .btn:focus{
      outline: none;
      box-shadow: 0 0 0 4px var(--focus), 0 8px 20px rgba(0,0,0,0.18);
    }

    .note{
      font-size: 12px;
      color: var(--muted);
      margin-top: 8px;
    }
    .panel pre {
                max-height: 100%;
                overflow: auto;
    }
    #resultBox {
    max-height: 100%;
    overflow: auto;
    padding: 8px;
    border-radius: 10px;
    }

	/* Only the result panel becomes a flex column so pre can scroll inside */
#resultPanel {
  display: flex;
  flex-direction: column;
}

/* Let the result box take remaining space and scroll */
#resultBox {
  flex: 1 1 auto;
  min-height: 0;      /* critical for overflow in flex containers */
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

    /* Responsive */
    @media (max-width: 860px){
      .grid{ grid-template-columns: 1fr; }
      .left{ border-right: none; border-bottom: 1px solid var(--border); }
      textarea{ height: 520px; }
      select{ min-height: 140px; }
    }


.symptom-list{
  max-height:520px;
  overflow-y:auto;
}

.group{
  margin-bottom:10px;
}

.group-title{
  font-weight:700;
  font-size:13px;
  margin:8px 0;
  color:var(--muted);
}

.row{
  display:flex;
  align-items:center;
  gap:6px;
  margin:3px 0;
}

.info{
  cursor:pointer;
  opacity:0.7;
}

.tooltip{
  position:fixed;
  background:#333;
  color:white;
  padding:6px 8px;
  border-radius:4px;
  font-size:12px;
  max-width:260px;
  z-index:1000;
}
