:root {
  --desktop-teal: #008080;
  --classic-grey: #c0c0c0;
  --classic-blue: #000080;
  --status-green: #008000;
  --danger-red: #a40000;
  --desktop-taskbar-height: 42px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--desktop-teal) url("./assets/background.png") center / 100% 100% no-repeat fixed;
}

button,
input,
label,
p,
h1,
legend,
span,
time {
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
}

.desktop {
  position: relative;
  min-height: 100vh;
  padding: 28px 28px calc(var(--desktop-taskbar-height) + 24px) 124px;
  background: transparent;
  overflow: auto;
}

.desktop-icons {
  position: fixed;
  top: 20px;
  left: 16px;
  z-index: 1;
  display: grid;
  gap: 22px;
  width: 92px;
}

.desktop-shortcut {
  display: flex;
  width: 92px;
  min-width: 0;
  height: auto;
  min-height: 78px;
  padding: 0;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border: 1px solid transparent;
  box-shadow: none;
  background: transparent;
  color: white;
  text-align: center;
  line-height: 1.25;
  text-shadow: 1px 1px #000;
}

.desktop-shortcut:hover,
.desktop-shortcut:focus-visible {
  border: 1px dotted white;
  outline: none;
  box-shadow: none;
  background: rgba(0, 0, 128, 0.22);
}

.asset-placeholder {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px dashed #666;
  background: #dfdfdf;
  color: #555;
  font-size: 8px;
  line-height: 1;
  text-align: center;
  overflow: hidden;
  user-select: none;
}

/*
  Drop-in PNG/image replacement for any .asset-placeholder.
  Keep the same size class (for example .desktop-icon-placeholder) and swap
  the element to <img class="asset-image ..." src="...">.

  V8.7 default = every icon box is square and every PNG stretches exactly
  to fill that square. This intentionally does not preserve source aspect ratio.
  Add .asset-image--cover only when you explicitly want fill/crop behavior.
*/
.asset-image {
  display: block;
  flex: 0 0 auto;
  object-fit: fill;
  object-position: center;
  overflow: hidden;
}

/* V8.7: icon assets use square boxes; source images stretch to fill them. */
.asset-image,
.asset-placeholder,
.wallet-icon-image,
.wallet-icon-placeholder {
  aspect-ratio: 1 / 1;
}

.asset-image--stretch {
  object-fit: fill;
}

.asset-image--cover {
  object-fit: cover;
}

.desktop-icon-placeholder {
  width: 40px;
  height: 40px;
  background: transparent;
  color: #333;
}

/* V8.7: real desktop PNG icons have no placeholder chrome/background. */
.desktop-shortcut img.desktop-icon-placeholder {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.browser-window {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100vw - 160px));
  min-width: 760px;
  margin: 18px auto;
}

.app-title {
  display: flex;
  align-items: center;
  gap: 5px;
}

.title-logo-placeholder,
.task-logo-placeholder {
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, 0.65);
  background: #d8d8d8;
  color: #333;
  font-size: 5px;
}

.menu-bar {
  display: flex;
  align-items: center;
  gap: 1px;
  min-height: 30px;
  padding: 2px 5px;
  border-bottom: 1px solid #808080;
  box-shadow: inset 0 -1px #fff;
}

.menu-bar button {
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid transparent;
  box-shadow: none;
  background: transparent;
}

.menu-bar button:hover,
.menu-bar button:focus-visible {
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  outline: none;
}

.browser-toolbar {
  padding: 7px 7px 8px;
  border-bottom: 1px solid #808080;
  box-shadow: inset 0 -1px #fff;
}

.toolbar-actions {
  display: flex;
  gap: 4px;
  margin-bottom: 7px;
}

.toolbar-button {
  display: flex;
  min-width: 78px;
  height: 45px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px 8px;
}

.toolbar-icon-placeholder {
  width: 20px;
  height: 20px;
  font-size: 5px;
}

.address-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.address-box {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  height: 27px;
  padding: 2px;
  background: #c0c0c0;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a,
    inset -2px -2px #dfdfdf, inset 2px 2px grey;
}

.address-box input {
  width: 100%;
  height: 21px;
  padding: 2px 4px;
  border: 0;
  box-shadow: none;
  background: #fff;
}

.tiny-logo-placeholder {
  width: 20px;
  height: 20px;
  font-size: 5px;
}

/* V10.5: classic address-bar treatment.
   The address container is Windows gray and only the URL input stays white.
   The web icon itself remains transparent so there is no white halo/padding. */
img.tiny-logo-placeholder {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

img.lock-icon-placeholder {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.app-body {
  margin: 10px 10px 7px !important;
}

.brand-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  padding: 10px 6px;
}

.brand-logo-placeholder {
  width: 84px;
  height: 84px;
  background: #d6d6d6;
  font-size: 10px;
}

.brand-badge-placeholder {
  width: 64px;
  height: 64px;
  font-size: 7px;
}

.brand-copy h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 38px);
  line-height: 1;
  font-weight: 700;
}

.brand-copy p {
  margin: 0;
  font-size: 18px;
}

.classic-rule,
.inner-rule {
  height: 2px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
}

.classic-rule {
  margin: 0 4px 18px;
}

.inner-rule {
  margin: 18px 0;
}

.clockin-grid {
  display: grid;
  grid-template-columns: 1fr 0.96fr;
  gap: 18px;
  min-height: 390px;
}

.clockin-grid fieldset {
  min-width: 0;
  margin: 0;
  padding: 20px 20px 22px;
}

.clockin-grid legend {
  padding: 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.connect-panel {
  display: flex;
  flex-direction: column;
}

.right-column {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 18px;
}

.panel-intro {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin: 9px 0 18px;
}

.panel-intro p {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
}

.feature-icon-placeholder {
  width: 54px;
  height: 54px;
}

.action-button {
  align-self: stretch;
  width: 100%;
  min-height: 48px;
  margin: 2px auto 15px;
  font-size: 18px;
  font-weight: 700;
}

.clock-button {
  min-height: 62px;
  font-size: 24px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin: 0 4px;
  color: #555;
}

.connection-status.connected {
  color: var(--status-green);
}

.connection-status.error {
  color: var(--danger-red);
}

.status-dot,
.footer-dot {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 1px solid #000;
  border-radius: 50%;
  background: #8b8b8b;
  box-shadow: inset 1px 1px rgba(255, 255, 255, 0.55);
}

.connection-status.connected .status-dot,
.footer-dot.connected {
  background: #00a000;
}

.connection-status.error .status-dot,
.footer-dot.error {
  background: #c00000;
}

.wallet-field {
  width: 100%;
  margin-top: 0;
}

.wallet-field label {
  margin-bottom: 7px;
  font-size: 14px;
}

.wallet-field input {
  width: 100%;
  height: 36px;
  font-size: 15px;
}

.wallet-income {
  margin: 7px 0 0;
  font-size: 12px;
}

.wallet-income strong {
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
  font-weight: 700;
}

.clock-message {
  min-height: 17px;
  margin: 0;
  text-align: center;
  color: #555;
}

.clock-message.success {
  color: var(--status-green);
  font-weight: 700;
}

.clock-message.error {
  color: var(--danger-red);
  font-weight: 700;
}

.total-panel {
  padding-top: 15px !important;
  padding-bottom: 15px !important;
}

.attendance-wrap {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 14px;
}

.users-icon-placeholder {
  width: 58px;
  height: 58px;
}

.attendance-label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
}

.attendance-number {
  display: block;
  color: var(--classic-blue);
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1;
}

.status-left,
.ca-field,
.secure-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-left {
  flex: 1 1 auto;
}

.ca-field,
.secure-field {
  flex: 0 0 auto;
}

.ca-field {
  white-space: nowrap;
}

.lock-icon-placeholder,
.tray-icon-placeholder,
.start-icon-placeholder {
  width: 18px;
  height: 18px;
  font-size: 5px;
}

.taskbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(170px, 330px) 1fr auto;
  align-items: center;
  gap: 4px;
  height: var(--desktop-taskbar-height);
  padding: 4px;
  background: var(--classic-grey);
  border-top: 2px solid #fff;
  box-shadow: 0 -1px #dfdfdf;
}

.start-button,
.task-button {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
}

.start-button {
  padding-inline: 7px 10px;
}

.start-button strong {
  font-size: 15px;
}

.task-button {
  justify-content: flex-start;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task-button[aria-pressed="true"] {
  box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a,
    inset -2px -2px #dfdfdf, inset 2px 2px grey;
  font-weight: 700;
}

.system-tray {
  grid-column: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  min-width: 116px;
  padding: 4px 8px;
  overflow: visible;
  background: var(--classic-grey);
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .desktop {
    padding: 14px 12px calc(var(--desktop-taskbar-height) + 16px);
  }

  .desktop-icons {
    display: none;
  }

  .browser-window {
    width: 100%;
    min-width: 0;
    margin: 0;
  }

  .toolbar-actions {
    display: none;
  }

  .clockin-grid {
    grid-template-columns: 1fr;
  }

  .brand-header {
    grid-template-columns: auto 1fr;
  }

  .brand-badge-placeholder {
    display: none;
  }

  .taskbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .system-tray {
    grid-column: 3;
  }
}

@media (max-width: 560px) {
  .status-bar {
    flex-wrap: wrap;
  }

  .status-left {
    flex-basis: 100%;
  }

  .menu-bar {
    overflow-x: auto;
  }

  .address-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .address-row > button {
    display: none;
  }

  .brand-logo-placeholder {
    width: 58px;
    height: 58px;
  }

  .brand-copy h1 {
    font-size: 22px;
  }

  .brand-copy p {
    font-size: 14px;
  }

  .clockin-grid fieldset {
    padding-inline: 14px;
  }

  .task-button span:last-child {
    display: none;
  }

  .system-tray {
    min-width: 100px;
  }
}

/* Wallet picker modal — Windows classic / 98.css */
.wallet-modal-backdrop[hidden] {
  display: none;
}

.wallet-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.34);
}

.wallet-modal {
  width: min(520px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 64px));
}

.wallet-modal-body {
  display: flex;
  min-height: 300px;
  max-height: calc(100vh - 105px);
  margin: 0 !important;
  padding: 14px !important;
  flex-direction: column;
  overflow: hidden;
}

.wallet-modal-intro {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.wallet-modal-intro p {
  margin: 0 0 4px;
  line-height: 1.35;
}

.wallet-standard-note {
  color: #555;
  font-size: 11px;
}

.wallet-dialog-icon-placeholder {
  width: 42px;
  height: 42px;
}

.wallet-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}

.wallet-list {
  display: grid;
  gap: 7px;
  min-height: 80px;
  max-height: 330px;
  padding: 8px;
  overflow: auto;
  background: #fff;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a,
    inset -2px -2px #dfdfdf, inset 2px 2px grey;
}

.wallet-option {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 7px 9px;
  text-align: left;
}

.wallet-option-copy {
  min-width: 0;
}

.wallet-option-name,
.wallet-option-rdns,
.wallet-option-badge {
  display: block;
}

.wallet-option-name {
  margin-bottom: 4px;
  overflow: hidden;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.wallet-option-rdns {
  overflow: hidden;
  color: #555;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.wallet-option-badge {
  padding: 2px 5px;
  border: 1px solid #808080;
  background: #dfdfdf;
  color: #222;
  font-size: 9px;
  white-space: nowrap;
}

.wallet-icon-placeholder,
.wallet-icon-image {
  width: 34px;
  height: 34px;
}

.wallet-icon-placeholder {
  font-size: 5px;
}

.wallet-icon-image {
  display: block;
  flex: 0 0 auto;
  object-fit: fill;
  border: 1px solid #808080;
  background: #fff;
  padding: 2px;
  image-rendering: auto;
}

.wallet-empty-state {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 112px;
  padding: 16px;
  background: #fff;
  box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a,
    inset -2px -2px #dfdfdf, inset 2px 2px grey;
}

.wallet-empty-state[hidden] {
  display: none;
}

.wallet-empty-state p {
  margin: 5px 0 0;
  line-height: 1.4;
}

.wallet-empty-icon-placeholder {
  width: 42px;
  height: 42px;
}

.wallet-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.wallet-discovery-status {
  min-width: 0;
  color: #555;
  font-size: 10px;
}

.wallet-modal-actions button {
  min-width: 76px;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 560px) {
  .wallet-modal-backdrop {
    padding: 8px;
  }

  .wallet-modal {
    width: calc(100vw - 16px);
  }

  .wallet-option {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .wallet-option-badge {
    display: none;
  }
}
