/* shared by messages.html (learner) and tutor-messages.html */
:root { --acc: #a663de; --acc-deep: #7c3aed; --acc-soft: #f6effd; --acc-line: #b98ced; }
.learner { --acc: #12b76a; --acc-deep: #0a8f52; --acc-soft: #ecfbf2; --acc-line: #7ad7a7; }
.inbox { display: grid; grid-template-columns: 284px 1fr 266px; height: calc(100vh - 200px); min-height: 640px; max-height: 860px; margin: 26px auto 60px; border-radius: 26px; overflow: hidden; background: #fff; box-shadow: var(--shadow); border: 1px solid #eceef0; }
.ib-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ib-list h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; padding: 30px 18px 0; }
.ib-search { margin: 16px 18px 0; height: 38px; border-radius: 999px; }
.ib-search input { font-size: 13px; }
.ib-filters { display: flex; gap: 8px; padding: 14px 18px 16px; flex-wrap: wrap; }
.ib-filters .chip { height: 30px; font-size: 13px; padding: 0 12px; }
.ib-filters .chip .n { color: var(--acc-deep); font-size: 11px; font-weight: 600; margin-left: 2px; }
.ib-filters .chip.on .n { color: #fff; }
.convs { overflow-y: auto; flex: 1; }
.conv { display: grid; grid-template-columns: 40px 1fr auto; gap: 4px 12px; width: 100%; padding: 16px 18px; border-bottom: 1px solid #f1f2f4; text-align: left; position: relative; transition: background-color .15s; }
.conv:hover { background: #fafafa; }
.conv.on { background: var(--acc-soft); }
.conv.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--acc); }
.conv .initials, .conv img { width: 40px; height: 40px; font-size: 13px; grid-row: span 3; }
.conv b { font-size: 14px; font-weight: 600; }
.conv time { font-size: 11px; color: var(--faint); justify-self: end; }
.conv p { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; grid-column: 2; }
.conv .unread { grid-column: 3; grid-row: 2; justify-self: end; width: 18px; height: 18px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 10px; display: grid; place-items: center; }
.conv .badge { grid-column: 2; justify-self: start; margin-top: 6px; }
.conv .av { position: relative; grid-row: span 3; align-self: start; height: 40px; }
.conv .av.on::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.ib-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fcfcfd; }
.chat-h { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.chat-h .initials, .chat-h img { width: 40px; height: 40px; font-size: 13px; }
.chat-h b { display: block; font-size: 15px; font-weight: 600; }
.chat-h small { font-size: 12px; color: var(--muted); }
.chat-h .tools { margin-left: auto; display: flex; gap: 10px; }
.chat-h .icon-btn { width: 36px; height: 36px; }
.chat-h .icon-btn .i { width: 17px; height: 17px; }
.chat-h .back { display: none; }
.thread { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.daypill { align-self: center; font-size: 12px; padding: 4px 12px; border-radius: 999px; background: #f1f2f4; color: var(--text); }
.msg { max-width: 78%; padding: 12px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; }
.msg time { display: block; font-size: 10.5px; margin-top: 6px; opacity: .65; }
.msg.in { background: #f1f2f4; align-self: flex-start; }
.msg.out { background: var(--acc); color: #fff; align-self: flex-end; }
.reqbox { align-self: center; width: min(400px, 100%); border: 2px solid var(--acc-line); border-radius: 14px; padding: 16px 18px; background: #fff; }
.reqbox .t { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.reqbox .t span { color: var(--red); font-size: 12.5px; font-weight: 600; }
.reqbox p { font-size: 13px; margin: 8px 0 14px; }
.reqbox .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.reqbox .btn { height: 34px; font-size: 13px; padding: 0 16px; }
.reqbox.done { border-color: var(--line); }
.filemsg { align-self: flex-end; display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: #fff; min-width: 240px; }
.filemsg .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--acc-soft); color: var(--acc-deep); display: grid; place-items: center; }
.filemsg .ic .i { width: 16px; height: 16px; }
.filemsg b { display: block; font-size: 13.5px; font-weight: 600; }
.filemsg small { font-size: 11.5px; color: var(--faint); }
.quick { display: flex; gap: 8px; padding: 0 22px 12px; flex-wrap: wrap; }
.quick button { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--acc-line); color: var(--acc-deep); font-size: 12.5px; font-weight: 500; background: #fff; transition: background-color .15s; }
.quick button:hover { background: var(--acc-soft); }
.composer { display: flex; align-items: center; gap: 10px; margin: 0 22px 20px; padding: 6px 6px 6px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.composer:focus-within { border-color: var(--acc); }
.composer input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 14px; height: 36px; background: none; }
.composer .ghost { color: var(--muted); display: grid; place-items: center; }
.composer .ghost .i { width: 18px; height: 18px; }
.composer .send { width: 36px; height: 36px; border-radius: 50%; background: var(--acc); color: #fff; display: grid; place-items: center; }
.composer .send .i { width: 16px; height: 16px; }
.ib-prof { border-left: 1px solid var(--line); padding: 26px 20px; display: flex; flex-direction: column; overflow-y: auto; }
.ib-prof .big { width: 72px; height: 72px; font-size: 22px; margin: 0 auto; }
.ib-prof h2 { text-align: center; font-size: 17px; font-weight: 600; margin-top: 12px; }
.ib-prof .city { text-align: center; font-size: 12.5px; color: var(--muted); }
.ib-prof .tagc { text-align: center; margin: 10px 0 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.ib-prof dl { display: grid; grid-template-columns: auto 1fr; gap: 12px 10px; font-size: 13px; margin: 0; }
.ib-prof dt { color: var(--muted); }
.ib-prof dd { margin: 0; text-align: right; font-weight: 600; }
.ib-prof .box { margin-top: 22px; border-radius: 14px; padding: 16px; background: var(--acc-soft); border: 1px solid #ecdffb; font-size: 13px; }
.learner .ib-prof .box { border-color: #cdeedc; }
.ib-prof .box small { color: var(--acc-deep); font-weight: 500; font-size: 12px; }
.ib-prof .box b { display: block; font-size: 14px; margin: 4px 0; }
.ib-prof .notes { margin-top: 16px; border: 1.5px dashed #d1d5db; border-radius: 14px; padding: 14px 16px; }
.ib-prof .notes b { font-size: 13.5px; }
.ib-prof .notes textarea { width: 100%; border: 0; outline: 0; resize: none; font-size: 12.5px; color: var(--text); margin-top: 6px; min-height: 52px; background: none; }
.ib-prof .safe { margin-top: auto; padding-top: 20px; display: flex; gap: 8px; font-size: 11.5px; color: var(--muted); }
.ib-prof .safe .i { width: 15px; height: 15px; }
@media (max-width: 1180px) { .inbox { grid-template-columns: 270px 1fr; } .ib-prof { display: none; } }
@media (max-width: 760px) {
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 120px); min-height: 520px; border-radius: 18px; margin: 14px auto 24px; }
  .inbox.chatting .ib-list, .inbox:not(.chatting) .ib-chat { display: none; }
  .chat-h .back { display: grid; }
  .msg { max-width: 88%; }
  .quick { padding: 0 14px 10px; } .composer { margin: 0 14px 14px; } .thread { padding: 16px 14px; }
}
