* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
.sidebar {
    width: 300px;
    padding: 16px;
    background: #f5f5f5;
    border-right: 1px solid #ddd;
    overflow-y: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}
.sidebar h2 { margin: 0 0 16px 0; font-size: 18px; }
.file-select { margin-bottom: 20px; }
.file-select select {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
}
.var-control { margin-bottom: 12px; }
.var-control label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #666;
    font-family: monospace;
}
.var-control select {
    width: 100%;
    padding: 8px;
    font-size: 14px;
}
.section-title {
    font-size: 11px;
    text-transform: uppercase;
    color: #999;
    margin: 20px 0 10px 0;
    letter-spacing: 0.5px;
}
.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.pill {
    padding: 8px 14px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.pill:active { border-color: #999; background: #eee; }
.pill.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}
.role-sub {
    margin-top: 8px;
    padding: 8px;
    background: #eee;
    border-radius: 6px;
}
.sub-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
    margin: 4px 0;
}
.sub-label:first-child { margin-top: 0; }
.toggle-row { display: flex; align-items: center; gap: 8px; }
.toggle {
    appearance: none;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.toggle:checked { background: #2563eb; }
.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle:checked::after { transform: translateX(20px); }
.toggle-label { font-size: 14px; color: #555; }
.text-input {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    font-family: monospace;
    border: 1px solid #ccc;
    border-radius: 6px;
}
.quick-fills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.quick-fill {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    font-family: monospace;
    min-height: 32px;
}
.quick-fill:active { background: #2563eb; color: white; border-color: #2563eb; }
.clear-btn { color: #999; font-family: sans-serif; }
.action-bar {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.action-btn {
    flex: 1;
    padding: 8px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    color: #888;
    cursor: pointer;
    min-height: 44px;
}
.action-btn:active { background: #eee; color: #444; }
.polish-btn {
    margin-top: 6px;
    width: 100%;
    padding: 8px;
    font-size: 13px;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    background: #fffbeb;
    cursor: pointer;
    min-height: 44px;
}
.status-bar {
    padding: 6px 12px;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
    font-size: 12px;
    color: #888;
}
#polishResults { margin-top: 6px; }
#editorBar {
    padding: 8px 12px;
    background: #1e1e1e;
    border-bottom: 1px solid #333;
}
#editor {
    flex: 1;
    font-family: 'SF Mono', Menlo, monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 12px;
    border: none;
    background: #1e1e1e;
    color: #d4d4d4;
    resize: none;
    tab-size: 4;
}
