.calcini-time{
  --border:#e5e7eb; --primary:#2563eb; --heading:#0b1220; --text:#0f172a;
  --sel-bg:#f3f4f6; --sel-arrow:#0f172a; --sel-border:#e5e7eb; --sel-focus:#2563eb;
  background:#fff; color:var(--text);
  font-family:"Poppins", ui-sans-serif, system-ui, "Segoe UI", Roboto, Helvetica, Arial;
  padding:0;
}
.calcini-time h2{
  margin:0 0 .8rem;
  font-size:clamp(1.4rem,2.4vw,1.8rem);
  font-weight:700;
  color:var(--heading);
}
.calcini-time .section-heading{
  display:flex; align-items:center; gap:.6rem;
  margin:1.1rem 0 .55rem;
  font-size:clamp(1rem,2vw,1.1rem);
  font-weight:600;
  color:var(--heading);
}
.calcini-time .h-ico{
  width:28px;height:28px;border-radius:8px;display:grid;place-items:center;flex:0 0 28px;
  background:#eff6ff; border:1px solid #bfdbfe; color:var(--primary);
}
.calcini-time .converter{width:100%; max-width:820px; margin-inline:auto; position:relative; padding-inline:8px}
.calcini-time .rows{display:grid; gap:.75rem}

/* capsule container (desktop/tablet) */
.calcini-time .row{
  position:relative; display:flex; align-items:stretch; padding-left:44px;
  border:1px solid var(--border); border-radius:14px; background:#fff;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.calcini-time .rows > .row:first-of-type:focus-within{
  border-color:#d7e2fa; box-shadow:0 0 0 2px #d7e2fa;
}
.calcini-time .rows > .row:last-of-type:focus-within{
  border-color:#a5d6a7; box-shadow:0 0 0 2px #a5d6a7;
}

/* input (keep native spinners) */
.calcini-time .row input[type="number"]{
  border:none; outline:none; font-size:1.06rem; padding:14px;
  flex: 1 1 58%; width:auto; min-width:0;
  background:transparent; text-align:right;
  border-top-left-radius:14px; border-bottom-left-radius:14px;
}

/* side paste/copy button — desktop default */
.calcini-time .side-btn{
  position:absolute; left:8px; top:50%; transform:translateY(-50%);
  width:32px;height:32px;border-radius:50%;
  border:1px solid #cbd5e1; background:#fff; cursor:pointer;
  display:grid; place-items:center; font-size:14px; color:#334155;
  transition:border-color .15s ease,color .15s ease;
}
.calcini-time .side-btn:hover{ border-color:var(--primary); color:var(--primary); }

.calcini-time .swap-wrapper{position:relative; height:0}
.calcini-time .swap-button{
  position:absolute; top:-18px; right:16px; z-index:5;
  background:#fff; color:var(--primary);
  border:1px solid var(--primary); border-radius:50%;
  width:36px; height:36px; font-size:15px;
  cursor:pointer; display:grid; place-items:center;
}
.calcini-time .rotate-90{display:inline-block; transform:rotate(90deg)}

/* ===========================
   Cross-browser custom SELECT
   =========================== */
.calcini-time .row select{
  -webkit-appearance:none; -moz-appearance:none; appearance:none;
  border:none; outline:none;
  font-size:1rem; line-height:1.2;
  padding:14px 44px 14px 14px;      /* room for custom arrow */
  flex: 1 1 42%; width:auto; min-width:0;
  color:var(--text);
  background: var(--sel-bg);
  border-left:1px solid var(--sel-border);
  border-top-right-radius:14px; border-bottom-right-radius:14px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  background-image: url("data:image/svg+xml;utf8,\
    <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'>\
      <path fill='%230f172a' d='M5.43 7.57a1 1 0 011.41 0L10 10.73l3.16-3.16a1 1 0 111.41 1.41l-3.87 3.87a1.5 1.5 0 01-2.12 0L5.43 9a1 1 0 010-1.41z'/>\
    </svg>");
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:18px 18px;
}
.calcini-time .row select::-ms-expand{ display:none; }
.calcini-time .row select:focus{ box-shadow:0 0 0 2px color-mix(in srgb, var(--sel-focus) 30%, transparent); }
.calcini-time .row select option:disabled{ color:#9aa3b2; background:var(--sel-bg); }

@media (forced-colors: active){
  .calcini-time .row select{
    background:Canvas; color:CanvasText; border:1px solid ButtonText;
    background-image:none; padding-right:14px;
  }
}

/* safety net */
.calcini-time, .calcini-time * { box-sizing:border-box; min-width:0; }
.calcini-time .converter { max-width:100%; }
.calcini-time .row { overflow:hidden; }

/* =====================================================
   MOBILE ≤510px
   Button centered on input axis; selector full width,
   right-aligned. Desktop/tablet unaffected.
   ===================================================== */
@media (max-width: 550px){
  .calcini-time .converter { padding-inline:8px; }

  /* grid layout:
     [ 40px btn | input (48px tall) ]
     [      select spans both       ] */
  .calcini-time .row{
    padding:0;                           /* no inner padding that breaks width */
    display:grid;
    grid-template-columns: 40px 1fr;     /* button column + content column */
    grid-template-rows: 48px auto;       /* input row is exactly 48px */
    column-gap:10px;                     /* keeps button off borders/divider */
    row-gap:0;
    border-radius:14px;
  }

  /* button perfectly centered on the input row */
  .calcini-time .side-btn{
    position:static;                     /* grid controls it on mobile */
    width:30px; height:30px; font-size:13px;
    align-self:center; justify-self:center;
    margin:0; transform:none; z-index:1;
  }

  /* input: fixed height to guarantee axis alignment */
  .calcini-time .row input[type="number"]{
    grid-column:2; grid-row:1;
    width:100%; height:48px;
    padding:0 12px;                      /* symmetric; button is in its own col */
    font-size:1rem; text-align:right; line-height:1.2;
    border-top-left-radius:14px; border-top-right-radius:14px;
    border-bottom-left-radius:0; border-bottom-right-radius:0;
    background:#fff;
  }

  /* selector: full width, right-aligned text */
  .calcini-time .row select{
    grid-column:1 / -1; grid-row:2;
    width:100%;
    padding:12px 36px 12px 12px;
    font-size:.98rem;

    border-left:none;
    border-top:1px solid var(--sel-border);   /* divider between input & select */

    border-top-left-radius:0; border-top-right-radius:0;
    border-bottom-left-radius:14px; border-bottom-right-radius:14px;

    /* right-align on mobile only */
    text-align:right;
    text-align-last:right;
    direction:ltr;

    background-position:right 10px center;
    background-size:14px 14px;

    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }

  /* swap button centered between rows */
  .calcini-time .swap-button{
    position:relative; top:0; right:auto;
    margin:.45rem auto; width:34px; height:34px; font-size:14px;
  }
  .calcini-time .swap-wrapper{ height:auto; }
}