/* ==========================================================================
   Iranian vehicle plate  —  v3
   --------------------------------------------------------------------------
   Moved out of ep02-modernization.css so that sheet could be retired. The
   component is unchanged: it is a scale replica of a physical object, so most
   of its values are measurements rather than design choices and are not
   tokenised.

   What deliberately does NOT come from the token layer:

     - The blue identity strip, the green/white/red flag and the plate's own
       white ground are the colours of the real plate. They do not respond to
       the portal theme, because a plate does not.
     - The size steps are proportions of the real plate, not steps on the
       type scale.

   What does: the plate's ground and ink invert under the dark theme so a
   white rectangle does not glare out of a black page, and the border and
   shadow follow the same reasoning as any other surface.

   Physical slot order is fixed and must never mirror:
       [ blue strip ] [ 2 digits ] [ letter ] [ 3 digits ] [ province ]
   which is why `direction: ltr` is enforced. A plate number is not prose.
   ========================================================================== */

:root {
    --ed-plate-bg: #ffffff;
    --ed-plate-ink: #0f172a;
    --ed-plate-edge: #0f172a;
}

[data-theme="dark"] {
    --ed-plate-bg: #0f172a;
    --ed-plate-ink: #f8fafc;
    --ed-plate-edge: #94a3b8;
}

.dispatch-physical-plate-display {
    /* !important on both: a plate must not pick up the text direction or the
       display mode of whatever cell it lands in. */
    display: inline-flex !important;
    direction: ltr !important;
    align-items: stretch;
    block-size: 32px;
    color: var(--ed-plate-ink);
    background: var(--ed-plate-bg);
    border: 1.5px solid var(--ed-plate-edge);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
    font-family: var(--ed-font-mono);
    font-weight: 700;
    line-height: 1;
    unicode-bidi: isolate;
    overflow: hidden;
    user-select: none;
    vertical-align: middle;
}

/* ---- Identity strip: I.R.IRAN over the flag ---- */
.dispatch-physical-plate-display .dispatch-plate-flag-strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-inline: 4px;
    color: #ffffff;
    background: #1e3a8a;
    border-inline-end: 1px solid rgba(0, 0, 0, .3);
    font-size: 7px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .02em;
}

.dispatch-physical-plate-display .dispatch-plate-flag-icon {
    position: relative;
    inline-size: 14px;
    block-size: 8px;
    margin-block-end: 2px;
    background: #22c55e;
    border-radius: 1px;
    overflow: hidden;
}

.dispatch-physical-plate-display .dispatch-plate-flag-icon-mid {
    position: absolute;
    inset-block-start: 2.66px;
    inset-inline: 0;
    block-size: 2.66px;
    background: #ffffff;
}

.dispatch-physical-plate-display .dispatch-plate-flag-icon::after {
    content: "";
    position: absolute;
    inset-block-end: 0;
    inset-inline: 0;
    block-size: 2.66px;
    background: #ef4444;
}

.dispatch-physical-plate-display .dispatch-plate-flag-text {
    color: #ffffff;
    font-size: 6px;
    font-weight: 800;
    text-align: center;
}

.dispatch-physical-plate-display .dispatch-plate-flag-text span {
    display: block;
    font-size: 5px;
}

/* ---- Number ---- */
.dispatch-physical-plate-display .dispatch-plate-middle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-inline: 8px;
    background: var(--ed-plate-bg);
}

.dispatch-physical-plate-display .dispatch-plate-digits-2-val,
.dispatch-physical-plate-display .dispatch-plate-digits-3-val {
    color: var(--ed-plate-ink);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .04em;
}

/* The letter is Persian, so it needs the Persian face rather than the mono
   face the digits use. */
.dispatch-physical-plate-display .dispatch-plate-letter-val {
    padding-inline: 2px;
    color: var(--ed-plate-ink);
    font-family: var(--ed-font-fa);
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
}

/* ---- Province box ---- */
.dispatch-physical-plate-display .dispatch-plate-prov-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-inline-size: 28px;
    padding-inline: 6px;
    background: var(--ed-plate-bg);
    border-inline-start: 1.5px solid var(--ed-plate-edge);
}

.dispatch-physical-plate-display .dispatch-plate-prov-val {
    color: var(--ed-plate-ink);
    font-size: .95rem;
    font-weight: 800;
}
