body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-color: #f4f4f4;
    margin: 0;
}

.container {
    background-color: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-width: 960px;
    width: 92%;
    border: 2px dashed transparent;
    transition: border-color 0.3s, background-color 0.3s;
}

.container.dragover {
    border-color: #007aff;
    background-color: #f0f8ff;
}

h1 {
    text-align: center;
    margin-top: 8px;
    font-size: 1.4em;
}

.navigation-links {
    margin-bottom: 8px;
    font-size: 0.9em;
}

.navigation-links a {
    color: #007aff;
    text-decoration: none;
}

.navigation-links a:hover {
    text-decoration: underline;
}

details summary {
    cursor: pointer;
    font-weight: bold;
}

details ol {
    padding-left: 1.5em;
    line-height: 1.7;
}

.upload-area {
    border: 2px dashed #bbb;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    margin: 16px 0;
    background: #fafafa;
}

.upload-area p {
    margin: 8px 0 0;
    color: #666;
    font-size: 0.9em;
}

.source-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin: 12px 0;
    font-size: 0.9em;
    color: #444;
}

.source-info .warning {
    color: #c0392b;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 20px;
    padding: 12px;
    background: #f7f7f7;
    border-radius: 6px;
}

.filter-group label,
.action-group label {
    margin-right: 12px;
    font-size: 0.95em;
}

.action-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

button {
    padding: 8px 14px;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    background-color: #007aff;
    color: white;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

button:hover:not(:disabled) {
    background-color: #005bbf;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

input[type="color"] {
    width: 36px;
    height: 28px;
    border: 1px solid #ccc;
    padding: 0;
    vertical-align: middle;
    border-radius: 4px;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.icon-card {
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.icon-card.hidden {
    display: none;
}

.icon-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-image:
            linear-gradient(45deg, #ddd 25%, transparent 25%),
            linear-gradient(-45deg, #ddd 25%, transparent 25%),
            linear-gradient(45deg, transparent 75%, #ddd 75%),
            linear-gradient(-45deg, transparent 75%, #ddd 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.icon-preview canvas {
    max-width: 100%;
    max-height: 100%;
    image-rendering: -webkit-optimize-contrast;
}

.icon-meta {
    font-size: 0.85em;
    line-height: 1.4;
}

.icon-meta .name {
    font-weight: bold;
    display: block;
}

.icon-meta .size {
    color: #666;
    display: block;
}

.icon-meta .scale {
    color: #999;
    font-size: 0.85em;
}

.icon-card button {
    margin-top: 8px;
    width: 100%;
    background-color: #34c759;
}

.icon-card button:hover:not(:disabled) {
    background-color: #28a745;
}

.icon-meta .uses {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-top: 6px;
}

.device-tag {
    display: inline-block;
    font-size: 0.68em;
    padding: 2px 6px;
    border-radius: 4px;
    background: #eee;
    color: #555;
    line-height: 1.3;
    white-space: nowrap;
}

.device-tag.iphone { background: #e7f3ff; color: #1a66c2; }
.device-tag.ipad { background: #fff3e7; color: #b8651b; }
.device-tag.ios-marketing { background: #efe7ff; color: #5a2ec2; }
