:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f6fb;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
.shell { max-width: 980px; margin: 0 auto; padding: 32px 18px 60px; }
.card { background: #fff; border: 1px solid #e4e8f0; border-radius: 18px; padding: 20px; box-shadow: 0 12px 36px rgba(25,42,70,.08); }
h1,h2,h3,p { margin-top: 0; }
.muted { color: #68738a; }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); gap: 14px; }
input, textarea, select, button { font: inherit; }
input, textarea, select { width: 100%; border: 1px solid #ccd3df; border-radius: 12px; padding: 11px 12px; background: #fff; }
textarea { min-height: 110px; resize: vertical; }
label { display: grid; gap: 7px; margin-bottom: 14px; font-weight: 600; }
button { border: 0; border-radius: 12px; padding: 11px 16px; cursor: pointer; background: #1d2f58; color: #fff; font-weight: 700; }
button.secondary { background: #eef2f8; color: #22314f; }
button.danger { background: #7e2d2d; }
button:disabled { opacity: .55; cursor: not-allowed; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.space { justify-content: space-between; }
.badge { display: inline-flex; border-radius: 999px; padding: 5px 9px; background: #edf1f7; font-size: 12px; font-weight: 700; }
.request { border: 1px solid #e2e6ef; border-radius: 14px; padding: 14px; background: #fff; }
.request + .request { margin-top: 10px; }
.chat { display: grid; gap: 9px; min-height: 260px; max-height: 50vh; overflow-y: auto; padding: 12px; border: 1px solid #e2e6ef; border-radius: 14px; background: #f8f9fc; }
.msg { max-width: 80%; border-radius: 14px; padding: 10px 12px; line-height: 1.4; white-space: pre-wrap; }
.msg.user { background: #fff; border: 1px solid #dde2ec; justify-self: start; }
.msg.professional { background: #dfe8fb; justify-self: end; }
.small { font-size: 12px; }
hr { border: 0; border-top: 1px solid #e6eaf1; margin: 18px 0; }
.notice { padding: 10px 12px; border-radius: 12px; background: #fff7df; border: 1px solid #f0dfab; }
a { color: #264b8f; }

/* Rahnama v0.2 */
.brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: #1d2f58; color: #fff; font-weight: 800; }
.brand strong, .brand span { display: block; line-height: 1.05; }
.brand span { color: #68738a; font-size: 12px; margin-top: 3px; }
.language-intro { max-width: 680px; margin: 10px 0 18px; }
.language-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 12px; }
.language-card { min-height: 112px; text-align: left; background: #fff; color: #172033; border: 1px solid #dfe4ed; box-shadow: 0 7px 18px rgba(25,42,70,.05); }
.language-card:hover { border-color: #9facbf; transform: translateY(-1px); }
.language-card strong, .language-card span { display: block; }
.language-card strong { font-size: 24px; margin-bottom: 8px; }
.language-card span { color: #68738a; font-weight: 500; }
.readonly-language { width: 100%; border: 1px solid #e0e5ed; border-radius: 12px; padding: 11px 12px; background: #f6f8fb; font-weight: 600; }
.compact { padding: 8px 11px; font-size: 13px; }
.form-error { margin: 0 0 12px; border: 1px solid #e5bcbc; background: #fff3f3; color: #732b2b; padding: 9px 11px; border-radius: 10px; }
.status-line { min-height: 24px; }
.message-form { flex-wrap: nowrap; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 20px; padding: 6px; border: 1px solid #e3e7ef; border-radius: 14px; background: #f8f9fc; }
.filter { background: transparent; color: #36435d; padding: 8px 12px; }
.filter.active { background: #1d2f58; color: #fff; }
.language-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 800; border: 1px solid #d8dfeb; background: #f6f8fb; }
.lang-fa { font-family: Tahoma, Arial, sans-serif; }
.request-context { margin: 10px 0; padding: 9px 11px; background: #f8f9fc; border-radius: 10px; }
.conversation-meta { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; margin: 16px 0 12px; }
.conversation-meta > div { border: 1px solid #e3e7ef; border-radius: 12px; padding: 10px 12px; }
.conversation-meta span, .conversation-meta strong { display: block; }
.conversation-meta strong { margin-top: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.rtl { font-family: Tahoma, Arial, sans-serif; }
.rtl .language-card { text-align: right; }
.rtl .row.space { flex-direction: row; }
.rtl label, .rtl input, .rtl textarea, .rtl select { text-align: right; }
.rtl .msg.user { justify-self: start; text-align: right; }
.rtl .msg.professional { justify-self: end; text-align: right; }
@media (max-width: 600px) { .shell { padding: 16px 10px 36px; } .card { padding: 16px; border-radius: 14px; } .message-form { flex-wrap: wrap; } .message-form button { width: 100%; } }
.source-badge{display:inline-flex;margin-inline-start:7px;padding:3px 7px;border-radius:999px;background:#eef3f2;color:#42544f;font-size:10px;font-weight:800;letter-spacing:.04em}.waiting-note{padding:12px 14px;border:1px solid #ead7a9;background:#fff8e9;border-radius:14px;line-height:1.5}
.new-request-box{margin-top:14px;border:1px solid #e2e6ef;border-radius:14px;padding:12px;background:#fbfcfe}.new-request-box summary{cursor:pointer;margin-bottom:10px}

/* Rahnama v0.5 */
.landing-shell{max-width:900px;padding-top:64px}.landing-card{padding:34px}.hero-brand{margin-bottom:12px}.landing-card h1{font-size:clamp(30px,5vw,48px);max-width:720px;margin:16px 0 12px}.landing-copy{font-size:17px;line-height:1.6;max-width:720px}.access-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:26px 0}.access-card{display:grid;gap:9px;text-decoration:none;border:1px solid #dfe4ed;border-radius:16px;padding:20px;background:#fff;color:#172033;box-shadow:0 8px 24px rgba(25,42,70,.05)}.access-card:hover{border-color:#9facbf;transform:translateY(-1px)}.access-card strong{font-size:22px}.access-card span{color:#68738a;line-height:1.45}.access-card b{color:#264b8f;font-size:14px}.landing-note{margin-bottom:0}.text-link{text-decoration:none;font-size:13px;font-weight:700}.wide-shell{max-width:1180px}.queue-head,.queue-row{display:grid;grid-template-columns:110px minmax(180px,1.3fr) minmax(160px,1fr) 150px 90px 90px;gap:12px;align-items:center}.queue-head{padding:0 12px 8px;color:#7a8498;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}.queue-list{border:1px solid #e1e6ef;border-radius:14px;overflow:hidden;background:#fff}.queue-row{padding:11px 12px;border-top:1px solid #e8ecf2}.queue-row:first-child{border-top:0}.queue-row:hover{background:#fafbfe}.queue-action{text-align:right}.empty-row{padding:22px;text-align:center}.history-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 0 8px}.pro-chat{max-height:56vh}.modal-backdrop{position:fixed;inset:0;background:rgba(12,20,34,.48);display:grid;place-items:center;padding:18px;z-index:50}.modal-backdrop[hidden]{display:none}.modal{width:min(760px,100%);max-height:88vh;overflow:auto;background:#fff;border-radius:18px;padding:22px;box-shadow:0 24px 80px rgba(0,0,0,.25)}.summary-stat-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:18px 0}.summary-stat-row span{border:1px solid #e4e8f0;border-radius:12px;padding:12px}.summary-stat-row strong,.summary-stat-row small{display:block}.summary-stat-row strong{font-size:20px}.summary-stat-row small{margin-top:3px;color:#68738a}.summary-chips{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:18px}.summary-chips span{padding:6px 9px;border-radius:999px;background:#edf1f7;font-size:12px;font-weight:700}.summary-list{display:grid;gap:8px;margin-bottom:18px}.summary-list>div{border-left:3px solid #dfe6f5;padding:7px 10px;background:#f8f9fc;border-radius:8px}.summary-list strong,.summary-list span{display:block}.summary-list span{font-size:12px;color:#68738a;margin-top:3px}.summary-quotes{display:grid;gap:8px;margin-bottom:18px}.summary-quotes p{margin:0;padding:10px 12px;border:1px solid #e6eaf1;border-radius:10px;line-height:1.45}.rtl .summary-list>div{border-left:0;border-right:3px solid #dfe6f5}
@media(max-width:820px){.queue-head{display:none}.queue-row{grid-template-columns:90px 1fr 90px}.queue-row>div:nth-child(3),.queue-row>div:nth-child(4){grid-column:2}.queue-row>div:nth-child(5){grid-column:3;grid-row:1}.queue-row>div:nth-child(6){grid-column:3;grid-row:2/4}.access-grid{grid-template-columns:1fr}.landing-card{padding:22px}.summary-stat-row{grid-template-columns:1fr}}
