/* =========================================================
   ToolZen Hub
   Image Compressor & Resizer

   Only what the shared tool styles do not already provide: the
   file chooser, the small previews, the settings groups and the
   result. Buttons, focus and headings come from the shared layer.
   Loaded after calculator-responsive.css.

   A smaller result and a larger one are told in WORDS ("Reduced
   by", "Larger by"); only a smaller one is styled as good news.
   Nothing animates. One column on a phone; from 900px the
   previews sit beside the settings.
========================================================= */

.calculator-page [hidden] {

    display: none !important;

}

.ic-sr {

    position: absolute;

    width: 1px;
    height: 1px;

    margin: -1px;
    padding: 0;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;

}

.ic-workspace {

    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;

}

.ic-card {

    min-width: 0;
    padding: 16px;

    border: 1px solid var(--color-slate-200);
    border-radius: 14px;

    background: #ffffff;

}

.ic-card__title {

    margin: 0 0 12px;
    padding: 0;

    color: var(--color-ink);

    font-size: 19px;
    font-weight: 700;

}

/* the file chooser, with the drop zone around it */

.ic-drop {

    padding: 18px 16px;

    border: 2px dashed #d0d5dd;
    border-radius: 12px;

    background: #f9fafb;

}

.ic-drop--over {

    border-color: #067647;

    background: #ecfdf3;

}

.ic-drop__label {

    display: block;

    margin-bottom: 10px;

    color: var(--color-ink);

    font-size: 16px;
    font-weight: 700;

}

.ic-file {

    display: block;

    width: 100%;
    min-height: 48px;
    padding: 10px;

    border: 1px solid #d0d5dd;
    border-radius: 10px;

    background: #ffffff;

    color: var(--color-ink);

    font: inherit;
    font-size: 16px;

}

.ic-file:focus-visible {

    outline: 3px solid var(--color-action-green);
    outline-offset: 2px;

}

.ic-hint {

    margin: 8px 0 0;

    color: #475467;

    font-size: 14px;
    line-height: 1.55;

}

.ic-error {

    margin: 12px 0 0;
    padding: 12px 16px;

    border-left: 6px solid #b42318;
    border-radius: 10px;

    background: #fef3f2;

    color: #912018;

    font-size: 15px;
    font-weight: 600;
    line-height: 1.55;

}

.ic-status {

    margin: 0;
    padding: 12px 16px;

    border-left: 6px solid #b54708;
    border-radius: 10px;

    background: #fffaeb;

    color: #7a2e0e;

    font-size: 16px;
    font-weight: 700;

}

/* previews are small by design */

.ic-figure {

    margin: 0 0 12px;

    text-align: center;

}

.ic-preview {

    display: inline-block;

    max-width: 100%;
    height: auto;

    border: 1px solid var(--color-slate-200);
    border-radius: 10px;

    background:
        conic-gradient(#eaecf0 25%, #ffffff 0 50%, #eaecf0 0 75%, #ffffff 0)
        0 0 / 16px 16px;

}

.ic-metrics {

    display: grid;
    gap: 0;

    margin: 0;

}

.ic-metric {

    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px 16px;

    padding: 8px 0;

    border-top: 1px solid var(--color-slate-200);

    font-size: 15px;
    line-height: 1.45;

}

.ic-metric dt {

    flex: none;

    color: #475467;

}

.ic-metric dd {

    min-width: 0;
    margin: 0;

    color: var(--color-ink);

    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;

}

/* settings */

.ic-fields {

    min-width: 0;
    margin: 0;
    padding: 0;

    border: 0;

}

.ic-group {

    min-width: 0;
    margin: 0 0 16px;
    padding: 12px 14px 14px;

    border: 1px solid var(--color-slate-200);
    border-radius: 12px;

}

.ic-group > legend {

    padding: 0 6px;

    color: var(--color-ink);

    font-size: 15px;
    font-weight: 700;

}

.ic-chips,
.ic-presets,
.ic-modes {

    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin: 0 0 12px;

}

.ic-chip {

    min-height: 44px;
    padding: 6px 14px;

    border: 1px solid #d0d5dd;
    border-radius: 999px;

    background: #ffffff;

    color: var(--color-ink);

    font: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

}

.ic-chip[aria-pressed="true"] {

    border-color: #067647;
    border-width: 2px;

    background: #ecfdf3;

}

.ic-chip:disabled {

    color: #475467;
    opacity: 0.55;

    cursor: not-allowed;

}

.ic-chip:focus-visible {

    outline: 3px solid var(--color-action-green);
    outline-offset: 2px;

}

.ic-size {

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;

}

.ic-field {

    min-width: 0;

}

.ic-field label {

    display: block;

    margin-bottom: 6px;

    color: var(--color-ink);

    font-size: 15px;
    font-weight: 700;

}

.ic-input {

    display: block;

    width: 100%;
    min-height: 48px;
    padding: 8px 12px;

    border: 1px solid #d0d5dd;
    border-radius: 10px;

    background: #ffffff;

    color: var(--color-ink);

    font: inherit;
    font-size: 16px;
    font-variant-numeric: tabular-nums;

}

.ic-input:focus-visible,
.ic-range:focus-visible {

    outline: 3px solid var(--color-action-green);
    outline-offset: 2px;

}

.ic-input[aria-invalid="true"] {

    border-color: #b42318;
    border-width: 2px;

}

.ic-field-error {

    min-height: 0;
    margin: 4px 0 0;

    color: #912018;

    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;

}

.ic-field-error:empty {

    display: none;

}

.ic-check,
.ic-radio {

    display: inline-flex;
    align-items: center;
    gap: 10px;

    min-height: 44px;

    color: var(--color-ink);

    font-size: 15px;

    cursor: pointer;

}

.ic-check {

    margin-top: 8px;

}

.ic-check input,
.ic-radio input {

    flex: none;

    width: 20px;
    height: 20px;

    accent-color: var(--color-action-green);

}

.ic-check input:focus-visible,
.ic-radio input:focus-visible {

    outline: 3px solid var(--color-action-green);
    outline-offset: 2px;

}

.ic-notes {

    margin: 8px 0 0;

    color: #475467;

    font-size: 14px;
    line-height: 1.55;

}

.ic-notes:empty {

    display: none;

}

.ic-advanced {

    margin: 4px 0 0;

}

.ic-advanced > summary {

    min-height: 44px;
    padding: 10px 0;

    color: var(--color-ink);

    font-weight: 700;

    cursor: pointer;

}

.ic-advanced > summary:focus-visible {

    outline: 3px solid var(--color-action-green);
    outline-offset: 2px;

}

.ic-range {

    display: block;

    width: 100%;
    min-height: 44px;

    accent-color: var(--color-action-green);

}

.ic-field output {

    margin-left: 6px;

    font-variant-numeric: tabular-nums;

}

.ic-actions {

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;

}

.ic-button {

    min-width: 0;
    min-height: 48px;

    font-size: 16px;

}

#ic-process {

    grid-column: 1 / -1;

}

/* the result */

.ic-change {

    margin: 0 0 4px;
    padding: 10px 14px;

    border: 1px solid var(--color-slate-200);
    border-left-width: 6px;
    border-radius: 10px;

    background: #f9fafb;

    color: #344054;

    font-size: 17px;
    font-weight: 700;

}

.ic-change[data-kind="smaller"] {

    border-color: #067647;

    background: #ecfdf3;

    color: #05603a;

}

.ic-change[data-kind="larger"] {

    border-color: #b54708;

    background: #fffaeb;

    color: #7a2e0e;

}

.ic-download {

    display: block;

    margin-top: 16px;

    /* the shared button is a fixed 46px tall with no side room: a long file name wraps onto several
       lines and must grow the button, not spill out of it over what follows */
    height: auto;
    min-height: 48px;
    padding: 12px 16px;

    font-size: 16px;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;

    overflow-wrap: anywhere;

}

/* a link styled as a button: keep its text readable in every state */

.ic-download,
.ic-download:visited,
.ic-download:hover,
.ic-download:focus {

    color: #ffffff;

}

@media (min-width: 640px) {

    .ic-actions {

        grid-template-columns: 2fr 1fr;

    }

    #ic-process {

        grid-column: auto;

    }

}

@media (min-width: 900px) {

    .ic-workspace {

        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;

    }

    /* the chooser, the status and any error run across; the original sits beside the settings */

    .ic-workspace > .ic-card:first-child,
    .ic-workspace > .ic-status,
    .ic-workspace > #ic-result {

        grid-column: 1 / -1;

    }

}

.ic-cancel {

    min-height: 48px;

    font-size: 16px;

}

@media (min-width: 900px) {

    .ic-workspace > .ic-cancel {

        grid-column: 1 / -1;
        justify-self: start;

        min-width: 180px;

    }

}
