:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-light: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --error: #dc2626;
    --success: #059669;
    --border: rgba(226, 232, 240, 0.8);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.02) 0%, transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.02) 0%, transparent 30%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    font-size: 14px; /* Reduced base font */
    line-height: 1.4;
}

.container {
    width: 100%;
    max-width: 650px; /* Slimmer container */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

header {
    text-align: center;
    margin-bottom: 0px;
}

header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 2px;
    letter-spacing: -0.025em;
    color: #1e1b4b;
}

header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.input-group {
    display: flex;
    gap: 8px;
}

.recent-searches {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
}

.contact-box {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fdba74;
}

.contact-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #9a3412;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.contact-line {
    color: #7c2d12;
    font-size: 0.9rem;
    font-weight: 700;
}

.contact-link {
    color: #c2410c;
    font-weight: 800;
    text-decoration: none;
}

.contact-link:hover {
    text-decoration: underline;
}

.recent-searches-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.recent-search-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recent-search-item {
    background: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 700;
}

.recent-search-item:hover {
    background: #e0e7ff;
}

.recent-clear-btn {
    background: transparent;
    color: #64748b;
    border: 1px solid #cbd5e1;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

input[type="text"] {
    flex: 1;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 16px;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

select {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

textarea {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    resize: vertical;
    min-height: 96px;
    font-family: inherit;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    color: #475569;
    border: 1.5px solid #e2e8f0;
}

.hidden {
    display: none !important;
}

#status-container {
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.notice-box {
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid transparent;
    text-align: center;
}

.notice-danger {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #b91c1c;
}

.diff-value {
    color: #4338ca;
    font-weight: 800;
    padding: 1px 6px;
    background: #e0e7ff;
    border-radius: 4px;
    font-size: 0.95rem;
}

.orig-value {
    color: #94a3b8;
    text-decoration: line-through;
    font-size: 0.8rem;
    margin-right: 6px;
}

.info-grid {
    margin: 12px 0;
}

.response-history {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.response-history-header {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

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

.response-history-item {
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
}

.response-history-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.response-history-time {
    font-size: 0.78rem;
    color: #64748b;
    font-family: monospace;
}

.response-history-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.response-history-badge.confirm {
    background: #dcfce7;
    color: #166534;
}

.response-history-badge.correct {
    background: #fef3c7;
    color: #92400e;
}

.response-history-summary {
    color: #334155;
    line-height: 1.6;
    font-size: 0.9rem;
}

.info-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}

.info-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f8fafc;
    background: #ffffff;
}

.info-table tr:hover td {
    background: #fafafa;
}

.info-table .info-label {
    width: 38%;
    font-weight: 700;
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #fdfdfd;
    border-right: 1px solid #f1f5f9;
}

.info-table .info-value {
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 500;
}

.edit-input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text-main);
    outline: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.date-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.date-select {
    width: 100%;
    min-width: 0;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.error-msg {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 4px;
    font-weight: 600;
    height: 1rem;
}

/* Toast */
.toast {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border-radius: 20px;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 3000;
    animation: toastScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastScaleIn {
    from { transform: translate(-50%, -10px) scale(0.9); opacity: 0; }
    to { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 10px;
}

.modal-content {
    width: 100%;
    max-width: 450px;
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from { 
        transform: translateY(20px) scale(0.95); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

@media (max-width: 600px) {
    body { padding: 8px; }
    .container { gap: 10px; }
    .glass-card { padding: 12px; }
    header h1 { font-size: 1.4rem; }
    .info-table .info-label { width: 42%; }
    .actions { flex-direction: column; gap: 8px; }
    .date-picker { grid-template-columns: 1fr; }
}
