/* Machined: separate metal, glass, paddle and light pipe surfaces.
   The same contours are used for each nested bevel so the seams stay even. */
:root[data-skin=machined] {
  --k-bg: #242c35;
  --k-acc: #84eff6;
  --k-hi: #c1fbff;
  --k-rx: #a5dcff;
  --k-glow: #84eff665;
  --k-soft: #84eff622;
  --k-text: #eef1f4;
  --k-dim: #b7bfca;
  --k-digits: #f7f8fa;
  --k-line: #56616a;
  --mc-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%237b8189' filter='url(%23n)' opacity='.17' d='M0 0h96v96H0z'/%3E%3C/svg%3E");
  --mc-case: var(--mc-grain), radial-gradient(ellipse at 10% 0, #7c8895, transparent 58%),
    linear-gradient(140deg, #505d69 0%, #34404c 60%, #242c34 100%);
  --mc-cap: var(--mc-grain), linear-gradient(142deg, #8794a0 0%, #54606d 56%, #303b46 100%);
  --mc-glass: polygon(0 0, 100% 0, 100% calc(100% - 30px), calc(100% - 30px) 100%, 0 100%);
  --mc-paddle: polygon(0 0, 69% 0, 100% 40%, 100% 100%, 0 100%);
}
@supports (clip-path: shape(from 0 0, line to 100% 100%, close)) {
  :root[data-skin=machined] {
    --mc-glass: shape(from 16px 0, line to calc(100% - 16px) 0, curve to 100% 16px with 100% 0,
      line to 100% calc(100% - 32px), curve to calc(100% - 4px) calc(100% - 24px) with 100% calc(100% - 28px),
      line to calc(100% - 25px) calc(100% - 4px), curve to calc(100% - 34px) 100% with calc(100% - 29px) 100%,
      line to 16px 100%, curve to 0 calc(100% - 16px) with 0 100%,
      line to 0 16px, curve to 16px 0 with 0 0, close);
    --mc-paddle: shape(from 17px 0, line to 66% 0, curve to 74% 7% with 71% 0,
      line to 97% 36%, curve to 100% 46% with 100% 41%, line to 100% calc(100% - 16px),
      curve to calc(100% - 16px) 100% with 100% 100%, line to 17px 100%,
      curve to 0 calc(100% - 17px) with 0 100%, line to 0 17px, curve to 17px 0 with 0 0, close);
  }
}

:root[data-skin=machined] .radio {
  container-type: inline-size;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  background: var(--mc-case);
  color: var(--k-text);
  --mc-gutter: 9px;
  --text-2: var(--k-dim);
}
:root[data-skin=machined] .radio::-webkit-scrollbar { display: none; }

:root[data-skin=machined] .radio .head {
  flex: 0 0 auto;
  min-height: calc(max(8px, env(safe-area-inset-top)) + 58px);
  padding: max(8px, env(safe-area-inset-top)) clamp(12px, 4.3cqw, 20px) 8px;
}
:root[data-skin=machined] .radio .head > .iconbtn {
  width: 44px;
  height: 44px;
  border: 1px solid #151c23;
  border-radius: 10px;
  color: #161e26;
  background: var(--mc-cap);
  box-shadow: inset 0 1px 1px #f5fbffb3, inset 0 -1px 0 #ffffff3d, 0 1px 2px #111920c2;
}
:root[data-skin=machined] .radio .head > .iconbtn svg {
  width: 21px;
  height: 21px;
  filter: drop-shadow(0 1px 0 #c4cfdc9c);
}
:root[data-skin=machined] .radio .head .chanbtn { min-height: 44px; }
:root[data-skin=machined] .radio .rlogo { color: #121920; filter: none; }
:root[data-skin=machined] .radio .rlogo :is(.rlwave, small) { display: none; }
:root[data-skin=machined] .radio .rlword b {
  font: 750 clamp(19px, 5.55cqw, 25px)/1 var(--font);
  letter-spacing: .38em;
  padding-inline-start: .38em;
  text-shadow: 0 1px 0 #b7c3cf9c;
}

/* The glass is set back from its polished frame. */
:root[data-skin=machined] .machined-display {
  position: relative;
  isolation: isolate;
  display: flex;
  flex: .35 0 auto;
  min-height: clamp(216px, 67cqw, 307px);
  margin: 0 var(--mc-gutter);
  padding: 5px;
  filter: drop-shadow(0 1px 1px #e8f8ff50);
}
:root[data-skin=machined] .machined-display::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 17px;
  clip-path: var(--mc-glass);
  background: linear-gradient(143deg, #b6c4d1, #19222b 19%, #090e14 67%, #647481 81%, #c1d0da 96%);
}
:root[data-skin=machined] .machined-glass {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(10px, 3.7cqw, 17px) clamp(14px, 5.2cqw, 24px) 14px;
  border: 1px solid #03070b;
  border-radius: 13px;
  clip-path: var(--mc-glass);
  background: linear-gradient(135deg, #ffffff0e 0%, #ffffff05 28%, transparent 28.4%),
    radial-gradient(ellipse at 0 0, #28313a, #151c23 41%, #11181d 83%);
  box-shadow: inset 0 2px 4px #000c, inset 0 -1px 1px #69798769;
}
:root[data-skin=machined] .machined-glass .airline { min-height: 36px; height: auto; gap: 9px; flex-wrap: wrap; }
:root[data-skin=machined] .machined-glass .airline::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  mask: none;
  -webkit-mask: none;
  background: var(--k-acc);
  box-shadow: 0 0 9px var(--k-glow);
}
:root[data-skin=machined] .machined-glass .airline:has(.err)::before { background: #ff9e94; box-shadow: none; }
:root[data-skin=machined] .machined-glass .airline .wstatus {
  font: 700 clamp(11px, 3.1cqw, 14px)/1.25 var(--font);
  letter-spacing: .15em;
  color: var(--k-dim);
}
:root[data-skin=machined] .machined-glass .airline .airtext { white-space: normal; }
:root[data-skin=machined] .machined-glass .airline :is(.tx, .rx) .wstatus { color: var(--k-hi); }
:root[data-skin=machined] .machined-glass .airline .unavail:not(:empty) { width: 100%; max-width: none; flex-wrap: wrap; }
:root[data-skin=machined] .machined-glass .airline .btn.replay {
  height: 40px;
  padding-inline: 6px;
  color: var(--k-dim);
  background: none;
  border: 0;
  box-shadow: none;
  font-size: 13px;
}
:root[data-skin=machined] .machined-glass .lcdbox {
  flex: 1 0 auto;
  justify-content: space-evenly;
  gap: 3px;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: none;
  border: 0;
  box-shadow: none;
}
:root[data-skin=machined] .machined-readout {
  display: flex;
  align-items: baseline;
  gap: .5em;
  white-space: nowrap;
}
:root[data-skin=machined] .machined-readout .lcdfreq {
  height: auto;
  margin: 0;
  color: var(--k-digits);
  font: 750 clamp(36px, 13.5cqw, 62px)/1.03 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.042em;
  text-shadow: none;
}
:root[data-skin=machined] .machined-readout .lcdfreq.word { font-size: clamp(22px, 7.8cqw, 35px); }
:root[data-skin=machined] .machined-unit { flex: none; color: var(--k-dim); font-size: clamp(13px, 4.45cqw, 19px); font-weight: 600; }
:root[data-skin=machined] .machined-glass .lcdart {
  display: block;
  height: clamp(42px, 14.5cqw, 65px);
  margin: 0 0 2px;
  padding-bottom: 9px;
}
:root[data-skin=machined] .machined-glass .lcdart::after {
  content: "";
  position: absolute;
  inset: auto 2px 0;
  height: 7px;
  background:
    repeating-linear-gradient(90deg, #9badba70 0 1px, transparent 1px 9.6%) left bottom / 100% 100% no-repeat,
    repeating-linear-gradient(90deg, #7d93a052 0 1px, transparent 1px 1.92%) left bottom / 100% 4px no-repeat;
}
:root[data-skin=machined] .machined-glass .lwave {
  --wave-style: ribbon;
  --wave-idle: .88;
  color: #8ae2ea;
  filter: drop-shadow(0 0 2px #75e4ea62);
}
:root[data-skin=machined] .machined-glass .lcdbot {
  order: 5;
  height: auto;
  min-height: 0;
  padding: 0;
  gap: 6px;
  flex-wrap: wrap;
}
:root[data-skin=machined] .machined-glass .lcdbox:not(.none) .lcdhere { display: none; }
:root[data-skin=machined] .machined-glass .lcdbot:not(:has(> :not(.lcdhere))) { display: none; }
:root[data-skin=machined] .radio .machined-glass .people {
  display: flex;
  height: auto;
  min-height: 40px;
  margin: 0;
  padding: 0;
  gap: 7px;
  background: none;
  border: 0;
  box-shadow: none;
}
:root[data-skin=machined] .machined-glass .people .pstrip {
  height: auto;
  min-height: 44px;
  color: var(--k-dim);
  font-size: clamp(11px, 3.2cqw, 14px);
  line-height: 1.2;
}
:root[data-skin=machined] .machined-glass .people .pstrip > .icon { flex: none; color: inherit; }
:root[data-skin=machined] .machined-glass .people .plabel { white-space: normal; }
:root[data-skin=machined] .machined-glass .people .pcall {
  height: 37px;
  border: 1px solid #53616b;
  border-radius: 20px;
  background: #141b21;
  color: var(--k-text);
  box-shadow: none;
  padding-inline: 10px;
}
:root[data-skin=machined] .machined-mode {
  color: #a9b4be;
  font: 500 9px/1.25 var(--font);
  letter-spacing: .06em;
  white-space: nowrap;
}
:root[data-skin=machined] .machined-mode .lcdmode { color: inherit; }

/* Three live presets share one flush strip; the arrows page the saved list. */
:root[data-skin=machined] .machined-rail {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  flex: none;
  min-height: 44px;
  margin: 8px var(--mc-gutter) 0;
  border: 1px solid #161d25;
  border-radius: 10px;
  background: var(--mc-grain), linear-gradient(148deg, #566471, #35414d);
  box-shadow: inset 0 1px 0 #dae8f580, inset 0 -1px 0 #b2c5d05e;
}
:root[data-skin=machined] .machined-preset-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
:root[data-skin=machined] :is(.machined-page-arrow, .machined-preset) {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 0 3px;
}
:root[data-skin=machined] :is(.machined-preset, .machined-page-arrow.next)::before {
  content: "";
  position: absolute;
  inset: 27% auto 27% 0;
  width: 1px;
  background: #b4c2ce56;
  box-shadow: -1px 0 #1a232b44;
}
:root[data-skin=machined] .machined-page-arrow {
  color: #0f1820;
  filter: drop-shadow(0 1px 0 #c0cedbad);
}
:root[data-skin=machined] .machined-page-arrow.prev .icon { transform: rotate(180deg); }
:root[data-skin=machined] .machined-page-arrow[aria-disabled=true] { opacity: .55; cursor: default; }
:root[data-skin=machined] .machined-preset-screen { width: 100%; min-width: 0; }
:root[data-skin=machined] .machined-preset-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d0d8e0;
  font: 650 clamp(11px, 3.65cqw, 16px)/1.12 var(--font);
  font-variant-numeric: tabular-nums;
}
:root[data-skin=machined] .machined-preset-text.add { font-size: clamp(10px, 3cqw, 13px); }
:root[data-skin=machined] .machined-preset.on .machined-preset-text { color: #fff; }
:root[data-skin=machined] .machined-preset.on::after {
  content: "";
  position: absolute;
  inset: auto 12% 5px;
  height: 2px;
  border-radius: 2px;
  background: var(--k-acc);
  box-shadow: 0 0 5px var(--k-glow);
}

/* The button's hit area and the black well stay stationary. Only the
   face and its engraving travel; the lens is a separate fixed component. */
:root[data-skin=machined] .radio .stage {
  flex: 1 0 auto;
  justify-content: stretch;
  min-height: clamp(151px, 49cqw, 235px);
  padding: 9px var(--mc-gutter) 12px;
}
:root[data-skin=machined] .radio .stage .ptt-wrap {
  --mc-light: #84eff6;
  --mc-well: clamp(34px, 10.25cqw, 46px);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--mc-well);
  place-items: stretch;
  gap: 5px;
  flex: 1 0 auto;
  min-height: 130px;
  max-height: none;
  height: auto;
  container-type: normal;
  padding: 6px;
  border: 1px solid #181f26;
  border-radius: 20px;
  background: radial-gradient(ellipse at 95% 0, #36414c, #131a20 53%, #0d1319);
  box-shadow: inset 1px 1px 3px #000b, 0 1px 0 #b5c5d47d;
}
:root[data-skin=machined] .radio .ptt-wrap:has(.ptt[data-state=transmitting]) { --mc-light: #c4fdff; }
:root[data-skin=machined] .radio .ptt-wrap:has(.ptt[data-state=receiving]) { --mc-light: #a5dcff; }
:root[data-skin=machined] .radio .ptt-wrap:has(.ptt:is([data-state=busy], [data-state=calling], [data-state=turn])) { --mc-light: #ffd29d; }
:root[data-skin=machined] .radio .stage .ptt[data-state] {
  --mc-travel: 0px;
  grid-area: 1 / 1;
  isolation: isolate;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  gap: clamp(4px, 2.4cqw, 13px);
  padding: 10px 11% 12px 7%;
  border: 0;
  border-radius: 17px;
  background: none;
  box-shadow: none;
  animation: none;
  transform: none;
  color: #1b222a;
}
:root[data-skin=machined] .radio .stage .ptt:is([data-held], [data-state=transmitting], [data-state=requesting]) { --mc-travel: 2px; }
:root[data-skin=machined] .radio .stage .ptt[data-state]::before,
:root[data-skin=machined] .radio .stage .ptt[data-state]::after {
  content: "";
  position: absolute;
  z-index: -1;
  border: 0;
  border-radius: inherit;
  clip-path: var(--mc-paddle);
  pointer-events: none;
  animation: none;
  transform: translateY(var(--mc-travel));
  transition: transform var(--mc-duration, .1s) var(--ease);
}
:root[data-skin=machined] .radio .stage .ptt[data-state]::before {
  inset: 2px 0 0;
  background: linear-gradient(156deg, #e9f2fa, #a1afbd 41%, #38424d 94%);
}
:root[data-skin=machined] .radio .stage .ptt[data-state]::after {
  inset: 4px 3px 6px;
  border-radius: 15px;
  background: var(--mc-grain), radial-gradient(ellipse at 4% 0, #b5bec9, transparent 77%),
    linear-gradient(140deg, #a3adba, #7d8997 56%, #616d79);
  box-shadow: inset 0 1px 1px #f3f8fd85, inset 1px 0 0 #f3f8fd65;
}
:root[data-skin=machined] .radio .stage .ptt[data-state] > * {
  position: relative;
  transform: translateY(var(--mc-travel));
  transition: transform var(--mc-duration, .1s) var(--ease);
}
:root[data-skin=machined] .radio .stage .ptt :is(.lbl, .lsub) {
  max-width: 90%;
  color: #1b222a;
  font: 750 clamp(11px, 3.85cqw, 17px)/1.12 var(--font);
  letter-spacing: .1em;
  text-shadow: 0 1px 0 #dce6ef7a;
  overflow-wrap: anywhere;
}
:root[data-skin=machined] .radio .stage .ptt .lsub { font-size: 10px; }
:root[data-skin=machined] .radio .stage .ptt .icon { display: grid; color: #212a34; filter: drop-shadow(0 1px 0 #e2eaf3b2); animation: none; }
:root[data-skin=machined] .radio .stage .ptt .icon svg { width: clamp(29px, 12.5cqw, 54px); height: auto; stroke-width: 1.6; }
:root[data-skin=machined] .radio .stage .ptt .pttface { width: 44px !important; height: 44px !important; animation: none; box-shadow: none; }
:root[data-skin=machined] .radio .stage .ptt:focus-visible { outline-offset: -2px; }
:root[data-skin=machined] .machined-light-pipe {
  grid-area: 1 / 2;
  position: relative;
  border: 1px solid #151e26;
  border-radius: 20px;
  background: var(--mc-grain), linear-gradient(145deg, #4b5865, #303b46);
  box-shadow: inset 0 1px 1px #e0edfa69, inset -1px -1px 0 #c1d0de38;
  pointer-events: none;
}
:root[data-skin=machined] .machined-light-pipe::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 24%;
  min-height: 18px;
  border-radius: 4px;
  transform: translate(-50%, -50%);
  background: var(--mc-light);
  box-shadow: 0 0 8px #81eff68a, inset 0 1px 0 #f0fcff;
  transition: background-color var(--mc-duration, .14s), box-shadow var(--mc-duration, .14s), opacity var(--mc-duration, .14s);
}
:root[data-skin=machined] .radio[data-air=tx] .machined-light-pipe::after { box-shadow: 0 0 12px 2px #95f8ffc4; }
:root[data-skin=machined] .radio .ptt-wrap:has(.ptt:is(:disabled, [data-state=none])) .machined-light-pipe::after { opacity: .28; }
:root[data-skin=machined] .radio .stage .hint-line { width: 100%; margin-top: 2px; color: var(--k-text); white-space: normal; }

/* Console and native app navigation are independent of the paddle. */
:root[data-skin=machined] .radio .actions {
  margin: 0 var(--mc-gutter) 13px;
  gap: 0;
  border: 1px solid #121b23;
  border-radius: 14px;
  background: var(--mc-grain), linear-gradient(140deg, #4a5662, #29343e);
  box-shadow: inset 0 1px 1px #b8c9d891, 0 1px 0 #a4b5c363;
}
:root[data-skin=machined] .radio .action {
  height: clamp(53px, 16.7cqw, 75px);
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--k-text);
  font-size: clamp(10px, 3.06cqw, 13px);
}
:root[data-skin=machined] .radio .action + .action { border-inline-start: 1px solid #111a22; box-shadow: inset 1px 0 #9cabb944; }
:root[data-skin=machined] .radio .action :is(.iconbtn, .iconbtn:hover) { color: inherit; background: none; border: 0; box-shadow: none; }
:root[data-skin=machined] .radio .action .icon svg { width: 21px; height: 21px; }
:root[data-skin=machined] .radio .action.on { color: var(--k-hi); background: #a4d7ec12; }
:root[data-skin=machined] .radio .action.off { color: #ffc6be; }
:root[data-skin=machined] .radio .action .actlbl { white-space: normal; line-height: 1.15; }
:root[data-skin=machined] .radio :is(.action, .machined-preset, .machined-page-arrow):focus-visible { outline-offset: -3px; }

.skinpic.sp-machined { background: linear-gradient(145deg, #82909d, #2e3a47 80%); }
.skinpic.sp-machined i { background: #131c24; clip-path: polygon(0 0, 100% 0, 100% 77%, 90% 100%, 0 100%); }
.skinpic.sp-machined b {
  left: 12%;
  bottom: 10px;
  width: 58%;
  height: 22px;
  margin: 0;
  border-radius: 5px;
  clip-path: polygon(0 0, 73% 0, 100% 42%, 100% 100%, 0 100%);
  background: linear-gradient(145deg, #c8d0da, #697684);
}
.skinpic.sp-machined::after {
  content: "";
  position: absolute;
  left: 79%;
  bottom: 14px;
  width: 2px;
  height: 9px;
  border-radius: 2px;
  background: #84eff6;
}

@media (max-height: 700px) {
  :root[data-skin=machined] .machined-display { min-height: 181px; }
  :root[data-skin=machined] .machined-glass { padding-block: 8px 10px; }
  :root[data-skin=machined] .machined-glass .lcdart { height: 42px; }
  :root[data-skin=machined] .radio .stage { min-height: 129px; padding-block: 7px; }
  :root[data-skin=machined] .radio .stage .ptt-wrap { min-height: 112px; }
  :root[data-skin=machined] .radio .actions { margin-bottom: 8px; }
}
@media (max-height: 610px) {
  :root[data-skin=machined] .radio .head { min-height: calc(max(4px, env(safe-area-inset-top)) + 48px); padding-block: max(4px, env(safe-area-inset-top)) 4px; }
  :root[data-skin=machined] .machined-glass .lcdart { height: 29px; }
  :root[data-skin=machined] .machined-glass .airline .btn.replay { height: 34px; }
  :root[data-skin=machined] .radio .actions { margin-bottom: 6px; }
}
/* Energy saving stops the mechanical transition just as reduced motion does. */
:root[data-skin=machined].eco .ptt-wrap { --mc-duration: 0s; }
@media (prefers-reduced-motion: reduce) {
  :root[data-skin=machined] .ptt-wrap { --mc-duration: 0s; }
}

/* The interface colour on the talk key (theme.js): while a colour is
   chosen (:root[data-tint]), its microphone and its words take it (the dark shade,
   on its satin titanium face); not while on air (the key's own colours say so).
   In «Original» nothing of it. */
:root[data-tint][data-skin=machined] .radio .ptt:not([data-state=transmitting]) :is(.icon, .lbl) { color: var(--tint-ink); }
