/* cmd/tms99/frontend/tms.css */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

:root {
  --bg:      #0d0f14;
  --surface: #151820;
  --sur2:    #1c2030;
  --border:  rgba(255,255,255,0.07);
  --accent:  #cfc205;
  --adim:    rgba(232,255,87,0.12);
  --adim2:   rgba(232,255,87,0.06);
  --text:    #f0f2f5;
  --text2:   #8a90a0;
  --text3:   #50576a;
  --green:   #4ade80;
  --red:     #f87171;
  --blue:    #60a5fa;
  --purple:  #c084fc;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Syne', sans-serif;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px 16px;
  overflow-x: hidden;
  overflow-y: scroll;
  width: 100%;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: -30%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(232,255,87,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 24px);
  gap: 12px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.logo {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.logo em { color: var(--accent); font-style: normal; }

.badge {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text3);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.05em;
}

.card {
  flex: 1;
  background: var(--surface);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  width: 100%;
}

.tab {
  padding: 16px 10px;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text2);
  cursor: pointer;
  text-align: center;
  border: none;
  background: none;
  position: relative;
  transition: color 0.2s, background 0.2s;
}
.tab:first-child { border-right: 1px solid var(--border); }
.tab.active { color: var(--accent); background: var(--adim2); }
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}

.clock-section {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.clock-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  width: 100%;
}

.clock-section-title {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.clock-section-title::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
  flex-shrink: 0;
}

.clock-controls { display: flex; align-items: center; }

.clock-interval-select {
  font-family: var(--mono);
  font-size: 0.6rem;
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--sur2);
  color: var(--text2);
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  line-height: 1;
  height: 28px;
  min-width: 70px;
  text-align: center;
}
.clock-interval-select:hover { border-color: var(--accent); color: var(--accent); }
.clock-interval-select option { background: var(--sur2); color: var(--text); text-align: center; }

.clock-scroll {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  margin-top: 8px;
  width: 100%;
}
.clock-scroll::-webkit-scrollbar { display: none; }
.clock-scroll:active { cursor: grabbing; }

.clock-grid {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  grid-auto-columns: calc((100%) / 3 - 5px);
  gap: 7px;
}

.clock-card {
  background: var(--sur2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: border-color 0.2s;
  scroll-snap-align: none;
}
.clock-card.snap-start { scroll-snap-align: start; }
.clock-card:hover { border-color: rgba(232,255,87,0.2); }

.clock-city {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-transform: uppercase;
  opacity: 0.9;
}

.analog-clock {
  position: relative;
  width: 62px;
  height: 62px;
  flex-shrink: 0;
}
.analog-clock svg { width: 100%; height: 100%; }

.clock-digital {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.clock-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 8px;
}

.clock-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.25s, transform 0.25s;
  cursor: pointer;
}
.clock-dot.active { background: var(--accent); transform: scale(1.25); }

#homePage {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  min-height: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.field { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
  width: 100%;
  box-sizing: border-box;
  min-height: 0;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text2);
}

.dot { 
  width: 5px; 
  height: 5px; 
  border-radius: 50%; 
  background: var(--accent); 
  opacity: 0.7; 
  flex-shrink: 0; 
}
.dot.dim { opacity: 0.3; }

.input {
  width: 100%;
  background: var(--sur2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus {
  border-color: rgba(232,255,87,0.4);
  box-shadow: 0 0 0 3px rgba(232,255,87,0.06);
}
.input::placeholder { color: var(--text3); }

select.input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23e8ff57' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.field-hint { font-family: var(--mono); font-size: 0.6rem; color: var(--text3); }

/* WARNING PANEL - Tightened spacing to reduce shift */
.warning-panel {
  margin-top: 4px; /* Reduced from 8px */
  background: var(--sur2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.warning-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px; /* Reduced from 10px */
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text2);
  width: 100%;
  box-sizing: border-box;
}

.warning-panel-header:hover {
  background: rgba(255,255,255,0.03);
}

.warning-panel-title {
  color: var(--accent);
  letter-spacing: 0.02em;
}

.warning-panel-chevron {
  width: 14px;
  height: 14px;
  color: var(--text3);
  transition: transform 0.25s;
  flex-shrink: 0;
}

.warning-panel.open .warning-panel-chevron {
  transform: rotate(180deg);
}

.warning-panel-body {
  display: none;
  padding: 0 12px 8px 12px; /* Reduced bottom padding from 12px to 8px */
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.65rem;
  line-height: 1.5;
  color: var(--text2);
  width: 100%;
  box-sizing: border-box;
}

.warning-panel.open .warning-panel-body {
  display: block;
}

.warning-content {
  width: 100%;
  box-sizing: border-box;
}

.warning-content ul.bullet-list {
  margin: 6px 0 8px 0; /* Reduced margins */
  padding-left: 20px;
  list-style-type: disc;
}

.warning-content ul.bullet-list li {
  margin-bottom: 4px; /* Reduced from 6px */
  font-family: var(--mono);
  font-size: 0.65rem;
  line-height: 1.5;
  color: var(--text2);
}

.warning-content ul.bullet-list li:last-child {
  margin-bottom: 0;
}

.warning-content ul.bullet-list li strong {
  color: var(--accent);
  font-weight: 600;
}

.warning-content p {
  margin: 6px 0 3px 0; /* Reduced margins */
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text);
  font-weight: 500;
}

.warning-content p:first-of-type {
  margin-top: 3px;
}

.warning-content p strong {
  color: var(--accent);
}

/* SPACER - Aggressive collapse */
.spacer { 
  flex: 1; 
  min-height: 0; 
  height: auto;
}

.spacer.collapsed { 
  flex: 0 !important; 
  min-height: 0 !important; 
  max-height: 0 !important; 
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.btn-generate {
  width: 100%;
  padding: 8px 12px;
  background: var(--accent);
  color: #0d0f14;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.2s, transform 0.1s;
  min-height: 32px;
  margin-top: 0; /* Ensure no extra margin */
}
.btn-generate:hover  { opacity: 0.9; }
.btn-generate:active { transform: scale(0.99); }

.status { 
  padding: 10px 14px; 
  border-radius: 8px; 
  font-family: var(--mono); 
  font-size: 0.75rem; 
  display: none; 
  width: 100%;
  box-sizing: border-box;
}
.status.err { display:block; background: rgba(248,113,113,0.08); color: var(--red);    border: 1px solid rgba(248,113,113,0.2); }
.status.ok  { display:block; background: rgba(74,222,128,0.08);  color: var(--green);  border: 1px solid rgba(74,222,128,0.2); }
.status.inf { display:block; background: var(--adim);            color: var(--accent); border: 1px solid rgba(232,255,87,0.2); }

#mnemonicPage {
  flex: 1;
  display: none;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

.mnem-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text2);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 0;
}
.btn-back:hover { color: var(--text); }
.btn-back svg   { width: 14px; height: 14px; transition: transform 0.2s; }
.btn-back:hover svg { transform: translateX(-3px); }

.batch-pill {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--adim);
  border: 1px solid rgba(232,255,87,0.2);
  padding: 4px 8px;
  border-radius: 100px;
}

.timer-track { height: 2px; background: var(--sur2); flex-shrink: 0; width: 100%; }
.timer-bar   { height: 100%; background: var(--accent); opacity: 0.35; width: 100%; transition: width 0.1s linear; }

.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px 8px;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

.nav-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--sur2);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.nav-btn svg { width: 16px; height: 16px; }
.nav-btn:hover:not(:disabled) { background: var(--adim); border-color: rgba(232,255,87,0.4); color: var(--accent); }
.nav-btn:active:not(:disabled) { transform: scale(0.9); }
.nav-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.word-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  flex: 1;
  align-self: stretch;
  min-width: 0;
  width: 100%;
}

.word-card {
  background: var(--sur2);
  border: 1px solid rgba(232,255,87,0.2);
  border-radius: 8px;
  padding: 12px 2px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
  width: 100%;
}

.word-n {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--text3);
  margin-bottom: 4px;
}

.word-v {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  word-break: break-word;
  line-height: 1.2;
  padding: 0 2px;
}

.batch-pw {
  margin: 0 16px 8px;
  background: var(--sur2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.batch-pw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.batch-pw-header:hover { background: rgba(255,255,255,0.03); }
.batch-pw-title {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 5px;
}
.batch-pw-title .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: 0.5; }
.batch-pw-chevron {
  color: var(--text3);
  transition: transform 0.25s;
  flex-shrink: 0;
  width: 12px; height: 12px;
}
.batch-pw.open .batch-pw-chevron { transform: rotate(180deg); }
.batch-pw-body {
  display: none;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}
.batch-pw.open .batch-pw-body { display: flex; }

.pw-side-layout {
  display: flex;
  align-items: stretch;
}
.pw-side-content {
  flex: 1;
  min-width: 0;
  border-top: 1px solid var(--border);
}
.pw-tab-content {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 184px;
  height: 184px;
  max-height: 184px;
  box-sizing: border-box;
  position: relative;
  width: 100%;
}

.pw-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: end;
  flex-shrink: 0;
  width: 100%;
}

.pw-out {
  background: var(--bg);
  border: 1px solid rgba(232,255,87,0.2);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  visibility: hidden;
  flex-shrink: 0;
}
.pw-out.visible { visibility: visible; }

.pw-out-header { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  width: 100%;
}

.pw-out-label {
  font-family: var(--mono);
  font-size: 0.52rem;
  color: var(--text3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pw-eye-icon {
  width: 14px; height: 14px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s, color 0.2s;
  color: var(--text2);
  flex-shrink: 0;
}
.pw-eye-icon:hover { opacity: 1; color: var(--accent); }

.pw-out-value {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  word-break: break-all;
  line-height: 1.3;
  letter-spacing: 0.02em;
  transition: filter 0.2s ease;
  min-height: 1.5em;
  max-height: 80px;
  overflow-y: auto;
  padding-right: 2px;
}
.pw-out-value::-webkit-scrollbar { width: 3px; }
.pw-out-value::-webkit-scrollbar-track { background: var(--sur2); }
.pw-out-value::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
.pw-out-value.masked { filter: blur(4px); cursor: pointer; user-select: none; }

.pw-out-meta { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  width: 100%;
}

.strength-bars { display: flex; gap: 2px; flex: 1; }
.strength-bar  { height: 2px; flex: 1; border-radius: 1px; background: var(--border); transition: all 0.3s; }
.strength-bar.weak   { background: var(--red); }
.strength-bar.medium { background: #f59e0b; }
.strength-bar.strong { background: var(--green); }

.strength-lbl { font-family: var(--mono); font-size: 0.52rem; color: var(--text3); min-width: 42px; text-align: right; }

.pw-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex-shrink: 0;
  margin-top: auto;
  width: 100%;
}

.pw-actions .act-btn {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--sur2);
  color: var(--text2);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
  min-height: 28px;
}
.pw-actions .act-btn svg { width: 12px; height: 12px; }
.pw-actions .act-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.pw-actions .act-btn:active { transform: scale(0.97); }

.overview {
  padding: 0 16px 8px;
  flex-shrink: 0;
  height: 70px;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.overview-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  margin-bottom: 6px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 0 0 5px var(--adim);
}

.dot-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  height: 40px;
  display: flex;
  justify-content: center;
}

.dot-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  justify-content: center;
  overflow-x: auto;
  overflow-y: visible;
  padding: 4px 0 8px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  align-items: center;
  min-height: 40px;
  width: fit-content;
  min-width: 100%;
  margin: 0 auto;
}
.dot-row::-webkit-scrollbar { display: none; }
.dot-row:active { cursor: grabbing; }

.dot-group {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  position: relative;
  padding: 2px 0;
  margin: 0;
  scroll-snap-align: center;
}

.dot-group.active-batch::after {
  content: '';
  position: absolute;
  top: -5px; left: -5px; right: -5px; bottom: -5px;
  border: 2px solid var(--accent);
  border-radius: 9px;
  opacity: 0.5;
  pointer-events: none;
  animation: pulse-glow 2s infinite ease-in-out;
  z-index: 10;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.3; border-color: var(--accent); }
  50% { opacity: 0.8; border-color: var(--accent); }
}

.wd {
  width: 21px; height: 21px;
  border-radius: 4px;
  background: var(--sur2);
  border: 1px solid rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.48rem;
  font-family: var(--mono);
  color: var(--text3);
  transition: all 0.2s;
  flex-shrink: 0;
}
.wd.done { background: rgba(74,222,128,0.12); border-color: rgba(74,222,128,0.3); color: var(--green); }
.wd.active {
  background: var(--adim);
  border-color: rgba(232,255,87,0.4);
  color: var(--accent);
  font-weight: 600;
  transform: scale(1.08);
  box-shadow: 0 0 7px var(--adim);
  z-index: 5;
}

.bottom-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 14px;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.action-group { display: flex; gap: 8px; flex: 1; }

.action-group .act-btn {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--sur2);
  color: var(--text2);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  transition: all 0.2s;
  min-height: 28px;
  white-space: nowrap;
  width: 100%;
}
.action-group .act-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.action-group .act-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.action-group .act-btn:active { transform: scale(0.97); }

.act-btn.hi {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(232,255,87,0.25);
  background: var(--adim);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  transition: all 0.2s;
  min-height: 28px;
  white-space: nowrap;
  width: 100%;
}
.act-btn.hi svg { width: 12px; height: 12px; flex-shrink: 0; }
.act-btn.hi:hover { background: rgba(232,255,87,0.18); }
.act-btn.hi:active { transform: scale(0.97); }

.qr-tab-content {
  padding: 12px 14px 14px;
  display: none;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
  min-height: 184px;
  height: 184px;
  max-height: 184px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  width: 100%;
}
.qr-tab-content.active { display: flex; }

.qr-left-column { flex-shrink: 0; width: 160px; }

.qr-right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 160px;
  position: relative;
}

.qr-container {
  position: relative;
  width: 160px; height: 160px;
  background: white;
  border-radius: 8px;
  padding: 8px;
  flex-shrink: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: block;
}
.qr-container:active { transform: scale(0.98); }

.qr-warning-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #14141e;
  border: 2px solid rgba(245,158,11,0.3);
  border-radius: 8px;
  padding: 6px;
  z-index: 20;
  cursor: pointer;
}

.warning-box-icon { font-size: 2.8rem; line-height: 1; margin-bottom: 4px; animation: gentle-pulse 2s infinite ease-in-out; }
.warning-box-title { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; color: #f59e0b; text-align: center; letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 4px; }
.warning-box-text { font-family: var(--mono); font-size: 0.8rem; line-height: 1.4; color: #e0e0e0; text-align: center; margin-bottom: 4px; }
.warning-box-button {
  width: 80%; max-width: 200px;
  padding: 8px 12px;
  background: #f59e0b; color: #000;
  font-family: var(--sans); font-size: 0.6rem; font-weight: 700;
  border: none; border-radius: 8px;
  cursor: pointer; transition: all 0.2s ease;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.warning-box-button:hover { opacity: 0.9; transform: scale(1.02); }
.warning-box-button:active { transform: scale(0.98); }

.qr-tap-button {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(245,158,11,0.15);
  border: 2px solid rgba(245,158,11,0.3);
  border-radius: 12px;
  height: 80px; width: 100%;
  cursor: pointer; transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.qr-tap-button:active { background: rgba(245,158,11,0.25); transform: scale(0.98); }

.warning-icon { font-size: 1.5rem; line-height: 1; margin-bottom: 4px; animation: gentle-pulse 2s infinite ease-in-out; }
.warning-tap-text { font-family: var(--mono); font-size: 0.6rem; font-weight: 600; color: #f59e0b; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.9; }

.qr-action-row { display: flex; flex-direction: row; gap: 6px; height: 40px; width: 100%; }

.qr-act-btn {
  padding: 4px 6px; border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--sur2); color: var(--text2);
  font-family: var(--sans); font-size: 0.65rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 4px; transition: all 0.2s; height: 36px; flex: 1;
  white-space: nowrap; text-transform: uppercase;
}
.qr-act-btn svg { width: 10px; height: 10px; }
.qr-act-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.qr-act-btn:active { transform: scale(0.97); }

@keyframes gentle-pulse {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.identity-message-box {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: none; flex-direction: column;
  background: #14141e;
  border: 2px solid var(--accent);
  border-radius: 8px; padding: 12px;
  z-index: 30; overflow-y: auto;
  margin: 0; width: 100%; height: 100%; box-sizing: border-box;
}

.identity-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.identity-header-text { font-family: var(--mono); font-size: 0.7rem; font-weight: 600; color: var(--accent); letter-spacing: 0.02em; }

.identity-close-btn {
  padding: 4px 10px; background: var(--accent); color: #0d0f14;
  font-family: var(--sans); font-size: 0.65rem; font-weight: 700;
  border: none; border-radius: 4px; cursor: pointer;
  transition: all 0.2s ease; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}
.identity-close-btn:hover { opacity: 0.9; transform: scale(1.02); }
.identity-close-btn:active { transform: scale(0.98); }

.identity-content {
  flex: 1; font-family: var(--mono); font-size: 0.7rem; line-height: 1.6;
  color: var(--text); white-space: pre-wrap; word-break: break-word; overflow-y: auto;
}

#qrCode, #qrCode * { pointer-events: none !important; user-select: none !important; }

.qr-container canvas,
.qr-container img {
  width: 144px !important; height: 144px !important;
  display: block; image-rendering: pixelated;
  pointer-events: none; user-select: none; -webkit-user-select: none;
}

.qr-blur-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border-radius: 8px; pointer-events: none;
}
.qr-blur-overlay.hidden { opacity: 0; pointer-events: none; }
.qr-blur-overlay-icon { width: 36px; height: 36px; color: #1c1c2e; opacity: 0.6; flex-shrink: 0; }

.pw-side-tabs {
  display: flex; flex-direction: column;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.pw-side-tab {
  writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg);
  padding: 14px 8px;
  font-family: var(--mono); font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text2); cursor: pointer; background: none; border: none;
  position: relative; transition: color 0.2s, background 0.2s;
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.pw-side-tab:first-child { border-bottom: 1px solid var(--border); }
.pw-side-tab:last-child { border-radius: 0 0 8px 0; }
.pw-side-tab.active { color: var(--accent); background: var(--adim2); }
.pw-side-tab.active::before {
  content: ''; position: absolute; left: -1px; top: 0; bottom: 0;
  width: 2px; background: var(--accent);
}
.pw-side-tab:hover:not(.active) { color: var(--text); background: rgba(255,255,255,0.03); }

.hidden { display: none !important; }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(13,15,20,0.25);
  border-top-color: #0d0f14;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  #homePage { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .spacer { flex: 0; min-height: 16px; }
  .clock-section { padding: 8px 8px 6px; }
  .clock-section-header { margin-bottom: 6px; }
  .clock-interval-select { font-size: 0.5rem; padding: 4px 6px; height: 24px; min-width: 52px; }
  .clock-grid { gap: 4px; grid-auto-columns: calc((100% - 8px) / 3); }
  .clock-card { padding: 6px 3px 4px; gap: 3px; border-radius: 6px; }
  .clock-city { font-size: 0.5rem; letter-spacing: 0.02em; }
  .analog-clock { width: 40px; height: 40px; }
  .clock-digital { font-size: 0.55rem; letter-spacing: 0.01em; }
  #homePage { padding: 12px; gap: 10px; }
  .field-row { gap: 8px; }
  .field { gap: 4px; }
  .field-label { font-size: 0.6rem; gap: 4px; }
  .input { padding: 8px 10px; font-size: 0.8rem; }
  select.input { padding-right: 30px; background-position: right 8px center; }
  .field-hint { font-size: 0.55rem; }
  .btn-generate { padding: 8px 10px; font-size: 0.8rem; min-height: 28px; }
  .shell { gap: 8px; }
  .header { padding: 0 4px 8px; }
  .logo { font-size: 1.2rem; }
  .badge { font-size: 0.75rem; padding: 3px 8px; }
  .card { margin-bottom: 8px; }
  .tab { padding: 10px 6px; font-size: 0.7rem; }
  .pw-tab-content, .qr-tab-content { min-height: 210px; height: 210px; max-height: 210px; }
  .word-card { min-height: 60px; padding: 8px 2px; }
  .word-n { font-size: 0.5rem; }
  .word-v { font-size: 0.7rem; }
  .overview { height: 60px; padding: 0 12px 6px; }
  .overview-label { font-size: 0.65rem; }
  .dot-container { height: 36px; }
  .dot-row { min-height: 36px; gap: 2px; padding: 4px 0 8px 0; }
  .wd { width: 17px; height: 17px; font-size: 0.43rem; }
  .dot-group.active-batch::after { top: -4px; left: -4px; right: -4px; bottom: -4px; border-radius: 7px; }
  .warning-panel-header { padding: 6px 10px; font-size: 0.65rem; }
  .warning-panel-body { padding: 0 10px 6px 10px; font-size: 0.6rem; }
  .warning-panel-chevron { width: 12px; height: 12px; }
  .warning-content ul.bullet-list { margin: 4px 0 6px 0; padding-left: 16px; }
  .warning-content ul.bullet-list li { margin-bottom: 3px; font-size: 0.6rem; line-height: 1.4; }
  .warning-content p { margin: 4px 0 2px 0; font-size: 0.6rem; }
  .pw-actions { gap: 4px; }
  .pw-actions .act-btn { padding: 4px 6px; font-size: 0.65rem; min-height: 24px; }
  .pw-actions .act-btn svg { width: 10px; height: 10px; }
  .bottom-actions { gap: 6px; padding: 0 12px 12px; }
  .action-group { gap: 6px; }
  .action-group .act-btn { padding: 4px 6px; font-size: 0.65rem; min-height: 24px; }
  .action-group .act-btn svg { width: 10px; height: 10px; }
  .act-btn.hi { padding: 4px 6px; font-size: 0.65rem; min-height: 24px; }
  .act-btn.hi svg { width: 10px; height: 10px; }
  .pw-out-value { max-height: 60px; font-size: 0.65rem; }
  .qr-tab-content { padding: 8px 10px; gap: 8px; }
  .qr-left-column { width: 120px; }
  .qr-container { width: 120px; height: 120px; padding: 6px; }
  .qr-container canvas, .qr-container img { width: 108px !important; height: 108px !important; }
  .qr-right-column { height: 120px; gap: 6px; }
  .qr-tap-button { height: 60px; }
  .warning-icon { font-size: 1.2rem; }
  .warning-tap-text { font-size: 0.5rem; }
  .qr-action-row { height: 32px; gap: 4px; }
  .qr-act-btn { height: 28px; font-size: 0.55rem; padding: 2px 4px; }
  .identity-message-box { padding: 8px; }
  .identity-header { margin-bottom: 8px; padding-bottom: 6px; }
  .identity-header-text { font-size: 0.6rem; }
  .identity-close-btn { padding: 3px 8px; font-size: 0.55rem; }
  .identity-content { font-size: 0.6rem; line-height: 1.4; }
  .qr-warning-overlay { padding: 12px; }
  .warning-box-icon { font-size: 2rem; margin-bottom: 8px; }
  .warning-box-title { font-size: 1rem; margin-bottom: 8px; }
  .warning-box-text { font-size: 0.65rem; margin-bottom: 12px; max-width: 220px; }
  .warning-box-button { padding: 8px 12px; font-size: 0.75rem; max-width: 160px; }
}