:root {
    --bg: #1C1C1C;
    --bg2: #2D2D2D;
    --bg-card: rgba(45, 45, 45, .9);
    --border: rgba(255, 255, 255, .08);
    --text: #E5E5E5;
    --muted: #808080;
    --orange: #FF6C37;
    --orange2: #FF8F5E;
    --glow: rgba(255, 108, 55, .25);
    --green: #4CAF50;
    --red: #F44336;
    --blue: #2196F3;
    --r: 8px;
    --font: 'Inter', sans-serif;
    --mono: 'Fira Code', monospace
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5
}

.app {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px 40px
}

.header {
    padding: 12px 0 8px
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px
}

.logo-icon {
    font-size: 1.2rem;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--orange), var(--orange2));
    border-radius: var(--r);
    box-shadow: 0 4px 16px var(--glow)
}

.logo h1 {
    font-size: .95rem;
    font-weight: 700
}

.header-actions {
    display: flex;
    gap: 4px
}

.hbtn {
    padding: 5px 10px;
    border: 1px solid var(--border);
    background: var(--bg2);
    border-radius: 6px;
    color: var(--muted);
    font: 500 .7rem var(--font);
    cursor: pointer;
    transition: .2s
}

.hbtn:hover {
    color: var(--text);
    border-color: var(--orange)
}

.btn-send {
    padding: 10px 24px;
    border: none;
    background: var(--orange);
    color: #fff;
    border-radius: 0 var(--r) var(--r) 0;
    font: 700 .84rem var(--font);
    cursor: pointer;
    transition: .2s
}

.btn-send:hover {
    filter: brightness(1.1)
}

/* URL Bar */
.url-bar {
    display: flex;
    margin-bottom: 8px
}

.url-bar select {
    padding: 10px 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--r) 0 0 var(--r);
    color: var(--orange);
    font: 700 .82rem var(--font);
    min-width: 90px;
    cursor: pointer
}

.url-bar input {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-right: none;
    color: var(--text);
    font: .82rem var(--mono)
}

.url-bar input:focus {
    outline: none;
    border-color: var(--orange)
}

/* Tabs */
.tabs,
.resp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px
}

.tab,
.rtab {
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--muted);
    font: 600 .76rem var(--font);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: .2s
}

.tab.active,
.rtab.active {
    color: var(--orange);
    border-bottom-color: var(--orange)
}

.tab-panel {
    padding: 8px 0;
    margin-bottom: 8px
}

.field-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px
}

.field-row label {
    min-width: 50px;
    font-size: .72rem;
    font-weight: 600;
    color: var(--muted)
}

.field-row input,
.field-row select {
    flex: 1;
    padding: 7px 10px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font: .8rem var(--font)
}

.field-row input:focus {
    outline: none;
    border-color: var(--orange)
}

.kv-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px
}

.kv-row input {
    flex: 1;
    padding: 6px 8px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font: .76rem var(--mono)
}

.kv-row input:focus {
    outline: none;
    border-color: var(--orange)
}

.kv-row .del {
    border: none;
    background: none;
    color: var(--muted);
    cursor: pointer;
    font-size: .8rem;
    padding: 4px
}

.kv-row .del:hover {
    color: var(--red)
}

.btn-add {
    border: 1px dashed var(--border);
    background: none;
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 6px;
    font: 500 .72rem var(--font);
    cursor: pointer;
    width: 100%
}

.btn-add:hover {
    border-color: var(--orange);
    color: var(--orange)
}

.body-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 4px
}

.btab {
    padding: 4px 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 4px;
    color: var(--muted);
    font: 600 .66rem var(--font);
    cursor: pointer
}

.btab.active {
    color: var(--orange);
    border-color: var(--orange)
}

#bodyInput {
    width: 100%;
    padding: 10px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font: .78rem var(--mono);
    resize: vertical
}

/* Response */
.response-section {
    margin-top: 12px;
    animation: fadeIn .3s
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.response-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    flex-wrap: wrap
}

.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font: 700 .74rem var(--font);
    color: #fff
}

.status-2xx {
    background: var(--green)
}

.status-3xx {
    background: var(--blue)
}

.status-4xx {
    background: #FF9800
}

.status-5xx {
    background: var(--red)
}

.status-0xx {
    background: var(--muted)
}

.resp-time,
.resp-size {
    font-size: .72rem;
    color: var(--muted)
}

.response-body {
    padding: 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 6px;
    font: .74rem var(--mono);
    color: var(--green);
    max-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
    line-height: 1.4;
    margin: 0
}

/* History */
.history-section {
    margin-top: 16px
}

.history-section h3 {
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: 6px
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 3px
}

.hist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: .2s;
    font-size: .74rem
}

.hist-item:hover {
    border-color: var(--orange)
}

.hist-method {
    font-weight: 700;
    color: var(--orange);
    min-width: 50px
}

.hist-url {
    flex: 1;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.hist-status {
    font-weight: 700
}

.hist-del {
    border: none;
    background: none;
    color: var(--muted);
    cursor: pointer;
    font-size: .7rem
}

.hist-del:hover {
    color: var(--red)
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text);
    font-size: .82rem;
    opacity: 0;
    transition: .35s;
    z-index: 100;
    pointer-events: none
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0)
}

.hidden {
    display: none !important
}