/* Granny's Cooking Utilities — Frontend Styles v1.0.0 */

.gcu-wrap {
    color-scheme: light;
    background: #FFFAF5;
    border: 1px solid #E8E0D8;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 0 32px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Headers ── */
.gcu-header {
    background: #FDB439;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gcu-header h2 {
    color: #1F2933 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

.gcu-subhead {
    background: #fccf65;
    padding: 8px 20px;
}

.gcu-subhead span {
    color: #1F2933;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .02em;
}

/* ── Body ── */
.gcu-body {
    padding: 20px;
}

/* ── Labels ── */
.gcu-label {
    display: block;
    font-size: 17px;
    color: #52606D;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ── ALL INPUT FIELDS — forced white, dark text, no dark-mode override ── */
.gcu-wrap input[type="text"],
.gcu-wrap input[type="number"],
.gcu-wrap input[type="email"],
.gcu-wrap select,
.gcu-wrap textarea,
.gcu-input,
.gcu-serving-input,
.gcu-textarea {
    color-scheme: light !important;
    background-color: #ffffff !important;
    color: #1F2933 !important;
    border: 1px solid #E8E0D8 !important;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 17px;
    font-family: inherit;
    width: 100%;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.gcu-wrap input[type="text"]:focus,
.gcu-wrap input[type="number"]:focus,
.gcu-wrap input[type="email"]:focus,
.gcu-wrap select:focus,
.gcu-wrap textarea:focus,
.gcu-input:focus,
.gcu-serving-input:focus,
.gcu-textarea:focus {
    border-color: #FDB439 !important;
    box-shadow: 0 0 0 3px rgba(253,180,57,0.18) !important;
}

.gcu-wrap input::placeholder,
.gcu-wrap textarea::placeholder {
    color: #7B8794 !important;
    opacity: 1 !important;
}

/* Select arrow */
.gcu-wrap select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2352606D' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 36px !important;
}

/* ── Textarea default size ── */
.gcu-wrap .gcu-textarea {
    min-height: 240px;
    resize: vertical;
}

/* ── Layout helpers ── */
.gcu-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

/* ── Buttons ── */
.gcu-btn-gold {
    background: #FDB439;
    color: #1F2933 !important;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: background .15s;
    font-family: inherit;
    line-height: 1.4;
}

.gcu-btn-gold:hover:not(:disabled) {
    background: #E47B02;
}

.gcu-btn-gold:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.gcu-btn-outline {
    background: #ffffff;
    color: #1F2933;
    border: 1.5px solid #FDB439;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .15s;
    font-family: inherit;
    line-height: 1.4;
}

.gcu-btn-outline:hover {
    background: #FFF3D6;
}

/* ── Results box ── */
.gcu-results-box {
    background: #ffffff;
    border: 1px solid #E8E0D8;
    border-radius: 8px;
    margin-top: 14px;
    overflow: hidden;
}

.gcu-result-head {
    background: #FDB439;
    padding: 9px 14px;
    font-size: 15px;
    font-weight: 700;
    color: #1F2933;
}

.gcu-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    border-bottom: 1px solid #F3F4F7;
    font-size: 17px;
    color: #1F2933;
    background: #ffffff;
    gap: 12px;
}

.gcu-result-row:nth-child(even) {
    background: #FFFAF5;
}

.gcu-result-row:last-child {
    border-bottom: none;
}

.gcu-result-val {
    font-weight: 700;
    color: #8B5A2B;
    white-space: nowrap;
    font-size: 16px;
}

.gcu-result-ing {
    flex: 1;
}

.gcu-result-unscaled {
    color: #7B8794;
    font-size: 12px;
    font-style: italic;
    white-space: nowrap;
}

.gcu-result-group-label {
    padding: 6px 14px;
    font-size: 16px;
    font-weight: 700;
    color: #7B8794;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: #F3F4F7;
    border-bottom: 1px solid #E8E0D8;
}

.gcu-tag {
    display: inline-block;
    background: #FDB439;
    color: #1F2933;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    margin-left: 5px;
}

/* ── AI notice ── */
.gcu-ai-notice {
    background: #FFFAF5;
    border: 1.5px dashed #FDB439;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
    font-size: 16px;
    color: #52606D;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.gcu-ai-notice svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #E47B02;
}

/* ── Notices ── */
.gcu-notice {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 16px;
    margin: 10px 0;
}

.gcu-notice-warn {
    background: #FFF3D6;
    border: 1px solid #FDB439;
    color: #8B5A2B;
}

.gcu-notice-error {
    background: #FEF0F0;
    border: 1px solid #FECACA;
    color: #7F1D1D;
}

.gcu-notice-success {
    background: #ECFDF5;
    border: 1px solid #86EFAC;
    color: #14532D;
}

/* ── Loading spinner ── */
.gcu-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    font-size: 17px;
    color: #52606D;
}

.gcu-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #E8E0D8;
    border-top-color: #FDB439;
    border-radius: 50%;
    animation: gcu-spin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes gcu-spin { to { transform: rotate(360deg); } }

/* ── Recipe name display ── */
.gcu-recipe-name {
    font-size: 16px;
    font-weight: 700;
    color: #1F2933;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: #FFF3D6;
    border-left: 4px solid #FDB439;
    border-radius: 0 8px 8px 0;
}

/* ── Serving bar ── */
.gcu-serving-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    background: #ffffff;
    border: 1px solid #E8E0D8;
    border-radius: 8px;
    padding: 12px 14px;
}

.gcu-serving-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gcu-serving-input {
    width: 72px !important;
    text-align: center;
    font-weight: 700 !important;
    font-size: 16px !important;
}

.gcu-serving-arrow {
    color: #E47B02;
    font-size: 20px;
    font-weight: 700;
    padding-bottom: 10px;
}

.gcu-btn-scale {
    width: auto !important;
    padding: 9px 18px !important;
    font-size: 15px !important;
    margin-bottom: 0;
    align-self: flex-end;
}

/* ── Actions row ── */
.gcu-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

/* ── Email panel ── */
.gcu-email-panel {
    background: #FFFAF5;
    border: 1px solid #E8E0D8;
    border-radius: 8px;
    padding: 14px;
    margin-top: 12px;
}

.gcu-email-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.gcu-email-row .gcu-input {
    flex: 1;
}

.gcu-email-row .gcu-btn-gold {
    width: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Print section ── */
.gcu-print-section {
    font-family: Georgia, serif;
    margin-top: 14px;
    border: 1px solid #E8E0D8;
    border-radius: 8px;
    overflow: hidden;
}

.gcu-print-header {
    background: #FDB439;
    padding: 14px 18px;
}

.gcu-print-header h2 {
    color: #1F2933;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.gcu-print-meta {
    color: #3E4C59;
    font-size: 12px;
    margin: 4px 0 0;
    font-family: -apple-system, sans-serif;
}

.gcu-print-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gcu-print-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px dashed #E8E0D8;
    font-size: 16px;
    color: #1F2933;
    background: #ffffff;
}

.gcu-print-item:nth-child(even) {
    background: #FFFAF5;
}

.gcu-print-item:last-child {
    border-bottom: none;
}

.gcu-print-amt {
    font-weight: 700;
    color: #8B5A2B;
    min-width: 90px;
    flex-shrink: 0;
}

.gcu-print-ing {
    flex: 1;
}

.gcu-print-group {
    background: #FFF3D6;
    padding: 5px 18px;
    font-size: 11px;
    font-weight: 700;
    color: #8B5A2B;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0;
    font-family: -apple-system, sans-serif;
}

.gcu-print-unscaled .gcu-print-amt {
    color: #7B8794;
    font-weight: 400;
    font-style: italic;
}

.gcu-print-note {
    font-size: 11px;
    color: #7B8794;
    padding: 10px 18px;
    border-top: 1px solid #E8E0D8;
    font-family: -apple-system, sans-serif;
    background: #FFFAF5;
}

/* ── Chart tabs ── */
.gcu-chart-tabs {
    display: flex;
    border-bottom: 2px solid #FDB439;
    background: #ffffff;
    padding: 0 4px;
    flex-wrap: wrap;
}

.gcu-tab {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #7B8794;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color .15s;
    font-family: inherit;
}

.gcu-tab:hover {
    color: #1F2933;
}

.gcu-tab.active {
    color: #1F2933;
    border-bottom-color: #FDB439;
}

.gcu-tab-content {
    display: none;
}

.gcu-tab-content.active {
    display: block;
}

/* ── Conversion table ── */
.gcu-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

.gcu-table th {
    background: #FDB439;
    color: #1F2933;
    font-weight: 700;
    padding: 12px 16px;
    text-align: left;
}

.gcu-table td {
    padding: 11px 16px;
    border-bottom: 1px solid #F3F4F7;
    color: #1F2933;
    background: #ffffff;
}

.gcu-table tr:nth-child(even) td {
    background: #FFFAF5;
}

.gcu-table tr:last-child td {
    border-bottom: none;
}

/* ── Print iframe styles (injected into iframe document) ── */
/* These are written by JS into the iframe, not used on the page itself */
/* The @media print block below is kept as fallback only */
@media print {
    body > *:not(#gcu-print-frame-wrap) { display: none !important; }
}

/* ── Step-by-step progression tab ── */
.gcu-steps-intro {
    background: #FFF3D6;
    border-left: 4px solid #FDB439;
    padding: 12px 18px;
    font-size: 17px;
    color: #52606D;
    margin-bottom: 0;
    border-radius: 4px 4px 0 0;
}

.gcu-steps-intro strong {
    color: #1F2933;
}

.gcu-step-row td {
    padding: 11px 14px !important;
    font-size: 16px !important;
}

.gcu-step-row td:nth-child(2) {
    color: #E47B02;
    font-weight: 700;
}

.gcu-step-row td:nth-child(3) {
    color: #52606D;
    font-style: italic;
}

/* ── Shopping list split layout ── */
.gcu-split-wrap {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 14px;
    width: 100%;
}

/* Ensure result rows render correctly inside split panels */
.gcu-split-panel .gcu-result-head {
    background: #FDB439;
    padding: 9px 14px;
    font-size: 16px;
    font-weight: 700;
    color: #1F2933;
}

.gcu-split-panel .gcu-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    border-bottom: 1px solid #F3F4F7;
    font-size: 16px;
    color: #1F2933;
    background: #ffffff;
    gap: 10px;
}

.gcu-split-panel .gcu-result-row:nth-child(even) { background: #FFFAF5; }
.gcu-split-panel .gcu-result-row:last-child { border-bottom: none; }
.gcu-split-panel .gcu-result-val { font-weight: 700; color: #8B5A2B; white-space: nowrap; }
.gcu-split-panel .gcu-result-unscaled { color: #7B8794; font-size: 15px; font-style: italic; }

@media (max-width: 680px) {
    .gcu-split-wrap {
        grid-template-columns: 1fr;
    }
}

.gcu-split-panel {
    background: #ffffff;
    border: 1px solid #E8E0D8;
    border-radius: 8px;
    overflow: hidden;
}

.gcu-split-head {
    background: #FDB439;
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 700;
    color: #1F2933;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gcu-split-head.shopping {
    background: #E47B02;
}

.gcu-split-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    border-bottom: 1px solid #F3F4F7;
    font-size: 16px;
    color: #1F2933;
    gap: 10px;
}

.gcu-split-row:nth-child(even) { background: #FFFAF5; }
.gcu-split-row:last-child { border-bottom: none; }

.gcu-split-row .val {
    font-weight: 700;
    color: #8B5A2B;
    white-space: nowrap;
    text-align: right;
}

.gcu-split-row .val.shop {
    color: #E47B02;
}

.gcu-split-row.unscaled .val {
    color: #7B8794;
    font-style: italic;
    font-weight: 400;
}

.gcu-shop-note {
    font-size: 14px;
    color: #7B8794;
    font-style: italic;
}

/* ── Mode toggle ── */
.gcu-mode-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #FDB439;
    background: #ffffff;
    margin-bottom: 0;
}

.gcu-mode-tab {
    flex: 1;
    padding: 11px 14px;
    font-size: 16px;
    font-weight: 600;
    color: #7B8794;
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-family: inherit;
    text-align: center;
    transition: color .15s;
}

.gcu-mode-tab:hover { color: #1F2933; }
.gcu-mode-tab.active {
    color: #1F2933;
    border-bottom-color: #FDB439;
}

/* ── Unit conversion mode ── */
.gcu-convert-direction {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.gcu-dir-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid #E8E0D8;
    border-radius: 8px;
    background: #ffffff;
    color: #52606D;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: all .15s;
}

.gcu-dir-btn:hover { border-color: #FDB439; color: #1F2933; }
.gcu-dir-btn.active {
    border-color: #FDB439;
    background: #FFF3D6;
    color: #1F2933;
}

/* ── Shopping list actions ── */
.gcu-shop-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.gcu-converted-result {
    background: #ffffff;
    border: 1px solid #E8E0D8;
    border-radius: 8px;
    margin-top: 14px;
    overflow: hidden;
    white-space: pre-wrap;
    font-size: 16px;
    color: #1F2933;
    line-height: 1.7;
}

.gcu-converted-head {
    background: #FDB439;
    padding: 9px 14px;
    font-size: 16px;
    font-weight: 700;
    color: #1F2933;
}

.gcu-converted-body {
    padding: 16px 18px;
    font-size: 16px;
    line-height: 1.8;
}

/* ── Converter button — not full width ── */
#gcu-converter .gcu-btn-gold {
    width: auto;
    min-width: 120px;
    align-self: flex-start;
    margin-top: 4px;
}

/* ── Parse button — reasonable width ── */
#gcu-scaler .gcu-btn-gold#gcu-parse-btn,
#gcu-scaler .gcu-btn-gold#gcu-conv-recipe-btn {
    max-width: 280px;
}

/* ── Direction buttons — compact ── */
.gcu-dir-btn {
    padding: 9px 14px !important;
    font-size: 15px !important;
}

/* ── Converter button row ── */
.gcu-conv-btn-row {
    margin-top: 10px;
}

.gcu-conv-btn-row .gcu-btn-gold {
    width: auto !important;
    min-width: 130px;
    display: inline-flex;
}