/* dotip.ir — minimal stylesheet, LTR + RTL aware. */
:root {
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --bg: #f5f7fa;
    --surface: #fff;
    --text: #1f2933;
    --muted: #627d98;
    --border: #e4e7eb;
    --header-bg: #102a43;
    --header-bg2: #1d3557;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif; line-height: 1.55; font-size: 15px; }
body.rtl {
    font-family: "Vazirmatn", Tahoma, "Iran Sans", "Vazir", "Segoe UI", sans-serif;
    line-height: 1.85;
    font-feature-settings: "ss02", "ss03";
}
body.rtl h1, body.rtl h2, body.rtl h3 { font-weight: 700; letter-spacing: -0.2px; }
body.rtl .brand-text { font-weight: 800; }
body.rtl .result { font-family: "SF Mono", Menlo, Consolas, monospace; }  /* keep code monospaced */
body.rtl input, body.rtl select, body.rtl button { font-family: inherit; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 980px; margin: 0 auto; padding: 0 18px; }

/* ===== Top bar (brand + lang) ===== */
.topbar {
    background: linear-gradient(135deg, var(--header-bg) 0%, var(--header-bg2) 100%);
    color: #fff; padding: 14px 0;
}
.topbar a, .topbar a:visited { color: #fff; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
    width: 40px; height: 40px; display: inline-block;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .35);
    vertical-align: middle;
}
.brand-text { font-weight: 800; font-size: 20px; letter-spacing: .3px; }
.brand-tag { font-size: 12px; color: #b7c6e0; margin-inline-start: 4px; }
.topbar-right { display: flex; gap: 12px; align-items: center; }
.lang-switch {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 6px 14px; border-radius: 6px; font-size: 13px;
}
.lang-switch:hover { background: rgba(255, 255, 255, 0.22); text-decoration: none; }

/* ===== Info bar (IP + location) — below the header ===== */
.infobar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 0; }
.infobar-inner { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.info-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #ebf5ff; border: 1px solid #bfdbfe; color: #1e3a8a;
    padding: 5px 12px; border-radius: 999px; font-size: 13px;
}
.info-chip-icon { font-size: 14px; }
.info-chip-label { color: var(--muted); }
.info-chip strong { color: var(--text); font-weight: 700; }
.info-chip .flag { font-size: 16px; line-height: 1; }

/* ===== Main content ===== */
main { padding: 22px 0 60px; min-height: calc(100vh - 180px); }
h1 { margin: 0 0 6px; font-size: 24px; color: #102a43; }
.subtitle { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

.hero { padding: 8px 0 14px; }
.hero h1 { font-size: 28px; }

/* ===== Tool menu grid ===== */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-top: 12px; }
.tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex; align-items: center; gap: 14px;
    transition: all .18s ease;
    color: var(--text);
    position: relative;
    overflow: hidden;
}
.tool-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, .12);
    text-decoration: none;
}
.tool-card::before {
    content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0;
    width: 4px; background: var(--brand); opacity: 0; transition: opacity .15s;
}
.tool-card:hover::before { opacity: 1; }
.tool-icon {
    width: 44px; height: 44px; flex: 0 0 44px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; font-size: 22px; line-height: 1;
    background: #ebf5ff;
}
.tool-body { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.tool-name { font-weight: 700; color: var(--brand); font-size: 15px; }
.tool-desc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.tool-arrow {
    color: #cbd2d9; font-size: 22px; line-height: 1;
    transition: transform .15s, color .15s;
}
body.rtl .tool-arrow { transform: scaleX(-1); }
.tool-card:hover .tool-arrow { color: var(--brand); transform: translateX(3px); }
body.rtl .tool-card:hover .tool-arrow { transform: scaleX(-1) translateX(3px); }

/* Category-tinted icon backgrounds */
.tool-card.tool-net      .tool-icon { background: #dbeafe; }
.tool-card.tool-dns      .tool-icon { background: #e0e7ff; }
.tool-card.tool-security .tool-icon { background: #fee2e2; }
.tool-card.tool-calc     .tool-icon { background: #fef3c7; }
.tool-card.tool-geo      .tool-icon { background: #d1fae5; }
.tool-card.tool-myip     .tool-icon { background: #fce7f3; }

/* ===== My IP hero box ===== */
.ip-hero {
    background: linear-gradient(135deg, #102a43 0%, #2563eb 100%);
    color: #fff;
    border-radius: 12px;
    padding: 26px 28px;
    margin: 6px 0 22px;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .18);
}
.ip-hero-label { font-size: 13px; opacity: .85; text-transform: uppercase; letter-spacing: .8px; }
.ip-hero-value {
    font-family: "SF Mono", Menlo, Consolas, monospace;
    font-size: 32px; font-weight: 700; letter-spacing: .5px;
    margin-top: 6px; direction: ltr; word-break: break-all;
}

/* ===== Forms ===== */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.form-row label span { margin-bottom: 4px; }
.form-row input, .form-row select { padding: 8px 10px; border: 1px solid #cbd2d9; border-radius: 6px; font: inherit; min-width: 200px; background: #fff; }
.form-row input:focus, .form-row select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }
button.btn {
    background: var(--brand); color: #fff; border: 0;
    padding: 9px 22px; border-radius: 6px; cursor: pointer;
    font: inherit; font-weight: 600;
}
button.btn:hover { background: var(--brand-dark); }

/* ===== Results / messages ===== */
.result {
    background: var(--header-bg); color: #f0f4f8;
    padding: 14px 16px; border-radius: 8px;
    overflow-x: auto;
    font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 13px;
    white-space: pre-wrap; word-break: break-word;
    direction: ltr; text-align: left;
}
.alert { background: #fff5f5; color: #9b1c1c; border: 1px solid #fbd5d5; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.info { background: #ebf5ff; color: #1e3a8a; border: 1px solid #bfdbfe; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }

/* Tables — fixed layout so long values wrap instead of breaking the page */
table.table {
    width: 100%; border-collapse: collapse; margin-top: 10px;
    background: var(--surface); border-radius: 8px; overflow: hidden;
    border: 1px solid var(--border);
    table-layout: fixed;
}
table.table th, table.table td {
    text-align: start; padding: 9px 12px;
    border-bottom: 1px solid var(--border); font-size: 14px;
    word-break: break-word; overflow-wrap: anywhere;
}
table.table th { background: #f0f4f8; 