:root {
  --bg: #faf6f1; --card: #ffffff; --line: #e7dfd5; --text: #2a2420; --muted: #8a7f74;
  --accent: #7b3a0a; --accent-2: #5e2b06; --ink: #1c1714; --ok: #1f7a4d; --warn: #c2620a; --danger: #c0352b;
  --ok-bg: #e5f4ec; --warn-bg: #fdeed9; --danger-bg: #fbe5e2; --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: "VazirLocal", "Vazirmatn", Tahoma, sans-serif; font-size: 14px; line-height: 1.6; }
body { padding: 16px 16px 64px; }
.wrap { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; cursor: pointer; border: 0; }
input, select, textarea { font: inherit; color: inherit; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px; }
.top .brand { display: flex; align-items: center; gap: 10px; }
.top .logo { width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 20px; }
.top h1 { font-size: 16px; font-weight: 800; }
.top .sub { font-size: 11px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 0 rgba(0,0,0,.02); }
.card > h2 { font-size: 14px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.count { font-weight: 500; color: var(--muted); }

label.f { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.input { width: 100%; height: 40px; padding: 0 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123,58,10,.12); }
.input[dir="ltr"] { text-align: left; }
textarea.input { height: 64px; padding: 8px 12px; resize: vertical; }
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 620px) { .grid.two { grid-template-columns: 1fr 1fr; } .span2 { grid-column: span 2; } }
.row { display: flex; gap: 8px; align-items: center; }
.row > .input { flex: 1; min-width: 0; }
.suffix { display: flex; align-items: center; direction: ltr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.suffix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123,58,10,.12); }
.suffix input { border: 0; box-shadow: none; flex: 1; min-width: 0; height: 40px; padding: 0 10px; outline: none; background: transparent; direction: ltr; text-align: left; }
.suffix select, .suffix .dom { border: 0; background: #f4eee7; height: 40px; padding: 0 10px; color: var(--muted); font-size: 12.5px; direction: ltr; }
.hint { font-size: 11px; color: var(--muted); }
.hint.bad { color: var(--danger); } .hint.good { color: var(--ok); }

.btn { height: 36px; padding: 0 14px; border-radius: 9px; font-weight: 700; font-size: 12.5px; background: #f1ebe3; color: var(--text); transition: transform .1s, background .15s; white-space: nowrap; }
.btn:hover { background: #e9e0d4; } .btn:active { transform: scale(.97); }
.btn.dark { background: var(--ink); color: #fff; } .btn.dark:hover { background: #000; }
.btn.primary { height: 46px; width: 100%; background: var(--accent); color: #fff; font-size: 14px; border-radius: 12px; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { background: var(--danger-bg); color: var(--danger); } .btn.danger:hover { background: #f6d3cf; }
.btn.ok { background: var(--ok-bg); color: var(--ok); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; padding: 0; font-size: 16px; flex: none; }

.seg { display: inline-flex; background: #f1ebe3; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { height: 30px; padding: 0 14px; border-radius: 8px; background: transparent; font-weight: 700; font-size: 12.5px; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.color-row code { direction: ltr; font-size: 12px; color: var(--muted); }
.file { font-size: 12px; max-width: 100%; }

.cafe { display: flex; flex-direction: column; gap: 12px; }
.cafe + .cafe { margin-top: 12px; }
.cafe-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cafe-head .av { width: 36px; height: 36px; border-radius: 10px; background: #eee center/cover no-repeat; flex: none; border: 1px solid var(--line); display: grid; place-items: center; color: #fff; font-weight: 800; }
.cafe-head .nm { font-weight: 800; font-size: 14.5px; flex: 1; min-width: 120px; }
.cafe-head .nm small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.mute { background: #eee8df; color: var(--muted); }
.links { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; direction: ltr; text-align: left; }
.links a { color: var(--accent); text-decoration: none; word-break: break-all; }
.links a:hover { text-decoration: underline; }
.links .fb { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions .days { width: 64px; height: 36px; text-align: center; padding: 0 6px; }
.edit { border-top: 1px dashed var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.edit[hidden] { display: none; }
.sw { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.notice { background: var(--ok-bg); border: 1px solid #bfe3cf; color: #15553a; border-radius: 10px; padding: 12px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.notice .cred { white-space: pre-wrap; direction: ltr; text-align: left; font-family: ui-monospace, Menlo, Consolas, monospace; background: #fff; border-radius: 8px; padding: 8px 10px; user-select: all; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }
.search { margin-bottom: 12px; }

.toast { position: fixed; inset-inline: 16px; bottom: 20px; max-width: 420px; margin: 0 auto; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; text-align: center; z-index: 50; box-shadow: 0 8px 28px rgba(0,0,0,.25); }
.toast.err { background: var(--danger); }
.toast[hidden] { display: none; }

.login { min-height: 80vh; display: grid; place-items: center; }
.login .card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.login h1 { font-size: 17px; text-align: center; }
.login .logo { width: 48px; height: 48px; border-radius: 14px; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 22px; margin: 0 auto; }
.err-box { background: var(--danger-bg); color: var(--danger); padding: 8px 12px; border-radius: 10px; font-size: 12.5px; }

.plan-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 0;border-top:1px solid rgba(0,0,0,.08)}
.plan-row.off{opacity:.55}
.plan-row .input{flex:1 1 130px;min-width:110px}
.plan-row .input.sm{flex:0 0 70px;min-width:70px}
.plan-row .input.md{flex:0 0 110px;min-width:100px}
.plan-row.new{border-top:2px dashed rgba(0,0,0,.15);margin-top:6px}
.plan-sel{height:36px;border-radius:10px;border:1px solid rgba(0,0,0,.15);padding:0 8px;font:inherit;background:#fff;max-width:220px}

/* نسخه ۳.۲: کلید اتصال برنامه ویندوز */
.dkey{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:10px 0 4px;padding:8px 10px;border-radius:10px;background:rgba(127,127,127,.08)}
.dkey-l{font-size:13px;opacity:.75}
.dkey-v{font-size:15px;font-weight:700;letter-spacing:1.5px;padding:2px 8px;border-radius:6px;background:rgba(127,127,127,.12)}
