* {
    box-sizing: border-box;
    font-family: "Hubballi";

    --background-color: #2b2d2f;   
    --foreground-color: #f0eae1;   
    --accent-green: #606c38;       
    --accent-bright-green: #7d8d4c;
    --accent-gold: #dda15e;        
    --accent-clay: #bc6c25;        
    --card-bg: #383b3e;            
    --border-dark: #191a1b;        
}

/* ==========================================================================
   Mobile-First Base Styles (scaled via dp)
   ========================================================================== */

body {
    display: block;
    width: 100vw;
    height: 100vh;
    font-size: 12dp;
    background-color: var(--background-color);
    color: var(--foreground-color);
    margin: 0dp;
    padding: 12dp;
}

/* Generic Structural Layout Defaults */
div, section, article, header, footer, main, nav, aside {
    display: block;
}

span, em, strong, a {
    display: inline;
}

/* Typographic Defaults */
p {
    display: block;
    margin: 0dp;
}

h1, h2, h3, h4, h5, h6 {
    display: block;
    font-weight: bold;
    margin: 0dp;
}

h1 { font-size: 1.6em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.17em; }

em { font-style: italic; }
strong { font-weight: bold; }

/* Form Inputs & Interactive UI Components */
button, input, select, textarea {
    display: inline-block;
    font-family: "Hubballi";
    font-size: 14dp;
    margin: 0dp;
    vertical-align: middle;
}

button {
    padding: 6dp 16dp;
    background-color: var(--accent-green);
    color: var(--foreground-color);
    border: 3dp var(--border-dark);
    border-radius: 6dp;
    text-align: center;
    font-weight: bold;
}

button:hover {
    background-color: var(--accent-bright-green);
}

button:active {
    background-color: var(--accent-gold);
    color: var(--border-dark);
}

input[type="text"], textarea {
    padding: 8dp 12dp;
    background-color: #212325;
    color: var(--foreground-color);
    border: 3dp var(--border-dark);
    border-radius: 6dp;
    width: 100%;
}

input[type="text"]:focus, textarea:focus {
    background-color: #2b2d2f;
    border-color: var(--accent-bright-green);
}

textarea {
    display: block;
    height: 120dp;
}

/* App Header */
#header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10dp 14dp;
    background-color: var(--accent-green);
    border: 3dp var(--border-dark);
    border-radius: 8dp;
    margin-bottom: 14dp;
}

.header-title-group {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 12dp;
}

#header h1 {
    font-size: 1.6em;
    color: var(--foreground-color);
    letter-spacing: 1dp;
}

.header-tag {
    font-size: 10dp;
    font-weight: bold;
    background-color: var(--border-dark);
    color: var(--accent-gold);
    padding: 2dp 10dp;
    border-radius: 12dp;
}

#new-critter-btn {
    height: 40dp;
    width: 40dp;
    border-radius: 8dp;
    font-size: 20dp;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3dp var(--border-dark);
    background-color: var(--accent-gold);
    color: var(--border-dark);
    padding: 0dp;
}

#new-critter-btn:hover {
    background-color: var(--accent-bright-green);
    color: var(--foreground-color);
}

/* Drawer List Styles */
.critter-list {
    display: flex;
    flex-direction: column;
    gap: 8dp;
}

.critter-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8dp 10dp;
    background-color: var(--card-bg);
    color: var(--foreground-color);
    border: 3dp var(--border-dark);
    border-left: 10dp var(--accent-green);
    border-radius: 6dp;
    text-align: left;
}

.critter-card:hover {
    background-color: #45484c;
    border-left-color: var(--accent-bright-green);
}

.critter-card-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10dp;
    flex: 1;
}

.thumb-frame {
    background-color: var(--accent-green);
    border: 2dp var(--border-dark);
    border-radius: 4dp;
    padding: 2dp;
}

.critter-thumb {
    width: 40dp;
    height: 40dp;
}

.critter-info {
    display: flex;
    flex-direction: column;
    gap: 2dp;
    flex: 1;
}

.critter-card-header {
    display: flex;
    align-items: baseline;
    gap: 10dp;
}

.critter-name {
    font-size: 14dp;
    margin: 0dp;
    color: var(--foreground-color);
}

.critter-id {
    font-size: 9dp;
    font-weight: bold;
    color: var(--accent-gold);
}

.info-pills {
    display: flex;
    flex-direction: row;
    gap: 8dp;
}

.pill {
    font-size: 10dp;
    background-color: #212325;
    color: var(--foreground-color);
    border: 1dp var(--accent-green);
    padding: 1dp 6dp;
    border-radius: 4dp;
}

.btn-delete {
    padding: 3dp 8dp;
    font-size: 9dp;
    font-weight: bold;
    background-color: var(--accent-clay);
    color: #ffffff;
    border: 2dp var(--border-dark);
    border-radius: 4dp;
}

.btn-delete:hover {
    background-color: #a3561a;
}

/* Modals Layout */
.modal-overlay {
    position: absolute;
    top: 0dp;
    left: 0dp;
    width: 100%;
    height: 100%;
    background-color: #1f1f1fdd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-bg);
    color: var(--foreground-color);
    border: 4dp var(--border-dark);
    border-radius: 10dp;
    width: 94vw;
    padding: 0dp;
    display: flex;
    flex-direction: column;
}

.modal-content-small {
    width: 88vw;
}

.modal-header {
    background-color: var(--accent-green);
    color: #ffffff;
    padding: 10dp 16px;
    border-bottom: 3dp var(--border-dark);
}

.modal-header h2 {
    font-size: 16dp;
    color: #ffffff;
}

.modal-body {
    padding: 14dp 16px;
    display: flex;
    flex-direction: column;
    gap: 10dp;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4dp;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 10dp;
}

.form-group.half {
    width: 100%;
}

.modal-content label {
    font-size: 12dp;
    font-weight: bold;
    color: var(--foreground-color);
}

.error {
    color: #ffffff;
    font-weight: bold;
    padding: 8dp;
    border: 2dp var(--border-dark);
    background-color: var(--accent-clay);
    border-radius: 4dp;
}

.dialog-text {
    font-size: 14dp;
    color: var(--foreground-color);
    padding: 10dp 0dp;
}

.modal-buttons {
    padding: 12dp 16px;
    background-color: #2b2d2f;
    border-top: 3dp var(--border-dark);
    display: flex;
    flex-direction: row;
    gap: 12dp;
    justify-content: flex-end;
}

.modal-buttons button {
    min-width: 90dp;
    height: 38dp;
    font-size: 13dp;
}

.btn-cancel {
    background-color: #45484c;
    color: var(--foreground-color);
}

.btn-cancel:hover {
    background-color: #565a5f;
}

.btn-submit {
    background-color: var(--accent-green);
    color: #ffffff;
}

.btn-submit:hover {
    background-color: var(--accent-bright-green);
}

/* Extra Narrow Viewports (< 380dp) */
@media (max-width: 380dp) {
    #header h1 {
        font-size: 1.3em;
    }

    .critter-name {
        font-size: 12dp;
    }

    .info-pills {
        flex-direction: column;
        gap: 4dp;
    }
}

/* ==========================================================================
   Desktop / Larger Screens Media Query (Min-Width >= 600dp)
   ========================================================================== */
@media (min-width: 600dp) {
    body {
        padding: 24dp;
        font-size: 15dp;
    }

    textarea {
        height: 150dp;
    }

    #header {
        padding: 12dp 20px;
        margin-bottom: 24dp;
    }

    .header-title-group {
        gap: 16dp;
    }

    #header h1 {
        font-size: 2.5em;
    }

    .header-tag {
        font-size: 12dp;
    }

    #new-critter-btn {
        height: 48dp;
        width: 48dp;
        font-size: 28dp;
    }

    .critter-list {
        gap: 10dp;
    }

    .critter-card {
        padding: 8dp 14dp;
    }

    .critter-card-body {
        gap: 14dp;
    }

    .critter-thumb {
        width: 50dp;
        height: 50dp;
    }

    .critter-card-header {
        gap: 12dp;
    }

    .critter-name {
        font-size: 18dp;
    }

    .critter-id {
        font-size: 11dp;
    }

    .pill {
        font-size: 12dp;
        padding: 1dp 8dp;
    }

    .btn-delete {
        padding: 4dp 10dp;
        font-size: 11dp;
    }

    .modal-content {
        width: 600dp;
    }

    .modal-content-small {
        width: 450dp;
    }

    .modal-header {
        padding: 12dp 20px;
    }

    .modal-header h2 {
        font-size: 20dp;
    }

    .modal-body {
        padding: 18dp 20px;
        gap: 12px;
    }

    .form-row {
        flex-direction: row;
        gap: 12dp;
    }

    .form-group.half {
        width: 50%;
    }

    .modal-content label {
        font-size: 14dp;
    }

    .dialog-text {
        font-size: 18dp;
    }

    .modal-buttons {
        padding: 14px 20px;
    }

    .modal-buttons button {
        min-width: 120dp;
        height: 42dp;
        font-size: 16dp;
    }
}