body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%; /* Prevent font scaling in landscape */
}

h2 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #000;
}

a {
    text-decoration: none;
    -webkit-tap-highlight-color: transparent; /* Remove highlight on tap */
}

.notice {
    text-align: center;
    font-weight: 500;
    margin-bottom: 20px;
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.row > span {
    font-weight: 500;
    font-size: 15px; /* Slightly larger for readability */
}

.btn {
    background-color: #2d8cf0;
    color: white;
    padding: 10px 16px; /* Larger padding for touch */
    border-radius: 20px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: background-color 0.2s, transform 0.1s;
    touch-action: manipulation;
    user-select: none;
}

.btn:active {
    background-color: #1c7cd6;
    transform: scale(0.98);
}

.btn:hover {
    background-color: #1c7cd6;
}

.btn.small {
    padding: 8px 14px; /* Larger touch target */
    border-radius: 8px;
    font-size: 13px;
}

.warn {
    color: #d33;
    font-size: 14px;
    margin: 10px 0;
    line-height: 1.4;
}

.red { color: #d33; }
.blue { color: #2d8cf0; }
.green { color: #26a269; }
.gray { color: #888; font-size: 13px; }

.card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card .top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap; /* Allow wrapping on very small screens */
    gap: 4px;
}

.card .top .warn {
    margin: 0;
    font-size: 13px;
    font-weight: bold;
    color: #333;
}

.tag {
    background-color: #2d8cf0;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    white-space: nowrap;
}

.field-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

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

input[readonly] {
    flex: 1;
    padding: 10px 12px; /* Larger padding */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
    color: #333;
    font-family: monospace;
    font-size: 16px; /* Prevent iOS zoom */
    outline: none;
    width: 0; /* Allow flex shrink properly */
    min-width: 0;
}

.status {
    font-size: 12px;
    margin-top: 8px;
    word-break: break-all;
}

/* Admin styles */
textarea {
    width: 100%;
    min-height: 400px;
    font-family: monospace;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
}

.login-form {
    max-width: 300px;
    margin: 100px auto;
    text-align: center;
}

.login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.login-form button {
    width: 100%;
    padding: 12px;
}

@media (max-width: 350px) {
    .row {
        flex-direction: column;
        align-items: flex-start;
    }
    .row > .btn {
        width: 100%;
    }
}

/* Toast Notification */
.toast {
    visibility: hidden;
    min-width: 160px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-align: center;
    border-radius: 50px;
    padding: 10px 20px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    visibility: visible;
    opacity: 1;
}
