﻿.workspace-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.5rem; align-items: start; padding: 1.5rem 0 4rem; }
.workspace-panel { min-width: 0; overflow: visible; }
.workspace-panel [hidden] { display: none !important; }
.mode-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; padding: .45rem; background: var(--soft); border: 1px solid var(--line); border-radius: 13px; }
.mode-tab { min-height: 44px; padding: .55rem .7rem; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font-weight: 750; cursor: pointer; }
.mode-tab:hover { color: var(--brand-dark); }
.mode-tab.active { color: white; background: var(--brand); box-shadow: 0 5px 14px rgba(102,87,232,.22); }
.workspace-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; padding: .85rem; background: #fafbfe; border: 1px solid var(--line); border-radius: 13px; }
.workspace-controls .field { min-width: 180px; flex: 1; }
.toggle { display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .5rem .65rem; background: white; border: 1px solid var(--line); border-radius: 9px; font-size: .84rem; font-weight: 650; }
.toggle input { accent-color: var(--brand); }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.editor-card { min-width: 0; padding: 1rem; background: #f7f8fc; border: 1px solid var(--line); border-radius: 14px; }
.editor-card.output-card-main { border-color: #c9c1f7; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .55rem; }
.editor-head label { font-size: .9rem; font-weight: 800; }
.editor-tools { display: flex; gap: .35rem; }
.icon-button { min-width: 38px; min-height: 36px; padding: .35rem .5rem; color: var(--muted); background: white; border: 1px solid var(--line); border-radius: 8px; font-weight: 750; cursor: pointer; }
.icon-button:hover { color: var(--brand-dark); border-color: #bcb2f8; }
.icon-button:disabled { opacity: .4; cursor: not-allowed; }
.workspace-textarea { min-height: 300px; max-height: 70vh; overflow-y: auto; background: white; line-height: 1.7; }
.output-textarea { border-color: #b8aef7; }
.stats-bar { display: flex; flex-wrap: wrap; gap: .45rem .9rem; margin-top: .6rem; color: var(--muted); font-size: .8rem; }
.conversion-message { padding: .65rem .8rem; color: #574400; background: #fff8d8; border: 1px solid #eadb8c; border-radius: 10px; font-size: .82rem; }
.keyboard-dock { padding: 1rem; background: #f8faff; border: 1px solid var(--line); border-radius: 14px; }
.keyboard-dock-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.keyboard-dock-head h3 { margin: 0; }
.key-section + .key-section { margin-top: .9rem; }
.key-section-label { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: .42rem; }
.screen-key { position: relative; min-height: 48px; padding: .48rem .3rem; color: var(--ink); background: white; border: 1px solid #d3d9e4; border-radius: 9px; font-size: .8rem; font-weight: 800; cursor: pointer; box-shadow: 0 2px 0 #d7dce6; touch-action: manipulation; }
.screen-key:hover { color: var(--brand-dark); background: #efecff; border-color: #bcb2f8; }
.screen-key:active { transform: translateY(2px); box-shadow: none; }
.screen-key.wide { grid-column: span 2; }
.wijesekara-board { display: grid; gap: .42rem; }
.wijesekara-row { display: flex; justify-content: center; gap: .42rem; }
.wijesekara-row .screen-key { flex: 1 1 58px; max-width: 76px; }
.key-legend { display: block; color: var(--muted); font-size: .66rem; font-weight: 600; }
.action-bar { position: sticky; z-index: 20; bottom: .6rem; display: flex; flex-wrap: wrap; gap: .5rem; padding: .65rem; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 8px 24px rgba(25,34,52,.12); backdrop-filter: blur(10px); }
.action-bar .button { min-height: 42px; }
.save-indicator { margin-left: auto; align-self: center; color: var(--muted); font-size: .78rem; }
.related-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.related-tools a { padding: 1rem; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 12px; font-weight: 750; text-decoration: none; }
.related-tools a:hover { color: var(--brand-dark); border-color: #bcb2f8; }
.fullscreen-workspace { position: fixed; z-index: 100; inset: 0; overflow-y: auto; padding: 1rem; background: white; }
.fullscreen-workspace .tool-sidebar { display: none; }
@media (max-width: 900px) { .workspace-layout { grid-template-columns: 1fr; } .workspace-layout .tool-sidebar { position: static; } .editor-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) {
  .mode-tabs { grid-template-columns: repeat(2, 1fr); }
  .workspace-controls { align-items: stretch; }
  .workspace-controls .button, .workspace-controls .toggle { flex: 1 1 calc(50% - .7rem); }
  .workspace-textarea { min-height: 220px; }
  .keyboard-dock { margin-inline: 0; padding: .7rem; }
  .key-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .screen-key { min-height: 52px; padding-inline: .2rem; }
  .wijesekara-row { gap: .25rem; }
  .wijesekara-row .screen-key { min-width: 0; font-size: .7rem; }
  .action-bar { margin-inline: 0; bottom: .35rem; }
  .action-bar .button { flex: 1 1 calc(33.333% - .5rem); padding-inline: .5rem; font-size: .8rem; }
  .save-indicator { width: 100%; margin: 0; text-align: center; }
  .related-tools { grid-template-columns: 1fr; }
}
@media (max-width: 390px) { .key-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (orientation: landscape) and (max-height: 520px) { .workspace-textarea { min-height: 145px; } .screen-key { min-height: 42px; } }


.workspace-panel .tool-body > * { min-width: 0; max-width: 100%; }
